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.

54 lines
1.4 KiB

  1. #ifndef H__debug
  2. #define H__debug
  3. /*
  4. Any functions that use windows.h types must be put in the 2nd section
  5. */
  6. #if defined(_MIPS_) || defined(_ALPHA_) || defined(_PPC_)
  7. void debug(char *, ...);
  8. void DebugInit( char * lpszDebugName );
  9. #else
  10. void _cdecl debug(char *, ...);
  11. void __stdcall DebugInit( char * lpszDebugName );
  12. #endif
  13. #if DBG
  14. #define DPRINTF(x) debug x
  15. #define DIPRINTF(x) if (bDebugInfo) debug x
  16. #define HEXDUMP(s, n) hexDump(s, n)
  17. #define MEMERROR() NDDELogError(MSG417, __LINE__, __FILE__, NULL);
  18. #else
  19. #define DPRINTF(x)
  20. #define DIPRINTF(x)
  21. #define HEXDUMP(s, n)
  22. #define MEMERROR()
  23. #endif // DBG
  24. #ifndef SKIP_DEBUG_WIN32
  25. /* dump.c functions */
  26. BOOL DumpDacl( LPTSTR szDumperName, PSECURITY_DESCRIPTOR pSD );
  27. BOOL DumpSid( LPTSTR szDumperName, PSID pSid );
  28. VOID DumpToken( HANDLE hToken );
  29. BOOL GetTokenUserDomain( HANDLE hToken, PSTR user, DWORD nUser,
  30. PSTR domain, DWORD nDomain );
  31. VOID DumpWhoIAm( LPSTR lpszMsg );
  32. #endif // SKIP_DEBUG_WIN32
  33. // #define DEBUG_IT
  34. #ifndef DEBUG_IT
  35. #define TRACEINIT(x)
  36. #else
  37. #define TRACEINIT(x) { char sz[100]; \
  38. char *szT; \
  39. wsprintfA(sz, "pid=%x, tid=%x | ", GetCurrentProcessId(), GetCurrentThreadId()); \
  40. szT = sz + strlen(sz); \
  41. wsprintfA##x; \
  42. strcat(szT, "\n"); \
  43. OutputDebugString(sz); \
  44. }
  45. #endif
  46. #endif // H__debug