diff --git a/reactos/win32ss/include/ntuser.h b/reactos/win32ss/include/ntuser.h index be749e2cc3f..c123cc79b6b 100644 --- a/reactos/win32ss/include/ntuser.h +++ b/reactos/win32ss/include/ntuser.h @@ -3301,12 +3301,14 @@ typedef struct tagKMDDELPARAM * ReactOS-specific NtUser calls and their related structures, both which shouldn't exist. */ +#define NOPARAM_ROUTINE_ISCONSOLEMODE 0xffff0001 #define NOPARAM_ROUTINE_GETMESSAGEEXTRAINFO 0xffff0005 #define ONEPARAM_ROUTINE_CSRSS_GUICHECK 0xffff0008 #define ONEPARAM_ROUTINE_SWITCHCARETSHOWING 0xfffe0008 #define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING 0xfffe000d #define ONEPARAM_ROUTINE_GETDESKTOPMAPPING 0xfffe000e #define TWOPARAM_ROUTINE_SETMENUBARHEIGHT 0xfffd0050 +#define TWOPARAM_ROUTINE_EXITREACTOS 0xfffd0051 #define TWOPARAM_ROUTINE_SETGUITHRDHANDLE 0xfffd0052 #define MSQ_STATE_CAPTURE 0x1 #define MSQ_STATE_ACTIVE 0x2 diff --git a/reactos/win32ss/pch.h b/reactos/win32ss/pch.h index 4368acc0489..67ba98420ec 100644 --- a/reactos/win32ss/pch.h +++ b/reactos/win32ss/pch.h @@ -86,6 +86,7 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; /* Undocumented user definitions */ #include +#include /* Freetype headers */ #include diff --git a/reactos/win32ss/user/ntuser/simplecall.c b/reactos/win32ss/user/ntuser/simplecall.c index 9f8e698486f..42eb59150b2 100644 --- a/reactos/win32ss/user/ntuser/simplecall.c +++ b/reactos/win32ss/user/ntuser/simplecall.c @@ -129,6 +129,10 @@ NtUserCallNoParam(DWORD Routine) RETURN(0); } + /* this is a Reactos only case and is needed for gui-on-demand */ + case NOPARAM_ROUTINE_ISCONSOLEMODE: + RETURN( ScreenDeviceContext == NULL ); + default: ERR("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine); EngSetLastError(ERROR_INVALID_PARAMETER); @@ -473,6 +477,13 @@ NtUserCallTwoParam( case TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK: RETURN( IntUnhookWindowsHook((int)Param1, (HOOKPROC)Param2)); + case TWOPARAM_ROUTINE_EXITREACTOS: + if(hwndSAS == NULL) + { + ASSERT(hwndSAS); + RETURN(STATUS_NOT_FOUND); + } + RETURN( co_IntSendMessage (hwndSAS, PM_WINLOGON_EXITWINDOWS, (WPARAM) Param1, (LPARAM)Param2)); } ERR("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n", Routine, Param1, Param2); diff --git a/reactos/win32ss/user/win32csr/desktopbg.c b/reactos/win32ss/user/win32csr/desktopbg.c index 4fef3937d4e..c6ba490b4ab 100644 --- a/reactos/win32ss/user/win32csr/desktopbg.c +++ b/reactos/win32ss/user/win32csr/desktopbg.c @@ -21,15 +21,7 @@ CSR_API(CsrHideDesktop) BOOL FASTCALL DtbgIsDesktopVisible(VOID) { - HWND VisibleDesktopWindow = GetDesktopWindow(); // DESKTOPWNDPROC - - if (VisibleDesktopWindow != NULL && - !IsWindowVisible(VisibleDesktopWindow)) - { - VisibleDesktopWindow = NULL; - } - - return VisibleDesktopWindow != NULL; + return !((BOOL)NtUserCallNoParam(NOPARAM_ROUTINE_ISCONSOLEMODE)); } /* EOF */ diff --git a/reactos/win32ss/user/win32csr/exitros.c b/reactos/win32ss/user/win32csr/exitros.c index fd11c1651c0..c0008ac40bc 100644 --- a/reactos/win32ss/user/win32csr/exitros.c +++ b/reactos/win32ss/user/win32csr/exitros.c @@ -13,7 +13,6 @@ #include "resource.h" #include -static HWND LogonNotifyWindow = NULL; static HANDLE LogonProcess = NULL; CSR_API(CsrRegisterLogonProcess) @@ -42,22 +41,6 @@ CSR_API(CsrRegisterLogonProcess) CSR_API(CsrSetLogonNotifyWindow) { - DWORD WindowCreator; - - if (0 == GetWindowThreadProcessId(Request->Data.SetLogonNotifyWindowRequest.LogonNotifyWindow, - &WindowCreator)) - { - DPRINT1("Can't get window creator\n"); - return STATUS_INVALID_HANDLE; - } - if (WindowCreator != (DWORD_PTR)LogonProcess) - { - DPRINT1("Trying to register window not created by winlogon as notify window\n"); - return STATUS_ACCESS_DENIED; - } - - LogonNotifyWindow = Request->Data.SetLogonNotifyWindowRequest.LogonNotifyWindow; - return STATUS_SUCCESS; } @@ -888,16 +871,9 @@ UserExitReactos(DWORD UserProcessId, UINT Flags) { NTSTATUS Status; - if (NULL == LogonNotifyWindow) - { - DPRINT1("No LogonNotifyWindow registered\n"); - return STATUS_NOT_FOUND; - } - /* FIXME Inside 2000 says we should impersonate the caller here */ - Status = SendMessageW(LogonNotifyWindow, PM_WINLOGON_EXITWINDOWS, - (WPARAM) UserProcessId, - (LPARAM) Flags); + Status = NtUserCallTwoParam (UserProcessId, Flags, TWOPARAM_ROUTINE_EXITREACTOS); + /* If the message isn't handled, the return value is 0, so 0 doesn't indicate success. Success is indicated by a 1 return value, if anything besides 0 or 1 it's a NTSTATUS value */