ReactOS  0.4.14-dev-854-gb9426a3
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 
50  LogonProcessId = 0;
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 */
68  &CsrApiPort,
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 NtCurrentThread()
#define STATUS_NOT_LOGON_PROCESS
Definition: ntstatus.h:459
NTSTATUS NTAPI NtUserSetInformationThread(IN HANDLE ThreadHandle, IN USERTHREADINFOCLASS ThreadInformationClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)
Definition: ntstubs.c:699
smooth NULL
Definition: ftsmooth.c:416
#define STATUS_LOGON_SESSION_EXISTS
Definition: ntstatus.h:460
ULONG_PTR LogonProcessId
Definition: register.c:21
void DPRINT(...)
Definition: polytest.cpp:61
HANDLE CsrApiPort
Definition: connect.c:21
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define UlongToHandle(ul)
Definition: basetsd.h:97
struct _USER_API_MESSAGE * PUSER_API_MESSAGE
Status
Definition: gdiplustypes.h:24
#define DPRINT1
Definition: precomp.h:8
return STATUS_SUCCESS
Definition: btrfs.c:2938
HANDLE NTAPI CsrQueryApiPort(VOID)
Definition: api.c:1078

◆ 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 }
ULONG_PTR ServicesProcessId
Definition: register.c:20
#define TRUE
Definition: types.h:120
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
static BOOLEAN ServicesProcessIdValid
Definition: register.c:19
struct _USER_API_MESSAGE * PUSER_API_MESSAGE
return STATUS_SUCCESS
Definition: btrfs.c:2938

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().