[ros-diffs] [cgutman] 53303: - Swap the failure cases - Missed change from r53301

cgutman at svn.reactos.org cgutman at svn.reactos.org
Thu Aug 18 18:13:52 UTC 2011


Author: cgutman
Date: Thu Aug 18 18:13:52 2011
New Revision: 53303

URL: http://svn.reactos.org/svn/reactos?rev=53303&view=rev
Log:
- Swap the failure cases
- Missed change from r53301

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

Modified: trunk/reactos/ntoskrnl/io/iomgr/deviface.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/deviface.c?rev=53303&r1=53302&r2=53303&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/deviface.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/deviface.c [iso-8859-1] Thu Aug 18 18:13:52 2011
@@ -1155,25 +1155,6 @@
     if (!NT_SUCCESS(Status))
     {
         DPRINT1("ZwSetValueKey() failed with status 0x%08lx\n", Status);
-        ExFreePool(SymbolicLinkName->Buffer);
-    }
-    else
-    {
-        SymbolicLinkName->Buffer[1] = '?';
-    }
-
-    /* Create symbolic link */
-    DPRINT("IoRegisterDeviceInterface(): creating symbolic link %wZ -> %wZ\n", SymbolicLinkName, &PdoNameInfo->Name);
-    Status = IoCreateSymbolicLink(SymbolicLinkName, &PdoNameInfo->Name);
-
-    /* If the symbolic link already exists, return an informational success status */
-    if (Status == STATUS_OBJECT_NAME_COLLISION)
-        Status = STATUS_OBJECT_NAME_EXISTS;
-
-    /* Check if it really failed */
-    if (!NT_SUCCESS(Status))
-    {
-        DPRINT1("IoCreateSymbolicLink() failed with status 0x%08lx\n", Status);
         ZwClose(SubKey);
         ZwClose(InterfaceKey);
         ZwClose(ClassKey);
@@ -1182,6 +1163,25 @@
         ExFreePool(BaseKeyName.Buffer);
         ExFreePool(SymbolicLinkName->Buffer);
         return Status;
+    }
+    else
+    {
+        SymbolicLinkName->Buffer[1] = '?';
+    }
+
+    /* Create symbolic link */
+    DPRINT("IoRegisterDeviceInterface(): creating symbolic link %wZ -> %wZ\n", SymbolicLinkName, &PdoNameInfo->Name);
+    Status = IoCreateSymbolicLink(SymbolicLinkName, &PdoNameInfo->Name);
+
+    /* If the symbolic link already exists, return an informational success status */
+    if (Status == STATUS_OBJECT_NAME_COLLISION)
+        Status = STATUS_OBJECT_NAME_EXISTS;
+
+    /* Check if it really failed */
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT1("IoCreateSymbolicLink() failed with status 0x%08lx\n", Status);
+        ExFreePool(SymbolicLinkName->Buffer);
     }
 
     ZwClose(SubKey);




More information about the Ros-diffs mailing list