- Add missing code to ObpLookupDirectoryEntry.

- Add calls to ObpInitailizeDirectoryLookup.
- Add calls to ObpCleanupDirectoryLookup but disable them for now.
- Add calls to ObpAcquireDirectoryLock but disable them for now.

svn path=/trunk/; revision=25395
This commit is contained in:
Alex Ionescu 2007-01-09 09:07:36 +00:00
parent fe1190c599
commit 96b09e8f09
4 changed files with 33 additions and 4 deletions

View file

@ -185,7 +185,8 @@ ObpLookupEntryDirectory(IN POBJECT_DIRECTORY Directory,
/* Check if the directory is already locked */
if (!Context->DirectoryLocked)
{
/* Lock it */
ObpAcquireDirectoryLockShared(Directory, Context);
}
/* Start looping */
@ -222,6 +223,8 @@ ObpLookupEntryDirectory(IN POBJECT_DIRECTORY Directory,
/* Check if the directory was locked */
if (!Context->DirectoryLocked)
{
/* Convert the lock from shared to exclusive */
ExConvertPushLockSharedToExclusive(&Directory->Lock);
}
/* Set the Current Entry */
@ -241,6 +244,11 @@ ObpLookupEntryDirectory(IN POBJECT_DIRECTORY Directory,
/* Get the object name information */
ObjectHeader = OBJECT_TO_OBJECT_HEADER(FoundObject);
HeaderNameInfo = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader);
if (HeaderNameInfo)
{
/* Add a query reference */
//ObpIncrementQueryReference(ObjectHeader, HeaderNameInfo);
}
/* Reference the object being looked up */
//ObReferenceObject(FoundObject);
@ -248,6 +256,8 @@ ObpLookupEntryDirectory(IN POBJECT_DIRECTORY Directory,
/* Check if the directory was locked */
if (!Context->DirectoryLocked)
{
/* Release the lock */
ObpReleaseDirectoryLock(Directory, Context);
}
}
else
@ -255,6 +265,8 @@ ObpLookupEntryDirectory(IN POBJECT_DIRECTORY Directory,
/* Check if the directory was locked */
if (!Context->DirectoryLocked)
{
/* Release the lock */
ObpReleaseDirectoryLock(Directory, Context);
}
/* Check if we should scan the shadow directory */

View file

@ -2030,6 +2030,7 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
if (!NT_SUCCESS(Status))
{
/* Cleanup after lookup */
//ObpCleanupDirectoryLookup(&TempBuffer->LookupContext, TRUE);
TempBuffer->LookupContext.Object = NULL;
goto Cleanup;
}
@ -2062,7 +2063,9 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
{
/* Set failure code */
Status = STATUS_INVALID_PARAMETER;
TempBuffer->LookupContext.Object = NULL;
/* Cleanup after lookup */
//ObpCleanupDirectoryLookup(&TempBuffer->LookupContext, TRUE);
}
else
{
@ -2440,12 +2443,13 @@ ObInsertObject(IN PVOID Object,
if (!NT_SUCCESS(Status))
{
/* Fail */
if (ObjectNameInfo) ObpDecrementQueryReference(ObjectNameInfo);
ObDereferenceObject(Object);
return Status;
}
/* Setup a lookup context */
Context.Object = NULL;
ObpInitializeDirectoryLookup(&Context);
InsertObject = Object;
OpenReason = ObCreateHandle;

View file

@ -278,9 +278,17 @@ ObPostPhase0:
Status = NtClose(Handle);
if (!NT_SUCCESS(Status)) return FALSE;
Context.Object = NULL;
/* Initialize lookup context */
ObpInitializeDirectoryLookup(&Context);
/* Lock it */
//ObpAcquireDirectoryLockExclusive(ObpTypeDirectoryObject, &Context);
/* Setup directory */
// FIXME: ObpSetLookupDirectory(Dir);?
Context.Directory = ObpTypeDirectoryObject;
Context.DirectoryLocked = TRUE;
Context.LockStateSignature = 0xCCCC1234;
/* Loop the object types */
ListHead = &ObTypeObjectType->TypeList;
@ -317,6 +325,8 @@ ObPostPhase0:
NextEntry = NextEntry->Flink;
}
/* Cleanup after lookup */
//ObpCleanupDirectoryLookup(&Context, TRUE);
Context.Object = NULL;
/* Initialize DOS Devices Directory and related Symbolic Links */

View file

@ -428,6 +428,9 @@ ObReferenceObjectByName(IN PUNICODE_STRING ObjectPath,
PassedAccessState,
&Context,
&Object);
/* Cleanup after lookup */
//ObpCleanupDirectoryLookup(&Context, TRUE);
Context.Object = NULL;
/* Check if the lookup succeeded */