Merge trunk head (r43756)
[reactos.git] / reactos / include / ddk / winddk.h
index 76a8897..0960564 100644 (file)
@@ -5585,7 +5585,7 @@ typedef VOID
     IN ULONG Length
 );
 
-#define PCI_DATA_TAG TAG('P', 'C', 'I', ' ')
+#define PCI_DATA_TAG ' ICP'
 #define PCI_DATA_VERSION 1
 
 typedef struct _PCIBUSDATA
@@ -5674,6 +5674,14 @@ KefReleaseSpinLockFromDpcLevel(
     
 #elif defined(_M_ARM) // !defined (_X86_)
     
+    FORCEINLINE
+    VOID
+    KeInitializeSpinLock(IN PKSPIN_LOCK SpinLock)
+    {
+        /* Clear the lock */
+        *SpinLock = 0;
+    }
+    
     NTHALAPI
     KIRQL
     FASTCALL
@@ -5788,18 +5796,37 @@ KeAcquireSpinLockRaiseToDpc(
 #define ROUND_TO_PAGES(Size) \
   ((ULONG_PTR) (((ULONG_PTR) Size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))
 
+
+
+#if defined(_X86_) || defined(_AMD64_)
+
+//
+// x86 and x64 performs a 0x2C interrupt
+//
+#define DbgRaiseAssertionFailure __int2c
+
+#elif defined(_ARM_)
+
+//
+// TODO
+//
+
+#else
+#error Unsupported Architecture
+#endif
+
 #if DBG
 
 #define ASSERT(exp) \
   (VOID)((!(exp)) ? \
-    RtlAssert( #exp, __FILE__, __LINE__, NULL ), FALSE : TRUE)
+    RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, NULL ), FALSE : TRUE)
 
 #define ASSERTMSG(msg, exp) \
   (VOID)((!(exp)) ? \
     RtlAssert( #exp, __FILE__, __LINE__, msg ), FALSE : TRUE)
 
 #define RTL_SOFT_ASSERT(exp) \
-  (VOID)((!(_exp)) ? \
+  (VOID)((!(exp)) ? \
     DbgPrint("%s(%d): Soft assertion failed\n   Expression: %s\n", __FILE__, __LINE__, #exp), FALSE : TRUE)
 
 #define RTL_SOFT_ASSERTMSG(msg, exp) \
@@ -5812,6 +5839,36 @@ KeAcquireSpinLockRaiseToDpc(
 #define RTL_SOFT_VERIFY(exp) RTL_SOFT_ASSERT(exp)
 #define RTL_SOFT_VERIFYMSG(msg, exp) RTL_SOFT_ASSERTMSG(msg, exp)
 
+#if defined(_MSC_VER)
+
+#define NT_ASSERT(exp) \
+   ((!(exp)) ? \
+      (__annotation(L"Debug", L"AssertFail", L#exp), \
+       DbgRaiseAssertionFailure(), FALSE) : TRUE)
+
+#define NT_ASSERTMSG(msg, exp) \
+   ((!(exp)) ? \
+      (__annotation(L"Debug", L"AssertFail", L##msg), \
+      DbgRaiseAssertionFailure(), FALSE) : TRUE)
+
+#define NT_ASSERTMSGW(msg, exp) \
+    ((!(exp)) ? \
+        (__annotation(L"Debug", L"AssertFail", msg), \
+         DbgRaiseAssertionFailure(), FALSE) : TRUE)
+
+#else
+
+//
+// GCC doesn't support __annotation (nor PDB)
+//
+#define NT_ASSERT(exp) \
+   (VOID)((!(exp)) ? (DbgRaiseAssertionFailure(), FALSE) : TRUE)
+
+#define NT_ASSERTMSG NT_ASSERT
+#define NT_ASSERTMSGW NT_ASSERT
+
+#endif
+
 #else /* !DBG */
 
 #define ASSERT(exp) ((VOID) 0)
@@ -5826,6 +5883,10 @@ KeAcquireSpinLockRaiseToDpc(
 #define RTL_SOFT_VERIFY(exp) ((exp) ? TRUE : FALSE)
 #define RTL_SOFT_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE)
 
+#define NT_ASSERT(exp)     ((VOID)0)
+#define NT_ASSERTMSG(exp)  ((VOID)0)
+#define NT_ASSERTMSGW(exp) ((VOID)0)
+
 #endif /* DBG */
 
 /* HACK HACK HACK - GCC (or perhaps LD) is messing this up */
@@ -9277,7 +9338,7 @@ MmSecureVirtualMemory(
   IN ULONG  ProbeMode);
 
 NTKERNELAPI
-ULONG
+SIZE_T
 NTAPI
 MmSizeOfMdl(
   IN PVOID  Base,
@@ -10298,27 +10359,35 @@ NTAPI
 vDbgPrintEx(
   IN ULONG ComponentId,
   IN ULONG Level,
-  IN LPCSTR Format,
+  IN PCCH Format,
   IN va_list ap);
 
 ULONG
 NTAPI
 vDbgPrintExWithPrefix(
-  IN LPCSTR Prefix,
+  IN PCCH Prefix,
   IN ULONG ComponentId,
   IN ULONG Level,
-  IN LPCSTR Format,
+  IN PCCH Format,
   IN va_list ap);
 
 NTKERNELAPI
 ULONG
 DDKCDECLAPI
 DbgPrintReturnControlC(
-  IN PCH  Format,
+  IN PCCH  Format,
   IN ...);
 
+ULONG
+NTAPI
+DbgPrompt(
+    IN PCCH Prompt,
+    OUT PCH Response,
+    IN ULONG MaximumResponseLength
+);
+
 NTKERNELAPI
-BOOLEAN
+NTSTATUS
 NTAPI
 DbgQueryDebugFilterState(
   IN ULONG  ComponentId,