[NTOS:OB] Rename object types to their official names to satisfy WinDbg

- Rename ObDirectoryType to ObpDirectoryObjectType and remove it from NDK (this is not exported!)
- Rename ObSymbolicLinkType to ObpSymbolicLinkObjectType
- Remove duplicated ObpTypeObjectType from ob.h
This commit is contained in:
Timo Kreuzer 2018-02-13 21:33:04 +01:00
parent 65f9783808
commit 2c909db295
11 changed files with 29 additions and 30 deletions

View File

@ -601,8 +601,8 @@ extern ULONG ObpTraceLevel;
extern KEVENT ObpDefaultObject;
extern KGUARDED_MUTEX ObpDeviceMapLock;
extern POBJECT_TYPE ObpTypeObjectType;
extern POBJECT_TYPE ObSymbolicLinkType;
extern POBJECT_TYPE ObpTypeObjectType;
extern POBJECT_TYPE ObpDirectoryObjectType;
extern POBJECT_TYPE ObpSymbolicLinkObjectType;
extern POBJECT_DIRECTORY ObpRootDirectoryObject;
extern POBJECT_DIRECTORY ObpTypeDirectoryObject;
extern PHANDLE_TABLE ObpKernelHandleTable;

View File

@ -25,7 +25,7 @@ ObpCreateDeviceMap(IN HANDLE DirectoryHandle)
Status = ObReferenceObjectByHandle(DirectoryHandle,
DIRECTORY_TRAVERSE,
ObDirectoryType,
ObpDirectoryObjectType,
KeGetPreviousMode(),
(PVOID*)&DirectoryObject,
NULL);

View File

