ObInsertObject must always return STATUS_OBJECT_NAME_COLLISION if an object with the same name exist.
Modified: trunk/reactos/ntoskrnl/ob/handle.c

Modified: trunk/reactos/ntoskrnl/ob/handle.c
--- trunk/reactos/ntoskrnl/ob/handle.c	2005-05-22 16:44:36 UTC (rev 15469)
+++ trunk/reactos/ntoskrnl/ob/handle.c	2005-05-22 16:48:30 UTC (rev 15470)
@@ -739,6 +739,10 @@
 	   "ObjectType %x, AccessMode %d, Object %x)\n",Handle,DesiredAccess,
 	   ObjectType,AccessMode,Object);
 
+   if (Handle == NULL)
+     {
+       return STATUS_INVALID_HANDLE;
+     }
    /*
     * Handle special handle names
     */
@@ -986,13 +990,8 @@
         if (FoundHeader && RemainingPath.Buffer == NULL)
         {
             DPRINT("Object exists\n");
-            if (FoundHeader->ObjectType != Header->ObjectType
-                || !(ObjectCreateInfo->Attributes & OBJ_OPENIF))
-            {
-                ObDereferenceObject(FoundObject);
-                return STATUS_OBJECT_NAME_COLLISION;
-            }
-            return STATUS_OBJECT_EXISTS;
+            ObDereferenceObject(FoundObject);
+            return STATUS_OBJECT_NAME_COLLISION;
         }
     }
     else