diff --git a/win32ss/user/ntuser/winsta.c b/win32ss/user/ntuser/winsta.c index 4e9a52692b9..0b8d11e1e05 100644 --- a/win32ss/user/ntuser/winsta.c +++ b/win32ss/user/ntuser/winsta.c @@ -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