From 69d7cb5681549a719bd27c7e2784f04c51056c80 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 18 Sep 2002 23:13:35 +0000 Subject: [PATCH] Avoid calling some kernel functions. --- dlls/ntdll/critsection.c | 2 +- dlls/ntdll/heap.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/critsection.c b/dlls/ntdll/critsection.c index 5835610c5c5..e291e597306 100644 --- a/dlls/ntdll/critsection.c +++ b/dlls/ntdll/critsection.c @@ -117,7 +117,7 @@ NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit ) if ( res == WAIT_TIMEOUT ) { const char *name = (char *)crit->DebugInfo; - if (!name || IsBadStringPtrA(name,80)) name = "?"; + if (!name) name = "?"; ERR( "section %p %s wait timed out, retrying (60 sec) tid=%08lx\n", crit, debugstr_a(name), GetCurrentThreadId() ); res = WaitForSingleObject( sem, 60000L ); diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 73675033854..e5aede0a45e 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -426,6 +426,7 @@ static void HEAP_MakeInUseBlockFree( SUBHEAP *subheap, ARENA_INUSE *pArena ) if (((char *)pFree == (char *)subheap + subheap->headerSize) && (subheap != &subheap->heap->subheap)) { + ULONG size = 0; SUBHEAP *pPrev = &subheap->heap->subheap; /* Remove the free block from the list */ pFree->next->prev = pFree->prev; @@ -435,7 +436,7 @@ static void HEAP_MakeInUseBlockFree( SUBHEAP *subheap, ARENA_INUSE *pArena ) if (pPrev) pPrev->next = subheap->next; /* Free the memory */ subheap->magic = 0; - VirtualFree( subheap, 0, MEM_RELEASE ); + NtFreeVirtualMemory( GetCurrentProcess(), (void **)&subheap, &size, MEM_RELEASE ); return; }