//*************************************************************** // From the book "Win32 System Services: The Heart of Windows 98 // and Windows 2000" // by Marshall Brain // Published by Prentice Hall // // Copyright 1995, by Prentice Hall. // // This code gets the logical drive strings and prints them // to stdout. //*************************************************************** // drvglds.cpp #include #include void main() { DWORD len; char buffer[1000]; char *p; len = GetLogicalDriveStrings(1000, buffer); cout << "Logical drives on this machine: \n"; for (p=buffer; *p != '\0'; p++) { cout << p << endl; while (*p != '\0') p++; } }