[KERNEL32]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 10 Jul 2015 23:57:26 +0000 (23:57 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 10 Jul 2015 23:57:26 +0000 (23:57 +0000)
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).

svn path=/trunk/; revision=68384

reactos/dll/win32/kernel32/client/console/vista.c
reactos/dll/win32/kernel32/client/dosdev.c
reactos/dll/win32/kernel32/client/file/deviceio.c
reactos/dll/win32/kernel32/client/file/filename.c
reactos/dll/win32/kernel32/client/proc.c

index ed18684..f2bc55d 100644 (file)
@@ -26,7 +26,6 @@ WINAPI
 DECLSPEC_HOTPATCH
 GetConsoleHistoryInfo(PCONSOLE_HISTORY_INFO lpConsoleHistoryInfo)
 {
-    NTSTATUS Status;
     CONSOLE_API_MESSAGE ApiMessage;
     PCONSOLE_GETSETHISTORYINFO HistoryInfoRequest = &ApiMessage.Data.HistoryInfoRequest;
 
@@ -36,13 +35,13 @@ GetConsoleHistoryInfo(PCONSOLE_HISTORY_INFO lpConsoleHistoryInfo)
         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 @@ WINAPI
 DECLSPEC_HOTPATCH
 SetConsoleHistoryInfo(IN PCONSOLE_HISTORY_INFO lpConsoleHistoryInfo)
 {
-    NTSTATUS Status;
     CONSOLE_API_MESSAGE ApiMessage;
     PCONSOLE_GETSETHISTORYINFO HistoryInfoRequest = &ApiMessage.Data.HistoryInfoRequest;
 
@@ -76,13 +74,13 @@ SetConsoleHistoryInfo(IN PCONSOLE_HISTORY_INFO lpConsoleHistoryInfo)
     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;
     }
 
index 38e0e3e..72e280e 100644 (file)
@@ -85,7 +85,6 @@ DefineDosDeviceW(
     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 @@ DefineDosDeviceW(
         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))
+        if (!NT_SUCCESS(ApiMessage.Status))
         {
-            WARN("CsrClientCallServer() failed (Status %lx)\n", Status);
-            BaseSetLastNTError(Status);
+            WARN("CsrClientCallServer() failed (Status %lx)\n", ApiMessage.Status);
+            BaseSetLastNTError(ApiMessage.Status);
             Result = FALSE;
         }
         else
index 892ac80..76ba3a5 100644 (file)
@@ -36,7 +36,7 @@ NotifySoundSentry(VOID)
         CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
                             NULL,
                             CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepSoundSentryNotification),
-                            sizeof(BASE_SOUND_SENTRY));
+                            sizeof(*SoundSentryRequest));
     }
 }
 
index cf13a5c..a13f453 100644 (file)
@@ -161,7 +161,7 @@ GetTempFileNameW(IN LPCWSTR lpPathName,
             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++;
index ebf1b34..809457c 100644 (file)
@@ -499,7 +499,6 @@ WINAPI
 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 @@ BasepNotifyCsrOfThread(IN HANDLE ThreadHandle,
     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))
+    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", Status);
-        return Status;
+        DPRINT1("Failed to tell CSRSS about new thread: %lx\n", ApiMessage.Status);
+        return ApiMessage.Status;
     }
 
     /* Return Success */
@@ -966,19 +965,18 @@ WINAPI
 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 @@ WINAPI
 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 @@ ExitProcess(IN UINT uExitCode)
         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);