Author: hbelusca
Date: Fri Jul 10 23:57:26 2015
New Revision: 68384
URL:
http://svn.reactos.org/svn/reactos?rev=68384&view=rev
Log:
[KERNEL32]
Since CsrClientCallServer returns the value of ApiMessage.Status, then just use
ApiMessage.Status instead of declaring another Status variable for querying the return
value of CsrClientCallServer (continuation of r62460).
Modified:
trunk/reactos/dll/win32/kernel32/client/console/vista.c
trunk/reactos/dll/win32/kernel32/client/dosdev.c
trunk/reactos/dll/win32/kernel32/client/file/deviceio.c
trunk/reactos/dll/win32/kernel32/client/file/filename.c
trunk/reactos/dll/win32/kernel32/client/proc.c
Modified: trunk/reactos/dll/win32/kernel32/client/console/vista.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/console/vista.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/console/vista.c [iso-8859-1] Fri Jul 10
23:57:26 2015
@@ -26,7 +26,6 @@
DECLSPEC_HOTPATCH
GetConsoleHistoryInfo(PCONSOLE_HISTORY_INFO lpConsoleHistoryInfo)
{
- NTSTATUS Status;
CONSOLE_API_MESSAGE ApiMessage;
PCONSOLE_GETSETHISTORYINFO HistoryInfoRequest =
&ApiMessage.Data.HistoryInfoRequest;
@@ -36,13 +35,13 @@
return FALSE;
}
- Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
- NULL,
- CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX,
ConsolepGetHistory),
- sizeof(CONSOLE_GETSETHISTORYINFO));
- if (!NT_SUCCESS(Status))
+ CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
+ NULL,
+ CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX,
ConsolepGetHistory),
+ sizeof(*HistoryInfoRequest));
+ if (!NT_SUCCESS(ApiMessage.Status))
{
- BaseSetLastNTError(Status);
+ BaseSetLastNTError(ApiMessage.Status);
return FALSE;
}
@@ -62,7 +61,6 @@
DECLSPEC_HOTPATCH
SetConsoleHistoryInfo(IN PCONSOLE_HISTORY_INFO lpConsoleHistoryInfo)
{
- NTSTATUS Status;
CONSOLE_API_MESSAGE ApiMessage;
PCONSOLE_GETSETHISTORYINFO HistoryInfoRequest =
&ApiMessage.Data.HistoryInfoRequest;
@@ -76,13 +74,13 @@
HistoryInfoRequest->NumberOfHistoryBuffers =
lpConsoleHistoryInfo->NumberOfHistoryBuffers;
HistoryInfoRequest->dwFlags = lpConsoleHistoryInfo->dwFlags;
- Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
- NULL,
- CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX,
ConsolepSetHistory),
- sizeof(CONSOLE_GETSETHISTORYINFO));
- if (!NT_SUCCESS(Status))
+ CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
+ NULL,
+ CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX,
ConsolepSetHistory),
+ sizeof(*HistoryInfoRequest));
+ if (!NT_SUCCESS(ApiMessage.Status))
{
- BaseSetLastNTError(Status);
+ BaseSetLastNTError(ApiMessage.Status);
return FALSE;
}
Modified: trunk/reactos/dll/win32/kernel32/client/dosdev.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/dosdev.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/dosdev.c [iso-8859-1] Fri Jul 10 23:57:26
2015
@@ -85,7 +85,6 @@
BASE_API_MESSAGE ApiMessage;
PBASE_DEFINE_DOS_DEVICE DefineDosDeviceRequest =
&ApiMessage.Data.DefineDosDeviceRequest;
PCSR_CAPTURE_BUFFER CaptureBuffer;
- NTSTATUS Status;
UNICODE_STRING NtTargetPathU;
UNICODE_STRING DeviceNameU;
UNICODE_STRING DeviceUpcaseNameU;
@@ -174,16 +173,16 @@
DefineDosDeviceRequest->TargetPath.MaximumLength =
NtTargetPathU.Length;
- Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
- CaptureBuffer,
- CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepDefineDosDevice),
- sizeof(BASE_DEFINE_DOS_DEVICE));
+ CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
+ CaptureBuffer,
+ CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepDefineDosDevice),
+ sizeof(*DefineDosDeviceRequest));
CsrFreeCaptureBuffer(CaptureBuffer);
- if (!NT_SUCCESS(Status))
- {
- WARN("CsrClientCallServer() failed (Status %lx)\n", Status);
- BaseSetLastNTError(Status);
+ if (!NT_SUCCESS(ApiMessage.Status))
+ {
+ WARN("CsrClientCallServer() failed (Status %lx)\n",
ApiMessage.Status);
+ BaseSetLastNTError(ApiMessage.Status);
Result = FALSE;
}
else
Modified: trunk/reactos/dll/win32/kernel32/client/file/deviceio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/file/deviceio.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/file/deviceio.c [iso-8859-1] Fri Jul 10
23:57:26 2015
@@ -36,7 +36,7 @@
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
NULL,
CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepSoundSentryNotification),
- sizeof(BASE_SOUND_SENTRY));
+ sizeof(*SoundSentryRequest));
}
}
Modified: trunk/reactos/dll/win32/kernel32/client/file/filename.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/file/filename.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/file/filename.c [iso-8859-1] Fri Jul 10
23:57:26 2015
@@ -161,7 +161,7 @@
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
NULL,
CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepGetTempFile),
- sizeof(BASE_GET_TEMP_FILE));
+ sizeof(*GetTempFile));
if (GetTempFile->UniqueID == 0)
{
Num++;
Modified: trunk/reactos/dll/win32/kernel32/client/proc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Fri Jul 10 23:57:26 2015
@@ -499,7 +499,6 @@
BasepNotifyCsrOfThread(IN HANDLE ThreadHandle,
IN PCLIENT_ID ClientId)
{
- NTSTATUS Status;
BASE_API_MESSAGE ApiMessage;
PBASE_CREATE_THREAD CreateThreadRequest = &ApiMessage.Data.CreateThreadRequest;
@@ -511,14 +510,14 @@
CreateThreadRequest->ThreadHandle = ThreadHandle;
/* Call CSR */
- Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
- NULL,
- CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepCreateThread),
- sizeof(BASE_CREATE_THREAD));
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("Failed to tell CSRSS about new thread: %lx\n", Status);
- return Status;
+ CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
+ NULL,
+ CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepCreateThread),
+ sizeof(*CreateThreadRequest));
+ if (!NT_SUCCESS(ApiMessage.Status))
+ {
+ DPRINT1("Failed to tell CSRSS about new thread: %lx\n",
ApiMessage.Status);
+ return ApiMessage.Status;
}
/* Return Success */
@@ -966,19 +965,18 @@
GetProcessShutdownParameters(OUT LPDWORD lpdwLevel,
OUT LPDWORD lpdwFlags)
{
- NTSTATUS Status;
BASE_API_MESSAGE ApiMessage;
PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest =
&ApiMessage.Data.ShutdownParametersRequest;
/* Ask CSRSS for shutdown information */
- Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
- NULL,
- CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepGetProcessShutdownParam),
- sizeof(BASE_GETSET_PROCESS_SHUTDOWN_PARAMS));
- if (!NT_SUCCESS(Status))
+ CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
+ NULL,
+ CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepGetProcessShutdownParam),
+ sizeof(*ShutdownParametersRequest));
+ if (!NT_SUCCESS(ApiMessage.Status))
{
/* Return the failure from CSRSS */
- BaseSetLastNTError(Status);
+ BaseSetLastNTError(ApiMessage.Status);
return FALSE;
}
@@ -996,21 +994,20 @@
SetProcessShutdownParameters(IN DWORD dwLevel,
IN DWORD dwFlags)
{
- NTSTATUS Status;
BASE_API_MESSAGE ApiMessage;
PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest =
&ApiMessage.Data.ShutdownParametersRequest;
/* Write the data into the CSRSS request and send it */
ShutdownParametersRequest->ShutdownLevel = dwLevel;
ShutdownParametersRequest->ShutdownFlags = dwFlags;
- Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
- NULL,
- CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepSetProcessShutdownParam),
- sizeof(BASE_GETSET_PROCESS_SHUTDOWN_PARAMS));
- if (!NT_SUCCESS(Status))
+ CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
+ NULL,
+ CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepSetProcessShutdownParam),
+ sizeof(*ShutdownParametersRequest));
+ if (!NT_SUCCESS(ApiMessage.Status))
{
/* Return the failure from CSRSS */
- BaseSetLastNTError(Status);
+ BaseSetLastNTError(ApiMessage.Status);
return FALSE;
}
@@ -1555,7 +1552,7 @@
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
NULL,
CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX,
BasepExitProcess),
- sizeof(BASE_EXIT_PROCESS));
+ sizeof(*ExitProcessRequest));
/* Now do it again */
NtTerminateProcess(NtCurrentProcess(), uExitCode);