summaryrefslogtreecommitdiff
path: root/serial
diff options
context:
space:
mode:
authorPranav Sharma <[email protected]>2022-03-18 15:36:03 -0700
committerPranav Sharma <[email protected]>2022-03-18 15:36:03 -0700
commit1650aeea25a2180fcfb062d69f6112079fef8f97 (patch)
tree71dc7555748245e011277496c989b55e7355cb32 /serial
parent86731b86485eee95fd5060232c3d171257607db6 (diff)
parent9bb77ebe0a5be25d21fff67200e75427e33a3d12 (diff)
Merge branch 'master' of https://github.com/pralater/Windows-driver-samples
Diffstat (limited to 'serial')
-rw-r--r--serial/serenum/pnp.c20
-rw-r--r--serial/serenum/serenum.c2
-rw-r--r--serial/serenum/serenum.h2
-rw-r--r--serial/serenum/string.c4
4 files changed, 16 insertions, 12 deletions
diff --git a/serial/serenum/pnp.c b/serial/serenum/pnp.c
index 597b693d..93004c5c 100644
--- a/serial/serenum/pnp.c
+++ b/serial/serenum/pnp.c
@@ -183,7 +183,7 @@ Arguments:
NULL, &nameLength);
if ((nameLength != 0) && (status == STATUS_BUFFER_TOO_SMALL)) {
- deviceName = ExAllocatePoolWithTag(NonPagedPoolNx, nameLength,SERENUM_POOL_TAG);
+ deviceName = ExAllocatePoolZero(NonPagedPoolNx, nameLength,SERENUM_POOL_TAG);
if (NULL == deviceName) {
goto someDebugStuffExit;
@@ -726,7 +726,7 @@ Routine Description:
length = sizeof(DEVICE_RELATIONS) +
((DeviceData->NumPDOs + i) * sizeof (PDEVICE_OBJECT));
- relations = (PDEVICE_RELATIONS) ExAllocatePoolWithTag (NonPagedPoolNx, length,SERENUM_POOL_TAG);
+ relations = (PDEVICE_RELATIONS) ExAllocatePoolZero(NonPagedPoolNx, length,SERENUM_POOL_TAG);
if (NULL == relations) {
Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
@@ -970,7 +970,7 @@ Routine Description:
break;
}
- returnBuffer = ExAllocatePoolWithTag(PagedPool, DeviceData->DevDesc.Length,SERENUM_POOL_TAG);
+ returnBuffer = ExAllocatePoolZero(PagedPool, DeviceData->DevDesc.Length,SERENUM_POOL_TAG);
if (returnBuffer == NULL) {
status = STATUS_INSUFFICIENT_RESOURCES;
@@ -1016,7 +1016,7 @@ Routine Description:
status = STATUS_SUCCESS;
length = SERENUM_INSTANCE_IDS_LENGTH * sizeof(WCHAR);
- returnBuffer = ExAllocatePoolWithTag(PagedPool, length,SERENUM_POOL_TAG);
+ returnBuffer = ExAllocatePoolZero(PagedPool, length,SERENUM_POOL_TAG);
if (returnBuffer != NULL) {
RtlCopyMemory(returnBuffer, SERENUM_INSTANCE_IDS, length);
@@ -1060,7 +1060,7 @@ Routine Description:
if (buffer != NULL) {
length = pId->Length;
- returnBuffer = ExAllocatePoolWithTag(PagedPool, length + sizeof(WCHAR),SERENUM_POOL_TAG);
+ returnBuffer = ExAllocatePoolZero(PagedPool, length + sizeof(WCHAR),SERENUM_POOL_TAG);
if (returnBuffer != NULL) {
RtlZeroMemory(returnBuffer, length + sizeof(WCHAR) );
RtlCopyMemory(returnBuffer, buffer, length);
@@ -1087,7 +1087,7 @@ Routine Description:
ASSERTMSG("Serenum appears not to be the sole bus?!?",
Irp->IoStatus.Information == (ULONG_PTR)NULL);
- pBusInfo = ExAllocatePoolWithTag(PagedPool, sizeof(PNP_BUS_INFORMATION),SERENUM_POOL_TAG);
+ pBusInfo = ExAllocatePoolZero(PagedPool, sizeof(PNP_BUS_INFORMATION),SERENUM_POOL_TAG);
if (pBusInfo == NULL) {
status = STATUS_INSUFFICIENT_RESOURCES;
@@ -1125,7 +1125,7 @@ Routine Description:
}
- pDevRel = ExAllocatePoolWithTag(PagedPool, sizeof(DEVICE_RELATIONS),SERENUM_POOL_TAG);
+ pDevRel = ExAllocatePoolZero(PagedPool, sizeof(DEVICE_RELATIONS),SERENUM_POOL_TAG);
if (pDevRel == NULL) {
status = STATUS_INSUFFICIENT_RESOURCES;
@@ -1175,7 +1175,7 @@ Routine Description:
if(DeviceData->PnPRev.Length) {
RtlInitUnicodeString(&keyname, NULL);
keyname.MaximumLength = sizeof(L"PnPRev");
- keyname.Buffer = ExAllocatePoolWithTag(PagedPool, keyname.MaximumLength,SERENUM_POOL_TAG);
+ keyname.Buffer = ExAllocatePoolZero(PagedPool, keyname.MaximumLength,SERENUM_POOL_TAG);
if (keyname.Buffer != NULL) {
@@ -1194,7 +1194,7 @@ Routine Description:
if(DeviceData->SerialNo.Length) {
RtlInitUnicodeString(&keyname, NULL);
keyname.MaximumLength = sizeof(L"Serial Number");
- keyname.Buffer = ExAllocatePoolWithTag(PagedPool, keyname.MaximumLength,SERENUM_POOL_TAG);
+ keyname.Buffer = ExAllocatePoolZero(PagedPool, keyname.MaximumLength,SERENUM_POOL_TAG);
if (keyname.Buffer != NULL) {
@@ -1442,7 +1442,7 @@ VOID SerenumStartDeviceWorker(
_Analysis_assume_(Irp != NULL); // Not NULL when passed to IoQueueWorkItem()
- if (NULL == (QueryTable = ExAllocatePoolWithTag(
+ if (NULL == (QueryTable = ExAllocatePoolZero(
PagedPool,
sizeof(RTL_QUERY_REGISTRY_TABLE)*2,
SERENUM_POOL_TAG
diff --git a/serial/serenum/serenum.c b/serial/serenum/serenum.c
index 0e369528..ec78544b 100644
--- a/serial/serenum/serenum.c
+++ b/serial/serenum/serenum.c
@@ -57,6 +57,8 @@ Routine Description:
{
ULONG i;
+ ExInitializeDriverRuntime(DrvRtPoolNxOptIn);
+
UNREFERENCED_PARAMETER (UniRegistryPath);
Serenum_KdPrint_Def (SER_DBG_SS_TRACE, ("Driver Entry\n"));
diff --git a/serial/serenum/serenum.h b/serial/serenum/serenum.h
index 11bc6671..500d5f31 100644
--- a/serial/serenum/serenum.h
+++ b/serial/serenum/serenum.h
@@ -136,6 +136,8 @@ Revision History:
#define MIN(_A_,_B_) (((_A_) < (_B_)) ? (_A_) : (_B_))
#endif
+#define POOL_ZERO_DOWN_LEVEL_SUPPORT
+
//
// A common header for the device extensions of the PDOs and FDO
//
diff --git a/serial/serenum/string.c b/serial/serenum/string.c
index bf54ca8e..4e4fc7a6 100644
--- a/serial/serenum/string.c
+++ b/serial/serenum/string.c
@@ -94,7 +94,7 @@ Return value:
// Allocate the string buffers
//
- pStrBuffer = ExAllocatePoolWithTag(PagedPool, MAX_DEVNODE_NAME * 7 + 1,SERENUM_POOL_TAG);
+ pStrBuffer = ExAllocatePoolZero(PagedPool, MAX_DEVNODE_NAME * 7 + 1,SERENUM_POOL_TAG);
if (pStrBuffer == NULL) {
status = STATUS_INSUFFICIENT_RESOURCES;
@@ -384,7 +384,7 @@ Return Value:
multiLength += sizeof(WCHAR);
MultiString->MaximumLength = (USHORT)multiLength;
- MultiString->Buffer = ExAllocatePoolWithTag(PagedPool, multiLength,SERENUM_POOL_TAG);
+ MultiString->Buffer = ExAllocatePoolZero(PagedPool, multiLength,SERENUM_POOL_TAG);
MultiString->Length = 0;
if (MultiString->Buffer == NULL) {