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.

55 lines
1.4 KiB

  1. #include "stdafx.h"
  2. #include "debugdefs.h"
  3. extern g_iDebugOutputLevel;
  4. #if defined(_DEBUG) || DBG
  5. #define DEBUG_FLAG
  6. #endif
  7. #ifdef DEBUG_FLAG
  8. inline void _cdecl DebugTraceHelp(DWORD_PTR dwWinHelpID)
  9. {
  10. // Only do this if the flag is set.
  11. if (0 != g_iDebugOutputLevel)
  12. {
  13. if (DEBUG_FLAG_HELP & g_iDebugOutputLevel)
  14. {
  15. TCHAR szBuffer[30];
  16. _stprintf(szBuffer,_T("WinHelp:0x%x,%d\r\n"),dwWinHelpID,dwWinHelpID);
  17. OutputDebugString(szBuffer);
  18. }
  19. }
  20. return;
  21. }
  22. inline void _cdecl DebugTrace(LPTSTR lpszFormat, ...)
  23. {
  24. // Only do this if the flag is set.
  25. if (0 != g_iDebugOutputLevel)
  26. {
  27. if (DEBUG_FLAG_MODULE_IISUIOBJ & g_iDebugOutputLevel)
  28. {
  29. int nBuf;
  30. TCHAR szBuffer[_MAX_PATH];
  31. va_list args;
  32. va_start(args, lpszFormat);
  33. nBuf = _vsntprintf(szBuffer, sizeof(szBuffer)/sizeof(szBuffer[0]), lpszFormat, args);
  34. OutputDebugString(szBuffer);
  35. va_end(args);
  36. // if it does not end if '\r\n' then make one.
  37. int nLen = _tcslen(szBuffer);
  38. if (szBuffer[nLen-1] != _T('\n')){OutputDebugString(_T("\r\n"));}
  39. }
  40. }
  41. }
  42. #else
  43. inline void _cdecl DebugTraceHelp(DWORD_PTR dwWinHelpID){}
  44. inline void _cdecl DebugTrace(LPTSTR , ...){}
  45. #endif
  46. void GetOutputDebugFlag(void);
  47. #define IISDebugOutput DebugTrace