[CMAKE]: Disable standard C libraries (WIP: Should add libgcc).
[reactos.git] / dll / ntdll / csr / api.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: lib/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 extern HANDLE CsrApiPort;
17
18 /* FUNCTIONS *****************************************************************/
19
20 /*
21 * @implemented
22 */
23 NTSTATUS
24 NTAPI
25 CsrNewThread(VOID)
26 {
27 /* Register the termination port to CSR's */
28 return NtRegisterThreadTerminatePort(CsrApiPort);
29 }
30
31 /*
32 * @implemented
33 */
34 NTSTATUS
35 NTAPI
36 CsrSetPriorityClass(HANDLE hProcess,
37 PULONG PriorityClass)
38 {
39 NTSTATUS Status;
40 CSR_API_MESSAGE2 ApiMessage; /* <- Remove the "2" when CSR is commited */
41 PCSR_SET_PRIORITY_CLASS SetPriorityClass = &ApiMessage.SetPriorityClass;
42
43 /* Set up the data for CSR */
44 DbgBreakPoint();
45 SetPriorityClass->hProcess = hProcess;
46 SetPriorityClass->PriorityClass = *PriorityClass;
47
48 /* Call it */
49 Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
50 NULL,
51 CSR_MAKE_OPCODE(CsrSrvSetPriorityClass,
52 CSR_SRV_SERVER),
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_MESSAGE2 ApiMessage; /* <- Remove the "2" when CSR is commited */
71 PCSR_IDENTIFY_ALTERTABLE_THREAD IdentifyAlertableThread;
72
73 /* Set up the data for CSR */
74 DbgBreakPoint();
75 IdentifyAlertableThread = &ApiMessage.IdentifyAlertableThread;
76 IdentifyAlertableThread->Cid = NtCurrentTeb()->ClientId;
77
78 /* Call it */
79 Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
80 NULL,
81 CSR_MAKE_OPCODE(CsrSrvIdentifyAlertableThread,
82 CSR_SRV_SERVER),
83 sizeof(CSR_SET_PRIORITY_CLASS));
84
85 /* Return to caller */
86 return Status;
87 }
88
89 /* EOF */