[NTOSKRNL]

- Fix return value of ObOpenObjectByName (in success case the return status of ObpLookupObjectName is returned.

svn path=/trunk/; revision=61569
This commit is contained in:
Timo Kreuzer 2014-01-07 20:50:34 +00:00
parent 0a7344aca7
commit f6c5b356aa

View file

@ -2431,7 +2431,7 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
{
PVOID Object = NULL;
UNICODE_STRING ObjectName;
NTSTATUS Status;
NTSTATUS Status, Status2;
POBJECT_HEADER ObjectHeader;
PGENERIC_MAPPING GenericMapping = NULL;
OB_OPEN_REASON OpenReason;
@ -2557,17 +2557,21 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
else
{
/* Create the actual handle now */
Status = ObpCreateHandle(OpenReason,
Object,
ObjectType,
PassedAccessState,
0,
TempBuffer->ObjectCreateInfo.Attributes,
&TempBuffer->LookupContext,
AccessMode,
NULL,
Handle);
if (!NT_SUCCESS(Status)) ObDereferenceObject(Object);
Status2 = ObpCreateHandle(OpenReason,
Object,
ObjectType,
PassedAccessState,
0,
TempBuffer->ObjectCreateInfo.Attributes,
&TempBuffer->LookupContext,
AccessMode,
NULL,
Handle);
if (!NT_SUCCESS(Status))
{
ObDereferenceObject(Object);
Status = Status2;
}
}
Cleanup: