Reverted some coding-style changes as per Alekseys request.
authorEric Kohl <eric.kohl@reactos.org>
Sat, 9 Jan 2010 21:57:00 +0000 (21:57 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 9 Jan 2010 21:57:00 +0000 (21:57 +0000)
svn path=/trunk/; revision=45019

reactos/dll/win32/kernel32/process/proc.c
reactos/dll/win32/kernel32/process/procsup.c
reactos/dll/win32/kernel32/synch/critical.c
reactos/dll/win32/kernel32/synch/mutex.c
reactos/dll/win32/kernel32/synch/sem.c
reactos/dll/win32/kernel32/synch/timer.c
reactos/dll/win32/kernel32/thread/fiber.c
reactos/dll/win32/kernel32/thread/fls.c

index d6055a6..6affdf8 100644 (file)
@@ -848,16 +848,16 @@ GetProcessVersion(DWORD ProcessId)
                                                &ProcessBasicInfo,
                                                sizeof(ProcessBasicInfo),
                                                NULL);
-            if (!NT_SUCCESS(Status))
-                goto Error;
+
+            if (!NT_SUCCESS(Status)) goto Error;
 
             Status = NtReadVirtualMemory(ProcessHandle,
                                          ProcessBasicInfo.PebBaseAddress,
                                          &Peb,
                                          sizeof(Peb),
                                          &Count);
-            if (!NT_SUCCESS(Status) || Count != sizeof(Peb))
-                goto Error;
+
+            if (!NT_SUCCESS(Status) || Count != sizeof(Peb)) goto Error;
 
             memset(&DosHeader, 0, sizeof(DosHeader));
             Status = NtReadVirtualMemory(ProcessHandle,
@@ -866,11 +866,8 @@ GetProcessVersion(DWORD ProcessId)
                                          sizeof(DosHeader),
                                          &Count);
 
-            if (!NT_SUCCESS(Status) || Count != sizeof(DosHeader))
-                goto Error;
-
-            if (DosHeader.e_magic != IMAGE_DOS_SIGNATURE)
-                goto Error;
+            if (!NT_SUCCESS(Status) || Count != sizeof(DosHeader)) goto Error;
+            if (DosHeader.e_magic != IMAGE_DOS_SIGNATURE) goto Error;
 
             memset(&NtHeaders, 0, sizeof(NtHeaders));
             Status = NtReadVirtualMemory(ProcessHandle,
@@ -879,11 +876,8 @@ GetProcessVersion(DWORD ProcessId)
                                          sizeof(NtHeaders),
                                          &Count);
 
-            if (!NT_SUCCESS(Status) || Count != sizeof(NtHeaders))
-                goto Error;
-
-            if (NtHeaders.Signature != IMAGE_NT_SIGNATURE)
-                goto Error;
+            if (!NT_SUCCESS(Status) || Count != sizeof(NtHeaders)) goto Error;
+            if (NtHeaders.Signature != IMAGE_NT_SIGNATURE) goto Error;
 
             Version = MAKELONG(NtHeaders.OptionalHeader.MinorSubsystemVersion,
                                NtHeaders.OptionalHeader.MajorSubsystemVersion);
@@ -897,8 +891,7 @@ Error:
     }
     _SEH2_FINALLY
     {
-        if (ProcessHandle)
-            CloseHandle(ProcessHandle);
+        if (ProcessHandle) CloseHandle(ProcessHandle);
     }
     _SEH2_END;
 
@@ -1075,11 +1068,9 @@ QueryFullProcessImageNameW(HANDLE hProcess,
                                            &Needed);
         Result = DynamicBuffer;
     }
-    else
-        Result = (PUNICODE_STRING)Buffer;
+    else Result = (PUNICODE_STRING)Buffer;
 
