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.

62 lines
1.5 KiB

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