- Rename made-up Ob functions names to match publicly available NT names, as most of other Ob names do.

svn path=/trunk/; revision=34009
This commit is contained in:
Aleksey Bragin 2008-06-18 12:28:29 +00:00
parent ab2b63b87b
commit f550691222
9 changed files with 67 additions and 67 deletions

View file

@ -66,7 +66,7 @@
// We can call the Ob Inlined API, it's the same thing
//
#define IopAllocateMdlFromLookaside \
ObpAllocateCapturedAttributes
ObpAllocateObjectCreateInfoBuffer
#define IopFreeMdlFromLookaside \
ObpFreeCapturedAttributes

View file

@ -562,7 +562,7 @@ ObpCaptureObjectName(
NTSTATUS
NTAPI
ObpCaptureObjectAttributes(
ObpCaptureObjectCreateInformation(
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN KPROCESSOR_MODE AccessMode,
IN BOOLEAN AllocateFromLookaside,

View file

@ -79,7 +79,7 @@ ObpReleaseObjectLock(IN POBJECT_HEADER ObjectHeader)
POBJECT_HEADER_NAME_INFO
FORCEINLINE
ObpAcquireNameInformation(IN POBJECT_HEADER ObjectHeader)
ObpReferenceNameInfo(IN POBJECT_HEADER ObjectHeader)
{
POBJECT_HEADER_NAME_INFO ObjectNameInfo;
ULONG NewValue, References;
@ -120,7 +120,7 @@ ObpAcquireNameInformation(IN POBJECT_HEADER ObjectHeader)
VOID
FORCEINLINE
ObpReleaseNameInformation(IN POBJECT_HEADER_NAME_INFO HeaderNameInfo)
ObpDereferenceNameInfo(IN POBJECT_HEADER_NAME_INFO HeaderNameInfo)
{
POBJECT_DIRECTORY Directory;
@ -198,7 +198,7 @@ ObpReleaseDirectoryLock(IN POBJECT_DIRECTORY Directory,
VOID
FORCEINLINE
ObpInitializeDirectoryLookup(IN POBP_LOOKUP_CONTEXT Context)
ObpInitializeLookupContext(IN POBP_LOOKUP_CONTEXT Context)
{
/* Initialize a null context */
Context->Object = NULL;
@ -222,7 +222,7 @@ ObpReleaseLookupContextObject(IN POBP_LOOKUP_CONTEXT Context)
HeaderNameInfo = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader);
/* release the name information */
ObpReleaseNameInformation(HeaderNameInfo);
ObpDereferenceNameInfo(HeaderNameInfo);
/* Dereference the object */
ObDereferenceObject(Context->Object);
@ -232,7 +232,7 @@ ObpReleaseLookupContextObject(IN POBP_LOOKUP_CONTEXT Context)
VOID
FORCEINLINE
ObpCleanupDirectoryLookup(IN POBP_LOOKUP_CONTEXT Context)
ObpReleaseLookupContext(IN POBP_LOOKUP_CONTEXT Context)
{
/* Check if we came back with the directory locked */
if (Context->DirectoryLocked)
@ -273,7 +273,7 @@ ObpLeaveObjectTypeMutex(IN POBJECT_TYPE ObjectType)
VOID
FORCEINLINE
ObpReleaseCapturedAttributes(IN POBJECT_CREATE_INFORMATION ObjectCreateInfo)
ObpReleaseObjectCreateInformation(IN POBJECT_CREATE_INFORMATION ObjectCreateInfo)
{
/* Check if we have a security descriptor */
if (ObjectCreateInfo->SecurityDescriptor)
@ -288,7 +288,7 @@ ObpReleaseCapturedAttributes(IN POBJECT_CREATE_INFORMATION ObjectCreateInfo)
PVOID
FORCEINLINE
ObpAllocateCapturedAttributes(IN PP_NPAGED_LOOKASIDE_NUMBER Type)
ObpAllocateObjectCreateInfoBuffer(IN PP_NPAGED_LOOKASIDE_NUMBER Type)
{
PVOID Buffer;
PNPAGED_LOOKASIDE_LIST List;
@ -369,10 +369,10 @@ ObpFreeCapturedAttributes(IN PVOID Buffer,
VOID
FORCEINLINE
ObpFreeAndReleaseCapturedAttributes(IN POBJECT_CREATE_INFORMATION ObjectCreateInfo)
ObpFreeObjectCreateInformation(IN POBJECT_CREATE_INFORMATION ObjectCreateInfo)
{
/* First release the attributes, then free them from the lookaside list */
ObpReleaseCapturedAttributes(ObjectCreateInfo);
ObpReleaseObjectCreateInformation(ObjectCreateInfo);
ObpFreeCapturedAttributes(ObjectCreateInfo, LookasideCreateInfoList);
}

View file

@ -262,7 +262,7 @@ Quickie:
{
/* Get the object name information */
ObjectHeader = OBJECT_TO_OBJECT_HEADER(FoundObject);
ObpAcquireNameInformation(ObjectHeader);
ObpReferenceNameInfo(ObjectHeader);
/* Reference the object being looked up */
ObReferenceObject(FoundObject);
@ -281,7 +281,7 @@ Quickie:
/* We already did a lookup, so remove this object's query reference */
ObjectHeader = OBJECT_TO_OBJECT_HEADER(Context->Object);
HeaderNameInfo = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader);
ObpReleaseNameInformation(HeaderNameInfo);
ObpDereferenceNameInfo(HeaderNameInfo);
/* Also dereference the object itself */
ObDereferenceObject(Context->Object);
@ -480,7 +480,7 @@ NtQueryDirectoryObject(IN HANDLE DirectoryHandle,
PAGED_CODE();
/* Initialize lookup */
ObpInitializeDirectoryLookup(&LookupContext);
ObpInitializeLookupContext(&LookupContext);
/* Check if we need to do any probing */
if (PreviousMode != KernelMode)

View file

@ -1467,7 +1467,7 @@ ObpCreateHandle(IN OB_OPEN_REASON OpenReason,
if ((Type) && (ObjectType != Type))
{
/* They don't, cleanup */
if (Context) ObpCleanupDirectoryLookup(Context);
if (Context) ObpReleaseLookupContext(Context);
return STATUS_OBJECT_TYPE_MISMATCH;
}
@ -1508,7 +1508,7 @@ ObpCreateHandle(IN OB_OPEN_REASON OpenReason,
* We failed (meaning security failure, according to NT Internals)
* detach and return
*/
if (Context) ObpCleanupDirectoryLookup(Context);
if (Context) ObpReleaseLookupContext(Context);
if (AttachedToProcess) KeUnstackDetachProcess(&ApcState);
return Status;
}
@ -1545,7 +1545,7 @@ ObpCreateHandle(IN OB_OPEN_REASON OpenReason,
}
/* Now we can release the object */
if (Context) ObpCleanupDirectoryLookup(Context);
if (Context) ObpReleaseLookupContext(Context);
/* Save the access mask */
NewEntry.GrantedAccess = GrantedAccess;
@ -2417,11 +2417,11 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
if (!TempBuffer) return STATUS_INSUFFICIENT_RESOURCES;
/* Capture all the info */
Status = ObpCaptureObjectAttributes(ObjectAttributes,
AccessMode,
TRUE,
&TempBuffer->ObjectCreateInfo,
&ObjectName);
Status = ObpCaptureObjectCreateInformation(ObjectAttributes,
AccessMode,
TRUE,
&TempBuffer->ObjectCreateInfo,
&ObjectName);
if (!NT_SUCCESS(Status))
{
/* Fail */
@ -2467,7 +2467,7 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
if (!NT_SUCCESS(Status))
{
/* Cleanup after lookup */
ObpCleanupDirectoryLookup(&TempBuffer->LookupContext);
ObpReleaseLookupContext(&TempBuffer->LookupContext);
goto Cleanup;
}
@ -2482,7 +2482,7 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
if (ObjectHeader->ObjectCreateInfo)
{
/* Free it */
ObpFreeAndReleaseCapturedAttributes(ObjectHeader->
ObpFreeObjectCreateInformation(ObjectHeader->
ObjectCreateInfo);
ObjectHeader->ObjectCreateInfo = NULL;
}
@ -2501,7 +2501,7 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
Status = STATUS_INVALID_PARAMETER;
/* Cleanup after lookup */
ObpCleanupDirectoryLookup(&TempBuffer->LookupContext);
ObpReleaseLookupContext(&TempBuffer->LookupContext);
/* Dereference the object */
ObDereferenceObject(Object);
@ -2531,7 +2531,7 @@ Cleanup:
Quickie:
/* Release the object attributes and temporary buffer */
ObpReleaseCapturedAttributes(&TempBuffer->ObjectCreateInfo);
ObpReleaseObjectCreateInformation(&TempBuffer->ObjectCreateInfo);
if (ObjectName.Buffer) ObpFreeObjectNameBuffer(&ObjectName);
ExFreePool(TempBuffer);
@ -2813,7 +2813,7 @@ ObInsertObject(IN PVOID Object,
/* Get the create and name info, as well as the object type */
ObjectCreateInfo = ObjectHeader->ObjectCreateInfo;
ObjectNameInfo = ObpAcquireNameInformation(ObjectHeader);
ObjectNameInfo = ObpReferenceNameInfo(ObjectHeader);
ObjectType = ObjectHeader->Type;
ObjectName = NULL;
@ -2849,10 +2849,10 @@ ObInsertObject(IN PVOID Object,
Handle);
/* Free the create information */
ObpFreeAndReleaseCapturedAttributes(ObjectCreateInfo);
ObpFreeObjectCreateInformation(ObjectCreateInfo);
/* Release the object name information */
ObpReleaseNameInformation(ObjectNameInfo);
ObpDereferenceNameInfo(ObjectNameInfo);
/* Remove the extra keep-alive reference */
ObDereferenceObject(Object);
@ -2878,7 +2878,7 @@ ObInsertObject(IN PVOID Object,
if (!NT_SUCCESS(Status))
{
/* Fail */
ObpReleaseNameInformation(ObjectNameInfo);
ObpDereferenceNameInfo(ObjectNameInfo);
ObDereferenceObject(Object);
return Status;
}
@ -2892,13 +2892,13 @@ ObInsertObject(IN PVOID Object,
if (!NT_SUCCESS(Status))
{
/* Fail */
ObpReleaseNameInformation(ObjectNameInfo);
ObpDereferenceNameInfo(ObjectNameInfo);
ObDereferenceObject(Object);
return Status;
}
/* Setup a lookup context */
ObpInitializeDirectoryLookup(&Context);
ObpInitializeLookupContext(&Context);
InsertObject = Object;
OpenReason = ObCreateHandle;
@ -2959,10 +2959,10 @@ ObInsertObject(IN PVOID Object,
if (!NT_SUCCESS(Status))
{
/* Cleanup after lookup */
ObpCleanupDirectoryLookup(&Context);
ObpReleaseLookupContext(&Context);
/* Remove query reference that we added */
ObpReleaseNameInformation(ObjectNameInfo);
ObpDereferenceNameInfo(ObjectNameInfo);
/* Dereference the object and delete the access state */
ObDereferenceObject(Object);
@ -3038,10 +3038,10 @@ ObInsertObject(IN PVOID Object,
}
/* Cleanup the lookup */
ObpCleanupDirectoryLookup(&Context);
ObpReleaseLookupContext(&Context);
/* Remove query reference that we added */
ObpReleaseNameInformation(ObjectNameInfo);
ObpDereferenceNameInfo(ObjectNameInfo);
/* Dereference the object and delete the access state */
ObDereferenceObject(Object);
@ -3086,7 +3086,7 @@ ObInsertObject(IN PVOID Object,
}
/* Remove a query reference */
ObpReleaseNameInformation(ObjectNameInfo);
ObpDereferenceNameInfo(ObjectNameInfo);
/* Remove the extra keep-alive reference */
ObDereferenceObject(Object);
@ -3109,7 +3109,7 @@ ObInsertObject(IN PVOID Object,
}
/* We can delete the Create Info now */
ObpFreeAndReleaseCapturedAttributes(ObjectCreateInfo);
ObpFreeObjectCreateInformation(ObjectCreateInfo);
/* Check if we created our own access state and delete it if so */
if (AccessState == &LocalAccessState) SeDeleteAccessState(AccessState);

View file

@ -298,7 +298,7 @@ ObPostPhase0:
if (!NT_SUCCESS(Status)) return FALSE;
/* Initialize lookup context */
ObpInitializeDirectoryLookup(&Context);
ObpInitializeLookupContext(&Context);
/* Lock it */
ObpAcquireDirectoryLockExclusive(ObpTypeDirectoryObject, &Context);
@ -339,7 +339,7 @@ ObPostPhase0:
}
/* Cleanup after lookup */
ObpCleanupDirectoryLookup(&Context);
ObpReleaseLookupContext(&Context);
/* Initialize DOS Devices Directory and related Symbolic Links */
Status = ObpCreateDosDevicesDirectory();

View file

@ -80,7 +80,7 @@ ObpDeallocateObject(IN PVOID Object)
if (Header->ObjectCreateInfo)
{
/* Free it */
ObpFreeAndReleaseCapturedAttributes(Header->ObjectCreateInfo);
ObpFreeObjectCreateInformation(Header->ObjectCreateInfo);
Header->ObjectCreateInfo = NULL;
}
}
@ -311,7 +311,7 @@ ObpAllocateObjectNameBuffer(IN ULONG Length,
{
/* Allocate from the lookaside */
//MaximumLength = 248; <= hack, we should actually set this...!
Buffer = ObpAllocateCapturedAttributes(LookasideNameBufferList);
Buffer = ObpAllocateObjectCreateInfoBuffer(LookasideNameBufferList);
}
/* Setup the string */
@ -418,7 +418,7 @@ ObpCaptureObjectName(IN OUT PUNICODE_STRING CapturedName,
NTSTATUS
NTAPI
ObpCaptureObjectAttributes(IN POBJECT_ATTRIBUTES ObjectAttributes,
ObpCaptureObjectCreateInformation(IN POBJECT_ATTRIBUTES ObjectAttributes,
IN KPROCESSOR_MODE AccessMode,
IN BOOLEAN AllocateFromLookaside,
IN POBJECT_CREATE_INFORMATION ObjectCreateInfo,
@ -541,7 +541,7 @@ ObpCaptureObjectAttributes(IN POBJECT_ATTRIBUTES ObjectAttributes,
}
/* Cleanup if we failed */
if (!NT_SUCCESS(Status)) ObpReleaseCapturedAttributes(ObjectCreateInfo);
if (!NT_SUCCESS(Status)) ObpFreeObjectCreateInformation(ObjectCreateInfo);
/* Return status to caller */
return Status;
@ -916,15 +916,15 @@ ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL,
POBJECT_HEADER Header;
/* Allocate a capture buffer */
ObjectCreateInfo = ObpAllocateCapturedAttributes(LookasideCreateInfoList);
ObjectCreateInfo = ObpAllocateObjectCreateInfoBuffer(LookasideCreateInfoList);
if (!ObjectCreateInfo) return STATUS_INSUFFICIENT_RESOURCES;
/* Capture all the info */
Status = ObpCaptureObjectAttributes(ObjectAttributes,
ProbeMode,
FALSE,
ObjectCreateInfo,
&ObjectName);
Status = ObpCaptureObjectCreateInformation(ObjectAttributes,
ProbeMode,
FALSE,
ObjectCreateInfo,
&ObjectName);
if (NT_SUCCESS(Status))
{
/* Validate attributes */
@ -984,7 +984,7 @@ ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL,
}
/* Release the Capture Info, we don't need it */
ObpReleaseCapturedAttributes(ObjectCreateInfo);
ObpFreeObjectCreateInformation(ObjectCreateInfo);
if (ObjectName.Buffer) ObpFreeObjectNameBuffer(&ObjectName);
}
@ -1038,7 +1038,7 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
}
/* Setup a lookup context */
ObpInitializeDirectoryLookup(&Context);
ObpInitializeLookupContext(&Context);
/* Check if we've already created the directory of types */
if (ObpTypeDirectoryObject)
@ -1054,7 +1054,7 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
&Context))
{
/* We have already created it, so fail */
ObpCleanupDirectoryLookup(&Context);
ObpReleaseLookupContext(&Context);
return STATUS_OBJECT_NAME_COLLISION;
}
}
@ -1066,7 +1066,7 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
if (!ObjectName.Buffer)
{
/* Out of memory, fail */
ObpCleanupDirectoryLookup(&Context);
ObpReleaseLookupContext(&Context);
return STATUS_INSUFFICIENT_RESOURCES;
}
@ -1084,7 +1084,7 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
if (!NT_SUCCESS(Status))
{
/* Free the name and fail */
ObpCleanupDirectoryLookup(&Context);
ObpReleaseLookupContext(&Context);
ExFreePool(ObjectName.Buffer);
return Status;
}
@ -1224,7 +1224,7 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
}
/* Cleanup the lookup context */
ObpCleanupDirectoryLookup(&Context);
ObpReleaseLookupContext(&Context);
/* Return the object type and success */
*ObjectType = LocalObjectType;
@ -1232,7 +1232,7 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
}
/* If we got here, then we failed */
ObpCleanupDirectoryLookup(&Context);
ObpReleaseLookupContext(&Context);
return STATUS_INSUFFICIENT_RESOURCES;
}

View file

@ -179,7 +179,7 @@ ObpDeleteNameCheck(IN PVOID Object)
/* Get object structures */
ObjectHeader = OBJECT_TO_OBJECT_HEADER(Object);
ObjectNameInfo = ObpAcquireNameInformation(ObjectHeader);
ObjectNameInfo = ObpReferenceNameInfo(ObjectHeader);
ObjectType = ObjectHeader->Type;
/*
@ -193,7 +193,7 @@ ObpDeleteNameCheck(IN PVOID Object)
!(ObjectHeader->Flags & OB_FLAG_PERMANENT))
{
/* Setup a lookup context */
ObpInitializeDirectoryLookup(&Context);
ObpInitializeLookupContext(&Context);
/* Lock the directory */
ObpAcquireDirectoryLockExclusive(ObjectNameInfo->Directory, &Context);
@ -242,16 +242,16 @@ ObpDeleteNameCheck(IN PVOID Object)
}
/* Cleanup after lookup */
ObpCleanupDirectoryLookup(&Context);
ObpReleaseLookupContext(&Context);
/* Remove another query reference since we added one on top */
ObpReleaseNameInformation(ObjectNameInfo);
ObpDereferenceNameInfo(ObjectNameInfo);
/* Check if we were inserted in a directory */
if (Directory)
{
/* We were, so first remove the extra reference we had added */
ObpReleaseNameInformation(ObjectNameInfo);
ObpDereferenceNameInfo(ObjectNameInfo);
/* Now dereference the object as well */
ObDereferenceObject(Object);
@ -260,7 +260,7 @@ ObpDeleteNameCheck(IN PVOID Object)
else
{
/* Remove the reference we added */
ObpReleaseNameInformation(ObjectNameInfo);
ObpDereferenceNameInfo(ObjectNameInfo);
}
}
@ -300,7 +300,7 @@ ObpLookupObjectName(IN HANDLE RootHandle OPTIONAL,
InsertObject);
/* Initialize starting state */
ObpInitializeDirectoryLookup(LookupContext);
ObpInitializeLookupContext(LookupContext);
*FoundObject = NULL;
Status = STATUS_SUCCESS;
Object = NULL;
@ -755,7 +755,7 @@ ReparseObject:
InterlockedExchangeAdd(&ObjectHeader->PointerCount, 1);
/* Cleanup from the first lookup */
ObpCleanupDirectoryLookup(LookupContext);
ObpReleaseLookupContext(LookupContext);
/* Check if we have a referenced directory */
if (ReferencedDirectory)
@ -931,7 +931,7 @@ ReparseObject:
if (!NT_SUCCESS(Status))
{
/* Cleanup after lookup */
ObpCleanupDirectoryLookup(LookupContext);
ObpReleaseLookupContext(LookupContext);
}
/* Check if we have a device map and dereference it if so */

View file

@ -429,7 +429,7 @@ ObReferenceObjectByName(IN PUNICODE_STRING ObjectPath,
&Object);
/* Cleanup after lookup */
ObpCleanupDirectoryLookup(&Context);
ObpReleaseLookupContext(&Context);
/* Check if the lookup succeeded */
if (NT_SUCCESS(Status))