Author: arty
Date: Mon Jul 11 21:46:54 2011
New Revision: 52644
URL:
http://svn.reactos.org/svn/reactos?rev=52644&view=rev
Log:
[CMAKE] Revert this for now.
Modified:
trunk/reactos/ntoskrnl/kdbg/kdb_symbols.cmake.c
Modified: trunk/reactos/ntoskrnl/kdbg/kdb_symbols.cmake.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb_symbols.…
==============================================================================
--- trunk/reactos/ntoskrnl/kdbg/kdb_symbols.cmake.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/kdbg/kdb_symbols.cmake.c [iso-8859-1] Mon Jul 11 21:46:54 2011
@@ -17,8 +17,6 @@
#include <debug.h>
/* GLOBALS ******************************************************************/
-
-#define CURRENT_PROCESS ((HANDLE)~0)
typedef struct _IMAGE_SYMBOL_INFO_CACHE
{
@@ -637,69 +635,14 @@
/* Nothing here */
}
-typedef struct {
- PMDL Mdl;
- SIZE_T Size;
- PVOID OriginalMapping;
-} KdbpMallocHeader;
-
-static PVOID KdbpSymAllocMem(ULONG_PTR Size)
-{
- KdbpMallocHeader *Hdr;
- if (Size < PAGE_SIZE)
- {
- PVOID Result = ExAllocatePoolWithTag(NonPagedPool, Size +
sizeof(KdbpMallocHeader), 'RSYM');
- if (!Result) return NULL;
- Hdr = (KdbpMallocHeader*)Result;
- Hdr->Mdl = NULL;
- Hdr->Size = Size;
- return &Hdr[1];
- }
- else
- {
- PVOID Base = NULL;
- SIZE_T RegionSize = Size + sizeof(KdbpMallocHeader);
- NTSTATUS Status = NtAllocateVirtualMemory
- (CURRENT_PROCESS, &Base, 0, &RegionSize, MEM_COMMIT,
PAGE_READWRITE);
- if (!NT_SUCCESS(Status)) return NULL;
- Hdr = (KdbpMallocHeader*)Base;
- Hdr->Mdl = IoAllocateMdl(Base, RegionSize, FALSE, FALSE, NULL);
- if (!Hdr->Mdl) {
- NtFreeVirtualMemory(CURRENT_PROCESS, &Base, &RegionSize,
MEM_RELEASE);
- return NULL;
- }
- Hdr->Size = RegionSize;
- Hdr->OriginalMapping = Base;
- MmProbeAndLockPages(Hdr->Mdl, KernelMode, IoModifyAccess);
- KdbpMallocHeader *MappedHdr = (KdbpMallocHeader*)MmMapLockedPages(Hdr->Mdl,
KernelMode);
- if (!MappedHdr) {
- MmUnlockPages(Hdr->Mdl);
- IoFreeMdl(Hdr->Mdl);
- NtFreeVirtualMemory(CURRENT_PROCESS, &Base, &RegionSize,
MEM_RELEASE);
- return NULL;
- }
- return &MappedHdr[1];
- }
+static PVOID KdbpSymAllocMem(ULONG_PTR size)
+{
+ return ExAllocatePoolWithTag(NonPagedPool, size, 'RSYM');
}
static VOID KdbpSymFreeMem(PVOID Area)
{
- PCHAR HdrPtr = ((PCHAR)Area) - sizeof(KdbpMallocHeader);
- KdbpMallocHeader *Hdr = (KdbpMallocHeader*)HdrPtr;
- if (Hdr->Size < PAGE_SIZE)
- {
- ExFreePool(Hdr);
- }
- else
- {
- PMDL Mdl = Hdr->Mdl;
- PVOID BaseAddress = Hdr->OriginalMapping;
- SIZE_T RegionSize = Hdr->Size;
- MmUnmapLockedPages(Hdr, Mdl);
- MmUnlockPages(Mdl);
- NtFreeVirtualMemory(CURRENT_PROCESS, &BaseAddress, &RegionSize,
MEM_RELEASE);
- IoFreeMdl(Mdl);
- }
+ return ExFreePool(Area);
}
static BOOLEAN KdbpSymReadMem(PVOID FileContext, PVOID TargetDebug, PVOID SourceMem,
ULONG Size)