Skip to content

[Dev] Windows Kernel - ExAllocatePoolWithTag / ExFreePool #11

@nixawk

Description

@nixawk

bluescreen

NTSTATUS ntstatus;

UNICODE_STRING dst = {0};
UNICODE_STRING src = RTL_CONSTANT_STRING(L"Allocate Example");

dst.Buffer = (PWCHAR)ExAllocatePoolWithTag(NonPagedPool, src.Length, 'TEST');
if (dst.Buffer == NULL)
{
    DbgPrint(".....");
    ntstatus = STATUS_INSUFFICIENT_RESOURCES;
}
dst.Length = dst.MaximumLength = src.Length;
RtlCopyUnicodeString(&dst, &src);

ExFreePool(dst.Buffer);
dst.Buffer = NULL;
dst.Length = dst.MaximumLength = 0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions