-/* $Id: object.c,v 1.47 2002/05/07 22:39:26 hbirr Exp $
+/* $Id: object.c,v 1.48 2002/05/13 18:10:41 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
Path = ObjectAttributes->ObjectName->Buffer;
- if (Path[0] == 0)
+ if ((Path == NULL) && (Path[0] == 0))
{
*ReturnedObject = CurrentObject;
return(STATUS_SUCCESS);
return(STATUS_UNSUCCESSFUL);
}
- if (Path)
- {
RtlCreateUnicodeString (&PathString, Path);
current = PathString.Buffer;
- }
- else
- {
- RtlInitUnicodeString (&PathString, NULL);
- current = NULL;
- }
RootObject = CurrentObject;
DPRINT("ObCreateObject(Handle %x, ObjectAttributes %x, Type %x)\n",
Handle, ObjectAttributes, Type);
+
if (ObjectAttributes != NULL &&
- ObjectAttributes->ObjectName != NULL)
+ ObjectAttributes->ObjectName != NULL &&
+ ObjectAttributes->ObjectName->Buffer != NULL)
{
DPRINT("ObjectAttributes->ObjectName->Buffer %S\n",
ObjectAttributes->ObjectName->Buffer);
}
if (ObjectAttributes != NULL &&
- ObjectAttributes->ObjectName != NULL)
+ ObjectAttributes->ObjectName != NULL &&
+ ObjectAttributes->ObjectName->Buffer != NULL)
{
Status = ObFindObject(ObjectAttributes,
&Parent,
{
RtlInitUnicodeString(&RemainingPath, NULL);
}
-
RtlMapGenericMask(&DesiredAccess,
Type->Mapping);
Parent,
RemainingPath.Buffer,
ObjectAttributes);
+
if (!NT_SUCCESS(Status))
{
if (ObjectAttached == TRUE)
return(Status);
}
}
+
RtlFreeUnicodeString( &RemainingPath );
*Object = HEADER_TO_BODY(Header);