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.

110 lines
2.3 KiB

  1. //*************************************************************
  2. //
  3. // Copyright (c) Microsoft Corporation 1998
  4. // All rights reserved
  5. //
  6. // dbg.hxx
  7. //
  8. //*************************************************************
  9. #ifndef __COMMON_DBG_HXX__
  10. #define __COMMON_DBG_HXX__
  11. extern HINSTANCE ghDllInstance;
  12. extern DWORD gDebugLevel;
  13. extern DWORD gDebugBreak;
  14. //
  15. // Official diagnostic key/value names.
  16. //
  17. #define DIAGNOSTICS_KEY L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Diagnostics"
  18. #define DIAGNOSTICS_POLICY_VALUE L"RunDiagnosticLoggingApplicationManagement"
  19. //
  20. // Additional debug settings.
  21. //
  22. #define DEBUG_KEY_NAME L"AppMgmtDebugLevel"
  23. #define DEBUGBREAK_KEY_NAME L"AppMgmtDebugBreak"
  24. //
  25. // Debug Levels. Must specify DL_NORMAL or DL_VERBOSE to get eventlog
  26. // or logfile output.
  27. //
  28. #define DL_NONE 0x00000000
  29. #define DL_NORMAL 0x00000001
  30. #define DL_VERBOSE 0x00000002 // do verbose logging
  31. #define DL_EVENTLOG 0x00000004 // sent debug to the event log
  32. #define DL_LOGFILE 0x00000008 // sent debug to a log file
  33. #define DL_EVENT 0x00000010 // set a special event when finished processing
  34. #define DL_APPLY 0x00000020 // always apply policy
  35. #define DL_NODBGOUT 0x00000040 // no debugger output
  36. #define DL_CSTORE 0x00000080 // really detailed ds query logging
  37. //
  38. // Debug message types
  39. //
  40. #define DM_ASSERT 0x1
  41. #define DM_WARNING 0x2
  42. #define DM_VERBOSE 0x4
  43. #define DM_NO_EVENTLOG 0x8
  44. #define DEBUGMODE_POLICY 1
  45. #define DEBUGMODE_SERVICE 2
  46. #define DEBUGMODE_CLIENT 3
  47. void
  48. _DebugMsg(
  49. DWORD mask,
  50. DWORD MsgID,
  51. ...
  52. );
  53. void
  54. LogTime();
  55. void
  56. ConditionalBreakIntoDebugger();
  57. void
  58. InitDebugSupport( DWORD DebugMode );
  59. BOOL
  60. DebugLevelOn( DWORD mask );
  61. HANDLE
  62. OpenUnicodeLogFile ( LPCTSTR lpszFilePath );
  63. BOOL
  64. GetDebugLogFileName(
  65. WCHAR* wszLogFile,
  66. LONG cchLogFile );
  67. //
  68. // Debug macros
  69. //
  70. #if DBG
  71. #define DebugMsg(x) _DebugMsg x
  72. #else
  73. #define DebugMsg(x) if ( gDebugLevel != DL_NONE ) _DebugMsg x
  74. #endif // DBG
  75. #define VerboseDebugDump( String ) DebugMsg((DM_VERBOSE | DM_NO_EVENTLOG, IDS_STRING, String))
  76. #endif // ifndef __COMMON_DBG_HXX__