From f55069122291fc94616378fb3df0a228ac2d97f9 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Wed, 18 Jun 2008 12:28:29 +0000 Subject: [PATCH] - Rename made-up Ob functions names to match publicly available NT names, as most of other Ob names do. svn path=/trunk/; revision=34009 --- reactos/ntoskrnl/include/internal/io.h | 2 +- reactos/ntoskrnl/include/internal/ob.h | 2 +- reactos/ntoskrnl/include/internal/ob_x.h | 18 ++++----- reactos/ntoskrnl/ob/obdir.c | 6 +-- reactos/ntoskrnl/ob/obhandle.c | 48 ++++++++++++------------ reactos/ntoskrnl/ob/obinit.c | 4 +- reactos/ntoskrnl/ob/oblife.c | 34 ++++++++--------- reactos/ntoskrnl/ob/obname.c | 18 ++++----- reactos/ntoskrnl/ob/obref.c | 2 +- 9 files changed, 67 insertions(+), 67 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h index b7afeac0ce8..1f096b4682c 100644 --- a/reactos/ntoskrnl/include/internal/io.h +++ b/reactos/ntoskrnl/include/internal/io.h @@ -66,7 +66,7 @@ // We can call the Ob Inlined API, it's the same thing // #define IopAllocateMdlFromLookaside \ - ObpAllocateCapturedAttributes + ObpAllocateObjectCreateInfoBuffer #define IopFreeMdlFromLookaside \ ObpFreeCapturedAttributes diff --git a/reactos/ntoskrnl/include/internal/ob.h b/reactos/ntoskrnl/include/internal/ob.h index 98b8ad2e00e..20890c0e4a6 100644 --- a/reactos/ntoskrnl/include/internal/ob.h +++ b/reactos/ntoskrnl/include/internal/ob.h @@ -562,7 +562,7 @@ ObpCaptureObjectName( NTSTATUS NTAPI -ObpCaptureObjectAttributes( +ObpCaptureObjectCreateInformation( IN POBJECT_ATTRIBUTES ObjectAttributes, IN KPROCESSOR_MODE AccessMode, IN BOOLEAN AllocateFromLookaside, diff --git a/reactos/ntoskrnl/include/internal/ob_x.h b/reactos/ntoskrnl/include/internal/ob_x.h index addd73b3335..91c385e4be0 100644 --- a/reactos/ntoskrnl/include/internal/ob_x.h +++ b/reactos/ntoskrnl/include/internal/ob_x.h @@ -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); } diff --git a/reactos/ntoskrnl/ob/obdir.c b/reactos/ntoskrnl/ob/obdir.c index 882a439a62c..1b7f1b3ff12 100644 --- a/reactos/ntoskrnl/ob/obdir.c +++ b/reactos/ntoskrnl/ob/obdir.c @@ -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) diff --git a/reactos/ntoskrnl/ob/obhandle.c b/reactos/ntoskrnl/ob/obhandle.c index d7e8aeb74ad..5068dd98579 100644 --- a/reactos/ntoskrnl/ob/obhandle.c +++ b/reactos/ntoskrnl/ob/obhandle.c @@ -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); diff --git a/reactos/ntoskrnl/ob/obinit.c b/reactos/ntoskrnl/ob/obinit.c index f6673c85e6b..1cf18b051f6 100644 --- a/reactos/ntoskrnl/ob/obinit.c +++ b/reactos/ntoskrnl/ob/obinit.c @@ -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(); diff --git a/reactos/ntoskrnl/ob/oblife.c b/reactos/ntoskrnl/ob/oblife.c index 063dbbc827d..887a3fdccf9 100644 --- a/reactos/ntoskrnl/ob/oblife.c +++ b/reactos/ntoskrnl/ob/oblife.c @@ -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; } diff --git a/reactos/ntoskrnl/ob/obname.c b/reactos/ntoskrnl/ob/obname.c index 20276657440..513032127e2 100644 --- a/reactos/ntoskrnl/ob/obname.c +++ b/reactos/ntoskrnl/ob/obname.c @@ -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 */ diff --git a/reactos/ntoskrnl/ob/obref.c b/reactos/ntoskrnl/ob/obref.c index e19a50539fd..0ebb04b5fbd 100644 --- a/reactos/ntoskrnl/ob/obref.c +++ b/reactos/ntoskrnl/ob/obref.c @@ -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))