[NTUSER] NtUserSetLogonNotifyWindow(): Lock-protect access to global data (#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.
This commit is contained in:
Hermès Bélusca-Maïto
2025-09-01 11:37:17 +02:00
parent 10d57cb8b2
commit c6fecdda65

View File

@@ -1963,19 +1963,25 @@ NtUserBuildNameList(
BOOL APIENTRY
NtUserSetLogonNotifyWindow(HWND hWnd)
{
if (gpidLogon != PsGetCurrentProcessId())
{
return FALSE;
}
BOOL Ret = FALSE;
UserEnterExclusive();
if (!IntIsWindow(hWnd))
goto Leave;
if (gpidLogon != PsGetCurrentProcessId())
{
return FALSE;
EngSetLastError(ERROR_ACCESS_DENIED);
goto Leave;
}
hwndSAS = hWnd;
Ret = TRUE;
return TRUE;
Leave:
UserLeave();
return Ret;
}
BOOL