From be65c5c73c8b8bae8b7dafb8cc1585c7ee8df28e Mon Sep 17 00:00:00 2001 From: houha2 <38798233+houha2@users.noreply.github.com> Date: Fri, 22 Jan 2021 12:05:15 -0800 Subject: WFPSampler: Replaces ExAllocatePoolWithTag to ExAllocatePoolZero (#490) * replaces ExAllocatePoolWithTag to ExAllocatePoolZero * adds marco for downlevel support * removes unneeded change * changes comment to reflect new API usage * fixes alignment issues * changes spacing Co-authored-by: Elaine Houha --- .../WFPSampler/syslib/HelperFunctions_Macros.h | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/network/trans/WFPSampler/syslib/HelperFunctions_Macros.h b/network/trans/WFPSampler/syslib/HelperFunctions_Macros.h index 36c2ec00..8af997bb 100644 --- a/network/trans/WFPSampler/syslib/HelperFunctions_Macros.h +++ b/network/trans/WFPSampler/syslib/HelperFunctions_Macros.h @@ -155,7 +155,7 @@ extern "C" /** @macro="HLPR_DELETE" - Purpose: Free memory allocated with ExAllocatePoolWithTag and set the pointer to 0.
+ Purpose: Free memory allocated with ExAllocatePoolZero and set the pointer to 0.

Notes:

@@ -172,7 +172,7 @@ extern "C" /** @macro="HLPR_DELETE_ARRAY" - Purpose: Free memory allocated with ExAllocatePoolWithTag and set the pointer to 0.
+ Purpose: Free memory allocated with ExAllocatePoolZero and set the pointer to 0.

Notes:

@@ -184,7 +184,7 @@ extern "C" /** @macro="HLPR_NEW" - Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolWithTag and initialize it's + Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolZero and initialize it's contents with 0's.

Notes: Caller responsible for freeing allocated memory using macro HLPR_DELETE.
@@ -196,9 +196,9 @@ extern "C" pPtr == 0; \ ) \ { \ - pPtr = (object*)ExAllocatePoolWithTag(NonPagedPoolNx, \ - sizeof(object), \ - tag); \ + pPtr = (object*)ExAllocatePoolZero(NonPagedPoolNx, \ + sizeof(object), \ + tag); \ if(pPtr) \ RtlSecureZeroMemory(pPtr, \ sizeof(object)); \ @@ -207,7 +207,7 @@ extern "C" /** @macro="HLPR_NEW_ARRAY" - Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolWithTag and initialize it's + Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolZero and initialize it's contents with 0's.

Notes: Caller responsible for freeing allocated memory using macro HLPR_DELETE_ARRAY.
@@ -226,9 +226,9 @@ extern "C" &SAFE_SIZE) == STATUS_SUCCESS && \ SAFE_SIZE >= (sizeof(object) * count)) \ { \ - pPtr = (object*)ExAllocatePoolWithTag(NonPagedPoolNx, \ - SAFE_SIZE, \ - tag); \ + pPtr = (object*)ExAllocatePoolZero(NonPagedPoolNx, \ + SAFE_SIZE, \ + tag); \ if(pPtr) \ RtlZeroMemory(pPtr, \ SAFE_SIZE); \ @@ -243,7 +243,7 @@ extern "C" /** @macro="HLPR_NEW_CASTED_ARRAY" - Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolWithTag and initialize it's + Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolZero and initialize it's contents with 0's.

Notes: Caller responsible for freeing allocated memory using macro HLPR_DELETE_ARRAY.
@@ -262,9 +262,9 @@ extern "C" &SAFE_SIZE) == STATUS_SUCCESS && \ SAFE_SIZE >= (sizeof(object) * count)) \ { \ - pPtr = (CAST_TYPE*)ExAllocatePoolWithTag(NonPagedPoolNx, \ - SAFE_SIZE, \ - tag); \ + pPtr = (CAST_TYPE*)ExAllocatePoolZero(NonPagedPoolNx, \ + SAFE_SIZE, \ + tag); \ if(pPtr) \ RtlZeroMemory(pPtr, \ SAFE_SIZE); \ @@ -279,7 +279,7 @@ extern "C" /** @macro="HLPR_NEW" - Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolWithTag and leave it's + Purpose: Allocate memory from NonPaged Pool with ExAllocatePoolZero and leave it's contents as is.

Notes: Caller responsible for freeing allocated memory using macro HLPR_DELETE.
@@ -291,9 +291,9 @@ extern "C" pPtr == 0; \ ) \ { \ - pPtr = (object*)ExAllocatePoolWithTag(NonPagedPoolNx, \ - sizeof(object), \ - tag); \ + pPtr = (object*)ExAllocatePoolZero(NonPagedPoolNx, \ + sizeof(object), \ + tag); \ } /** -- cgit v1.3.1