Author: cgutman
Date: Fri Dec 16 20:12:28 2011
New Revision: 54666
URL:
http://svn.reactos.org/svn/reactos?rev=54666&view=rev
Log:
[RTL]
- Revert r54660 and properly fix NtAllocateVirtualMemory/NtFreeVirtualMemory usage
Modified:
trunk/reactos/lib/rtl/dbgbuffer.c
Modified: trunk/reactos/lib/rtl/dbgbuffer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/dbgbuffer.c?rev=54…
==============================================================================
--- trunk/reactos/lib/rtl/dbgbuffer.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/dbgbuffer.c [iso-8859-1] Fri Dec 16 20:12:28 2011
@@ -29,7 +29,7 @@
(PVOID*)&Buf,
0,
&ViewSize,
- MEM_COMMIT,
+ MEM_RESERVE | MEM_COMMIT,
PAGE_READWRITE);
if (!NT_SUCCESS(Status)) return NULL;
@@ -49,12 +49,13 @@
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))