3.2. Getting Volume Information

You can obtain information about any volume available locally on your machine or mounted over the network using the GetVolumeInformation function. Listing 3.1 demonstrates this function.

Code Listing 3.1. Results of the GetVolumeInformation function
 // drvgvi.cpp #include <windows.h> #include <iostream.h> void main() { BOOL success; char volumeName[MAX_PATH]; DWORD volumeSerialNumber; DWORD maxNameLength; DWORD fileSystemFlags; char systemName[MAX_PATH]; // get the volume information for drive C success = GetVolumeInformation("c:\\", volumeName, MAX_PATH, &volumeSerialNumber, &maxNameLength, &fileSystemFlags, systemName, MAX_PATH); // output information cout << "Volume name: " << volumeName << endl; cout << "Volume ...

Get Win32 System Services: The Heart of Windows® 98 and Windows® 2000 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.