Respect OBJ_OPENIF flag in ObCreateObject

svn path=/trunk/; revision=14596
This commit is contained in:
Hervé Poussineau 2005-04-11 22:38:05 +00:00
parent c568ca436d
commit 63e93fb6ba
2 changed files with 3 additions and 2 deletions

View file

@ -60,7 +60,7 @@ ObReferenceObjectByName(PUNICODE_STRING ObjectPath,
InitializeObjectAttributes(&ObjectAttributes,
ObjectPath,
Attributes,
Attributes | OBJ_OPENIF,
NULL,
NULL);
Status = ObFindObject(&ObjectAttributes,

View file

@ -712,7 +712,8 @@ ObCreateObject (IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
if (ParentHeader &&
RemainingPath.Buffer == NULL)
{
if (ParentHeader->ObjectType != Type)
if (ParentHeader->ObjectType != Type
|| !(ObjectAttributes->Attributes & OBJ_OPENIF))
{
ObDereferenceObject(Parent);
return STATUS_OBJECT_NAME_COLLISION;