ReactOS  0.4.15-dev-5618-g8866b9d
api.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Client/Server Runtime SubSystem
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: CSR Client Library - API LPC Implementation
5  * COPYRIGHT: Copyright 2005-2012 Alex Ionescu <alex@relsoft.net>
6  * Copyright 2012-2022 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include "csrlib.h"
12 
13 #define NTOS_MODE_USER
14 #include <ndk/psfuncs.h>
15 
16 #define NDEBUG
17 #include <debug.h>
18 
19 /* FUNCTIONS ******************************************************************/
20 
21 /*
22  * @implemented
23  */
25 NTAPI
27 {
28  /* Register the termination port to CSR's */
30 }
31 
32 /*
33  * @implemented
34  */
36 NTAPI
38 {
39 #if (NTDDI_VERSION < NTDDI_WS03)
41  CSR_API_MESSAGE ApiMessage;
42  PCSR_IDENTIFY_ALERTABLE_THREAD IdentifyAlertableThread;
43 
44  /* Set up the data for CSR */
45  IdentifyAlertableThread = &ApiMessage.Data.IdentifyAlertableThread;
46  IdentifyAlertableThread->Cid = NtCurrentTeb()->ClientId;
47 
48  /* Call it */
49  Status = CsrClientCallServer(&ApiMessage,
50  NULL,
52  sizeof(*IdentifyAlertableThread));
53 
54  /* Return to caller */
55  return Status;
56 #else
57  /* Deprecated */
58  return STATUS_SUCCESS;
59 #endif
60 }
61 
62 /*
63  * @implemented
64  */
66 NTAPI
69  _Inout_ PULONG PriorityClass)
70 {
71 #if (NTDDI_VERSION < NTDDI_WS03)
73  CSR_API_MESSAGE ApiMessage;
74  PCSR_SET_PRIORITY_CLASS SetPriorityClass = &ApiMessage.Data.SetPriorityClass;
75 
76  /* Set up the data for CSR */
77  SetPriorityClass->hProcess = Process;
78  SetPriorityClass->PriorityClass = *PriorityClass;
79 
80  /* Call it */
81  Status = CsrClientCallServer(&ApiMessage,
82  NULL,
84  sizeof(*SetPriorityClass));
85 
86  /* Return what we got, if requested */
87  if (*PriorityClass) *PriorityClass = SetPriorityClass->PriorityClass;
88 
89  /* Return to caller */
90  return Status;
91 #else
93  UNREFERENCED_PARAMETER(PriorityClass);
94 
95  /* Deprecated */
97 #endif
98 }
99 
100 /* EOF */
HANDLE CsrApiPort
Definition: connect.c:27
#define _Inout_
Definition: ms_sal.h:378
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
BOOL WINAPI SetPriorityClass(IN HANDLE hProcess, IN DWORD dwPriorityClass)
Definition: proc.c:1692
union _CSR_API_MESSAGE::@3429::@3431::@3433 Data
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define _In_
Definition: ms_sal.h:308
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI CsrClientCallServer(_Inout_ PCSR_API_MESSAGE ApiMessage, _Inout_opt_ PCSR_CAPTURE_BUFFER CaptureBuffer, _In_ CSR_API_NUMBER ApiNumber, _In_ ULONG DataLength)
Definition: connect.c:366
NTSTATUS NTAPI CsrIdentifyAlertableThread(VOID)
Definition: api.c:37
NTSTATUS NTAPI CsrNewThread(VOID)
Definition: api.c:26
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define CSRSRV_SERVERDLL_INDEX
Definition: csrmsg.h:20
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
NTSTATUS NTAPI CsrSetPriorityClass(_In_ HANDLE Process, _Inout_ PULONG PriorityClass)
Definition: api.c:67
#define STATUS_SUCCESS
Definition: shellext.h:65
NTSTATUS NTAPI NtRegisterThreadTerminatePort(IN HANDLE PortHandle)
Definition: kill.c:1342