Leaked source code of windows server 2003
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

  1. #include "global.h"
  2. #include "protos.h"
  3. #define DRIVE_STRING_LENGTH 512
  4. USHORT BuildDriveTable(VOLINFO *pVolInfo)
  5. {
  6. WCHAR sDriveString[DRIVE_STRING_LENGTH];
  7. PWCHAR sDrive;
  8. USHORT index;
  9. GetLogicalDriveStrings(DRIVE_STRING_LENGTH, sDriveString);
  10. index = 0;
  11. for (sDrive = sDriveString; *sDrive != NULL; sDrive += 4, index ++) {
  12. pVolInfo[index].nDriveName = sDrive[0];
  13. pVolInfo[index].nType = GetDriveType( sDrive );
  14. pVolInfo[index].bHook = FALSE;
  15. switch (pVolInfo[index].nType) {
  16. case DRIVE_FIXED:
  17. pVolInfo[index].nImage = IMAGE_FIXEDDRIVE;
  18. break;
  19. case DRIVE_CDROM:
  20. pVolInfo[index].nImage = IMAGE_CDROMDRIVE;
  21. break;
  22. case DRIVE_REMOVABLE:
  23. pVolInfo[index].nImage = IMAGE_REMOVABLEDRIVE;
  24. break;
  25. case DRIVE_REMOTE:
  26. pVolInfo[index].nImage = IMAGE_REMOTEDRIVE;
  27. break;
  28. default:
  29. pVolInfo[index].nImage = IMAGE_UNKNOWNDRIVE;
  30. break;
  31. }
  32. }
  33. return index;
  34. }