mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-06-18 02:26:07 -05:00
Windows: Fix false positive detection of new device insertion when clear keys option is enable
When this option is enabled, we first build the list of currently inserted devices then we start listening to insertion events. When a device insertion occurs, we check if this device is on our list and if yes, we ignore its insertion. We also ignore devices whose Device ID starts with "SWD\" and "ROOT\" since these are not real devices.
This commit is contained in:
@@ -128,4 +128,42 @@ void SetDriverConfigurationFlag (uint32 flag, BOOL state);
|
||||
BOOL MountFavoriteVolumes (HWND hwnd, BOOL systemFavorites = FALSE, BOOL logOnMount = FALSE, BOOL hotKeyMount = FALSE, const VeraCrypt::FavoriteVolume &favoriteVolumeToMount = VeraCrypt::FavoriteVolume());
|
||||
void __cdecl mountFavoriteVolumeThreadFunction (void *pArg);
|
||||
|
||||
// A class that represents a device based on its device ID
|
||||
class CDevice
|
||||
{
|
||||
public:
|
||||
WCHAR m_szDeviceID[MAX_PATH];
|
||||
|
||||
CDevice()
|
||||
{
|
||||
ZeroMemory(m_szDeviceID, sizeof(m_szDeviceID));
|
||||
}
|
||||
|
||||
CDevice(WCHAR* szDevicePath)
|
||||
{
|
||||
StringCchCopyW(m_szDeviceID, MAX_PATH, szDevicePath);
|
||||
}
|
||||
|
||||
CDevice(const CDevice& src)
|
||||
{
|
||||
StringCchCopyW(m_szDeviceID, MAX_PATH, src.m_szDeviceID);
|
||||
}
|
||||
|
||||
CDevice& operator=(const CDevice& src)
|
||||
{
|
||||
StringCchCopyW(m_szDeviceID, MAX_PATH, src.m_szDeviceID);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOL operator==(const CDevice& src)
|
||||
{
|
||||
return wcscmp(m_szDeviceID, src.m_szDeviceID) == 0;
|
||||
}
|
||||
|
||||
~CDevice()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user