[NTOS:IO]
authorThomas Faber <thomas.faber@reactos.org>
Thu, 15 Sep 2016 13:25:20 +0000 (13:25 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Thu, 15 Sep 2016 13:25:20 +0000 (13:25 +0000)
- Avoid IRP allocation failure in IopDeleteFile and IopCloseFile. Based on a patch by Volodymyr Shcherbyna.
CORE-11959

svn path=/trunk/; revision=72682

reactos/ntoskrnl/io/iomgr/file.c

index 0fa6d43..71863cc 100644 (file)
@@ -1283,8 +1283,7 @@ IopDeleteFile(IN PVOID ObjectBody)
         KeInitializeEvent(&Event, SynchronizationEvent, FALSE);
 
         /* Allocate an IRP */
-        Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE);
-        if (!Irp) return;
+        Irp = IopAllocateIrpMustSucceed(DeviceObject->StackSize);
 
         /* Set it up */
         Irp->UserEvent = &Event;
@@ -1977,8 +1976,7 @@ IopCloseFile(IN PEPROCESS Process OPTIONAL,
     KeInitializeEvent(&Event, SynchronizationEvent, FALSE);
 
     /* Allocate an IRP */
-    Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE);
-    if (!Irp) return;
+    Irp = IopAllocateIrpMustSucceed(DeviceObject->StackSize);
 
     /* Set it up */
     Irp->UserEvent = &Event;