From 57da8d9f18410a10ad232adb81aa609343ffb67c Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Thu, 12 Jun 2008 09:40:33 +0000 Subject: [PATCH] - Formatting cleanup for the previously patched functions. svn path=/trunk/; revision=33946 --- reactos/lib/rtl/heap.c | 44 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/reactos/lib/rtl/heap.c b/reactos/lib/rtl/heap.c index b16167b828a..2e9e832e5d5 100644 --- a/reactos/lib/rtl/heap.c +++ b/reactos/lib/rtl/heap.c @@ -596,14 +596,12 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags, int i; NTSTATUS Status; -#if 1 - if (address==NULL && ZwAllocateVirtualMemory( NtCurrentProcess(), &address, 0, + if (!address && ZwAllocateVirtualMemory( NtCurrentProcess(), &address, 0, &commitSize, MEM_COMMIT, PAGE_READWRITE )) { WARN("Could not commit %08lx bytes for sub-heap %p\n", commitSize, address ); return FALSE; } -#endif /* Fill the sub-heap structure */ @@ -1596,26 +1594,21 @@ NTSTATUS NTAPI RtlEnumProcessHeaps(PHEAP_ENUMERATION_ROUTINE HeapEnumerationRoutine, PVOID lParam) { + NTSTATUS Status = STATUS_SUCCESS; -#if 1 - NTSTATUS Status = STATUS_SUCCESS; + struct list *ptr=NULL; + RtlEnterHeapLock(&processHeap->critSection); + Status=HeapEnumerationRoutine(processHeap,lParam); - struct list *ptr=NULL; - RtlEnterHeapLock(&processHeap->critSection); - Status=HeapEnumerationRoutine(processHeap,lParam); - LIST_FOR_EACH( ptr, &processHeap->entry ) - { - if (!NT_SUCCESS(Status)) - break; - Status = HeapEnumerationRoutine(ptr,lParam); + LIST_FOR_EACH( ptr, &processHeap->entry ) + { + if (!NT_SUCCESS(Status)) break; + Status = HeapEnumerationRoutine(ptr,lParam); + } - } + RtlLeaveHeapLock(&processHeap->critSection); - - RtlLeaveHeapLock(&processHeap->critSection); - - return Status; -#endif + return Status; } @@ -1637,13 +1630,9 @@ RtlGetProcessHeaps(ULONG count, i++; LIST_FOR_EACH( ptr, &processHeap->entry ) { - if(i>=count) - { - break; - } + if (i >= count) break; i++; *(heaps++) = LIST_ENTRY( ptr, HEAP, entry ); - } } RtlLeaveHeapLock( &processHeap->critSection ); @@ -1657,12 +1646,9 @@ RtlGetProcessHeaps(ULONG count, BOOLEAN NTAPI RtlValidateProcessHeaps(VOID) { - -#if 1 BOOLEAN Result = TRUE; HEAP ** pptr; - RtlEnterHeapLock( &processHeap->critSection ); for (pptr = (HEAP**)&NtCurrentPeb()->ProcessHeaps; *pptr; pptr++) @@ -1674,10 +1660,8 @@ RtlValidateProcessHeaps(VOID) } } - - RtlLeaveHeapLock( &processHeap->critSection ); + RtlLeaveHeapLock( &processHeap->critSection ); return Result; -#endif }