Leaked source code of windows server 2003
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.

51 lines
1.3 KiB

  1. //
  2. // dbgid.h
  3. //
  4. // debug macros
  5. //
  6. #ifndef DBGID_H
  7. #define DBGID_H
  8. #ifdef __cplusplus // "C" files can't handle "inline"
  9. #include "ciccs.h"
  10. extern CCicCriticalSectionStatic g_cs;
  11. //extern "C" BOOL Dbg_MemSetNameID(void *pv, const TCHAR *pszName, DWORD dwID);
  12. #ifdef DEBUG
  13. #define DBG_ID_DECLARE \
  14. static DWORD _s_Dbg_dwID; \
  15. DWORD _Dbg_dwID;
  16. #define DBG_ID_INSTANCE(_class_) \
  17. DWORD _class_::_s_Dbg_dwID = 0;
  18. #define Dbg_MemSetThisNameID(pszName) \
  19. EnterCriticalSection(g_cs); \
  20. _Dbg_dwID = ++_s_Dbg_dwID; \
  21. LeaveCriticalSection(g_cs); \
  22. Dbg_MemSetNameID(this, pszName, _Dbg_dwID)
  23. #define Dbg_MemSetThisNameIDCounter(pszName, iCounter) \
  24. EnterCriticalSection(g_cs); \
  25. _Dbg_dwID = ++_s_Dbg_dwID; \
  26. LeaveCriticalSection(g_cs); \
  27. Dbg_MemSetNameIDCounter(this, pszName, _Dbg_dwID, iCounter)
  28. #else
  29. #define DBG_ID_DECLARE
  30. #define DBG_ID_INSTANCE(_class_)
  31. #define Dbg_MemSetNameIDCounter(pv, pszName, dwID, iCounter)
  32. #define Dbg_MemSetThisNameIDCounter(pszName, iCounter)
  33. #define Dbg_MemSetThisNameID(pszName)
  34. #endif // DEBUG
  35. #endif // __cplusplus // "C" files can't handle "inline"
  36. #endif // DBGID_H