[NTOS:OB] Rename object types to their official names to satisfy WinDbg
[reactos.git] / ntoskrnl / include / internal / ob.h
index 3c8ad1e..e6f9c56 100644 (file)
@@ -1,7 +1,7 @@
 /*
 * PROJECT:         ReactOS Kernel
 * LICENSE:         GPL - See COPYING in the top level directory
-* FILE:            ntoskrnl/include/ob.h
+* FILE:            ntoskrnl/include/internal/ob.h
 * PURPOSE:         Internal header for the Object Manager
 * PROGRAMMERS:     Alex Ionescu (alex.ionescu@reactos.org)
 */
 //
 // Identifies a Kernel Handle
 //
-#define KERNEL_HANDLE_FLAG                              \
-    ((ULONG_PTR)1 << ((sizeof(HANDLE) * 8) - 1))
-#define ObIsKernelHandle(Handle, ProcessorMode)         \
-    (((ULONG_PTR)(Handle) & KERNEL_HANDLE_FLAG) &&      \
-    ((ProcessorMode) == KernelMode))
+#ifdef _WIN64
+#define KERNEL_HANDLE_FLAG 0xFFFFFFFF80000000ULL
+#else
+#define KERNEL_HANDLE_FLAG 0x80000000
+#endif
+#define ObpIsKernelHandle(Handle, ProcessorMode)        \
+    ((((ULONG_PTR)(Handle) & KERNEL_HANDLE_FLAG) == KERNEL_HANDLE_FLAG) && \
+     ((ProcessorMode) == KernelMode) && \
+     ((Handle) != NtCurrentProcess()) && \
+     ((Handle) != NtCurrentThread()))
 
 //
 // Converts to and from a Kernel Handle to a normal handle
@@ -263,16 +268,16 @@ ObKillProcess(
 NTSTATUS
 NTAPI
 ObpLookupObjectName(
-    IN HANDLE RootHandle,
-    IN PUNICODE_STRING ObjectName,
+    IN HANDLE RootHandle OPTIONAL,
+    IN OUT PUNICODE_STRING ObjectName,
     IN ULONG Attributes,
     IN POBJECT_TYPE ObjectType,
     IN KPROCESSOR_MODE AccessMode,
     IN OUT PVOID ParseContext,
-    IN PSECURITY_QUALITY_OF_SERVICE SecurityQos,
-    IN PVOID InsertObject,
-    IN PACCESS_STATE AccessState,
-    IN POBP_LOOKUP_CONTEXT LookupContext,
+    IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
+    IN PVOID InsertObject OPTIONAL,
+    IN OUT PACCESS_STATE AccessState,
+    OUT POBP_LOOKUP_CONTEXT LookupContext,
     OUT PVOID *FoundObject
 );
 
@@ -379,9 +384,24 @@ ObpDeleteObjectType(
     IN PVOID Object
 );
 
+NTSTATUS
+NTAPI
+ObReferenceFileObjectForWrite(
+    IN HANDLE Handle,
+    IN KPROCESSOR_MODE AccessMode,
+    OUT PFILE_OBJECT *FileObject,
+    OUT POBJECT_HANDLE_INFORMATION HandleInformation
+);
+
 //
 // DOS Devices Functions
 //
+NTSTATUS
+NTAPI
+ObpCreateDeviceMap(
+    IN HANDLE DirectoryHandle
+);
+
 VOID
 NTAPI
 ObDereferenceDeviceMap(
@@ -391,7 +411,7 @@ ObDereferenceDeviceMap(
 VOID
 FASTCALL
 ObfDereferenceDeviceMap(
-    IN PVOID DeviceMap
+    IN PDEVICE_MAP DeviceMap
 );
 
 VOID
@@ -559,6 +579,7 @@ NTAPI
 ObpCaptureObjectCreateInformation(
     IN POBJECT_ATTRIBUTES ObjectAttributes,
     IN KPROCESSOR_MODE AccessMode,
+    IN KPROCESSOR_MODE CreatorMode,
     IN BOOLEAN AllocateFromLookaside,
     IN POBJECT_CREATE_INFORMATION ObjectCreateInfo,
     OUT PUNICODE_STRING ObjectName
@@ -580,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;