ReactOS  0.4.13-dev-92-gf251225
logon.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS user32.dll
4  * FILE: win32ss/user/user32/misc/logon.c
5  * PURPOSE: Logon functions
6  * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
7  */
8 
9 #include <user32.h>
10 
12 
13 /*
14  * @implemented
15  */
16 BOOL
17 WINAPI
19 {
20  USER_API_MESSAGE ApiMessage;
21  PUSER_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest = &ApiMessage.Data.RegisterServicesProcessRequest;
22 
23  RegisterServicesProcessRequest->ProcessId = ServicesProcessId;
24 
26  NULL,
28  sizeof(*RegisterServicesProcessRequest));
29  if (!NT_SUCCESS(ApiMessage.Status))
30  {
31  UserSetLastNTError(ApiMessage.Status);
32  return FALSE;
33  }
34 
35  return TRUE;
36 }
37 
38 /*
39  * @implemented
40  */
41 BOOL
42 WINAPI
44  BOOL bRegister)
45 {
46  gfLogonProcess = NtUserxRegisterLogonProcess(dwProcessId, bRegister);
47 
48  if (gfLogonProcess)
49  {
50  USER_API_MESSAGE ApiMessage;
51  PUSER_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest = &ApiMessage.Data.RegisterLogonProcessRequest;
52 
53  RegisterLogonProcessRequest->ProcessId = dwProcessId;
54  RegisterLogonProcessRequest->Register = bRegister;
55 
57  NULL,
59  sizeof(*RegisterLogonProcessRequest));
60  if (!NT_SUCCESS(ApiMessage.Status))
61  {
62  ERR("Failed to register logon process with CSRSS\n");
63  UserSetLastNTError(ApiMessage.Status);
64  }
65  }
66 
67  return gfLogonProcess;
68 }
69 
70 /*
71  * Helper function used by SetWindowStationUser (see winsta.c)
72  */
74 Logon(BOOL IsLogon)
75 {
76  USER_API_MESSAGE ApiMessage;
77  PUSER_LOGON LogonRequest = &ApiMessage.Data.LogonRequest;
78 
79  LogonRequest->IsLogon = IsLogon;
81  NULL,
83  sizeof(*LogonRequest));
84 }
85 
86 /*
87  * @implemented
88  */
89 BOOL
90 WINAPI
92 {
93  return NtUserSetLogonNotifyWindow(Wnd);
94 }
95 
96 /*
97  * @implemented
98  */
99 BOOL
100 WINAPI
102  BOOL bEnable)
103 {
104  // Update Imm support and load Imm32.dll.
106 
108 }
ULONG_PTR ServicesProcessId
Definition: register.c:20
#define TRUE
Definition: types.h:120
BOOL WINAPI UpdatePerUserSystemParameters(DWORD dwReserved, BOOL bEnable)
Definition: logon.c:101
#define USERSRV_SERVERDLL_INDEX
Definition: winmsg.h:15
BOOL WINAPI SetLogonNotifyWindow(HWND Wnd)
Definition: logon.c:91
BOOL IsLogon
Definition: winmsg.h:65
NTSTATUS NTAPI CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage, IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL, IN CSR_API_NUMBER ApiNumber, IN ULONG DataLength)
Definition: connect.c:360
EXTINLINE BOOL NtUserxRegisterLogonProcess(DWORD dwProcessId, BOOL bRegister)
Definition: ntwrapper.h:831
BOOL WINAPI RegisterServicesProcess(DWORD ServicesProcessId)
Definition: logon.c:18
WINE_DEFAULT_DEBUG_CHANNEL(advapi)
#define FASTCALL
Definition: nt_native.h:50
NTSTATUS Status
Definition: csrmsg.h:112
USER_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest
Definition: winmsg.h:104
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
USER_LOGON LogonRequest
Definition: winmsg.h:102
smooth NULL
Definition: ftsmooth.c:416
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
USER_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest
Definition: winmsg.h:105
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
union _USER_API_MESSAGE::@3382 Data
BOOL NTAPI NtUserUpdatePerUserSystemParameters(DWORD dwReserved, BOOL bEnable)
Definition: sysparams.c:352
VOID WINAPI UserSetLastNTError(IN NTSTATUS Status)
Definition: misc.c:25
#define ERR(fmt,...)
Definition: debug.h:109
_In_ BOOL bEnable
Definition: winddi.h:3426
BOOLEAN gfLogonProcess
Definition: dllmain.c:18
BOOL WINAPI RegisterLogonProcess(DWORD dwProcessId, BOOL bRegister)
Definition: logon.c:43
VOID FASTCALL Logon(BOOL IsLogon)
Definition: logon.c:74
BOOL WINAPI UpdatePerUserImmEnabling(VOID)
Definition: imm.c:287
BOOL NTAPI NtUserSetLogonNotifyWindow(HWND hWnd)
Definition: winsta.c:1917