ReactOS 0.4.16-dev-297-gc569aee
register.c File Reference
#include "usersrv.h"
#include <debug.h>
Include dependency graph for register.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

 CSR_API (SrvRegisterLogonProcess)
 
 CSR_API (SrvRegisterServicesProcess)
 

Variables

static BOOLEAN ServicesProcessIdValid = FALSE
 
ULONG_PTR ServicesProcessId = 0
 
ULONG_PTR LogonProcessId = 0
 
HANDLE CsrApiPort
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 14 of file register.c.

Function Documentation

◆ CSR_API() [1/2]

CSR_API ( SrvRegisterLogonProcess  )

Definition at line 30 of file register.c.

31{
32 PUSER_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.RegisterLogonProcessRequest;
33
34 if (RegisterLogonProcessRequest->Register)
35 {
36 if (LogonProcessId != 0)
38
39 LogonProcessId = RegisterLogonProcessRequest->ProcessId;
40 }
41 else
42 {
43 if (ApiMessage->Header.ClientId.UniqueProcess != UlongToHandle(LogonProcessId))
44 {
45 DPRINT1("Current logon process 0x%x, can't deregister from process 0x%x\n",
46 LogonProcessId, ApiMessage->Header.ClientId.UniqueProcess);
48 }
49
51 }
52
53#if 1 //HAAAACK. This should be done in UserClientConnect which is never called!
54
55 /* Check if we don't have an API port yet */
56 if (CsrApiPort == NULL)
57 {
59
60 /* Query the API port and save it globally */
62
63 DPRINT("Giving win32k our api port\n");
64
65 /* Inform win32k about the API port */
69 sizeof(CsrApiPort));
70 if (!NT_SUCCESS(Status))
71 {
72 return Status;
73 }
74 }
75#endif
76
77 return STATUS_SUCCESS;
78}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define UlongToHandle(ul)
Definition: basetsd.h:97
HANDLE NTAPI CsrQueryApiPort(VOID)
Definition: api.c:1097
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI NtUserSetInformationThread(IN HANDLE ThreadHandle, IN USERTHREADINFOCLASS ThreadInformationClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)
Definition: ntstubs.c:673
@ UserThreadCsrApiPort
Definition: ntuser.h:78
#define STATUS_NOT_LOGON_PROCESS
Definition: ntstatus.h:473
#define STATUS_LOGON_SESSION_EXISTS
Definition: ntstatus.h:474
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
ULONG_PTR LogonProcessId
Definition: register.c:21
HANDLE CsrApiPort
Definition: connect.c:27
struct _USER_API_MESSAGE * PUSER_API_MESSAGE
#define NtCurrentThread()

◆ CSR_API() [2/2]

CSR_API ( SrvRegisterServicesProcess  )

Definition at line 81 of file register.c.

82{
83 PUSER_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.RegisterServicesProcessRequest;
84
86 {
87 /* Only accept a single call */
89 }
90 else
91 {
92 ServicesProcessId = RegisterServicesProcessRequest->ProcessId;
94 return STATUS_SUCCESS;
95 }
96}
#define TRUE
Definition: types.h:120
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
static BOOLEAN ServicesProcessIdValid
Definition: register.c:19
ULONG_PTR ServicesProcessId
Definition: register.c:20

Variable Documentation

◆ CsrApiPort

◆ LogonProcessId

ULONG_PTR LogonProcessId = 0

Definition at line 21 of file register.c.

Referenced by CSR_API(), UserClientShutdown(), and UserExitReactOS().

◆ ServicesProcessId

ULONG_PTR ServicesProcessId = 0

Definition at line 20 of file register.c.

Referenced by CSR_API(), and RegisterServicesProcess().

◆ ServicesProcessIdValid

BOOLEAN ServicesProcessIdValid = FALSE
static

Definition at line 19 of file register.c.

Referenced by CSR_API().