ReactOS 0.4.16-dev-334-g4d9f67c
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 */
27{
28 /* Register the termination port to CSR's */
30}
31
32/*
33 * @implemented
34 */
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 */
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 */
LONG NTSTATUS
Definition: precomp.h:26
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
#define CSRSRV_SERVERDLL_INDEX
Definition: csrmsg.h:20
@ CsrpSetPriorityClass
Definition: csrmsg.h:29
@ CsrpIdentifyAlertableThread
Definition: csrmsg.h:28
#define NULL
Definition: types.h:112
BOOL WINAPI SetPriorityClass(IN HANDLE hProcess, IN DWORD dwPriorityClass)
Definition: proc.c:1698
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
Status
Definition: gdiplustypes.h:25
#define NtCurrentTeb
#define _Inout_
Definition: no_sal2.h:162
#define _In_
Definition: no_sal2.h:158
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
NTSTATUS NTAPI NtRegisterThreadTerminatePort(IN HANDLE PortHandle)
Definition: kill.c:1342
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
#define STATUS_SUCCESS
Definition: shellext.h:65
union _CSR_API_MESSAGE::@3487::@3489::@3491 Data
NTSTATUS NTAPI CsrSetPriorityClass(_In_ HANDLE Process, _Inout_ PULONG PriorityClass)
Definition: api.c:67
NTSTATUS NTAPI CsrNewThread(VOID)
Definition: api.c:26
NTSTATUS NTAPI CsrIdentifyAlertableThread(VOID)
Definition: api.c:37
HANDLE CsrApiPort
Definition: connect.c:27
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135