VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Dlgcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Dlgcode.c')
-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);
}
}
}