From 6256db0836a280fcdc832ff27a6ce646beb84f3e Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sat, 9 Apr 2005 09:37:32 +0000 Subject: [PATCH] ObCreateObject should return an existing named object if one already exist. svn path=/trunk/; revision=14560 --- reactos/ntoskrnl/ob/object.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/ob/object.c b/reactos/ntoskrnl/ob/object.c index 79c33949181..08c36ed50d6 100644 --- a/reactos/ntoskrnl/ob/object.c +++ b/reactos/ntoskrnl/ob/object.c @@ -712,8 +712,13 @@ ObCreateObject (IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL, if (ParentHeader && RemainingPath.Buffer == NULL) { - ObDereferenceObject(Parent); - return STATUS_OBJECT_NAME_COLLISION; + if (ParentHeader->ObjectType != Type) + { + ObDereferenceObject(Parent); + return STATUS_OBJECT_NAME_COLLISION; + } + *Object = Parent; + return STATUS_OBJECT_EXISTS; } } else