[KERNEL32]

Use some existing #define'd constants.

[CSRSRV-BASESRV]
- Add CSR version define (based from BASESRV version define).
- Add missing BASESRV structures, taken from https://code.google.com/p/ontl/source/browse/branches/devel/ntl/nt/csr.hxx (OpenNT Native Template Library).

svn path=/trunk/; revision=59779
This commit is contained in:
Hermès Bélusca-Maïto 2013-08-19 17:50:27 +00:00
parent 519595d9c4
commit 4203172aa0
10 changed files with 164 additions and 78 deletions

View file

@ -107,7 +107,7 @@ CsrpConnectToServer(IN PWSTR ObjectDirectory)
SecurityQos.EffectiveOnly = TRUE; SecurityQos.EffectiveOnly = TRUE;
/* Setup the connection info */ /* Setup the connection info */
ConnectionInfo.Version = 0x10000; ConnectionInfo.Version = CSRSRV_VERSION;
/* Create a SID for us */ /* Create a SID for us */
Status = RtlAllocateAndInitializeSid(&NtSidAuthority, Status = RtlAllocateAndInitializeSid(&NtSidAuthority,

View file

@ -157,7 +157,7 @@ DefineDosDeviceW(
} }
else else
{ {
DefineDosDeviceRequest->dwFlags = dwFlags; DefineDosDeviceRequest->Flags = dwFlags;
CsrCaptureMessageBuffer(CaptureBuffer, CsrCaptureMessageBuffer(CaptureBuffer,
(PVOID)DeviceUpcaseNameU.Buffer, (PVOID)DeviceUpcaseNameU.Buffer,
@ -174,11 +174,11 @@ DefineDosDeviceW(
CsrCaptureMessageBuffer(CaptureBuffer, CsrCaptureMessageBuffer(CaptureBuffer,
(PVOID)NtTargetPathU.Buffer, (PVOID)NtTargetPathU.Buffer,
NtTargetPathU.Length, NtTargetPathU.Length,
(PVOID*)&DefineDosDeviceRequest->TargetName.Buffer); (PVOID*)&DefineDosDeviceRequest->TargetPath.Buffer);
} }
DefineDosDeviceRequest->TargetName.Length = DefineDosDeviceRequest->TargetPath.Length =
NtTargetPathU.Length; NtTargetPathU.Length;
DefineDosDeviceRequest->TargetName.MaximumLength = DefineDosDeviceRequest->TargetPath.MaximumLength =
NtTargetPathU.Length; NtTargetPathU.Length;
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,

View file

@ -92,7 +92,7 @@ GetTempFileNameW(IN LPCWSTR lpPathName,
CHAR IDString[5]; CHAR IDString[5];
WCHAR * TempFileName; WCHAR * TempFileName;
BASE_API_MESSAGE ApiMessage; BASE_API_MESSAGE ApiMessage;
PBASE_GET_TEMP_FILE GetTempFile = &ApiMessage.Data.GetTempFile; PBASE_GET_TEMP_FILE GetTempFile = &ApiMessage.Data.GetTempFileRequest;
DWORD FileAttributes, LastError; DWORD FileAttributes, LastError;
UNICODE_STRING PathNameString, PrefixString; UNICODE_STRING PathNameString, PrefixString;
static const WCHAR Ext[] = { L'.', 't', 'm', 'p', UNICODE_NULL }; static const WCHAR Ext[] = { L'.', 't', 'm', 'p', UNICODE_NULL };

View file

@ -963,13 +963,13 @@ GetProcessShutdownParameters(OUT LPDWORD lpdwLevel,
{ {
NTSTATUS Status; NTSTATUS Status;
BASE_API_MESSAGE ApiMessage; BASE_API_MESSAGE ApiMessage;
PBASE_GET_PROCESS_SHUTDOWN_PARAMS GetShutdownParametersRequest = &ApiMessage.Data.GetShutdownParametersRequest; PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest = &ApiMessage.Data.ShutdownParametersRequest;
/* Ask CSRSS for shutdown information */ /* Ask CSRSS for shutdown information */
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
NULL, NULL,
CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepGetProcessShutdownParam), CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepGetProcessShutdownParam),
sizeof(BASE_GET_PROCESS_SHUTDOWN_PARAMS)); sizeof(BASE_GETSET_PROCESS_SHUTDOWN_PARAMS));
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
/* Return the failure from CSRSS */ /* Return the failure from CSRSS */
@ -978,8 +978,8 @@ GetProcessShutdownParameters(OUT LPDWORD lpdwLevel,
} }
/* Get the data back */ /* Get the data back */
*lpdwLevel = GetShutdownParametersRequest->Level; *lpdwLevel = ShutdownParametersRequest->ShutdownLevel;
*lpdwFlags = GetShutdownParametersRequest->Flags; *lpdwFlags = ShutdownParametersRequest->ShutdownFlags;
return TRUE; return TRUE;
} }
@ -993,15 +993,15 @@ SetProcessShutdownParameters(IN DWORD dwLevel,
{ {
NTSTATUS Status; NTSTATUS Status;
BASE_API_MESSAGE ApiMessage; BASE_API_MESSAGE ApiMessage;
PBASE_SET_PROCESS_SHUTDOWN_PARAMS SetShutdownParametersRequest = &ApiMessage.Data.SetShutdownParametersRequest; PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest = &ApiMessage.Data.ShutdownParametersRequest;
/* Write the data into the CSRSS request and send it */ /* Write the data into the CSRSS request and send it */
SetShutdownParametersRequest->Level = dwLevel; ShutdownParametersRequest->ShutdownLevel = dwLevel;
SetShutdownParametersRequest->Flags = dwFlags; ShutdownParametersRequest->ShutdownFlags = dwFlags;
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
NULL, NULL,
CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepSetProcessShutdownParam), CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepSetProcessShutdownParam),
sizeof(BASE_SET_PROCESS_SHUTDOWN_PARAMS)); sizeof(BASE_GETSET_PROCESS_SHUTDOWN_PARAMS));
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
/* Return the failure from CSRSS */ /* Return the failure from CSRSS */
@ -2426,7 +2426,7 @@ CreateProcessInternalW(IN HANDLE hUserToken,
/* Set message structures */ /* Set message structures */
CreateProcessMsg = &CsrMsg.Data.CreateProcessRequest; CreateProcessMsg = &CsrMsg.Data.CreateProcessRequest;
VdmMsg = &CsrMsg.Data.CheckVdm; VdmMsg = &CsrMsg.Data.CheckVDMRequest;
/* Clear the more complex structures by zeroing out their entire memory */ /* Clear the more complex structures by zeroing out their entire memory */
RtlZeroMemory(&Context, sizeof(Context)); RtlZeroMemory(&Context, sizeof(Context));

View file

@ -2,7 +2,7 @@
* PROJECT: ReactOS Win32 Base API * PROJECT: ReactOS Win32 Base API
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/kernel32/client/vdm.c * FILE: dll/win32/kernel32/client/vdm.c
* PURPOSE: Virtual Dos Machine (VDM) Support * PURPOSE: Virtual DOS Machines (VDM) Support
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/ */
@ -49,17 +49,18 @@ BaseIsDosApplication(IN PUNICODE_STRING PathName,
/* Is it a .com? */ /* Is it a .com? */
String.Length = BaseDotComSuffixName.Length; String.Length = BaseDotComSuffixName.Length;
String.Buffer = &PathName->Buffer[(PathName->Length - String.Length) / sizeof(WCHAR)]; String.Buffer = &PathName->Buffer[(PathName->Length - String.Length) / sizeof(WCHAR)];
if (RtlEqualUnicodeString(&String, &BaseDotComSuffixName, TRUE)) return 2; if (RtlEqualUnicodeString(&String, &BaseDotComSuffixName, TRUE)) return BINARY_TYPE_COM;
/* Is it a .pif? */ /* Is it a .pif? */
String.Length = BaseDotPifSuffixName.Length; String.Length = BaseDotPifSuffixName.Length;
String.Buffer = &PathName->Buffer[(PathName->Length - String.Length) / sizeof(WCHAR)]; String.Buffer = &PathName->Buffer[(PathName->Length - String.Length) / sizeof(WCHAR)];
if (RtlEqualUnicodeString(&String, &BaseDotPifSuffixName, TRUE)) return 3; if (RtlEqualUnicodeString(&String, &BaseDotPifSuffixName, TRUE)) return BINARY_TYPE_PIF;
/* Is it an exe? */ /* Is it an exe? */
String.Length = BaseDotExeSuffixName.Length; String.Length = BaseDotExeSuffixName.Length;
String.Buffer = &PathName->Buffer[(PathName->Length - String.Length) / sizeof(WCHAR)]; String.Buffer = &PathName->Buffer[(PathName->Length - String.Length) / sizeof(WCHAR)];
if (RtlEqualUnicodeString(&String, &BaseDotExeSuffixName, TRUE)) return 1; if (RtlEqualUnicodeString(&String, &BaseDotExeSuffixName, TRUE)) return BINARY_TYPE_EXE;
return 0; return 0;
} }

