X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Finclude%2Fddk%2Fwinddk.h;h=096056478ac7a7f4a5953fc2b038da3e0df9908c;hp=d86119068f6cf0a8062a0b76e840ae4bb6e0b62e;hb=cc5c0a08164f732809d06487a52217e788cd0324;hpb=87ab5d0e6dbea26b9f91806acaeba1d171bb4f84 diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index d86119068f6..096056478ac 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5796,6 +5796,25 @@ 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) \ @@ -5807,7 +5826,7 @@ KeAcquireSpinLockRaiseToDpc( 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) \ @@ -5820,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) @@ -5834,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 */ @@ -10306,23 +10359,23 @@ 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