[NTOSKRNL] Use ExAllocatePoolWithQuotaTag() when allocating SystemBuffer for the IRP
authorPierre Schweitzer <pierre@reactos.org>
Sun, 26 Nov 2017 13:01:04 +0000 (14:01 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 26 Nov 2017 13:03:30 +0000 (14:03 +0100)
That way, in case the system lacks memory, an exception is thrown and IRP isn't sent
to the device with NULL SystemBuffer.

CORE-14048

ntoskrnl/io/iomgr/iofunc.c

index bde78e4..19f54e0 100644 (file)
@@ -516,9 +516,9 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
                 {
                     /* Allocate the System Buffer */
                     Irp->AssociatedIrp.SystemBuffer =
-                        ExAllocatePoolWithTag(PoolType,
-                                              BufferLength,
-                                              TAG_SYS_BUF);
+                        ExAllocatePoolWithQuotaTag(PoolType,
+                                                   BufferLength,
+                                                   TAG_SYS_BUF);
 
                     /* Check if we got a buffer */
                     if (InputBuffer)
@@ -563,9 +563,9 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
                 {
                     /* Allocate the System Buffer */
                     Irp->AssociatedIrp.SystemBuffer =
-                        ExAllocatePoolWithTag(PoolType,
-                                              InputBufferLength,
-                                              TAG_SYS_BUF);
+                        ExAllocatePoolWithQuotaTag(PoolType,
+                                                   InputBufferLength,
+                                                   TAG_SYS_BUF);
 
                     /* Copy into the System Buffer */
                     RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer,