Windows: when listing connected devices, consider that a partition exists if CreateFile returns ERROR_ACCESS_DENIED

This commit is contained in:
Mounir IDRASSI committed 2017-07-09 09:49:35 +02:00
1 parent ac37fb0003
commit 9833a753dd
1 file changed
+2 -1
+2 -1
View File
@@ -12106,9 +12106,10 @@ void UpdateMountableHostDeviceList ()
OPEN_EXISTING, OPEN_EXISTING,
0, 0,
NULL ); NULL );
if (handle != INVALID_HANDLE_VALUE) if ((handle != INVALID_HANDLE_VALUE) || (GetLastError () == ERROR_ACCESS_DENIED))
{ {
AddDeviceToList (mountableDevices, It->SystemNumber, layout->PartitionEntry[i].PartitionNumber); AddDeviceToList (mountableDevices, It->SystemNumber, layout->PartitionEntry[i].PartitionNumber);
if (handle != INVALID_HANDLE_VALUE)
CloseHandle (handle); CloseHandle (handle);
} }
} }