Skip to content

Commit c6fecdd

Browse files
committed
[NTUSER] NtUserSetLogonNotifyWindow(): Lock-protect access to global data (reactos#8369)
Like with all the other win32k NtUser* functions, acquire on entry and release on exit the global lock, since the function is reading/writing to global variables. Also, set the last-error to ERROR_ACCESS_DENIED if the caller isn't the registered logon process.
1 parent 10d57cb commit c6fecdd

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

win32ss/user/ntuser/winsta.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,19 +1963,25 @@ NtUserBuildNameList(
19631963
BOOL APIENTRY
19641964
NtUserSetLogonNotifyWindow(HWND hWnd)
19651965
{
1966-
if (gpidLogon != PsGetCurrentProcessId())
1967-
{
1968-
return FALSE;
1969-
}
1966+
BOOL Ret = FALSE;
1967+
1968+
UserEnterExclusive();
19701969

19711970
if (!IntIsWindow(hWnd))
1971+
goto Leave;
1972+
1973+
if (gpidLogon != PsGetCurrentProcessId())
19721974
{
1973-
return FALSE;
1975+
EngSetLastError(ERROR_ACCESS_DENIED);
1976+
goto Leave;
19741977
}
19751978

19761979
hwndSAS = hWnd;
1980+
Ret = TRUE;
19771981

1978-
return TRUE;
1982+
Leave:
1983+
UserLeave();
1984+
return Ret;
19791985
}
19801986

19811987
BOOL

0 commit comments

Comments
 (0)