- Changes to lookup context set-up as place-holder and compatibility for future patch. Only configure the lookup context once, outside the initial loop, instead of configuring it with the same settings at each iteration.

svn path=/trunk/; revision=25371
This commit is contained in:
Alex Ionescu 2007-01-08 07:54:57 +00:00
parent 569e9458d6
commit 956ae8b6f1

View file

@ -12,11 +12,9 @@
#include <ntoskrnl.h> #include <ntoskrnl.h>
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <debug.h>
#if defined (ALLOC_PRAGMA) /* GLOBALS *******************************************************************/
#pragma alloc_text(INIT, ObInit)
#endif
GENERIC_MAPPING ObpTypeMapping = GENERIC_MAPPING ObpTypeMapping =
{ {
@ -280,6 +278,10 @@ ObPostPhase0:
Status = NtClose(Handle); Status = NtClose(Handle);
if (!NT_SUCCESS(Status)) return FALSE; if (!NT_SUCCESS(Status)) return FALSE;
Context.Object = NULL;
Context.Directory = ObpTypeDirectoryObject;
Context.DirectoryLocked = TRUE;
/* Loop the object types */ /* Loop the object types */
ListHead = &ObTypeObjectType->TypeList; ListHead = &ObTypeObjectType->TypeList;
NextEntry = ListHead->Flink; NextEntry = ListHead->Flink;
@ -297,10 +299,6 @@ ObPostPhase0:
/* Make sure we have a name, and aren't inserted yet */ /* Make sure we have a name, and aren't inserted yet */
if ((NameInfo) && !(NameInfo->Directory)) if ((NameInfo) && !(NameInfo->Directory))
{ {
/* Set up the context for the insert */
Context.Directory = ObpTypeDirectoryObject;
Context.DirectoryLocked = TRUE;
/* Do the initial lookup to setup the context */ /* Do the initial lookup to setup the context */
if (!ObpLookupEntryDirectory(ObpTypeDirectoryObject, if (!ObpLookupEntryDirectory(ObpTypeDirectoryObject,
&NameInfo->Name, &NameInfo->Name,
@ -319,6 +317,8 @@ ObPostPhase0:
NextEntry = NextEntry->Flink; NextEntry = NextEntry->Flink;
} }
Context.Object = NULL;
/* Initialize DOS Devices Directory and related Symbolic Links */ /* Initialize DOS Devices Directory and related Symbolic Links */
Status = ObpCreateDosDevicesDirectory(); Status = ObpCreateDosDevicesDirectory();
if (!NT_SUCCESS(Status)) return FALSE; if (!NT_SUCCESS(Status)) return FALSE;