diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-07-09 09:45:50 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-07-09 09:49:35 +0200 |
commit | 9833a753ddab074654e6002332a6605bce29b13e (patch) | |
tree | 17e1330abfe7eaf35a402baa75e7526ac28828c2 /src/Common | |
parent | ac37fb000375031d02c1be37108e340f145fa6c6 (diff) | |
download | VeraCrypt-9833a753ddab074654e6002332a6605bce29b13e.tar.gz VeraCrypt-9833a753ddab074654e6002332a6605bce29b13e.zip |
Windows: when listing connected devices, consider that a partition exists if CreateFile returns ERROR_ACCESS_DENIED
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/Dlgcode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index 8ea025e5..702ba4e9 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -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); } } } |