From a9c70ab4663f7be67ff4e473b6ad648e877a664e Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Fri, 24 Jun 2022 18:28:02 +0500 Subject: [PATCH] Driver: fortutl: Use fort_mem_alloc() with tag Remove fort_mem_alloc_notag(). --- src/driver/fortdrv.h | 5 ++--- src/driver/fortutl.c | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/driver/fortdrv.h b/src/driver/fortdrv.h index 7bc39eb5..ef6d7a78 100644 --- a/src/driver/fortdrv.h +++ b/src/driver/fortdrv.h @@ -25,10 +25,9 @@ # define fort_mem_exec_alloc(size, tag) \ ExAllocatePool2(POOL_FLAG_UNINITIALIZED | POOL_FLAG_NON_PAGED_EXECUTE, (size), (tag)) #endif -#define fort_mem_free(p, tag) ExFreePoolWithTag((p), (tag)) -#define fort_mem_alloc_notag(size) ExAllocatePool(NonPagedPoolNx, (size)) -#define fort_mem_free_notag(p) ExFreePool((p)) +#define fort_mem_free(p, tag) ExFreePoolWithTag((p), (tag)) +#define fort_mem_free_notag(p) ExFreePool((p)) #define fort_request_complete_info(irp, status, info) \ do { \ diff --git a/src/driver/fortutl.c b/src/driver/fortutl.c index 275c84df..5d4e2ffd 100644 --- a/src/driver/fortutl.c +++ b/src/driver/fortutl.c @@ -2,6 +2,8 @@ #include "fortutl.h" +#define FORT_UTL_POOL_TAG 'UwfF' + #define FORT_MAX_FILE_SIZE (4 * 1024 * 1024) #define FORT_KEY_INFO_PATH_SIZE \ @@ -15,7 +17,7 @@ static UNICODE_STRING g_systemDrivePath; static NTSTATUS fort_string_new(ULONG len, PCWSTR src, PUNICODE_STRING outData) { - PWSTR buf = fort_mem_alloc_notag(len); + PWSTR buf = fort_mem_alloc(len, FORT_UTL_POOL_TAG); if (buf == NULL) return STATUS_INSUFFICIENT_RESOURCES;