View file

@ -32,13 +32,6 @@ typedef enum _CSRSRV_API_NUMBER
} CSRSRV_API_NUMBER, *PCSRSRV_API_NUMBER; } CSRSRV_API_NUMBER, *PCSRSRV_API_NUMBER;
/*
typedef struct _CSR_API_NUMBER
{
WORD Index;
WORD Subsystem;
} CSR_API_NUMBER, *PCSR_API_NUMBER;
*/
typedef ULONG CSR_API_NUMBER; typedef ULONG CSR_API_NUMBER;
#define CSR_CREATE_API_NUMBER(ServerId, ApiId) \ #define CSR_CREATE_API_NUMBER(ServerId, ApiId) \
@ -64,6 +57,8 @@ typedef struct _CSR_CONNECTION_INFO
HANDLE ProcessId; HANDLE ProcessId;
} CSR_CONNECTION_INFO, *PCSR_CONNECTION_INFO; } CSR_CONNECTION_INFO, *PCSR_CONNECTION_INFO;
#define CSRSRV_VERSION 0x10000
// We must have a size at most equal to the maximum acceptable LPC data size. // We must have a size at most equal to the maximum acceptable LPC data size.
C_ASSERT(sizeof(CSR_CONNECTION_INFO) <= LPC_MAX_DATA_LENGTH); C_ASSERT(sizeof(CSR_CONNECTION_INFO) <= LPC_MAX_DATA_LENGTH);

