mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
ObInsertObject must always return STATUS_OBJECT_NAME_COLLISION if an object with the same name exist.
svn path=/trunk/; revision=15470
This commit is contained in:
parent
4eba3d8e71
commit
8b6398a0e3
1 changed files with 6 additions and 7 deletions
|
@ -739,6 +739,10 @@ ObReferenceObjectByHandle(HANDLE Handle,
|
||||||
"ObjectType %x, AccessMode %d, Object %x)\n",Handle,DesiredAccess,
|
"ObjectType %x, AccessMode %d, Object %x)\n",Handle,DesiredAccess,
|
||||||
ObjectType,AccessMode,Object);
|
ObjectType,AccessMode,Object);
|
||||||
|
|
||||||
|
if (Handle == NULL)
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_HANDLE;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Handle special handle names
|
* Handle special handle names
|
||||||
*/
|
*/
|
||||||
|
@ -986,13 +990,8 @@ ObInsertObject(IN PVOID Object,
|
||||||
if (FoundHeader && RemainingPath.Buffer == NULL)
|
if (FoundHeader && RemainingPath.Buffer == NULL)
|
||||||
{
|
{
|
||||||
DPRINT("Object exists\n");
|
DPRINT("Object exists\n");
|
||||||
if (FoundHeader->ObjectType != Header->ObjectType
|
ObDereferenceObject(FoundObject);
|
||||||
|| !(ObjectCreateInfo->Attributes & OBJ_OPENIF))
|
return STATUS_OBJECT_NAME_COLLISION;
|
||||||
{
|
|
||||||
ObDereferenceObject(FoundObject);
|
|
||||||
return STATUS_OBJECT_NAME_COLLISION;
|
|
||||||
}
|
|
||||||
return STATUS_OBJECT_EXISTS;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue