mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-10 13:13:34 +01:00
Windows: Ensure that only one thread at a time can create a secure desktop
This commit is contained in:
parent
3903fcc595
commit
2061b4c28c
@ -214,6 +214,9 @@ CRITICAL_SECTION csVolumeIdCandidates;
|
|||||||
static std::vector<HostDevice> mountableDevices;
|
static std::vector<HostDevice> mountableDevices;
|
||||||
static std::vector<HostDevice> rawHostDeviceList;
|
static std::vector<HostDevice> rawHostDeviceList;
|
||||||
|
|
||||||
|
/* Critical section used to ensure that only one thread at a time can create a secure desktop */
|
||||||
|
CRITICAL_SECTION csSecureDesktop;
|
||||||
|
|
||||||
HINSTANCE hInst = NULL;
|
HINSTANCE hInst = NULL;
|
||||||
HCURSOR hCursor = NULL;
|
HCURSOR hCursor = NULL;
|
||||||
|
|
||||||
@ -445,6 +448,7 @@ void InitGlobalLocks ()
|
|||||||
InitializeCriticalSection (&csWNetCalls);
|
InitializeCriticalSection (&csWNetCalls);
|
||||||
InitializeCriticalSection (&csMountableDevices);
|
InitializeCriticalSection (&csMountableDevices);
|
||||||
InitializeCriticalSection (&csVolumeIdCandidates);
|
InitializeCriticalSection (&csVolumeIdCandidates);
|
||||||
|
InitializeCriticalSection (&csSecureDesktop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FinalizeGlobalLocks ()
|
void FinalizeGlobalLocks ()
|
||||||
@ -452,6 +456,7 @@ void FinalizeGlobalLocks ()
|
|||||||
DeleteCriticalSection (&csWNetCalls);
|
DeleteCriticalSection (&csWNetCalls);
|
||||||
DeleteCriticalSection (&csMountableDevices);
|
DeleteCriticalSection (&csMountableDevices);
|
||||||
DeleteCriticalSection (&csVolumeIdCandidates);
|
DeleteCriticalSection (&csVolumeIdCandidates);
|
||||||
|
DeleteCriticalSection (&csSecureDesktop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanup ()
|
void cleanup ()
|
||||||
@ -13556,6 +13561,9 @@ INT_PTR SecureDesktopDialogBoxParam(
|
|||||||
|
|
||||||
HDESK hInputDesk = NULL;
|
HDESK hInputDesk = NULL;
|
||||||
|
|
||||||
|
EnterCriticalSection (&csSecureDesktop);
|
||||||
|
finally_do ({ LeaveCriticalSection (&csSecureDesktop); });
|
||||||
|
|
||||||
// wait for the input desktop to be available before switching to
|
// wait for the input desktop to be available before switching to
|
||||||
// secure desktop. Under Windows 10, the user session can be started
|
// secure desktop. Under Windows 10, the user session can be started
|
||||||
// in the background even before the user has authenticated and in this
|
// in the background even before the user has authenticated and in this
|
||||||
|
Loading…
Reference in New Issue
Block a user