-    if (!NT_SUCCESS(Status))
-        goto Cleanup;
+    if (!NT_SUCCESS(Status)) goto Cleanup;
 
     if (Result->Length / sizeof(WCHAR) + 1 > *pdwSize)
     {
index 137b4a9..06b0747 100644 (file)
@@ -294,8 +294,7 @@ BasepDuplicateAndWriteHandle(IN HANDLE ProcessHandle,
            "Address: %p\n", ProcessHandle, StandardHandle, Address);
 
     /* Don't touch Console Handles */
-    if (IsConsoleHandle(StandardHandle))
-        return;
+    if (IsConsoleHandle(StandardHandle)) return;
 
     /* Duplicate the handle */
     Status = NtDuplicateObject(NtCurrentProcess(),
@@ -1018,8 +1017,7 @@ GetAppName:
             CmdLineLength = wcslen(CMD_STRING) + wcslen(lpCommandLine) + 1;
 
             /* If we found quotes, then add them into the length size */
-            if (CmdLineIsAppName || FoundQuotes)
-                CmdLineLength += 2;
+            if (CmdLineIsAppName || FoundQuotes) CmdLineLength += 2;
             CmdLineLength *= sizeof(WCHAR);
 
             /* Allocate space for the new command line */
@@ -1313,8 +1311,7 @@ GetAppName:
     if(lpEnvironment && !(dwCreationFlags & CREATE_UNICODE_ENVIRONMENT))
     {
         lpEnvironment = BasepConvertUnicodeEnvironment(&EnvSize, lpEnvironment);
-        if (!lpEnvironment)
-            goto Cleanup;
+        if (!lpEnvironment) goto Cleanup;
     }
 
     /* Create Process Environment */
@@ -1422,31 +1419,21 @@ GetAppName:
 
 Cleanup:
     /* De-allocate heap strings */
-    if (NameBuffer)
-        RtlFreeHeap(RtlGetProcessHeap(), 0, NameBuffer);
-
+    if (NameBuffer) RtlFreeHeap(RtlGetProcessHeap(), 0, NameBuffer);
     if (ApplicationName.Buffer)
         RtlFreeHeap(RtlGetProcessHeap(), 0, ApplicationName.Buffer);
-
-    if (CurrentDirectory)
-        RtlFreeHeap(RtlGetProcessHeap(), 0, CurrentDirectory);
-
-    if (QuotedCmdLine)
-        RtlFreeHeap(RtlGetProcessHeap(), 0, QuotedCmdLine);
+    if (CurrentDirectory) RtlFreeHeap(RtlGetProcessHeap(), 0, CurrentDirectory);
+    if (QuotedCmdLine) RtlFreeHeap(RtlGetProcessHeap(), 0, QuotedCmdLine);
 
     /* Kill any handles still alive */
-    if (hSection)
-        NtClose(hSection);
-
+    if (hSection) NtClose(hSection);
     if (hThread)
     {
         /* We don't know any more details then this */
         NtTerminateProcess(hProcess, STATUS_UNSUCCESSFUL);
         NtClose(hThread);
     }
-
-    if (hProcess)
-        NtClose(hProcess);
+    if (hProcess) NtClose(hProcess);
 
     /* Return Success */
     return Ret;
index 4335a3f..474a5d6 100644 (file)
@@ -26,9 +26,8 @@ InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
 
     /* Initialize the critical section and raise an exception if we failed */
     Status = RtlInitializeCriticalSection(
-       (PRTL_CRITICAL_SECTION)lpCriticalSection);
-    if (!NT_SUCCESS(Status))
-        RtlRaiseStatus(Status);
+        (PRTL_CRITICAL_SECTION)lpCriticalSection);
+    if (!NT_SUCCESS(Status)) RtlRaiseStatus(Status);
 }
 
 /*
index 2708fe5..69dca56 100644 (file)
@@ -75,8 +75,7 @@ CreateMutexExW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes  OPTIONAL,
     BOOLEAN InitialOwner;
 
     /* Now check if we got a name */
