mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Disk (Windows): fix crashing on Windows 7 VM
This commit is contained in:
@@ -38,6 +38,7 @@ const char* ffDetectDisksImpl(FFlist* disks)
|
||||
if (handle != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DEVICE_SEEK_PENALTY_DESCRIPTOR dspd = {};
|
||||
DWORD retSize = 0;
|
||||
if(DeviceIoControl(
|
||||
handle,
|
||||
IOCTL_STORAGE_QUERY_PROPERTY,
|
||||
@@ -48,9 +49,9 @@ const char* ffDetectDisksImpl(FFlist* disks)
|
||||
sizeof(STORAGE_PROPERTY_QUERY),
|
||||
&dspd,
|
||||
sizeof(dspd),
|
||||
NULL,
|
||||
&retSize,
|
||||
NULL
|
||||
))
|
||||
) && retSize == sizeof(dspd))
|
||||
disk->physicalType = dspd.IncursSeekPenalty ? FF_DISK_PHYSICAL_TYPE_HDD : FF_DISK_PHYSICAL_TYPE_SSD;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user