VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-09 09:45:50 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-09 09:49:35 +0200
commit9833a753ddab074654e6002332a6605bce29b13e (patch)
tree17e1330abfe7eaf35a402baa75e7526ac28828c2
parentac37fb000375031d02c1be37108e340f145fa6c6 (diff)
downloadVeraCrypt-9833a753ddab074654e6002332a6605bce29b13e.tar.gz
VeraCrypt-9833a753ddab074654e6002332a6605bce29b13e.zip
Windows: when listing connected devices, consider that a partition exists if CreateFile returns ERROR_ACCESS_DENIED
-rw-r--r--src/Common/Dlgcode.c5
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);
}
}
}