mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
changed ObLookupObject to use Parse member if nonnull
svn path=/trunk/; revision=181
This commit is contained in:
parent
a1fca3d3ae
commit
5998255e83
1 changed files with 113 additions and 101 deletions
|
@ -432,8 +432,12 @@ VOID ObCreateEntry(PDIRECTORY_OBJECT parent,POBJECT_HEADER Object)
|
||||||
InsertTailList(&parent->head,&Object->Entry);
|
InsertTailList(&parent->head,&Object->Entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
|
NTSTATUS
|
||||||
PWSTR* UnparsedSection, ULONG Attributes)
|
ObLookupObject(HANDLE rootdir,
|
||||||
|
PWSTR string,
|
||||||
|
PVOID* Object,
|
||||||
|
PWSTR* UnparsedSection,
|
||||||
|
ULONG Attributes)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Lookup an object within the system namespc
|
* FUNCTION: Lookup an object within the system namespc
|
||||||
* ARGUMENTS:
|
* ARGUMENTS:
|
||||||
|
@ -451,8 +455,6 @@ NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
|
||||||
DPRINT("ObLookupObject(rootdir %x, string %x, string %w, Object %x, "
|
DPRINT("ObLookupObject(rootdir %x, string %x, string %w, Object %x, "
|
||||||
"UnparsedSection %x)\n",rootdir,string,string,Object,
|
"UnparsedSection %x)\n",rootdir,string,string,Object,
|
||||||
UnparsedSection);
|
UnparsedSection);
|
||||||
|
|
||||||
|
|
||||||
*UnparsedSection = NULL;
|
*UnparsedSection = NULL;
|
||||||
*Object = NULL;
|
*Object = NULL;
|
||||||
|
|
||||||
|
@ -462,8 +464,12 @@ NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ObReferenceObjectByHandle(rootdir,DIRECTORY_TRAVERSE,NULL,
|
ObReferenceObjectByHandle(rootdir,
|
||||||
UserMode,(PVOID*)¤t_dir,NULL);
|
DIRECTORY_TRAVERSE,
|
||||||
|
NULL,
|
||||||
|
UserMode,
|
||||||
|
(PVOID*)¤t_dir,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -472,17 +478,16 @@ NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
|
||||||
if (string[0] == 0)
|
if (string[0] == 0)
|
||||||
{
|
{
|
||||||
*Object = current_dir;
|
*Object = current_dir;
|
||||||
return(STATUS_SUCCESS);
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string[0] != '\\')
|
if (string[0] != '\\')
|
||||||
{
|
{
|
||||||
DbgPrint("(%s:%d) Non absolute pathname passed to %s\n",__FILE__,
|
DbgPrint("Non absolute pathname passed\n");
|
||||||
__LINE__,__FUNCTION__);
|
return STATUS_UNSUCCESSFUL;
|
||||||
return(STATUS_UNSUCCESSFUL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
next = &string[0];
|
next = string;
|
||||||
current = next + 1;
|
current = next + 1;
|
||||||
|
|
||||||
while (next != NULL &&
|
while (next != NULL &&
|
||||||
|
@ -503,13 +508,13 @@ NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
|
||||||
}
|
}
|
||||||
DPRINT("\n",0);
|
DPRINT("\n",0);
|
||||||
|
|
||||||
current_dir=(PDIRECTORY_OBJECT)ObDirLookup(current_dir,current,
|
current_dir = (PDIRECTORY_OBJECT)ObDirLookup(current_dir,
|
||||||
|
current,
|
||||||
Attributes);
|
Attributes);
|
||||||
if (current_dir == NULL)
|
if (current_dir == NULL)
|
||||||
{
|
{
|
||||||
DbgPrint("(%s:%d) Path component %w not found\n",__FILE__,
|
DbgPrint("Path component %w not found\n", current);
|
||||||
__LINE__,current);
|
return STATUS_UNSUCCESSFUL;
|
||||||
return(STATUS_UNSUCCESSFUL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BODY_TO_HEADER(current_dir)->ObjectType == IoSymbolicLinkType)
|
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;
|
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
|
else
|
||||||
{
|
{
|
||||||
Status = STATUS_UNSUCCESSFUL;
|
Status = STATUS_UNSUCCESSFUL;
|
||||||
|
@ -547,8 +559,8 @@ NTSTATUS ObLookupObject(HANDLE rootdir, PWSTR string, PVOID* Object,
|
||||||
}
|
}
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
*Object = current_dir;
|
*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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue