[WIN32SS:NTUSER] Make sure to hold User Global Lock before manipulating desktops. (#4053)

This commit is contained in:
Hermès Bélusca-Maïto 2021-10-19 23:09:16 +02:00
parent 6b7b0f0c7e
commit 5891ab2bfd
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -561,6 +561,8 @@ IntResolveDesktop(
BOOLEAN bInteractive = FALSE;
BOOLEAN bAccessAllowed = FALSE;
ASSERT(UserIsEnteredExclusive());
ASSERT(phWinSta);
ASSERT(phDesktop);
ASSERT(DesktopPath);
@ -2329,6 +2331,8 @@ IntCreateDesktop(
TRACE("Enter IntCreateDesktop\n");
ASSERT(UserIsEnteredExclusive());
ASSERT(phDesktop);
*phDesktop = NULL;
@ -2808,7 +2812,7 @@ NtUserResolveDesktop(
if (!NT_SUCCESS(Status))
return NULL;
// UserEnterShared();
UserEnterExclusive();
_SEH2_TRY
{
@ -2863,7 +2867,7 @@ NtUserResolveDesktop(
ReleaseCapturedUnicodeString(&CapturedDesktopPath, UserMode);
Quit:
// UserLeave();
UserLeave();
/* Dereference the process object */
ObDereferenceObject(Process);