Author: hbelusca
Date: Sun Feb 15 21:56:03 2015
New Revision: 66303
URL:
http://svn.reactos.org/svn/reactos?rev=66303&view=rev
Log:
[USER32]
Implement SrvLogon (client-side), called by the SetWindowStationUser API (called by
winlogon) when a user logs-on (or off).
See also
http://www.openrce.org/reference_library/win32_call_chains/2003SP1/USER32/S…
and
http://www.openrce.org/reference_library/win32_call_chains/2003SP1/USER32/L… for
details.
Part 1/2
Modified:
trunk/reactos/include/reactos/subsys/win/winmsg.h
trunk/reactos/win32ss/user/user32/include/user32p.h
trunk/reactos/win32ss/user/user32/misc/logon.c
trunk/reactos/win32ss/user/user32/misc/winsta.c
Modified: trunk/reactos/include/reactos/subsys/win/winmsg.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/win…
==============================================================================
--- trunk/reactos/include/reactos/subsys/win/winmsg.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/subsys/win/winmsg.h [iso-8859-1] Sun Feb 15 21:56:03
2015
@@ -60,6 +60,11 @@
BOOL Success;
} USER_END_TASK, *PUSER_END_TASK;
+typedef struct _USER_LOGON
+{
+ BOOL IsLogon;
+} USER_LOGON, *PUSER_LOGON;
+
typedef struct _USER_GET_THREAD_CONSOLE_DESKTOP
{
ULONG_PTR ThreadId;
@@ -90,6 +95,7 @@
{
USER_EXIT_REACTOS ExitReactosRequest;
USER_END_TASK EndTaskRequest;
+ USER_LOGON LogonRequest;
USER_GET_THREAD_CONSOLE_DESKTOP GetThreadConsoleDesktopRequest;
USER_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest;
USER_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest;
Modified: trunk/reactos/win32ss/user/user32/include/user32p.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/includ…
==============================================================================
--- trunk/reactos/win32ss/user/user32/include/user32p.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/include/user32p.h [iso-8859-1] Sun Feb 15 21:56:03
2015
@@ -113,6 +113,9 @@
VOID MenuTrackMouseMenuBar(HWND hWnd, ULONG Ht, POINT Pt);
VOID MenuTrackKbdMenuBar(HWND hWnd, UINT wParam, WCHAR wChar);
+/* definitions for logon.c */
+VOID FASTCALL Logon(BOOL IsLogon);
+
/* misc definitions */
void mirror_rect( const RECT *window_rect, RECT *rect );
BOOL FASTCALL DefSetText(HWND hWnd, PCWSTR String, BOOL Ansi);
Modified: trunk/reactos/win32ss/user/user32/misc/logon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/l…
==============================================================================
--- trunk/reactos/win32ss/user/user32/misc/logon.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/misc/logon.c [iso-8859-1] Sun Feb 15 21:56:03 2015
@@ -74,6 +74,22 @@
}
/*
+ * Helper function used by SetWindowStationUser (see winsta.c)
+ */
+VOID FASTCALL
+Logon(BOOL IsLogon)
+{
+ USER_API_MESSAGE ApiMessage;
+ PUSER_LOGON LogonRequest = &ApiMessage.Data.LogonRequest;
+
+ LogonRequest->IsLogon = IsLogon;
+ CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
+ NULL,
+ CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpLogon),
+ sizeof(*LogonRequest));
+}
+
+/*
* @implemented
*/
BOOL
Modified: trunk/reactos/win32ss/user/user32/misc/winsta.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/w…
==============================================================================
--- trunk/reactos/win32ss/user/user32/misc/winsta.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/misc/winsta.c [iso-8859-1] Sun Feb 15 21:56:03 2015
@@ -371,7 +371,7 @@
/*
- * @unimplemented
+ * @implemented
*/
BOOL
WINAPI
@@ -380,7 +380,21 @@
PSID psid,
DWORD size)
{
- return NtUserSetWindowStationUser(hWindowStation, pluid, psid, size);
+ BOOL Success;
+
+ Success = NtUserSetWindowStationUser(hWindowStation, pluid, psid, size);
+ if (Success)
+ {
+ /* Signal log-on/off to WINSRV */
+
+ /* User is logging on if pluid != LuidNone, otherwise it is a log-off */
+ LUID LuidNone = {0, 0};
+ BOOL IsLogon = (pluid && !RtlEqualLuid(pluid, &LuidNone));
+
+ Logon(IsLogon);
+ }
+
+ return Success;
}
/* EOF */