@ -18,7 +18,7 @@
#include <debug.h>
BOOLEAN ObpLUIDDeviceMapsEnabled;
POBJECT_TYPE ObDirectoryType = NULL;
POBJECT_TYPE ObpDirectoryObjectType = NULL;
/* PRIVATE FUNCTIONS ******************************************************/
@ -383,7 +383,7 @@ NtOpenDirectoryObject(OUT PHANDLE DirectoryHandle,
/* Open the directory object */
Status = ObOpenObjectByName(ObjectAttributes,
ObDirectoryType,
ObpDirectoryObjectType,
PreviousMode,
NULL,
DesiredAccess,
@ -520,7 +520,7 @@ NtQueryDirectoryObject(IN HANDLE DirectoryHandle,
/* Get a reference to directory */
Status = ObReferenceObjectByHandle(DirectoryHandle,
DIRECTORY_QUERY,
ObDirectoryType,
ObpDirectoryObjectType,
PreviousMode,
(PVOID*)&Directory,
NULL);
@ -756,7 +756,7 @@ NtCreateDirectoryObject(OUT PHANDLE DirectoryHandle,
/* Create the object */
Status = ObCreateObject(PreviousMode,
ObDirectoryType,
ObpDirectoryObjectType,
ObjectAttributes,
PreviousMode,
NULL,

View File

@ -3095,7 +3095,7 @@ ObInsertObject(IN PVOID Object,
{
/* Check if this was a symbolic link */
if (OBJECT_TO_OBJECT_HEADER(InsertObject)->Type ==
ObSymbolicLinkType)
ObpSymbolicLinkObjectType)
{
/* Dereference it */
ObDereferenceObject(InsertObject);
@ -3129,7 +3129,7 @@ ObInsertObject(IN PVOID Object,
else
{
/* Check if this is a symbolic link */
if (ObjectType == ObSymbolicLinkType)
if (ObjectType == ObpSymbolicLinkObjectType)
{
/* Create the internal name */
ObpCreateSymbolicLinkName(Object);

View File

@ -282,8 +282,8 @@ ObInitSystem(VOID)
ObjectTypeInitializer.GenericMapping = ObpDirectoryMapping;
ObjectTypeInitializer.DeleteProcedure = NULL;
ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(OBJECT_DIRECTORY);
ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &ObDirectoryType);
ObDirectoryType->TypeInfo.ValidAccessMask &= ~SYNCHRONIZE;
ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &ObpDirectoryObjectType);
ObpDirectoryObjectType->TypeInfo.ValidAccessMask &= ~SYNCHRONIZE;
/* Create 'symbolic link' object type */
RtlInitUnicodeString(&Name, L"SymbolicLink");
@ -292,8 +292,8 @@ ObInitSystem(VOID)
ObjectTypeInitializer.ValidAccessMask = SYMBOLIC_LINK_ALL_ACCESS;
ObjectTypeInitializer.ParseProcedure = ObpParseSymbolicLink;
ObjectTypeInitializer.DeleteProcedure = ObpDeleteSymbolicLink;
ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &ObSymbolicLinkType);
ObSymbolicLinkType->TypeInfo.ValidAccessMask &= ~SYNCHRONIZE;
ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &ObpSymbolicLinkObjectType);
ObpSymbolicLinkObjectType->TypeInfo.ValidAccessMask &= ~SYNCHRONIZE;
/* Phase 0 initialization complete */
ObpInitializationPhase++;
@ -321,7 +321,7 @@ ObPostPhase0:
/* Get a handle to it */
Status = ObReferenceObjectByHandle(Handle,
0,
ObDirectoryType,
ObpDirectoryObjectType,
KernelMode,
(PVOID*)&ObpRootDirectoryObject,
NULL);
@ -372,7 +372,7 @@ ObPostPhase0:
/* Get a handle to it */
Status = ObReferenceObjectByHandle(Handle,
0,
ObDirectoryType,
ObpDirectoryObjectType,
KernelMode,
(PVOID*)&ObpTypeDirectoryObject,
NULL);

View File

@ -1563,7 +1563,7 @@ NtQueryObject(IN HANDLE ObjectHandle,
BasicInfo->SecurityDescriptorSize = 0; /* FIXME*/
/* Check if this is a symlink */
if (ObjectHeader->Type == ObSymbolicLinkType)
if (ObjectHeader->Type == ObpSymbolicLinkObjectType)
{
/* Return the creation time */
BasicInfo->CreationTime.QuadPart =
@ -1798,7 +1798,7 @@ NtSetInformationObject(IN HANDLE ObjectHandle,
/* Get the object directory */
Status = ObReferenceObjectByHandle(ObjectHandle,
0,
ObDirectoryType,
ObpDirectoryObjectType,
PreviousMode,
(PVOID*)&Directory,
NULL);

View File

@ -15,7 +15,7 @@
/* GLOBALS ******************************************************************/
POBJECT_TYPE ObSymbolicLinkType = NULL;
POBJECT_TYPE ObpSymbolicLinkObjectType = NULL;
/* PRIVATE FUNCTIONS *********************************************************/
@ -150,12 +150,12 @@ ObpParseSymbolicLinkToIoDeviceObject(IN POBJECT_DIRECTORY SymbolicLinkDirectory,
if (! *Object)
break;
if (OBJECT_TO_OBJECT_HEADER(*Object)->Type == ObDirectoryType)
if (OBJECT_TO_OBJECT_HEADER(*Object)->Type == ObpDirectoryObjectType)
{
/* Make this current directory, and continue search */
*Directory = (POBJECT_DIRECTORY)*Object;
}
else if (OBJECT_TO_OBJECT_HEADER(*Object)->Type == ObSymbolicLinkType &&
else if (OBJECT_TO_OBJECT_HEADER(*Object)->Type == ObpSymbolicLinkObjectType &&
(((POBJECT_SYMBOLIC_LINK)*Object)->DosDeviceDriveIndex == 0))
{
/* Symlink points to another initialized symlink, ask caller to reparse */
@ -574,7 +574,7 @@ NtCreateSymbolicLinkObject(OUT PHANDLE LinkHandle,
/* Create the object */
Status = ObCreateObject(PreviousMode,
ObSymbolicLinkType,
ObpSymbolicLinkObjectType,
ObjectAttributes,
PreviousMode,
NULL,
@ -696,7 +696,7 @@ NtOpenSymbolicLinkObject(OUT PHANDLE LinkHandle,
/* Open the object */
Status = ObOpenObjectByName(ObjectAttributes,
ObSymbolicLinkType,
ObpSymbolicLinkObjectType,
PreviousMode,
NULL,
DesiredAccess,
@ -784,7 +784,7 @@ NtQuerySymbolicLinkObject(IN HANDLE LinkHandle,
/* Reference the object */
Status = ObReferenceObjectByHandle(LinkHandle,
SYMBOLIC_LINK_QUERY,
ObSymbolicLinkType,
ObpSymbolicLinkObjectType,
PreviousMode,
(PVOID *)&SymlinkObject,
NULL);

View File

@ -306,7 +306,7 @@ ObpDeleteNameCheck(IN PVOID Object)
ObpDeleteEntryDirectory(&Context);
/* Check if this is a symbolic link */
if (ObjectType == ObSymbolicLinkType)
if (ObjectType == ObpSymbolicLinkObjectType)
{
/* Remove internal name */
ObpDeleteSymbolicLinkName(Object);
@ -434,7 +434,7 @@ ObpLookupObjectName(IN HANDLE RootHandle OPTIONAL,
}
/* Don't parse a Directory */
if (ObjectHeader->Type != ObDirectoryType)
if (ObjectHeader->Type != ObpDirectoryObjectType)
{
/* Make sure the Object Type has a parse routine */
ParseRoutine = ObjectHeader->Type->TypeInfo.ParseProcedure;
@ -745,7 +745,7 @@ ParseFromRoot:
/* Check create access for the object */
if (!ObCheckCreateObjectAccess(Directory,
ObjectType == ObDirectoryType ?
ObjectType == ObpDirectoryObjectType ?
DIRECTORY_CREATE_SUBDIRECTORY :
DIRECTORY_CREATE_OBJECT,
AccessState,
@ -988,7 +988,7 @@ ReparseObject:
else
{
/* We still have a name; check if this is a directory object */
if (ObjectHeader->Type == ObDirectoryType)
if (ObjectHeader->Type == ObpDirectoryObjectType)
{
/* Check if we have a referenced parent directory */
if (ReferencedParentDirectory)

View File

@ -395,7 +395,7 @@ ObReferenceObjectByPointer(IN PVOID Object,
* NOTE: Unless it's a symbolic link (Caz Yokoyama [MSFT])
*/
if ((Header->Type != ObjectType) && ((AccessMode != KernelMode) ||
(ObjectType == ObSymbolicLinkType)))
(ObjectType == ObpSymbolicLinkObjectType)))
{
/* Invalid type */
return STATUS_OBJECT_TYPE_MISMATCH;

View File

@ -561,7 +561,7 @@ ObAssignSecurity(IN PACCESS_STATE AccessState,
Status = SeAssignSecurity(SecurityDescriptor,
AccessState->SecurityDescriptor,
&NewDescriptor,
(Type == ObDirectoryType),
(Type == ObpDirectoryObjectType),
&AccessState->SubjectSecurityContext,
&Type->TypeInfo.GenericMapping,
PagedPool);

View File

@ -544,7 +544,6 @@ typedef struct _OBJECT_SYMBOLIC_LINK
//
// Kernel Exports
//
extern POBJECT_TYPE NTSYSAPI ObDirectoryType;
extern PDEVICE_MAP NTSYSAPI ObSystemDeviceMap;
#endif // !NTOS_MODE_USER