2005-09-25 18:17:27 +00:00
|
|
|
/*
|
2022-10-23 16:02:38 +00:00
|
|
|
* PROJECT: ReactOS Client/Server Runtime SubSystem
|
|
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
|
|
|
* PURPOSE: CSR Client Library - API LPC Implementation
|
|
|
|
* COPYRIGHT: Copyright 2005-2012 Alex Ionescu <alex@relsoft.net>
|
|
|
|
* Copyright 2012-2022 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
|
2005-09-25 13:43:33 +00:00
|
|
|
*/
|
|
|
|
|
2012-10-27 19:05:10 +00:00
|
|
|
/* INCLUDES *******************************************************************/
|
2005-09-25 13:43:33 +00:00
|
|
|
|
2022-10-23 16:02:38 +00:00
|
|
|
#include "csrlib.h"
|
|
|
|
|
|
|
|
#define NTOS_MODE_USER
|
|
|
|
#include <ndk/psfuncs.h>
|
2014-01-20 12:59:27 +00:00
|
|
|
|
2005-09-25 13:43:33 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
2012-10-27 19:05:10 +00:00
|
|
|
/* FUNCTIONS ******************************************************************/
|
2005-09-25 13:43:33 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
CsrNewThread(VOID)
|
|
|
|
{
|
|
|
|
/* Register the termination port to CSR's */
|
|
|
|
return NtRegisterThreadTerminatePort(CsrApiPort);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2021-11-21 22:46:11 +00:00
|
|
|
CsrIdentifyAlertableThread(VOID)
|
2005-09-25 13:43:33 +00:00
|
|
|
{
|
2021-11-21 22:46:11 +00:00
|
|
|
#if (NTDDI_VERSION < NTDDI_WS03)
|
2005-09-25 13:43:33 +00:00
|
|
|
NTSTATUS Status;
|
2012-10-17 23:10:40 +00:00
|
|
|
CSR_API_MESSAGE ApiMessage;
|
2021-11-21 22:46:11 +00:00
|
|
|
PCSR_IDENTIFY_ALERTABLE_THREAD IdentifyAlertableThread;
|
2005-09-25 13:43:33 +00:00
|
|
|
|
|
|
|
/* Set up the data for CSR */
|
2021-11-21 22:46:11 +00:00
|
|
|
IdentifyAlertableThread = &ApiMessage.Data.IdentifyAlertableThread;
|
|
|
|
IdentifyAlertableThread->Cid = NtCurrentTeb()->ClientId;
|
2005-09-25 13:43:33 +00:00
|
|
|
|
|
|
|
/* Call it */
|
2012-10-17 23:10:40 +00:00
|
|
|
Status = CsrClientCallServer(&ApiMessage,
|
2005-09-25 13:43:33 +00:00
|
|
|
NULL,
|
2021-11-21 22:46:11 +00:00
|
|
|
CSR_CREATE_API_NUMBER(CSRSRV_SERVERDLL_INDEX, CsrpIdentifyAlertableThread),
|
|
|
|
sizeof(*IdentifyAlertableThread));
|
2005-09-25 13:43:33 +00:00
|
|
|
|
|
|
|
/* Return to caller */
|
|
|
|
return Status;
|
2021-11-21 22:46:11 +00:00
|
|
|
#else
|
|
|
|
/* Deprecated */
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
#endif
|
2005-09-25 13:43:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2022-10-23 01:09:41 +00:00
|
|
|
CsrSetPriorityClass(
|
|
|
|
_In_ HANDLE Process,
|
|
|
|
_Inout_ PULONG PriorityClass)
|
2005-09-25 13:43:33 +00:00
|
|
|
{
|
2021-11-21 22:46:11 +00:00
|
|
|
#if (NTDDI_VERSION < NTDDI_WS03)
|
2005-09-25 13:43:33 +00:00
|
|
|
NTSTATUS Status;
|
2012-10-17 23:10:40 +00:00
|
|
|
CSR_API_MESSAGE ApiMessage;
|
2021-11-21 22:46:11 +00:00
|
|
|
PCSR_SET_PRIORITY_CLASS SetPriorityClass = &ApiMessage.Data.SetPriorityClass;
|
2012-11-05 00:23:58 +00:00
|
|
|
|
2005-09-25 13:43:33 +00:00
|
|
|
/* Set up the data for CSR */
|
2021-11-21 22:46:11 +00:00
|
|
|
SetPriorityClass->hProcess = Process;
|
|
|
|
SetPriorityClass->PriorityClass = *PriorityClass;
|
2005-09-25 13:43:33 +00:00
|
|
|
|
|
|
|
/* Call it */
|
2012-10-17 23:10:40 +00:00
|
|
|
Status = CsrClientCallServer(&ApiMessage,
|
2005-09-25 13:43:33 +00:00
|
|
|
NULL,
|
2021-11-21 22:46:11 +00:00
|
|
|
CSR_CREATE_API_NUMBER(CSRSRV_SERVERDLL_INDEX, CsrpSetPriorityClass),
|
|
|
|
sizeof(*SetPriorityClass));
|
|
|
|
|
|
|
|
/* Return what we got, if requested */
|
|
|
|
if (*PriorityClass) *PriorityClass = SetPriorityClass->PriorityClass;
|
2005-09-25 13:43:33 +00:00
|
|
|
|
|
|
|
/* Return to caller */
|
|
|
|
return Status;
|
2021-11-21 22:46:11 +00:00
|
|
|
#else
|
|
|
|
UNREFERENCED_PARAMETER(Process);
|
|
|
|
UNREFERENCED_PARAMETER(PriorityClass);
|
|
|
|
|
|
|
|
/* Deprecated */
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
#endif
|
2005-09-25 13:43:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|