From 80ecdce6cc780e62cb71a2e8faea2e8ed5871c86 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 16 Dec 2011 20:12:28 +0000 Subject: [PATCH] [RTL] - Revert r54660 and properly fix NtAllocateVirtualMemory/NtFreeVirtualMemory usage svn path=/trunk/; revision=54666 --- reactos/lib/rtl/dbgbuffer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reactos/lib/rtl/dbgbuffer.c b/reactos/lib/rtl/dbgbuffer.c index 9bb55a3a020..cf716838e8b 100644 --- a/reactos/lib/rtl/dbgbuffer.c +++ b/reactos/lib/rtl/dbgbuffer.c @@ -29,7 +29,7 @@ RtlCreateQueryDebugBuffer(IN ULONG Size, (PVOID*)&Buf, 0, &ViewSize, - MEM_COMMIT, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); if (!NT_SUCCESS(Status)) return NULL; @@ -49,12 +49,13 @@ NTAPI RtlDestroyQueryDebugBuffer(IN PRTL_DEBUG_INFORMATION Buf) { NTSTATUS Status = STATUS_SUCCESS; + SIZE_T ViewSize = 0; if (NULL != Buf) { Status = NtFreeVirtualMemory(NtCurrentProcess(), - (PVOID)Buf, - (PSIZE_T)&Buf->ViewSize, /* FIXME: not portable! */ + (PVOID*)&Buf, + &ViewSize, MEM_RELEASE); } if (!NT_SUCCESS(Status))