Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.0 KiB

  1. //
  2. // DRVDBG.H
  3. // Display Driver (NT-only right now) Debug Macros
  4. //
  5. // Copyright(c) Microsoft 1997-
  6. //
  7. #ifndef _H_DRVDBG
  8. #define _H_DRVDBG
  9. #ifdef ASSERT
  10. #undef ASSERT
  11. #endif // ASSERT
  12. #define CCH_DEBUG_MAX 256
  13. // Standard Zones
  14. #define ZONE_INIT 0x0001
  15. #define ZONE_TRACE 0x0002
  16. #define ZONE_FUNCTION 0x0004
  17. #define ZONE_MASK 0x0007
  18. #define ZONE_OAHEAPCHECK 0x0008
  19. #ifndef DEBUG
  20. #define DebugEntry(x)
  21. #define DebugExitVOID(x)
  22. #define DebugExitDWORD(x, dw)
  23. #define DebugExitBOOL(x, f)
  24. #define DebugExitPVOID(x, ptr)
  25. #define TRACE_OUT(x)
  26. #define WARNING_OUT(x)
  27. #define ASSERT(x)
  28. #else
  29. void DbgZPrintFn(LPSTR szFn);
  30. void DbgZPrintFnExitDWORD(LPSTR szFn, DWORD dwResult);
  31. void DbgZPrintFnExitPVOID(LPSTR szFn, PVOID ptr);
  32. #define DebugEntry(szFn) DbgZPrintFn("ENTER "#szFn)
  33. #define DebugExitVOID(szFn) DbgZPrintFn("LEAVE "#szFn)
  34. #define DebugExitDWORD(szFn, dwResult) DbgZPrintFnExitDWORD("LEAVE "#szFn, dwResult)
  35. #define DebugExitBOOL(szFn, fResult) DbgZPrintFnExitDWORD("LEAVE "#szFn, fResult)
  36. #define DebugExitPVOID(szFn, dwResult) DbgZPrintFnExitPVOID("LEAVE "#szFn, dwResult)
  37. void _cdecl DbgZPrintTrace(LPSTR pszFormat, ...);
  38. void _cdecl DbgZPrintWarning(LPSTR pszFormat, ...);
  39. #define TRACE_OUT(szMsg) DbgZPrintTrace szMsg
  40. #define WARNING_OUT(szMsg) DbgZPrintWarning szMsg
  41. #define ERROR_OUT(szMsg) DbgZPrintError szMsg
  42. extern char g_szAssertionFailure[];
  43. #define ASSERT(exp) if (!(exp)) ERROR_OUT((g_szAssertionFailure))
  44. #endif // !DEBUG
  45. //
  46. // For driver start up tracing in retail as well
  47. //
  48. #if defined(DEBUG) || defined(INIT_TRACE)
  49. void _cdecl DbgZPrintInit(LPSTR pszFormat, ...);
  50. void _cdecl DbgZPrintError(LPSTR pszFormat, ...);
  51. #define INIT_OUT(szMsg) DbgZPrintInit szMsg
  52. #define ERROR_OUT(szMsg) DbgZPrintError szMsg
  53. #else
  54. #define INIT_OUT(x)
  55. #define ERROR_OUT(x)
  56. #endif // DEBUG or INIT_TRACE
  57. #endif // _H_DRVDBG
  58.