VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Dlgcode.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-06-01 01:53:03 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-06-01 01:56:13 +0200
commit55aa098295567868af26ca753e33cd9907d3b33d (patch)
tree1c1ea675b52bed065611d57bac76638ea22293ff /src/Common/Dlgcode.h
parent029341a7474ab7aa858a9f427c4c5c34713ecff0 (diff)
downloadVeraCrypt-55aa098295567868af26ca753e33cd9907d3b33d.tar.gz
VeraCrypt-55aa098295567868af26ca753e33cd9907d3b33d.zip
Windows: fix high CPU usage when a favorite is configured to mount using VolumeID when its host device is connected to the machine.
Diffstat (limited to 'src/Common/Dlgcode.h')
-rw-r--r--src/Common/Dlgcode.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h
index be04bd39..110c8def 100644
--- a/src/Common/Dlgcode.h
+++ b/src/Common/Dlgcode.h
@@ -306,7 +306,7 @@ void InitOSVersionInfo ();
void InitApp ( HINSTANCE hInstance, wchar_t *lpszCommandLine );
void FinalizeApp (void);
void InitHelpFileName (void);
-BOOL OpenDevice (const wchar_t *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectFilesystem, BOOL matchVolumeID, const BYTE* pbVolumeID);
+BOOL OpenDevice (const wchar_t *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectFilesystem, BOOL computeVolumeID);
void NotifyDriverOfPortableMode (void);
int GetAvailableFixedDisks ( HWND hComboBox , char *lpszRootPath );
int GetAvailableRemovables ( HWND hComboBox , char *lpszRootPath );
@@ -543,11 +543,34 @@ struct HostDevice
HasUnencryptedFilesystem (false),
Removable (false),
Size (0),
- SystemNumber((uint32) -1)
+ SystemNumber((uint32) -1),
+ HasVolumeIDs (false)
{
+ ZeroMemory (VolumeIDs, sizeof (VolumeIDs));
}
- ~HostDevice () { }
+ HostDevice (const HostDevice& device)
+ :
+ Bootable (device.Bootable),
+ ContainsSystem (device.ContainsSystem),
+ DynamicVolume (device.DynamicVolume),
+ Floppy (device.Floppy),
+ IsPartition (device.IsPartition),
+ IsVirtualPartition (device.IsVirtualPartition),
+ HasUnencryptedFilesystem (device.HasUnencryptedFilesystem),
+ MountPoint (device.MountPoint),
+ Name (device.Name),
+ Path (device.Path),
+ Removable (device.Removable),
+ Size (device.Size),
+ SystemNumber (device.SystemNumber),
+ HasVolumeIDs (device.HasVolumeIDs),
+ Partitions (device.Partitions)
+ {
+ memcpy (VolumeIDs, device.VolumeIDs, sizeof (VolumeIDs));
+ }
+
+ ~HostDevice () {}
bool Bootable;
bool ContainsSystem;
@@ -562,6 +585,8 @@ struct HostDevice
bool Removable;
uint64 Size;
uint32 SystemNumber;
+ BYTE VolumeIDs[TC_VOLUME_TYPE_COUNT][VOLUME_ID_SIZE];
+ bool HasVolumeIDs;
std::vector <HostDevice> Partitions;
};
@@ -597,6 +622,7 @@ inline std::wstring AppendSrcPos (const wchar_t* msg, const char* srcPos)
{
return std::wstring (msg? msg : L"") + L"\n\nSource: " + SingleStringToWide (srcPos);
}
+void UpdateMountableHostDeviceList ();
// Display a wait dialog while calling the provided callback with the given parameter
typedef void (CALLBACK* WaitThreadProc)(void* pArg, HWND hWaitDlg);