[NTOSKRNL]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 24 Oct 2014 07:16:44 +0000 (07:16 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 24 Oct 2014 07:16:44 +0000 (07:16 +0000)
Do not try to dereference Irp->UserIosb if it is NULL, to avoid unnecessary exceptions (inside SEH).

svn path=/trunk/; revision=64947

reactos/ntoskrnl/io/iomgr/irp.c

index f768c76..940c3e3 100644 (file)
@@ -324,17 +324,21 @@ IopCompleteRequest(IN PKAPC Apc,
             Key = FileObject->CompletionContext->Key;
         }
 
-        /* Use SEH to make sure we don't write somewhere invalid */
-        _SEH2_TRY
+        /* Check for UserIos */
+        if (Irp->UserIosb != NULL)
         {
-            /*  Save the IOSB Information */
-            *Irp->UserIosb = Irp->IoStatus;
-        }
-        _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
-        {
-            /* Ignore any error */
+            /* Use SEH to make sure we don't write somewhere invalid */
+            _SEH2_TRY
+            {
+                /*  Save the IOSB Information */
+                *Irp->UserIosb = Irp->IoStatus;
+            }
+            _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+            {
+                /* Ignore any error */
+            }
+            _SEH2_END;
         }
-        _SEH2_END;
 
         /* Check if we have an event or a file object */
         if (Irp->UserEvent)