Author: tkreuzer
Date: Fri Oct 24 07:16:44 2014
New Revision: 64947

URL: http://svn.reactos.org/svn/reactos?rev=64947&view=rev
Log:
[NTOSKRNL]
Do not try to dereference Irp->UserIosb if it is NULL, to avoid unnecessary 
exceptions (inside SEH).

Modified:
    trunk/reactos/ntoskrnl/io/iomgr/irp.c

Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?rev=64947&r1=64946&r2=64947&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/irp.c       [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/irp.c       [iso-8859-1] Fri Oct 24 
07:16:44 2014
@@ -324,17 +324,21 @@
             Key = FileObject->CompletionContext->Key;
         }
 
-        /* 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;
+        /* Check for UserIos */
+        if (Irp->UserIosb != NULL)
+        {
+            /* 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;
+        }
 
         /* Check if we have an event or a file object */
         if (Irp->UserEvent)


Reply via email to