You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
47 lines
1.1 KiB
#include "global.h"
|
|
#include "protos.h"
|
|
|
|
#define DRIVE_STRING_LENGTH 512
|
|
|
|
USHORT BuildDriveTable(VOLINFO *pVolInfo)
|
|
{
|
|
WCHAR sDriveString[DRIVE_STRING_LENGTH];
|
|
PWCHAR sDrive;
|
|
USHORT index;
|
|
|
|
GetLogicalDriveStrings(DRIVE_STRING_LENGTH, sDriveString);
|
|
|
|
index = 0;
|
|
|
|
for (sDrive = sDriveString; *sDrive != NULL; sDrive += 4, index ++) {
|
|
|
|
pVolInfo[index].nDriveName = sDrive[0];
|
|
pVolInfo[index].nType = GetDriveType( sDrive );
|
|
pVolInfo[index].bHook = FALSE;
|
|
|
|
switch (pVolInfo[index].nType) {
|
|
case DRIVE_FIXED:
|
|
pVolInfo[index].nImage = IMAGE_FIXEDDRIVE;
|
|
break;
|
|
|
|
case DRIVE_CDROM:
|
|
pVolInfo[index].nImage = IMAGE_CDROMDRIVE;
|
|
break;
|
|
|
|
case DRIVE_REMOVABLE:
|
|
pVolInfo[index].nImage = IMAGE_REMOVABLEDRIVE;
|
|
break;
|
|
|
|
case DRIVE_REMOTE:
|
|
pVolInfo[index].nImage = IMAGE_REMOTEDRIVE;
|
|
break;
|
|
|
|
default:
|
|
pVolInfo[index].nImage = IMAGE_UNKNOWNDRIVE;
|
|
break;
|
|
}
|
|
}
|
|
|
|
return index;
|
|
}
|
|
|