ReactOS  0.4.15-dev-316-g938df97
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  PULONG PriorityClass)
40 {
42  CSR_API_MESSAGE ApiMessage;
43  PCSR_SET_PRIORITY_CLASS SetPriorityClass = &ApiMessage.Data.SetPriorityClass;
44 
45  /* Set up the data for CSR */
46  DbgBreakPoint();
47  SetPriorityClass->hProcess = hProcess;
48  SetPriorityClass->PriorityClass = *PriorityClass;
49 
50  /* Call it */
51  Status = CsrClientCallServer(&ApiMessage,
52  NULL,
54  sizeof(CSR_SET_PRIORITY_CLASS));
55 
56  /* Return what we got, if requested */
57  if (*PriorityClass) *PriorityClass = SetPriorityClass->PriorityClass;
58 
59  /* Return to caller */
60  return Status;
61 }
62 
63 /*
64  * @implemented
65  */
67 NTAPI
69 {
71  CSR_API_MESSAGE ApiMessage;
72  PCSR_IDENTIFY_ALTERTABLE_THREAD IdentifyAlertableThread;
73 
74  /* Set up the data for CSR */
75  DbgBreakPoint();
76  IdentifyAlertableThread = &ApiMessage.Data.IdentifyAlertableThread;
77  IdentifyAlertableThread->Cid = NtCurrentTeb()->ClientId;
78 
79  /* Call it */
80  Status = CsrClientCallServer(&ApiMessage,
81  NULL,
84 
85  /* Return to caller */
86  return Status;
87 }
88 
89 /* EOF */
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
LONG NTSTATUS
Definition: precomp.h:26
BOOL WINAPI SetPriorityClass(IN HANDLE hProcess, IN DWORD dwPriorityClass)
Definition: proc.c:1692
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
void DbgBreakPoint()
Definition: mach.c:553
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
smooth NULL
Definition: ftsmooth.c:416
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
union _CSR_API_MESSAGE::@3385::@3387::@3389 Data
NTSTATUS NTAPI CsrIdentifyAlertableThread(VOID)
Definition: api.c:68
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI CsrNewThread(VOID)
Definition: api.c:27
HANDLE CsrApiPort
Definition: connect.c:21
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
NTSTATUS NTAPI CsrSetPriorityClass(HANDLE hProcess, PULONG PriorityClass)
Definition: api.c:38
#define CSRSRV_SERVERDLL_INDEX
Definition: csrmsg.h:20
unsigned int * PULONG
Definition: retypes.h:1
NTSTATUS NTAPI NtRegisterThreadTerminatePort(IN HANDLE PortHandle)
Definition: kill.c:1341