Christina
Catastrophic Error on unmapped drive
Posted 22 February 2002 - 22:11
Posted 25 February 2002 - 16:42
DWORD GetLogicalDrives(VOID);
prototype LONG KERNEL.GetLogicalDrives();
Then you check the bits to see if the drive is a valid drive letter. Bit 1 = A, Bit 2 = B, etc.
Or you can use GetDriveType function that determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive.
UINT GetDriveType(
LPCTSTR lpRootPathName // root directory
);
prototype LONG KERNEL.GetDriveType(BYREF STRING);
Or you can try to make the drive root directory the current directory and then switch back to 'real' current directory. If it fails to become current, then maybe assume that drive is not valid.