how to get disk properties?

2 aim that i want to achieve

1) get disk properties, i want to find out a disk C: D: E: etc , which is local disk,not removeable USB / optical disk

2) get the current running windows installationlocation-->which partition (C: D: E:)

thanks
Last edited on
1) I think GetDriveType or some similar function does this.

http://msdn.microsoft.com/en-us/library/aa364939.aspx <---- GetDriveType seems rather simplistic. Perhaps too much so

http://msdn.microsoft.com/en-us/library/aa364993(VS.85).aspx <--- also GetVolumeInformation seems much more detailed, but also more complicated. I've never used this function though.

2) Probably can use getenv(). Surely there must be SOME environment variable that has the installation directory. Don't know which though.
for get the current running windows installation location, i have a idea that get the current running proccess- kernel32.dll , and get its path , than we casn know which partition label the user install windows on it~ ~

would anyone know how to do it?
To get the current windows directory, use GetWindowsDirectory().
http://www.google.com/search?btnI=1&q=msdn+GetWindowsDirectory

You can get the drive off of that.
Topic archived. No new replies allowed.