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.

41 lines
997 B

  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 DebugTrace(LPTSTR lpszFormat, ...)
  9. {
  10. // Only do this if the flag is set.
  11. if (0 != g_iDebugOutputLevel)
  12. {
  13. if (DEBUG_FLAG_MODULE_CERTOBJ & g_iDebugOutputLevel)
  14. {
  15. int nBuf;
  16. TCHAR szBuffer[_MAX_PATH];
  17. va_list args;
  18. va_start(args, lpszFormat);
  19. nBuf = _vsntprintf(szBuffer, sizeof(szBuffer)/sizeof(szBuffer[0]), lpszFormat, args);
  20. OutputDebugString(szBuffer);
  21. va_end(args);
  22. // if it does not end if '\r\n' then make one.
  23. int nLen = _tcslen(szBuffer);
  24. if (szBuffer[nLen-1] != _T('\n')){OutputDebugString(_T("\r\n"));}
  25. }
  26. }
  27. }
  28. #else
  29. inline void _cdecl DebugTrace(LPTSTR , ...){}
  30. inline void _cdecl DebugTraceA(LPTSTR , ...){}
  31. #endif
  32. void GetOutputDebugFlag(void);
  33. #define IISDebugOutput DebugTrace