-    if (lpName)
-        RtlInitUnicodeString(&ObjectName, lpName);
+    if (lpName) RtlInitUnicodeString(&ObjectName, lpName);
 
     if (dwFlags & ~(CREATE_MUTEX_INITIAL_OWNER))
     {
@@ -258,8 +257,7 @@ ReleaseMutex(IN HANDLE hMutex)
 
     /* Release the mutant */
     Status = NtReleaseMutant(hMutex, NULL);
-    if (NT_SUCCESS(Status))
-        return TRUE;
+    if (NT_SUCCESS(Status)) return TRUE;
 
     /* If we got here, then we failed */
     SetLastErrorByStatus(Status);
index f1ceb53..6b85931 100644 (file)
@@ -80,8 +80,7 @@ CreateSemaphoreExW(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes  OPTIONAL,
     UNICODE_STRING ObjectName;
 
     /* Now check if we got a name */
-    if (lpName)
-        RtlInitUnicodeString(&ObjectName, lpName);
+    if (lpName) RtlInitUnicodeString(&ObjectName, lpName);
 
     if (dwFlags != 0)
     {
@@ -261,8 +260,7 @@ ReleaseSemaphore(IN HANDLE hSemaphore,
 
     /* Release the semaphore */
     Status = NtReleaseSemaphore(hSemaphore, lReleaseCount, lpPreviousCount);
-    if (NT_SUCCESS(Status))
-        return TRUE;
+    if (NT_SUCCESS(Status)) return TRUE;
 
     /* If we got here, then we failed */
     SetLastErrorByStatus(Status);
index bf99ded..fd21a1b 100644 (file)
@@ -75,8 +75,7 @@ CreateWaitableTimerExW(IN LPSECURITY_ATTRIBUTES lpTimerAttributes  OPTIONAL,
     TIMER_TYPE TimerType;
 
     /* Now check if we got a name */
-    if (lpTimerName)
-        RtlInitUnicodeString(&ObjectName, lpTimerName);
+    if (lpTimerName) RtlInitUnicodeString(&ObjectName, lpTimerName);
 
     if (dwFlags & ~(CREATE_WAITABLE_TIMER_MANUAL_RESET))
     {
@@ -269,8 +268,7 @@ SetWaitableTimer(IN HANDLE hTimer,
                         (BOOLEAN)fResume,
                         lPeriod,
                         NULL);
-    if (NT_SUCCESS(Status))
-        return TRUE;
+    if (NT_SUCCESS(Status)) return TRUE;
 
     /* If we got here, then we failed */
     SetLastErrorByStatus(Status);
@@ -288,8 +286,7 @@ CancelWaitableTimer(IN HANDLE hTimer)
 
     /* Cancel the timer */
     Status = NtCancelTimer(hTimer, NULL);
-    if (NT_SUCCESS(Status))
-        return TRUE;
+    if (NT_SUCCESS(Status)) return TRUE;
 
     /* If we got here, then we failed */
     SetLastErrorByStatus(Status);
index 6be7ad4..58aa6e9 100644 (file)
@@ -69,8 +69,7 @@ ConvertThreadToFiberEx(LPVOID lpParameter,
     DPRINT1("Converting Thread to Fiber\n");
 
     /* the current thread is already a fiber */
-    if (pTeb->HasFiberData && pTeb->Tib.FiberData)
-        return pTeb->Tib.FiberData;
+    if(pTeb->HasFiberData && pTeb->Tib.FiberData) return pTeb->Tib.FiberData;
 
     /* allocate the fiber */
     pfCurFiber = (PFIBER)RtlAllocateHeap(GetProcessHeap(), 
@@ -228,8 +227,7 @@ DeleteFiber(LPVOID lpFiber)
     RtlFreeHeap(GetProcessHeap(), 0, lpFiber);
 
     /* the fiber is deleting itself: let the system deallocate the stack */
-    if (NtCurrentTeb()->Tib.FiberData == lpFiber)
-        ExitThread(1);
+    if(NtCurrentTeb()->Tib.FiberData == lpFiber) ExitThread(1);
 
     /* deallocate the stack */
     NtFreeVirtualMemory(NtCurrentProcess(),
index f538e84..d5e4e61 100644 (file)
@@ -55,13 +55,11 @@ FlsGetValue(DWORD dwFlsIndex)
     PVOID *ppFlsSlots;
     PVOID pRetVal;
 
-    if (dwFlsIndex >= 128)
-        goto l_InvalidParam;
+    if(dwFlsIndex >= 128) goto l_InvalidParam;
 
     ppFlsSlots = NtCurrentTeb()->FlsData;
 
-    if (ppFlsSlots == NULL)
-        goto l_InvalidParam;
+    if(ppFlsSlots == NULL) goto l_InvalidParam;
 
     SetLastError(0);
     pRetVal = ppFlsSlots[dwFlsIndex + 2];
@@ -84,8 +82,7 @@ FlsSetValue(DWORD dwFlsIndex, PVOID lpFlsData)
     PVOID *ppFlsSlots;
     TEB *pTeb = NtCurrentTeb();
 
-    if (dwFlsIndex >= 128)
-        goto l_InvalidParam;
+    if(dwFlsIndex >= 128) goto l_InvalidParam;
 
     ppFlsSlots = pTeb->FlsData;
 
@@ -96,8 +93,7 @@ FlsSetValue(DWORD dwFlsIndex, PVOID lpFlsData)
         ppFlsSlots = RtlAllocateHeap(pPeb->ProcessHeap,
                                      HEAP_ZERO_MEMORY,
                                      (128 + 2) * sizeof(PVOID));
-        if (ppFlsSlots == NULL)
-            goto l_OutOfMemory;
+        if(ppFlsSlots == NULL) goto l_OutOfMemory;
 
         pTeb->FlsData = ppFlsSlots;