Author: ekohl Date: Sat Jan 9 22:57:00 2010 New Revision: 45019
URL: http://svn.reactos.org/svn/reactos?rev=45019&view=rev Log: Reverted some coding-style changes as per Alekseys request.
Modified: trunk/reactos/dll/win32/kernel32/process/proc.c trunk/reactos/dll/win32/kernel32/process/procsup.c trunk/reactos/dll/win32/kernel32/synch/critical.c trunk/reactos/dll/win32/kernel32/synch/mutex.c trunk/reactos/dll/win32/kernel32/synch/sem.c trunk/reactos/dll/win32/kernel32/synch/timer.c trunk/reactos/dll/win32/kernel32/thread/fiber.c trunk/reactos/dll/win32/kernel32/thread/fls.c
Modified: trunk/reactos/dll/win32/kernel32/process/proc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process/... ============================================================================== --- trunk/reactos/dll/win32/kernel32/process/proc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/process/proc.c [iso-8859-1] Sat Jan 9 22:57:00 2010 @@ -848,16 +848,16 @@ &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 @@ 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 @@ 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 @@ } _SEH2_FINALLY { - if (ProcessHandle) - CloseHandle(ProcessHandle); + if (ProcessHandle) CloseHandle(ProcessHandle); } _SEH2_END;
@@ -1075,11 +1068,9 @@ &Needed); Result = DynamicBuffer; } - else - Result = (PUNICODE_STRING)Buffer; - - if (!NT_SUCCESS(Status)) - goto Cleanup; + else Result = (PUNICODE_STRING)Buffer; + + if (!NT_SUCCESS(Status)) goto Cleanup;
if (Result->Length / sizeof(WCHAR) + 1 > *pdwSize) {
Modified: trunk/reactos/dll/win32/kernel32/process/procsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process/... ============================================================================== --- trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] Sat Jan 9 22:57:00 2010 @@ -294,8 +294,7 @@ "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 @@ 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 @@ 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 @@
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;
Modified: trunk/reactos/dll/win32/kernel32/synch/critical.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/cr... ============================================================================== --- trunk/reactos/dll/win32/kernel32/synch/critical.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/synch/critical.c [iso-8859-1] Sat Jan 9 22:57:00 2010 @@ -26,9 +26,8 @@
/* 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); }
/*
Modified: trunk/reactos/dll/win32/kernel32/synch/mutex.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/mu... ============================================================================== --- trunk/reactos/dll/win32/kernel32/synch/mutex.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/synch/mutex.c [iso-8859-1] Sat Jan 9 22:57:00 2010 @@ -75,8 +75,7 @@ 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 @@
/* 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);
Modified: trunk/reactos/dll/win32/kernel32/synch/sem.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/se... ============================================================================== --- trunk/reactos/dll/win32/kernel32/synch/sem.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/synch/sem.c [iso-8859-1] Sat Jan 9 22:57:00 2010 @@ -80,8 +80,7 @@ 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 @@
/* 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);
Modified: trunk/reactos/dll/win32/kernel32/synch/timer.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/ti... ============================================================================== --- trunk/reactos/dll/win32/kernel32/synch/timer.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/synch/timer.c [iso-8859-1] Sat Jan 9 22:57:00 2010 @@ -75,8 +75,7 @@ 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 @@ (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 @@
/* 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);
Modified: trunk/reactos/dll/win32/kernel32/thread/fiber.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/thread/f... ============================================================================== --- trunk/reactos/dll/win32/kernel32/thread/fiber.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/thread/fiber.c [iso-8859-1] Sat Jan 9 22:57:00 2010 @@ -69,8 +69,7 @@ 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 @@ 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(),
Modified: trunk/reactos/dll/win32/kernel32/thread/fls.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/thread/f... ============================================================================== --- trunk/reactos/dll/win32/kernel32/thread/fls.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/thread/fls.c [iso-8859-1] Sat Jan 9 22:57:00 2010 @@ -55,13 +55,11 @@ 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 @@ PVOID *ppFlsSlots; TEB *pTeb = NtCurrentTeb();
- if (dwFlsIndex >= 128) - goto l_InvalidParam; + if(dwFlsIndex >= 128) goto l_InvalidParam;
ppFlsSlots = pTeb->FlsData;
@@ -96,8 +93,7 @@ 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;