Detect Microsoft C in 16-bit OS/2 and use different PFSINFO structure format to retrieve volume serial number.

This commit is contained in:
2021-04-11 02:51:30 +01:00
parent 37da49d062
commit 870443e203

View File

@@ -121,8 +121,13 @@ void GetVolumeInfo(const char* path, size_t* clusterSize)
if(rc) log_write("Error %d requesting volume information.\n", rc);
else
{
#ifdef _MSC_VER
usVolSerialHigh = (USHORT)(pfsInfo->ulVSN >> 16);
usVolSerialLow = (USHORT)(pfsInfo->ulVSN & 0xFFFF);
#else
usVolSerialHigh = *((PUSHORT)&pfsInfo->ftimeCreation);
usVolSerialLow = *((PUSHORT)&pfsInfo->fdateCreation);
#endif
log_write("\tVolume label: %s\n", pfsInfo->vol.szVolLabel);
log_write("\tVolume created on %04X:%04X\n", usVolSerialHigh, usVolSerialLow);
}