16#define MODULE_INVOLVED_IN_ARM3
32#define POOL_BIG_TABLE_ENTRY_FREE 0x1
35#define POOL_ENTRY(x) (PPOOL_HEADER)((ULONG_PTR)(x) - sizeof(POOL_HEADER))
36#define POOL_FREE_BLOCK(x) (PLIST_ENTRY)((ULONG_PTR)(x) + sizeof(POOL_HEADER))
37#define POOL_BLOCK(x, i) (PPOOL_HEADER)((ULONG_PTR)(x) + ((i) * POOL_BLOCK_SIZE))
38#define POOL_NEXT_BLOCK(x) POOL_BLOCK((x), (x)->BlockSize)
39#define POOL_PREV_BLOCK(x) POOL_BLOCK((x), -((x)->PreviousSize))
45#if DBG && defined(KDBG)
65 KdbpPrint(
"Invalid parameter: %s\n", Argv[1]);
75 KdbpPrint(
"Invalid parameter: %s\n", Argv[2]);
101 KdbpPrint(
"Allocation is from PagedPool region\n");
103 KdbpPrint(
"Allocation is from NonPagedPool region\n");
118 if (!(
Flags & 1) || ThisOne)
121 KdbpPrint(
"%c%p size: %4d previous size: %4d %s %.4s\n",
123 (
Flags & 0x80000000) ?
"" : (
Entry->PoolType ?
"(Allocated)" :
"(Free) "),
130 KdbpPrint(
" %p %08lx %08lx %08lx %08lx\n"
131 " %p %08lx %08lx %08lx %08lx\n",
165 *
Mask |= (0xFF <<
i * 8);
187 ExpKdbgExtPoolUsedGetTag(Argv[2], &
Tag, &
Mask);
190 KdbpPrint(
"Invalid parameter: %s\n", Argv[1]);
196 if (
strlen(Argv[1]) == 1 ||
197 (
strlen(Argv[1]) == 3 && Argv[1][0] ==
'0' && (Argv[1][1] ==
'x' || Argv[1][1] ==
'X')))
202 ExpKdbgExtPoolUsedGetTag(Argv[1], &
Tag, &
Mask);
208 ExpKdbgExtPoolUsedGetTag(Argv[1], &
Tag, &
Mask);
221ExpKdbgExtPoolFindLargePool(
241 if (FoundCallback !=
NULL)
258ExpKdbgExtValidatePoolHeader(
264 if (
Entry->BlockSize <= 0)
278 if (
Entry->PreviousSize == 0 && BaseVa !=
Entry)
294 if ((
Entry->PoolTag & 0x00808080) != 0)
304ExpKdbgExtPoolFindPagedPool(
322 while (
i != 0xFFFFFFFF)
355 if (FoundCallback !=
NULL)
362 KdbpPrint(
"%p size: %4d previous size: %4d %s %.4s\n",
364 Entry->PoolType ?
"(Allocated)" :
"(Free) ",
377ExpKdbgExtPoolFindNonPagedPool(
419 if (FoundCallback !=
NULL)
426 KdbpPrint(
"%p size: %4d previous size: %4d %s %.4s\n",
428 Entry->PoolType ?
"(Allocated)" :
"(Free) ",
452 if (
strlen(Argv[1]) != 1 || Argv[1][0] !=
'*')
454 ExpKdbgExtPoolUsedGetTag(Argv[1], &
Tag, &
Mask);
464 KdbpPrint(
"Only (non) paged pool are supported\n");
486ExpKdbgExtIrpFindPrint(
499 if (
Entry->PoolType == 0)
514 if (
Irp->CurrentLocation <=
Irp->StackCount + 1)
520 DriverName = &IoStack->
DeviceObject->DriverObject->DriverName;
528 if (SData == 0 || Criteria == 0 ||
530 (Criteria & 0x2 && SData == (
ULONG_PTR)
Irp->Tail.Overlay.OriginalFileObject) ||
531 (Criteria & 0x4 &&
Irp->MdlAddress && SData == (
ULONG_PTR)
Irp->MdlAddress->Process) ||
532 (Criteria & 0x8 && SData == (
ULONG_PTR)
Irp->Tail.Overlay.Thread) ||
533 (Criteria & 0x10 && SData == (
ULONG_PTR)
Irp->UserEvent))
541 KdbpPrint(
"%p Thread %p is complete (CurrentLocation %d > StackCount %d)\n",
Irp,
Irp->Tail.Overlay.Thread,
Irp->CurrentLocation,
Irp->StackCount + 1);
561 KdbpPrint(
"Only (non) paged pool are supported\n");
573 KdbpPrint(
"Invalid parameter: %s\n", Argv[2]);
586 if (
strcmp(Argv[3],
"device") == 0)
590 else if (
strcmp(Argv[3],
"fileobject") == 0)
594 else if (
strcmp(Argv[3],
"mdlprocess") == 0)
598 else if (
strcmp(Argv[3],
"thread") == 0)
602 else if (
strcmp(Argv[3],
"userevent") == 0)
606 else if (
strcmp(Argv[3],
"arg") == 0)
615 ExpKdbgExtPoolFindNonPagedPool(
TAG_IRP, 0xFFFFFFFF, ExpKdbgExtIrpFindPrint, &FindCtxt);
619 ExpKdbgExtPoolFindPagedPool(
TAG_IRP, 0xFFFFFFFF, ExpKdbgExtIrpFindPrint, &FindCtxt);
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define BASE_POOL_TYPE_MASK
int strcmp(const char *String1, const char *String2)
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
ACPI_SIZE strlen(const char *String)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID KdbpPrint(_In_ PSTR Format, _In_ ...)
Prints the given string with printf-like formatting.
BOOLEAN NTAPI KdbpGetHexNumber(IN PCHAR pszNum, OUT ULONG_PTR *pulValue)
BOOLEAN ExpKdbgExtPool(ULONG Argc, PCHAR Argv[])
BOOLEAN ExpKdbgExtPoolFind(ULONG Argc, PCHAR Argv[])
BOOLEAN ExpKdbgExtIrpFind(ULONG Argc, PCHAR Argv[])
BOOLEAN ExpKdbgExtPoolUsed(ULONG Argc, PCHAR Argv[])
MM_PAGED_POOL_INFO MmPagedPoolInfo
BOOLEAN NTAPI MmIsAddressValid(IN PVOID VirtualAddress)
#define MiAddressToPde(x)
PVOID MmNonPagedPoolExpansionStart
PVOID MmNonPagedPoolStart
#define POOL_FREE_BLOCK(x)
SIZE_T PoolBigPageTableSize
VOID MiDumpPoolConsumers(BOOLEAN CalledFromDbg, ULONG Tag, ULONG Mask, ULONG Flags)
PPOOL_TRACKER_BIG_PAGES PoolBigPageTable
struct _IRP_FIND_CTXT * PIRP_FIND_CTXT
#define POOL_BIG_TABLE_ENTRY_FREE
struct _IRP_FIND_CTXT IRP_FIND_CTXT
base of all file and directory entries
PDEVICE_OBJECT DeviceObject
PRTL_BITMAP PagedPoolAllocationMap
PMMPDE NextPdeForPagedPoolExpansion
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
_Must_inspect_result_ _In_ ULONG Flags