mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 19:26:33 +00:00
- Remove ROS-internal object macros and use the public ones in obtypes.h instead.
svn path=/trunk/; revision=22045
This commit is contained in:
@@ -515,7 +515,7 @@ CmiObjectQueryName (PVOID ObjectBody,
|
||||
else
|
||||
{
|
||||
/* KeyObject is the root key */
|
||||
Status = ObQueryNameString (HEADER_TO_OBJECT_NAME(BODY_TO_HEADER(KeyObject))->Directory,
|
||||
Status = ObQueryNameString (OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(KeyObject))->Directory,
|
||||
ObjectNameInfo,
|
||||
Length,
|
||||
ReturnLength);
|
||||
|
||||
@@ -14,20 +14,6 @@
|
||||
GENERIC_EXECUTE | \
|
||||
GENERIC_ALL)
|
||||
|
||||
#define BODY_TO_HEADER(objbdy) \
|
||||
CONTAINING_RECORD((objbdy), OBJECT_HEADER, Body)
|
||||
|
||||
#define HEADER_TO_OBJECT_NAME(objhdr) ((POBJECT_HEADER_NAME_INFO) \
|
||||
(!(objhdr)->NameInfoOffset ? NULL: ((PCHAR)(objhdr) - (objhdr)->NameInfoOffset)))
|
||||
|
||||
#define HEADER_TO_HANDLE_INFO(objhdr) ((POBJECT_HEADER_HANDLE_INFO) \
|
||||
(!(objhdr)->HandleInfoOffset ? NULL: ((PCHAR)(objhdr) - (objhdr)->HandleInfoOffset)))
|
||||
|
||||
#define HEADER_TO_CREATOR_INFO(objhdr) ((POBJECT_HEADER_CREATOR_INFO) \
|
||||
(!((objhdr)->Flags & OB_FLAG_CREATOR_INFO) ? NULL: ((PCHAR)(objhdr) - sizeof(OBJECT_HEADER_CREATOR_INFO))))
|
||||
|
||||
#define OBJECT_ALLOC_SIZE(ObjectSize) ((ObjectSize)+sizeof(OBJECT_HEADER))
|
||||
|
||||
#define KERNEL_HANDLE_FLAG (1 << ((sizeof(HANDLE) * 8) - 1))
|
||||
#define ObIsKernelHandle(Handle, ProcessorMode) \
|
||||
(((ULONG_PTR)(Handle) & KERNEL_HANDLE_FLAG) && \
|
||||
@@ -45,14 +31,6 @@ extern POBJECT_DIRECTORY NameSpaceRoot;
|
||||
extern POBJECT_DIRECTORY ObpTypeDirectoryObject;
|
||||
extern PHANDLE_TABLE ObpKernelHandleTable;
|
||||
|
||||
typedef NTSTATUS
|
||||
(NTAPI *OB_ROS_CREATE_METHOD)(
|
||||
PVOID ObjectBody,
|
||||
PVOID Parent,
|
||||
PWSTR RemainingPath,
|
||||
struct _OBJECT_ATTRIBUTES* ObjectAttributes
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
ObpDeleteEntryDirectory(POBP_LOOKUP_CONTEXT Context);
|
||||
|
||||
@@ -63,14 +63,14 @@ IopCreateFile(PVOID ObjectBody,
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
ParentObjectType = BODY_TO_HEADER(Parent)->Type;
|
||||
ParentObjectType = OBJECT_TO_OBJECT_HEADER(Parent)->Type;
|
||||
|
||||
if (ParentObjectType != IoDeviceObjectType &&
|
||||
ParentObjectType != IoFileObjectType)
|
||||
{
|
||||
DPRINT("Parent [%wZ] is a %S which is neither a file type nor a device type ; remaining path = %S\n",
|
||||
&HEADER_TO_OBJECT_NAME(BODY_TO_HEADER(Parent))->Name,
|
||||
BODY_TO_HEADER(Parent)->Type->Name.Buffer,
|
||||
&OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(Parent))->Name,
|
||||
OBJECT_TO_OBJECT_HEADER(Parent)->Type->Name.Buffer,
|
||||
RemainingPath);
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
@@ -954,7 +954,7 @@ IoCreateFile(OUT PHANDLE FileHandle,
|
||||
{
|
||||
return Status;
|
||||
}
|
||||
if (BODY_TO_HEADER(DeviceObject)->Type != IoDeviceObjectType)
|
||||
if (OBJECT_TO_OBJECT_HEADER(DeviceObject)->Type != IoDeviceObjectType)
|
||||
{
|
||||
ObDereferenceObject (DeviceObject);
|
||||
return STATUS_OBJECT_NAME_COLLISION;
|
||||
@@ -1022,7 +1022,7 @@ IoCreateFile(OUT PHANDLE FileHandle,
|
||||
}
|
||||
}
|
||||
RtlMapGenericMask(&DesiredAccess,
|
||||
&BODY_TO_HEADER(FileObject)->Type->TypeInfo.GenericMapping);
|
||||
&OBJECT_TO_OBJECT_HEADER(FileObject)->Type->TypeInfo.GenericMapping);
|
||||
|
||||
Status = ObInsertObject ((PVOID)FileObject,
|
||||
NULL,
|
||||
|
||||
@@ -64,7 +64,7 @@ ObpInsertEntryDirectory(IN POBJECT_DIRECTORY Parent,
|
||||
NewEntry->HashValue = Context->HashValue;
|
||||
|
||||
/* Get the Object Name Information */
|
||||
HeaderNameInfo = HEADER_TO_OBJECT_NAME(ObjectHeader);
|
||||
HeaderNameInfo = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader);
|
||||
|
||||
/* Get the Allocated entry */
|
||||
AllocatedEntry = &Parent->HashBuckets[Context->HashIndex];
|
||||
@@ -184,10 +184,10 @@ ObpLookupEntryDirectory(IN POBJECT_DIRECTORY Directory,
|
||||
if (CurrentEntry->HashValue == HashValue)
|
||||
{
|
||||
/* Make sure that it has a name */
|
||||
ASSERT(BODY_TO_HEADER(CurrentEntry->Object)->NameInfoOffset != 0);
|
||||
ASSERT(OBJECT_TO_OBJECT_HEADER(CurrentEntry->Object)->NameInfoOffset != 0);
|
||||
|
||||
/* Get the name information */
|
||||
HeaderNameInfo = HEADER_TO_OBJECT_NAME(BODY_TO_HEADER(CurrentEntry->Object));
|
||||
HeaderNameInfo = OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(CurrentEntry->Object));
|
||||
|
||||
/* Do the names match? */
|
||||
if ((Name->Length == HeaderNameInfo->Name.Length) &&
|
||||
|
||||
@@ -45,7 +45,7 @@ ObpSetPermanentObject(IN PVOID ObjectBody,
|
||||
POBJECT_HEADER ObjectHeader;
|
||||
OBP_LOOKUP_CONTEXT Context;
|
||||
|
||||
ObjectHeader = BODY_TO_HEADER(ObjectBody);
|
||||
ObjectHeader = OBJECT_TO_OBJECT_HEADER(ObjectBody);
|
||||
ASSERT (ObjectHeader->PointerCount > 0);
|
||||
if (Permanent)
|
||||
{
|
||||
@@ -55,13 +55,13 @@ ObpSetPermanentObject(IN PVOID ObjectBody,
|
||||
{
|
||||
ObjectHeader->Flags &= ~OB_FLAG_PERMANENT;
|
||||
if (ObjectHeader->HandleCount == 0 &&
|
||||
HEADER_TO_OBJECT_NAME(ObjectHeader)->Directory)
|
||||
OBJECT_HEADER_TO_NAME_INFO(ObjectHeader)->Directory)
|
||||
{
|
||||
/* Make sure it's still inserted */
|
||||
Context.Directory = HEADER_TO_OBJECT_NAME(ObjectHeader)->Directory;
|
||||
Context.Directory = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader)->Directory;
|
||||
Context.DirectoryLocked = TRUE;
|
||||
if (ObpLookupEntryDirectory(HEADER_TO_OBJECT_NAME(ObjectHeader)->Directory,
|
||||
&HEADER_TO_OBJECT_NAME(ObjectHeader)->Name,
|
||||
if (ObpLookupEntryDirectory(OBJECT_HEADER_TO_NAME_INFO(ObjectHeader)->Directory,
|
||||
&OBJECT_HEADER_TO_NAME_INFO(ObjectHeader)->Name,
|
||||
0,
|
||||
FALSE,
|
||||
&Context))
|
||||
@@ -111,12 +111,12 @@ ObpGetNextHandleByProcessCount(PSYSTEM_HANDLE_TABLE_ENTRY_INFO pshi,
|
||||
static VOID
|
||||
ObpDecrementHandleCount(PVOID ObjectBody)
|
||||
{
|
||||
POBJECT_HEADER ObjectHeader = BODY_TO_HEADER(ObjectBody);
|
||||
POBJECT_HEADER ObjectHeader = OBJECT_TO_OBJECT_HEADER(ObjectBody);
|
||||
LONG NewHandleCount = InterlockedDecrement(&ObjectHeader->HandleCount);
|
||||
OBP_LOOKUP_CONTEXT Context;
|
||||
DPRINT("Header: %x\n", ObjectHeader);
|
||||
DPRINT("NewHandleCount: %x\n", NewHandleCount);
|
||||
DPRINT("HEADER_TO_OBJECT_NAME: %x\n", HEADER_TO_OBJECT_NAME(ObjectHeader));
|
||||
DPRINT("OBJECT_HEADER_TO_NAME_INFO: %x\n", OBJECT_HEADER_TO_NAME_INFO(ObjectHeader));
|
||||
|
||||
if ((ObjectHeader->Type != NULL) &&
|
||||
(ObjectHeader->Type->TypeInfo.CloseProcedure != NULL))
|
||||
@@ -128,8 +128,8 @@ ObpDecrementHandleCount(PVOID ObjectBody)
|
||||
|
||||
if(NewHandleCount == 0)
|
||||
{
|
||||
if(HEADER_TO_OBJECT_NAME(ObjectHeader) &&
|
||||
HEADER_TO_OBJECT_NAME(ObjectHeader)->Directory != NULL &&
|
||||
if(OBJECT_HEADER_TO_NAME_INFO(ObjectHeader) &&
|
||||
OBJECT_HEADER_TO_NAME_INFO(ObjectHeader)->Directory != NULL &&
|
||||
!(ObjectHeader->Flags & OB_FLAG_PERMANENT))
|
||||
{
|
||||
/* delete the object from the namespace when the last handle got closed.
|
||||
@@ -137,10 +137,10 @@ ObpDecrementHandleCount(PVOID ObjectBody)
|
||||
if it's not a permanent object. */
|
||||
|
||||
/* Make sure it's still inserted */
|
||||
Context.Directory = HEADER_TO_OBJECT_NAME(ObjectHeader)->Directory;
|
||||
Context.Directory = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader)->Directory;
|
||||
Context.DirectoryLocked = TRUE;
|
||||
if (ObpLookupEntryDirectory(HEADER_TO_OBJECT_NAME(ObjectHeader)->Directory,
|
||||
&HEADER_TO_OBJECT_NAME(ObjectHeader)->Name,
|
||||
if (ObpLookupEntryDirectory(OBJECT_HEADER_TO_NAME_INFO(ObjectHeader)->Directory,
|
||||
&OBJECT_HEADER_TO_NAME_INFO(ObjectHeader)->Name,
|
||||
0,
|
||||
FALSE,
|
||||
&Context))
|
||||
@@ -599,7 +599,7 @@ ObpCreateHandle(PVOID ObjectBody,
|
||||
|
||||
CurrentProcess = PsGetCurrentProcess();
|
||||
|
||||
ObjectHeader = BODY_TO_HEADER(ObjectBody);
|
||||
ObjectHeader = OBJECT_TO_OBJECT_HEADER(ObjectBody);
|
||||
|
||||
/* check that this is a valid kernel pointer */
|
||||
ASSERT((ULONG_PTR)ObjectHeader & EX_HANDLE_ENTRY_LOCKED);
|
||||
@@ -739,7 +739,7 @@ ObGetObjectHandleCount(PVOID Object)
|
||||
PAGED_CODE();
|
||||
|
||||
ASSERT(Object);
|
||||
Header = BODY_TO_HEADER(Object);
|
||||
Header = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
|
||||
return Header->HandleCount;
|
||||
}
|
||||
@@ -935,9 +935,9 @@ ObInsertObject(IN PVOID Object,
|
||||
PAGED_CODE();
|
||||
|
||||
/* Get the Header and Create Info */
|
||||
Header = BODY_TO_HEADER(Object);
|
||||
Header = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
ObjectCreateInfo = Header->ObjectCreateInfo;
|
||||
ObjectNameInfo = HEADER_TO_OBJECT_NAME(Header);
|
||||
ObjectNameInfo = OBJECT_HEADER_TO_NAME_INFO(Header);
|
||||
|
||||
/* First try to find the Object */
|
||||
if (ObjectNameInfo && ObjectNameInfo->Name.Buffer)
|
||||
@@ -961,7 +961,7 @@ ObInsertObject(IN PVOID Object,
|
||||
if (FoundObject)
|
||||
{
|
||||
DPRINT("Getting header: %x\n", FoundObject);
|
||||
FoundHeader = BODY_TO_HEADER(FoundObject);
|
||||
FoundHeader = OBJECT_TO_OBJECT_HEADER(FoundObject);
|
||||
}
|
||||
|
||||
if (FoundHeader && RemainingPath.Buffer == NULL)
|
||||
@@ -986,7 +986,7 @@ ObInsertObject(IN PVOID Object,
|
||||
PWSTR BufferPos = RemainingPath.Buffer;
|
||||
ULONG Delta = 0;
|
||||
|
||||
ObjectNameInfo = HEADER_TO_OBJECT_NAME(Header);
|
||||
ObjectNameInfo = OBJECT_HEADER_TO_NAME_INFO(Header);
|
||||
|
||||
if (BufferPos[0] == L'\\')
|
||||
{
|
||||
|
||||
@@ -147,20 +147,20 @@ ObInit(VOID)
|
||||
Context.Directory = ObpTypeDirectoryObject;
|
||||
Context.DirectoryLocked = TRUE;
|
||||
if (!ObpLookupEntryDirectory(ObpTypeDirectoryObject,
|
||||
&HEADER_TO_OBJECT_NAME(BODY_TO_HEADER(ObTypeObjectType))->Name,
|
||||
&OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(ObTypeObjectType))->Name,
|
||||
OBJ_CASE_INSENSITIVE,
|
||||
FALSE,
|
||||
&Context))
|
||||
{
|
||||
ObpInsertEntryDirectory(ObpTypeDirectoryObject, &Context, BODY_TO_HEADER(ObTypeObjectType));
|
||||
ObpInsertEntryDirectory(ObpTypeDirectoryObject, &Context, OBJECT_TO_OBJECT_HEADER(ObTypeObjectType));
|
||||
}
|
||||
if (!ObpLookupEntryDirectory(ObpTypeDirectoryObject,
|
||||
&HEADER_TO_OBJECT_NAME(BODY_TO_HEADER(ObDirectoryType))->Name,
|
||||
&OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(ObDirectoryType))->Name,
|
||||
OBJ_CASE_INSENSITIVE,
|
||||
FALSE,
|
||||
&Context))
|
||||
{
|
||||
ObpInsertEntryDirectory(ObpTypeDirectoryObject, &Context, BODY_TO_HEADER(ObDirectoryType));
|
||||
ObpInsertEntryDirectory(ObpTypeDirectoryObject, &Context, OBJECT_TO_OBJECT_HEADER(ObDirectoryType));
|
||||
}
|
||||
|
||||
/* Create 'symbolic link' object type */
|
||||
|
||||
@@ -56,11 +56,11 @@ ObpDeleteObject(POBJECT_HEADER Header)
|
||||
ObpRemoveSecurityDescriptor(Header->SecurityDescriptor);
|
||||
}
|
||||
|
||||
if (HEADER_TO_OBJECT_NAME(Header))
|
||||
if (OBJECT_HEADER_TO_NAME_INFO(Header))
|
||||
{
|
||||
if(HEADER_TO_OBJECT_NAME(Header)->Name.Buffer)
|
||||
if(OBJECT_HEADER_TO_NAME_INFO(Header)->Name.Buffer)
|
||||
{
|
||||
ExFreePool(HEADER_TO_OBJECT_NAME(Header)->Name.Buffer);
|
||||
ExFreePool(OBJECT_HEADER_TO_NAME_INFO(Header)->Name.Buffer);
|
||||
}
|
||||
}
|
||||
if (Header->ObjectCreateInfo)
|
||||
@@ -70,15 +70,15 @@ ObpDeleteObject(POBJECT_HEADER Header)
|
||||
}
|
||||
|
||||
/* To find the header, walk backwards from how we allocated */
|
||||
if ((CreatorInfo = HEADER_TO_CREATOR_INFO(Header)))
|
||||
if ((CreatorInfo = OBJECT_HEADER_TO_CREATOR_INFO(Header)))
|
||||
{
|
||||
HeaderLocation = CreatorInfo;
|
||||
}
|
||||
if ((NameInfo = HEADER_TO_OBJECT_NAME(Header)))
|
||||
if ((NameInfo = OBJECT_HEADER_TO_NAME_INFO(Header)))
|
||||
{
|
||||
HeaderLocation = NameInfo;
|
||||
}
|
||||
if ((HandleInfo = HEADER_TO_HANDLE_INFO(Header)))
|
||||
if ((HandleInfo = OBJECT_HEADER_TO_HANDLE_INFO(Header)))
|
||||
{
|
||||
HeaderLocation = HandleInfo;
|
||||
}
|
||||
@@ -557,7 +557,7 @@ ObpCreateTypeObject(POBJECT_TYPE_INITIALIZER ObjectTypeInitializer,
|
||||
Status = ObpAllocateObject(NULL,
|
||||
TypeName,
|
||||
ObTypeObjectType,
|
||||
OBJECT_ALLOC_SIZE(sizeof(OBJECT_TYPE)),
|
||||
sizeof(OBJECT_TYPE) + sizeof(OBJECT_HEADER),
|
||||
(POBJECT_HEADER*)&Header);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
@@ -686,10 +686,10 @@ ObCreateObject(IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
|
||||
POBJECT_CREATE_INFORMATION ObjectCreateInfo;
|
||||
UNICODE_STRING ObjectName;
|
||||
POBJECT_HEADER Header;
|
||||
|
||||
|
||||
DPRINT("ObCreateObject(Type %p ObjectAttributes %p, Object %p)\n",
|
||||
Type, ObjectAttributes, Object);
|
||||
|
||||
|
||||
/* Allocate a Buffer for the Object Create Info */
|
||||
DPRINT("Allocating Create Buffer\n");
|
||||
ObjectCreateInfo = ExAllocatePoolWithTag(NonPagedPool,
|
||||
@@ -703,17 +703,16 @@ ObCreateObject(IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
|
||||
Type,
|
||||
ObjectCreateInfo,
|
||||
&ObjectName);
|
||||
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
/* Allocate the Object */
|
||||
DPRINT("Allocating: %wZ\n", &ObjectName);
|
||||
Status = ObpAllocateObject(ObjectCreateInfo,
|
||||
&ObjectName,
|
||||
Type,
|
||||
OBJECT_ALLOC_SIZE(ObjectSize),
|
||||
Type,
|
||||
ObjectSize + sizeof(OBJECT_HEADER),
|
||||
&Header);
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
/* Return the Object */
|
||||
@@ -723,13 +722,13 @@ ObCreateObject(IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
|
||||
/* Return to caller, leave the Capture Info Alive for ObInsert */
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/* Release the Capture Info, we don't need it */
|
||||
DPRINT1("Allocation failed\n");
|
||||
ObpReleaseCapturedAttributes(ObjectCreateInfo);
|
||||
if (ObjectName.Buffer) ExFreePool(ObjectName.Buffer);
|
||||
}
|
||||
|
||||
|
||||
/* We failed, so release the Buffer */
|
||||
DPRINT1("Capture failed\n");
|
||||
ExFreePool(ObjectCreateInfo);
|
||||
@@ -785,7 +784,7 @@ NtQueryObject(IN HANDLE ObjectHandle,
|
||||
&HandleInfo);
|
||||
if (!NT_SUCCESS (Status)) return Status;
|
||||
|
||||
ObjectHeader = BODY_TO_HEADER(Object);
|
||||
ObjectHeader = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
|
||||
switch (ObjectInformationClass)
|
||||
{
|
||||
|
||||
@@ -110,7 +110,7 @@ ObFindObject(POBJECT_CREATE_INFORMATION ObjectCreateInfo,
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
CurrentHeader = BODY_TO_HEADER(CurrentObject);
|
||||
CurrentHeader = OBJECT_TO_OBJECT_HEADER(CurrentObject);
|
||||
|
||||
/* Loop as long as we're dealing with a directory */
|
||||
while (CurrentHeader->Type == ObDirectoryType)
|
||||
@@ -164,7 +164,7 @@ Next:
|
||||
}
|
||||
ObDereferenceObject(CurrentObject);
|
||||
CurrentObject = NextObject;
|
||||
CurrentHeader = BODY_TO_HEADER(CurrentObject);
|
||||
CurrentHeader = OBJECT_TO_OBJECT_HEADER(CurrentObject);
|
||||
}
|
||||
|
||||
if (CurrentHeader->Type->TypeInfo.ParseProcedure == NULL)
|
||||
@@ -236,8 +236,8 @@ ObQueryNameString(IN PVOID Object,
|
||||
DPRINT("ObQueryNameString: %x, %x\n", Object, ObjectNameInfo);
|
||||
|
||||
/* Get the Kernel Meta-Structures */
|
||||
ObjectHeader = BODY_TO_HEADER(Object);
|
||||
LocalInfo = HEADER_TO_OBJECT_NAME(ObjectHeader);
|
||||
ObjectHeader = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
LocalInfo = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader);
|
||||
|
||||
/* Check if a Query Name Procedure is available */
|
||||
if (ObjectHeader->Type->TypeInfo.QueryNameProcedure)
|
||||
@@ -299,7 +299,7 @@ ObQueryNameString(IN PVOID Object,
|
||||
while ((ParentDirectory != NameSpaceRoot) && (ParentDirectory))
|
||||
{
|
||||
/* Get the Name Information */
|
||||
LocalInfo = HEADER_TO_OBJECT_NAME(BODY_TO_HEADER(ParentDirectory));
|
||||
LocalInfo = OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(ParentDirectory));
|
||||
|
||||
/* Add the size of the Directory Name */
|
||||
if (LocalInfo && LocalInfo->Directory)
|
||||
@@ -336,7 +336,7 @@ ObQueryNameString(IN PVOID Object,
|
||||
* it's easier to start off from the Name we have and walk up the
|
||||
* parent directories. We use the same logic as Name Length calculation.
|
||||
*/
|
||||
LocalInfo = HEADER_TO_OBJECT_NAME(ObjectHeader);
|
||||
LocalInfo = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader);
|
||||
ObjectName = (PWCH)((ULONG_PTR)ObjectNameInfo + *ReturnLength);
|
||||
*--ObjectName = UNICODE_NULL;
|
||||
|
||||
@@ -362,7 +362,7 @@ ObQueryNameString(IN PVOID Object,
|
||||
while ((ParentDirectory != NameSpaceRoot) && (ParentDirectory))
|
||||
{
|
||||
/* Get the name information */
|
||||
LocalInfo = HEADER_TO_OBJECT_NAME(BODY_TO_HEADER(ParentDirectory));
|
||||
LocalInfo = OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(ParentDirectory));
|
||||
|
||||
/* Add the "\" */
|
||||
*(--ObjectName) = OBJ_NAME_PATH_SEPARATOR;
|
||||
|
||||
@@ -77,7 +77,7 @@ ObGetObjectPointerCount(PVOID Object)
|
||||
PAGED_CODE();
|
||||
|
||||
ASSERT(Object);
|
||||
Header = BODY_TO_HEADER(Object);
|
||||
Header = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
|
||||
return Header->PointerCount;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ ObfReferenceObject(IN PVOID Object)
|
||||
|
||||
ASSERT(Object);
|
||||
|
||||
Header = BODY_TO_HEADER(Object);
|
||||
Header = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
|
||||
/* No one should be referencing an object once we are deleting it. */
|
||||
if (InterlockedIncrement(&Header->PointerCount) == 1 && !(Header->Flags & OB_FLAG_PERMANENT))
|
||||
@@ -110,7 +110,7 @@ ObfDereferenceObject(IN PVOID Object)
|
||||
ASSERT(Object);
|
||||
|
||||
/* Extract the object header. */
|
||||
Header = BODY_TO_HEADER(Object);
|
||||
Header = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
Permanent = Header->Flags & OB_FLAG_PERMANENT;
|
||||
|
||||
/*
|
||||
@@ -142,16 +142,16 @@ ObReferenceObjectByPointer(IN PVOID Object,
|
||||
DPRINT("ObReferenceObjectByPointer(Object %x, ObjectType %x)\n",
|
||||
Object,ObjectType);
|
||||
|
||||
Header = BODY_TO_HEADER(Object);
|
||||
Header = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
|
||||
if (ObjectType != NULL && Header->Type != ObjectType)
|
||||
{
|
||||
DPRINT("Failed %p (type was %x %wZ) should be %x %wZ\n",
|
||||
Header,
|
||||
Header->Type,
|
||||
&HEADER_TO_OBJECT_NAME(BODY_TO_HEADER(Header->Type))->Name,
|
||||
&OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(Header->Type))->Name,
|
||||
ObjectType,
|
||||
&HEADER_TO_OBJECT_NAME(BODY_TO_HEADER(ObjectType))->Name);
|
||||
&OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(ObjectType))->Name);
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
if (Header->Type == PsProcessType)
|
||||
@@ -409,7 +409,7 @@ ObReferenceObjectByHandle(HANDLE Handle,
|
||||
if (DesiredAccess & GENERIC_ACCESS)
|
||||
{
|
||||
RtlMapGenericMask(&DesiredAccess,
|
||||
&BODY_TO_HEADER(ObjectBody)->Type->TypeInfo.GenericMapping);
|
||||
&OBJECT_TO_OBJECT_HEADER(ObjectBody)->Type->TypeInfo.GenericMapping);
|
||||
}
|
||||
|
||||
GrantedAccess = HandleEntry->GrantedAccess;
|
||||
|
||||
@@ -105,7 +105,7 @@ ObGetObjectSecurity(IN PVOID Object,
|
||||
NTSTATUS Status;
|
||||
PAGED_CODE();
|
||||
|
||||
Header = BODY_TO_HEADER(Object);
|
||||
Header = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
if (Header->Type == NULL) return STATUS_UNSUCCESSFUL;
|
||||
|
||||
if (Header->Type->TypeInfo.SecurityProcedure == NULL)
|
||||
@@ -267,7 +267,7 @@ NtQuerySecurityObject(IN HANDLE Handle,
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
Header = BODY_TO_HEADER(Object);
|
||||
Header = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
ASSERT(Header->Type != NULL);
|
||||
|
||||
Status = Header->Type->TypeInfo.SecurityProcedure(
|
||||
@@ -376,7 +376,7 @@ NtSetSecurityObject(IN HANDLE Handle,
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
Header = BODY_TO_HEADER(Object);
|
||||
Header = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
ASSERT(Header->Type != NULL);
|
||||
|
||||
Status = Header->Type->TypeInfo.SecurityProcedure(
|
||||
|
||||
@@ -335,7 +335,7 @@ NtWaitForSingleObject(IN HANDLE ObjectHandle,
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
/* Get the Waitable Object */
|
||||
WaitableObject = BODY_TO_HEADER(Object)->Type->DefaultObject;
|
||||
WaitableObject = OBJECT_TO_OBJECT_HEADER(Object)->Type->DefaultObject;
|
||||
|
||||
/* Is it an offset for internal objects? */
|
||||
if (IsPointerOffset(WaitableObject))
|
||||
@@ -452,7 +452,7 @@ NtSignalAndWaitForSingleObject(IN HANDLE ObjectHandleToSignal,
|
||||
}
|
||||
|
||||
/* Get the real waitable object */
|
||||
WaitableObject = BODY_TO_HEADER(WaitObj)->Type->DefaultObject;
|
||||
WaitableObject = OBJECT_TO_OBJECT_HEADER(WaitObj)->Type->DefaultObject;
|
||||
|
||||
/* Handle internal offset */
|
||||
if (IsPointerOffset(WaitableObject))
|
||||
@@ -463,7 +463,7 @@ NtSignalAndWaitForSingleObject(IN HANDLE ObjectHandleToSignal,
|
||||
}
|
||||
|
||||
/* Check Signal Object Type */
|
||||
Type = BODY_TO_HEADER(WaitObj)->Type;
|
||||
Type = OBJECT_TO_OBJECT_HEADER(WaitObj)->Type;
|
||||
if (Type == ExEventObjectType)
|
||||
{
|
||||
/* Set the Event */
|
||||
|
||||
@@ -212,7 +212,7 @@ SeDefaultObjectMethod(PVOID Object,
|
||||
PISECURITY_DESCRIPTOR ObjectSd;
|
||||
PISECURITY_DESCRIPTOR NewSd;
|
||||
PISECURITY_DESCRIPTOR SecurityDescriptor = _SecurityDescriptor;
|
||||
POBJECT_HEADER Header = BODY_TO_HEADER(Object);
|
||||
POBJECT_HEADER Header = OBJECT_TO_OBJECT_HEADER(Object);
|
||||
PSID Owner = 0;
|
||||
PSID Group = 0;
|
||||
PACL Dacl = 0;
|
||||
|
||||
Reference in New Issue
Block a user