https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5891ab2bfd8bc3d91c4e9…
commit 5891ab2bfd8bc3d91c4e9d8fc30d27393d9c60b1
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Tue Oct 19 23:09:16 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Fri Oct 22 21:44:56 2021 +0200
[WIN32SS:NTUSER] Make sure to hold User Global Lock before manipulating desktops.
(#4053)
---
win32ss/user/ntuser/desktop.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/win32ss/user/ntuser/desktop.c b/win32ss/user/ntuser/desktop.c
index 84cac5fb47b..4d8f2956b44 100644
--- a/win32ss/user/ntuser/desktop.c
+++ b/win32ss/user/ntuser/desktop.c
@@ -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);