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.

69 lines
2.0 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1996.
  5. //
  6. // File: wizdbg.hxx
  7. //
  8. // Contents: Debug macros in addition to the ones in ..\folderui\dbg.h
  9. //
  10. // History: 4-28-1997 DavidMun Created
  11. //
  12. //---------------------------------------------------------------------------
  13. #ifndef __WIZDBG_HXX_
  14. #define __WIZDBG_HXX_
  15. //
  16. // Technically this isn't a debug macro; but it's frequently used with them
  17. //
  18. #define HRESULT_FROM_LASTERROR HRESULT_FROM_WIN32(GetLastError())
  19. //
  20. // This is defined for debug and retail both. In retail, the DEBUG_OUT
  21. // section is removed by the precompiler.
  22. //
  23. #define DEBUG_OUT_HRESULT(hr) \
  24. DEBUG_OUT((DEB_ERROR, \
  25. "**** ERROR RETURN <%s @line %d> -> %08lx\n", \
  26. __FILE__, \
  27. __LINE__, \
  28. hr))
  29. #define BREAK_ON_FAIL_HRESULT(hr) \
  30. if (FAILED(hr)) \
  31. { \
  32. DEBUG_OUT_HRESULT(hr); \
  33. break; \
  34. }
  35. #define TRACE_CONSTRUCTOR(ClassName) TRACE(ClassName, ClassName)
  36. #define TRACE_DESTRUCTOR(ClassName) TRACE(ClassName, ~##ClassName)
  37. #define TRACE_METHOD TRACE
  38. #if (DBG == 1)
  39. VOID
  40. DebugMessageBox(ULONG flLevel, LPTSTR ptszFormat, ...);
  41. #if (defined(DBG_MSGBOX))
  42. //
  43. // Debug outs show up in message boxes instead of going to debugger
  44. //
  45. #undef DEBUG_OUT
  46. #define DEBUG_OUT(x) DebugMessageBox x
  47. #endif // (defined(DBG_MSGBOX))
  48. #endif // (DBG == 1)
  49. #endif // __WIZDBG_HXX_