[KMTESTS:MM]
authorThomas Faber <thomas.faber@reactos.org>
Sat, 29 Jun 2013 13:10:30 +0000 (13:10 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 29 Jun 2013 13:10:30 +0000 (13:10 +0000)
- Gracefully handle file open failure in ZwCreateSection test. Patch by Aleksandar Andrejevic.
ROSTESTS-115 #resolve

svn path=/trunk/; revision=59362

rostests/kmtests/ntos_mm/ZwCreateSection.c

index 54f2dc7..0a4ba59 100644 (file)
@@ -507,9 +507,12 @@ START_TEST(ZwCreateSection)
 
     KmtInitTestFiles(&FileHandleReadOnly, &FileHandleWriteOnly, &FileHandleExecuteOnly);
 
-    FileSectionViewPermissionCheck(FileHandleReadOnly, FileHandleWriteOnly, FileHandleExecuteOnly);
-    SimpleErrorChecks(FileHandleReadOnly, FileHandleWriteOnly, FileHandleExecuteOnly);
-    BasicBehaviorChecks(FileHandleWriteOnly);
+    if (FileHandleReadOnly && FileHandleWriteOnly && FileHandleExecuteOnly)
+    {
+        FileSectionViewPermissionCheck(FileHandleReadOnly, FileHandleWriteOnly, FileHandleExecuteOnly);
+        SimpleErrorChecks(FileHandleReadOnly, FileHandleWriteOnly, FileHandleExecuteOnly);
+        BasicBehaviorChecks(FileHandleWriteOnly);
+    }
 
     if (FileHandleReadOnly)
         ZwClose(FileHandleReadOnly);