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

This commit is contained in:
Mounir IDRASSI 2017-07-09 09:45:50 +02:00
parent ac37fb0003
commit 9833a753dd
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC

View File

@ -12106,10 +12106,11 @@ void UpdateMountableHostDeviceList ()
OPEN_EXISTING,
0,
NULL );
if (handle != INVALID_HANDLE_VALUE)
if ((handle != INVALID_HANDLE_VALUE) || (GetLastError () == ERROR_ACCESS_DENIED))
{
AddDeviceToList (mountableDevices, It->SystemNumber, layout->PartitionEntry[i].PartitionNumber);
CloseHandle (handle);
if (handle != INVALID_HANDLE_VALUE)
CloseHandle (handle);
}
}
}