View file

@ -52,6 +52,21 @@ typedef enum _BASESRV_API_NUMBER
BasepMaxApiNumber BasepMaxApiNumber
} BASESRV_API_NUMBER, *PBASESRV_API_NUMBER; } BASESRV_API_NUMBER, *PBASESRV_API_NUMBER;
typedef struct
{
ULONG ExpectedVersion;
HANDLE DefaultObjectDirectory;
ULONG WindowsVersion;
ULONG CurrentVersion;
ULONG DebugFlags;
WCHAR WindowsDirectory[MAX_PATH];
WCHAR WindowsSystemDirectory[MAX_PATH];
} BASESRV_API_CONNECTINFO, *PBASESRV_API_CONNECTINFO;
#define BASESRV_VERSION 0x10000
typedef struct _BASE_SXS_CREATEPROCESS_MSG typedef struct _BASE_SXS_CREATEPROCESS_MSG
{ {
ULONG Flags; ULONG Flags;
@ -94,11 +109,6 @@ typedef struct
HANDLE ThreadHandle; HANDLE ThreadHandle;
} BASE_CREATE_THREAD, *PBASE_CREATE_THREAD; } BASE_CREATE_THREAD, *PBASE_CREATE_THREAD;
typedef struct
{
UINT uExitCode;
} BASE_EXIT_PROCESS, *PBASE_EXIT_PROCESS;
typedef struct typedef struct
{ {
UINT UniqueID; UINT UniqueID;
@ -106,28 +116,33 @@ typedef struct
typedef struct typedef struct
{ {
ULONG iTask; UINT uExitCode;
} BASE_EXIT_PROCESS, *PBASE_EXIT_PROCESS;
typedef struct
{
ULONG iTask;
HANDLE ConsoleHandle; HANDLE ConsoleHandle;
ULONG BinaryType; ULONG BinaryType;
HANDLE WaitObjectForParent; HANDLE WaitObjectForParent;
HANDLE StdIn; HANDLE StdIn;
HANDLE StdOut; HANDLE StdOut;
HANDLE StdErr; HANDLE StdErr;
ULONG CodePage; ULONG CodePage;
ULONG dwCreationFlags; ULONG dwCreationFlags;
PCHAR CmdLine; PCHAR CmdLine;
PCHAR appName; PCHAR appName;
PCHAR PifFile; PCHAR PifFile;
PCHAR CurDirectory; PCHAR CurDirectory;
PCHAR Env; PCHAR Env;
ULONG EnvLen; ULONG EnvLen;
PVOID StartupInfo; LPSTARTUPINFOA StartupInfo;
PCHAR Desktop; PCHAR Desktop;
ULONG DesktopLen; ULONG DesktopLen;
PCHAR Title; PCHAR Title;
ULONG TitleLen; ULONG TitleLen;
PCHAR Reserved; PCHAR Reserved;
ULONG ReservedLen; ULONG ReservedLen;
USHORT CmdLen; USHORT CmdLen;
USHORT AppLen; USHORT AppLen;
USHORT PifLen; USHORT PifLen;
@ -138,8 +153,8 @@ typedef struct
typedef struct typedef struct
{ {
ULONG iTask; ULONG iTask;
ULONG BinaryType; ULONG BinaryType;
HANDLE ConsoleHandle; HANDLE ConsoleHandle;
HANDLE VDMProcessHandle; HANDLE VDMProcessHandle;
HANDLE WaitObjectForParent; HANDLE WaitObjectForParent;
@ -147,24 +162,87 @@ typedef struct
USHORT VDMCreationState; USHORT VDMCreationState;
} BASE_UPDATE_VDM_ENTRY, *PBASE_UPDATE_VDM_ENTRY; } BASE_UPDATE_VDM_ENTRY, *PBASE_UPDATE_VDM_ENTRY;
typedef struct
{
ULONG iTask;
HANDLE ConsoleHandle;
HANDLE WaitObjectForVDM;
HANDLE StdIn;
HANDLE StdOut;
HANDLE StdErr;
ULONG CodePage;
ULONG dwCreationFlags;
ULONG ExitCode;
PCHAR CmdLine;
PCHAR AppName;
PCHAR PifFile;
PCHAR CurDirectory;
PCHAR Env;
ULONG EnvLen;
LPSTARTUPINFOA StartupInfo;
PCHAR Desktop;
ULONG DesktopLen;
PCHAR Title;
ULONG TitleLen;
PCHAR Reserved;
ULONG ReservedLen;
USHORT CurrentDrive;
USHORT CmdLen;
USHORT AppLen;
USHORT PifLen;
USHORT CurDirectoryLen;
USHORT VDMState;
ULONG fComingFromBat;
} BASE_GET_NEXT_VDM_COMMAND, *PBASE_GET_NEXT_VDM_COMMAND;
typedef struct
{
HANDLE ConsoleHandle;
ULONG iWowTask;
HANDLE WaitObjectForVDM;
} BASE_EXIT_VDM, *PBASE_EXIT_VDM;
typedef struct
{
ULONG FirstVDM;
} BASE_IS_FIRST_VDM, *PBASE_IS_FIRST_VDM;
typedef struct typedef struct
{ {
HANDLE ConsoleHandle; HANDLE ConsoleHandle;
HANDLE hParent; HANDLE hParent;
ULONG ExitCode; ULONG ExitCode;
} BASE_GET_VDM_EXIT_CODE, *PBASE_GET_VDM_EXIT_CODE; } BASE_GET_VDM_EXIT_CODE, *PBASE_GET_VDM_EXIT_CODE;
typedef struct typedef struct
{ {
DWORD Level; HANDLE ConsoleHandle;
DWORD Flags; ULONG fIncDec;
} BASE_SET_PROCESS_SHUTDOWN_PARAMS, *PBASE_SET_PROCESS_SHUTDOWN_PARAMS; } BASE_SET_REENTER_COUNT, *PBASE_SET_REENTER_COUNT;
typedef struct typedef struct
{ {
DWORD Level; ULONG ShutdownLevel;
DWORD Flags; ULONG ShutdownFlags;
} BASE_GET_PROCESS_SHUTDOWN_PARAMS, *PBASE_GET_PROCESS_SHUTDOWN_PARAMS; } BASE_GETSET_PROCESS_SHUTDOWN_PARAMS, *PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS;
typedef struct
{
HANDLE ConsoleHandle;
PCHAR lpszzCurDirs;
ULONG cchCurDirs;
} BASE_GETSET_VDM_CURDIRS, *PBASE_GETSET_VDM_CURDIRS;
typedef struct
{
HANDLE ConsoleHandle;
ULONG fBeginEnd;
} BASE_BAT_NOTIFICATION, *PBASE_BAT_NOTIFICATION;
typedef struct
{
HANDLE hwndWowExec;
} BASE_REGISTER_WOWEXEC, *PBASE_REGISTER_WOWEXEC;
typedef struct typedef struct
{ {
@ -173,9 +251,14 @@ typedef struct
typedef struct typedef struct
{ {
UNICODE_STRING IniFileName;
} BASE_REFRESH_INIFILE_MAPPING, *PBASE_REFRESH_INIFILE_MAPPING;
typedef struct
{
ULONG Flags;
UNICODE_STRING DeviceName; UNICODE_STRING DeviceName;
UNICODE_STRING TargetName; UNICODE_STRING TargetPath;
DWORD dwFlags;
} BASE_DEFINE_DOS_DEVICE, *PBASE_DEFINE_DOS_DEVICE; } BASE_DEFINE_DOS_DEVICE, *PBASE_DEFINE_DOS_DEVICE;
typedef struct _BASE_API_MESSAGE typedef struct _BASE_API_MESSAGE
@ -190,14 +273,21 @@ typedef struct _BASE_API_MESSAGE
{ {
BASE_CREATE_PROCESS CreateProcessRequest; BASE_CREATE_PROCESS CreateProcessRequest;
BASE_CREATE_THREAD CreateThreadRequest; BASE_CREATE_THREAD CreateThreadRequest;
BASE_GET_TEMP_FILE GetTempFileRequest;
BASE_EXIT_PROCESS ExitProcessRequest; BASE_EXIT_PROCESS ExitProcessRequest;
BASE_GET_TEMP_FILE GetTempFile; BASE_CHECK_VDM CheckVDMRequest;
BASE_CHECK_VDM CheckVdm; BASE_UPDATE_VDM_ENTRY UpdateVDMEntryRequest;
BASE_UPDATE_VDM_ENTRY UpdateVdmEntry; BASE_GET_NEXT_VDM_COMMAND GetNextVDMCommandRequest;
BASE_GET_VDM_EXIT_CODE GetVdmExitCode; BASE_EXIT_VDM ExitVDMRequest;
BASE_SET_PROCESS_SHUTDOWN_PARAMS SetShutdownParametersRequest; BASE_IS_FIRST_VDM IsFirstVDMRequest;
BASE_GET_PROCESS_SHUTDOWN_PARAMS GetShutdownParametersRequest; BASE_GET_VDM_EXIT_CODE GetVDMExitCodeRequest;
BASE_SET_REENTER_COUNT SetReenterCountRequest;
BASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest;
BASE_GETSET_VDM_CURDIRS VDMCurrentDirsRequest;
BASE_BAT_NOTIFICATION BatNotificationRequest;
BASE_REGISTER_WOWEXEC RegisterWowExecRequest;
BASE_SOUND_SENTRY SoundSentryRequest; BASE_SOUND_SENTRY SoundSentryRequest;
BASE_REFRESH_INIFILE_MAPPING RefreshIniFileMappingRequest;
BASE_DEFINE_DOS_DEVICE DefineDosDeviceRequest; BASE_DEFINE_DOS_DEVICE DefineDosDeviceRequest;
} Data; } Data;
} BASE_API_MESSAGE, *PBASE_API_MESSAGE; } BASE_API_MESSAGE, *PBASE_API_MESSAGE;

View file

@ -99,17 +99,17 @@ CSR_API(BaseSrvDefineDosDevice)
DWORD dwFlags; DWORD dwFlags;
PWSTR lpBuffer; PWSTR lpBuffer;
DPRINT("BaseSrvDefineDosDevice entered, Flags:%d, DeviceName:%wZ, TargetName:%wZ\n", DPRINT("BaseSrvDefineDosDevice entered, Flags:%d, DeviceName:%wZ, TargetPath:%wZ\n",
DefineDosDeviceRequest->dwFlags, DefineDosDeviceRequest->Flags,
&DefineDosDeviceRequest->DeviceName, &DefineDosDeviceRequest->DeviceName,
&DefineDosDeviceRequest->TargetName); &DefineDosDeviceRequest->TargetPath);
Matched = AddHistory = FALSE; Matched = AddHistory = FALSE;
HistoryEntry = NULL; HistoryEntry = NULL;
AdminSid = SystemSid = WorldSid = NULL; AdminSid = SystemSid = WorldSid = NULL;
SecurityDescriptor = NULL; SecurityDescriptor = NULL;
ListHead = &DosDeviceHistory; ListHead = &DosDeviceHistory;
dwFlags = DefineDosDeviceRequest->dwFlags; dwFlags = DefineDosDeviceRequest->Flags;
/* Validate the flags */ /* Validate the flags */
if ( (dwFlags & 0xFFFFFFF0) || if ( (dwFlags & 0xFFFFFFF0) ||
@ -136,7 +136,7 @@ CSR_API(BaseSrvDefineDosDevice)
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
_SEH2_LEAVE; _SEH2_LEAVE;
RequestLinkTarget = &DefineDosDeviceRequest->TargetName; RequestLinkTarget = &DefineDosDeviceRequest->TargetPath;
lpBuffer = (PWSTR)RtlAllocateHeap(BaseSrvHeap, lpBuffer = (PWSTR)RtlAllocateHeap(BaseSrvHeap,
HEAP_ZERO_MEMORY, HEAP_ZERO_MEMORY,
RequestDeviceName.MaximumLength + 5 * sizeof(WCHAR)); RequestDeviceName.MaximumLength + 5 * sizeof(WCHAR));

View file

@ -18,7 +18,7 @@
CSR_API(BaseSrvGetTempFile) CSR_API(BaseSrvGetTempFile)
{ {
static UINT BaseGetTempFileUnique = 0; static UINT BaseGetTempFileUnique = 0;
PBASE_GET_TEMP_FILE GetTempFile = &((PBASE_API_MESSAGE)ApiMessage)->Data.GetTempFile; PBASE_GET_TEMP_FILE GetTempFile = &((PBASE_API_MESSAGE)ApiMessage)->Data.GetTempFileRequest;
/* Return 16-bits ID */ /* Return 16-bits ID */
GetTempFile->UniqueID = (++BaseGetTempFileUnique & 0xFFFF); GetTempFile->UniqueID = (++BaseGetTempFileUnique & 0xFFFF);
@ -211,24 +211,24 @@ CSR_API(BaseSrvExitProcess)
CSR_API(BaseSrvGetProcessShutdownParam) CSR_API(BaseSrvGetProcessShutdownParam)
{ {
PBASE_GET_PROCESS_SHUTDOWN_PARAMS GetShutdownParametersRequest = &((PBASE_API_MESSAGE)ApiMessage)->Data.GetShutdownParametersRequest; PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest = &((PBASE_API_MESSAGE)ApiMessage)->Data.ShutdownParametersRequest;
PCSR_THREAD CsrThread = CsrGetClientThread(); PCSR_THREAD CsrThread = CsrGetClientThread();
ASSERT(CsrThread); ASSERT(CsrThread);
GetShutdownParametersRequest->Level = CsrThread->Process->ShutdownLevel; ShutdownParametersRequest->ShutdownLevel = CsrThread->Process->ShutdownLevel;
GetShutdownParametersRequest->Flags = CsrThread->Process->ShutdownFlags; ShutdownParametersRequest->ShutdownFlags = CsrThread->Process->ShutdownFlags;
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
CSR_API(BaseSrvSetProcessShutdownParam) CSR_API(BaseSrvSetProcessShutdownParam)
{ {
PBASE_SET_PROCESS_SHUTDOWN_PARAMS SetShutdownParametersRequest = &((PBASE_API_MESSAGE)ApiMessage)->Data.SetShutdownParametersRequest; PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest = &((PBASE_API_MESSAGE)ApiMessage)->Data.ShutdownParametersRequest;
PCSR_THREAD CsrThread = CsrGetClientThread(); PCSR_THREAD CsrThread = CsrGetClientThread();
ASSERT(CsrThread); ASSERT(CsrThread);
CsrThread->Process->ShutdownLevel = SetShutdownParametersRequest->Level; CsrThread->Process->ShutdownLevel = ShutdownParametersRequest->ShutdownLevel;
CsrThread->Process->ShutdownFlags = SetShutdownParametersRequest->Flags; CsrThread->Process->ShutdownFlags = ShutdownParametersRequest->ShutdownFlags;
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Base API Server DLL * PROJECT: ReactOS Base API Server DLL
* FILE: subsystems/win/basesrv/vdm.c * FILE: subsystems/win/basesrv/vdm.c
* PURPOSE: Virtual DOS Machines Management * PURPOSE: Virtual DOS Machines (VDM) Support
* PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr) * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
*/ */