|
|
@ -232,7 +232,7 @@ void InitNotifyIconData() |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void getRaspiStorage() { |
|
|
|
void getRaspiStorage(LPWSTR out) { |
|
|
|
// GetLogicalDrives()
|
|
|
|
// for result
|
|
|
|
// if result.GetDriveType() == DRIVE_REMOVABLE
|
|
|
@ -245,58 +245,22 @@ void getRaspiStorage() { |
|
|
|
|
|
|
|
if (!GetLogicalDriveStringsW(ARRAYSIZE(myDrives)-1, myDrives)) |
|
|
|
{ |
|
|
|
wprintf(L"GetLogicalDrives() failed with error code: %lu\n", GetLastError()); |
|
|
|
//wprintf(L"GetLogicalDrives() failed with error code: %lu\n", GetLastError());
|
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
wprintf(L"This machine has the following logical drives:\n"); |
|
|
|
|
|
|
|
for (LPWSTR drive = myDrives; *drive != 0; drive += 4) |
|
|
|
{ |
|
|
|
driveType = GetDriveTypeW(drive); |
|
|
|
wprintf(L"Drive %s is type %d - ", drive, driveType); |
|
|
|
|
|
|
|
switch (driveType) |
|
|
|
{ |
|
|
|
case DRIVE_UNKNOWN: |
|
|
|
wprintf(L"Cannot be determined!"); |
|
|
|
break; |
|
|
|
case DRIVE_NO_ROOT_DIR: |
|
|
|
wprintf(L"Invalid root path/Not available."); |
|
|
|
break; |
|
|
|
case DRIVE_REMOVABLE: |
|
|
|
wprintf(L"Removable."); |
|
|
|
break; |
|
|
|
case DRIVE_FIXED: |
|
|
|
wprintf(L"Fixed."); |
|
|
|
break; |
|
|
|
case DRIVE_REMOTE: |
|
|
|
wprintf(L"Network."); |
|
|
|
break; |
|
|
|
case DRIVE_CDROM: |
|
|
|
wprintf(L"CD-ROM."); |
|
|
|
break; |
|
|
|
case DRIVE_RAMDISK: |
|
|
|
wprintf(L"RAMDISK."); |
|
|
|
break; |
|
|
|
default: |
|
|
|
wprintf(L"Unknown value!"); |
|
|
|
} |
|
|
|
wprintf(L"\n"); |
|
|
|
|
|
|
|
if (driveType == DRIVE_CDROM) |
|
|
|
if (driveType == DRIVE_REMOVABLE) |
|
|
|
{ |
|
|
|
if (GetVolumeInformationW(drive, volumeName, ARRAYSIZE(volumeName), &serialNumber, &maxComponentLen, &fileSystemFlags, fileSystemName, ARRAYSIZE(fileSystemName))) |
|
|
|
{ |
|
|
|
wprintf(L" There is a CD/DVD in the drive:\n"); |
|
|
|
wprintf(L" Volume Name: %s\n", volumeName); |
|
|
|
wprintf(L" Serial Number: %08X\n", serialNumber); |
|
|
|
wprintf(L" File System Name: %s\n", fileSystemName); |
|
|
|
wprintf(L" Max Component Length: %lu\n", maxComponentLen); |
|
|
|
if (wcscmp(volumeName, L"SCREENSHOTS")) { |
|
|
|
wcsncpy(drive, out, sizeof(out)); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
wprintf(L" There is NO CD/DVD in the drive"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|