changed ObLookupObject to use Parse member if nonnull

svn path=/trunk/; revision=181
This commit is contained in:
Rex Jolliff 1999-01-20 00:19:46 +00:00
parent a1fca3d3ae
commit 5998255e83

View file

@ -432,8 +432,12 @@ VOID ObCreateEntry(PDIRECTORY_OBJECT parent,POBJECT_HEADER Object)
InsertTailList(&parent->head,&Object->Entry);
}
NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
PWSTR* UnparsedSection, ULONG Attributes)
NTSTATUS
ObLookupObject(HANDLE rootdir,
PWSTR string,
PVOID* Object,
PWSTR* UnparsedSection,
ULONG Attributes)
/*
* FUNCTION: Lookup an object within the system namespc
* ARGUMENTS:
@ -451,8 +455,6 @@ NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
DPRINT("ObLookupObject(rootdir %x, string %x, string %w, Object %x, "
"UnparsedSection %x)\n",rootdir,string,string,Object,
UnparsedSection);
*UnparsedSection = NULL;
*Object = NULL;
@ -462,8 +464,12 @@ NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
}
else
{
ObReferenceObjectByHandle(rootdir,DIRECTORY_TRAVERSE,NULL,
UserMode,(PVOID*)&current_dir,NULL);
ObReferenceObjectByHandle(rootdir,
DIRECTORY_TRAVERSE,
NULL,
UserMode,
(PVOID*)&current_dir,
NULL);
}
/*
@ -472,17 +478,16 @@ NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
if (string[0] == 0)
{
*Object = current_dir;
return(STATUS_SUCCESS);
return STATUS_SUCCESS;
}
if (string[0] != '\\')
{
DbgPrint("(%s:%d) Non absolute pathname passed to %s\n",__FILE__,
__LINE__,__FUNCTION__);
return(STATUS_UNSUCCESSFUL);
DbgPrint("Non absolute pathname passed\n");
return STATUS_UNSUCCESSFUL;
}
next = &string[0];
next = string;
current = next + 1;
while (next != NULL &&
@ -503,13 +508,13 @@ NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
}
DPRINT("\n",0);
current_dir=(PDIRECTORY_OBJECT)ObDirLookup(current_dir,current,
current_dir = (PDIRECTORY_OBJECT)ObDirLookup(current_dir,
current,
Attributes);
if (current_dir == NULL)
{
DbgPrint("(%s:%d) Path component %w not found\n",__FILE__,
__LINE__,current);
return(STATUS_UNSUCCESSFUL);
DbgPrint("Path component %w not found\n", current);
return STATUS_UNSUCCESSFUL;
}
if (BODY_TO_HEADER(current_dir)->ObjectType == IoSymbolicLinkType)
@ -540,6 +545,13 @@ NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
{
Status = STATUS_FS_QUERY_REQUIRED;
}
else if (BODY_TO_HEADER(current_dir)->ObjectType->Parse != NULL)
{
current_dir = BODY_TO_HEADER(current_dir)->ObjectType->
Parse(current_dir,
UnparsedSection);
Status = (current_dir != NULL) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
}
else
{
Status = STATUS_UNSUCCESSFUL;
@ -547,8 +559,8 @@ NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
}
CHECKPOINT;
*Object = current_dir;
DPRINT("(%s:%d) current_dir %x\n",__FILE__,__LINE__,current_dir);
DPRINT("current_dir %x\n", current_dir);
return(Status);
return Status;
}