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/SetWindowStationUser and http://www.openrce.org/reference_library/win32_call_chains/2003SP1/USER32/Logon for details.
Part 1/2

svn path=/trunk/; revision=66303
This commit is contained in:
Hermès Bélusca-Maïto
2015-02-15 21:56:03 +00:00
parent c5dcd5d90a
commit 3ce6fcf3b2
4 changed files with 41 additions and 2 deletions
@@ -60,6 +60,11 @@ typedef struct _USER_END_TASK
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 @@ typedef struct _USER_API_MESSAGE
{
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;
@@ -113,6 +113,9 @@ UINT MenuDrawMenuBar(HDC hDC, LPRECT Rect, HWND hWnd, BOOL Draw);
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);
+16
View File
@@ -73,6 +73,22 @@ RegisterLogonProcess(DWORD dwProcessId,
return gfLogonProcess;
}
/*
* 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
*/
+16 -2
View File
@@ -371,7 +371,7 @@ OpenWindowStationW(LPCWSTR lpszWinSta,
/*
* @unimplemented
* @implemented
*/
BOOL
WINAPI
@@ -380,7 +380,21 @@ SetWindowStationUser(HWINSTA hWindowStation,
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 */