[SHELL/EXPERIMENTS]
[reactos.git] / ntoskrnl / include / internal / ob.h
index 532565e..54c7d1d 100644 (file)
@@ -31,7 +31,7 @@
     if (x & ObpTraceLevel) DbgPrint(__VA_ARGS__)
 #endif
 #else
-#define OBTRACE(x, ...) DPRINT(__VA_ARGS__)
+#define OBTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
 #endif
 
 //
 //
 // Identifies a Kernel Handle
 //
-#define KERNEL_HANDLE_FLAG                              \
-    (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
@@ -559,6 +564,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