Sync up with trunk r61578.
[reactos.git] / dll / ntdll / csr / api.c
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 #define NDEBUG
13 #include <debug.h>
14
15 /* GLOBALS ********************************************************************/
16
17 extern HANDLE CsrApiPort;
18
19 /* FUNCTIONS ******************************************************************/
20
21 /*
22 * @implemented
23 */
24 NTSTATUS
25 NTAPI
26 CsrNewThread(VOID)
27 {
28 /* Register the termination port to CSR's */
29 return NtRegisterThreadTerminatePort(CsrApiPort);
30 }
31
32 /*
33 * @implemented
34 */
35 NTSTATUS
36 NTAPI
37 CsrSetPriorityClass(HANDLE hProcess,
38 PULONG PriorityClass)
39 {
40 NTSTATUS Status;
41 CSR_API_MESSAGE ApiMessage;
42 PCSR_SET_PRIORITY_CLASS SetPriorityClass = &ApiMessage.Data.SetPriorityClass;
43
44 /* Set up the data for CSR */
45 DbgBreakPoint();
46 SetPriorityClass->hProcess = hProcess;
47 SetPriorityClass->PriorityClass = *PriorityClass;
48
49 /* Call it */
50 Status = CsrClientCallServer(&ApiMessage,
51 NULL,
52 CSR_CREATE_API_NUMBER(CSRSRV_SERVERDLL_INDEX, CsrpSetPriorityClass),
53 sizeof(CSR_SET_PRIORITY_CLASS));
54
55 /* Return what we got, if requested */
56 if (*PriorityClass) *PriorityClass = SetPriorityClass->PriorityClass;
57
58 /* Return to caller */
59 return Status;
60 }
61
62 /*
63 * @implemented
64 */
65 NTSTATUS
66 NTAPI
67 CsrIdentifyAlertableThread(VOID)
68 {
69 NTSTATUS Status;
70 CSR_API_MESSAGE ApiMessage;
71 PCSR_IDENTIFY_ALTERTABLE_THREAD IdentifyAlertableThread;
72
73 /* Set up the data for CSR */
74 DbgBreakPoint();
75 IdentifyAlertableThread = &ApiMessage.Data.IdentifyAlertableThread;
76 IdentifyAlertableThread->Cid = NtCurrentTeb()->ClientId;
77
78 /* Call it */
79 Status = CsrClientCallServer(&ApiMessage,
80 NULL,
81 CSR_CREATE_API_NUMBER(CSRSRV_SERVERDLL_INDEX, CsrpIdentifyAlertable),
82 sizeof(CSR_IDENTIFY_ALTERTABLE_THREAD));
83
84 /* Return to caller */
85 return Status;
86 }
87
88 /* EOF */