VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-09-30 16:08:27 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-09-30 22:27:55 +0200
commit9b804137e0095c66eff17856cced5bcf5784eb7a (patch)
tree8b4d58c1c5de765aa43d9237249fc3afb05f54ec /src
parente3afa296c7dc323211689216d5ac2af72a42c100 (diff)
downloadVeraCrypt-9b804137e0095c66eff17856cced5bcf5784eb7a.tar.gz
VeraCrypt-9b804137e0095c66eff17856cced5bcf5784eb7a.zip
Windows: when periodic update of device is disabled, use SetupAPI to list disks on demand instead of testing all disks to reduce CPU usage.
Diffstat (limited to 'src')
-rw-r--r--src/Common/Dlgcode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 46e7d818..654e29a5 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -12533,7 +12533,7 @@ wstring FindDeviceByVolumeID (const BYTE volumeID [VOLUME_ID_SIZE], BOOL bFromSe
/* not mounted. Look for it in the local drives*/
- if (bFromService || !NeedPeriodicDeviceListUpdate)
+ if (bFromService)
{
for (int devNumber = 0; devNumber < MAX_HOST_DRIVE_NUMBER; devNumber++)
{
@@ -12562,6 +12562,8 @@ wstring FindDeviceByVolumeID (const BYTE volumeID [VOLUME_ID_SIZE], BOOL bFromSe
static std::vector<HostDevice> volumeIdCandidates;
EnterCriticalSection (&csMountableDevices);
+ if (!NeedPeriodicDeviceListUpdate)
+ UpdateMountableHostDeviceList ();
std::vector<HostDevice> newDevices = mountableDevices;
LeaveCriticalSection (&csMountableDevices);