[CONSRV-USER32-WINSRV]

Pre-synchrosize with trunk, by applying some changes from revision r58411.

svn path=/branches/ros-csrss/; revision=58455
This commit is contained in:
Hermès Bélusca-Maïto 2013-03-09 21:52:12 +00:00
parent 62f4efcc97
commit 5819952ab9
6 changed files with 7 additions and 87 deletions

View file

@ -32,9 +32,6 @@ typedef enum _USERSRV_API_NUMBER
// UserpConsoleHandleOperation, // Added in Win7
// UserpGetSetShutdownBlockReason, // Added in Vista
/// HACK: ReactOS-specific
UserpRosSetLogonNotifyWindow,
UserpMaxApiNumber
} USERSRV_API_NUMBER, *PUSERSRV_API_NUMBER;
@ -56,12 +53,6 @@ typedef struct
BOOL Register;
} CSRSS_REGISTER_LOGON_PROCESS, *PCSRSS_REGISTER_LOGON_PROCESS;
/// HACK: ReactOS-specific
typedef struct
{
HWND LogonNotifyWindow;
} CSRSS_SET_LOGON_NOTIFY_WINDOW, *PCSRSS_SET_LOGON_NOTIFY_WINDOW;
typedef struct _USER_API_MESSAGE
{
@ -76,9 +67,6 @@ typedef struct _USER_API_MESSAGE
CSRSS_EXIT_REACTOS ExitReactosRequest;
CSRSS_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest;
CSRSS_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest;
/// HACK: ReactOS-specific
CSRSS_SET_LOGON_NOTIFY_WINDOW SetLogonNotifyWindowRequest;
} Data;
} USER_API_MESSAGE, *PUSER_API_MESSAGE;

View file

@ -31,15 +31,7 @@
BOOL FASTCALL
DtbgIsDesktopVisible(VOID)
{
HWND VisibleDesktopWindow = GetDesktopWindow(); // DESKTOPWNDPROC
if (VisibleDesktopWindow != NULL &&
!IsWindowVisible(VisibleDesktopWindow))
{
VisibleDesktopWindow = NULL;
}
return VisibleDesktopWindow != NULL;
return !((BOOL)NtUserCallNoParam(NOPARAM_ROUTINE_ISCONSOLEMODE));
}
VOID FASTCALL

View file

@ -74,24 +74,6 @@ BOOL
WINAPI
SetLogonNotifyWindow(HWND Wnd, HWINSTA WinSta)
{
/// HACK: Windows does not do this !! ReactOS-specific
/* Maybe we should call NtUserSetLogonNotifyWindow and let that one inform CSRSS??? */
USER_API_MESSAGE Request;
NTSTATUS Status;
Request.Data.SetLogonNotifyWindowRequest.LogonNotifyWindow = Wnd;
Status = CsrClientCallServer((PCSR_API_MESSAGE)&Request,
NULL,
CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRosSetLogonNotifyWindow),
sizeof(CSRSS_SET_LOGON_NOTIFY_WINDOW));
if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
/// END HACK
return NtUserSetLogonNotifyWindow(Wnd);
}
@ -100,10 +82,10 @@ SetLogonNotifyWindow(HWND Wnd, HWINSTA WinSta)
*/
BOOL WINAPI
UpdatePerUserSystemParameters(
DWORD dwReserved,
BOOL bEnable)
DWORD dwReserved,
BOOL bEnable)
{
return NtUserUpdatePerUserSystemParameters(dwReserved, bEnable);
return NtUserUpdatePerUserSystemParameters(dwReserved, bEnable);
}
PTHREADINFO

View file

@ -19,7 +19,6 @@
static BOOLEAN ServicesProcessIdValid = FALSE;
static ULONG_PTR ServicesProcessId = 0;
HWND LogonNotifyWindow = NULL;
ULONG_PTR LogonProcessId = 0;
/* PUBLIC SERVER APIS *********************************************************/
@ -50,29 +49,6 @@ CSR_API(SrvRegisterLogonProcess)
return STATUS_SUCCESS;
}
/// HACK: ReactOS-specific
CSR_API(RosSetLogonNotifyWindow)
{
PCSRSS_SET_LOGON_NOTIFY_WINDOW SetLogonNotifyWindowRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.SetLogonNotifyWindowRequest;
DWORD WindowCreator;
if (0 == GetWindowThreadProcessId(SetLogonNotifyWindowRequest->LogonNotifyWindow,
&WindowCreator))
{
DPRINT1("Can't get window creator\n");
return STATUS_INVALID_HANDLE;
}
if (WindowCreator != LogonProcessId)
{
DPRINT1("Trying to register window not created by winlogon as notify window\n");
return STATUS_ACCESS_DENIED;
}
LogonNotifyWindow = SetLogonNotifyWindowRequest->LogonNotifyWindow;
return STATUS_SUCCESS;
}
CSR_API(SrvRegisterServicesProcess)
{
PCSRSS_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.RegisterServicesProcessRequest;

View file

@ -426,15 +426,7 @@ NotifyTopLevelWindows(PNOTIFY_CONTEXT Context)
BOOL FASTCALL
DtbgIsDesktopVisible(VOID)
{
HWND VisibleDesktopWindow = GetDesktopWindow(); // DESKTOPWNDPROC
if (VisibleDesktopWindow != NULL &&
!IsWindowVisible(VisibleDesktopWindow))
{
VisibleDesktopWindow = NULL;
}
return VisibleDesktopWindow != NULL;
return !((BOOL)NtUserCallNoParam(NOPARAM_ROUTINE_ISCONSOLEMODE));
}
/* TODO: Find an other way to do it. */
@ -894,16 +886,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 */

View file

@ -51,7 +51,6 @@
extern HINSTANCE UserServerDllInstance;
extern HANDLE UserServerHeap;
extern HWND LogonNotifyWindow;
extern ULONG_PTR LogonProcessId;
/* init.c */
@ -64,8 +63,6 @@ VOID WINAPI UserServerHardError(IN PCSR_THREAD ThreadData,
/* register.c */
CSR_API(SrvRegisterServicesProcess);
CSR_API(SrvRegisterLogonProcess);
/// HACK: ReactOS-specific
CSR_API(RosSetLogonNotifyWindow);
/* shutdown.c */
CSR_API(SrvExitWindowsEx);