ReactOS  0.4.15-dev-3717-g292e6a4
api.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS kernel
4  * FILE: dll/ntdll/csr/api.c
5  * PURPOSE: CSR APIs exported through NTDLL
6  * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include <ntdll.h>
12 
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* GLOBALS ********************************************************************/
17 
18 extern HANDLE CsrApiPort;
19 
20 /* FUNCTIONS ******************************************************************/
21 
22 /*
23  * @implemented
24  */
26 NTAPI
28 {
29  /* Register the termination port to CSR's */
31 }
32 
33 /*
34  * @implemented
35  */
37 NTAPI
39 {
40 #if (NTDDI_VERSION < NTDDI_WS03)
42  CSR_API_MESSAGE ApiMessage;
43  PCSR_IDENTIFY_ALERTABLE_THREAD IdentifyAlertableThread;
44 
45  /* Set up the data for CSR */
46  IdentifyAlertableThread = &ApiMessage.Data.IdentifyAlertableThread;
47  IdentifyAlertableThread->Cid = NtCurrentTeb()->ClientId;
48 
49  /* Call it */
50  Status = CsrClientCallServer(&ApiMessage,
51  NULL,
53  sizeof(*IdentifyAlertableThread));
54 
55  /* Return to caller */
56  return Status;
57 #else
58  /* Deprecated */
59  return STATUS_SUCCESS;
60 #endif
61 }
62 
63 /*
64  * @implemented
65  */
67 NTAPI
69  IN OUT 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 */
#define IN
Definition: typedefs.h:39
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
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:365
union _CSR_API_MESSAGE::@3392::@3394::@3396 Data
LONG NTSTATUS
Definition: precomp.h:26
BOOL WINAPI SetPriorityClass(IN HANDLE hProcess, IN DWORD dwPriorityClass)
Definition: proc.c:1693
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI CsrSetPriorityClass(IN HANDLE Process, IN OUT PULONG PriorityClass)
Definition: api.c:68
NTSTATUS NTAPI CsrIdentifyAlertableThread(VOID)
Definition: api.c:38
NTSTATUS NTAPI CsrNewThread(VOID)
Definition: api.c:27
HANDLE CsrApiPort
Definition: connect.c:21
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
#define OUT
Definition: typedefs.h:40
#define STATUS_SUCCESS
Definition: shellext.h:65
NTSTATUS NTAPI NtRegisterThreadTerminatePort(IN HANDLE PortHandle)
Definition: kill.c:1345