VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-09-30 14:08:27 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-09-30 20:27:55 (GMT)
commit9b804137e0095c66eff17856cced5bcf5784eb7a (patch)
tree8b4d58c1c5de765aa43d9237249fc3afb05f54ec /src/Common
parente3afa296c7dc323211689216d5ac2af72a42c100 (diff)
downloadVeraCrypt-9b804137e0095c66eff17856cced5bcf5784eb7a.zip
VeraCrypt-9b804137e0095c66eff17856cced5bcf5784eb7a.tar.gz
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/Common')
-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 46e7d81..654e29a 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);