Source code of Windows XP (NT5)
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.

103 lines
5.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: D B G F L A G S . C P P
  7. //
  8. // Contents: DebugFlag list for the NetCfg Project
  9. //
  10. // Notes:
  11. //
  12. // Author: jeffspr 27 May 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #include <pch.h>
  16. #pragma hdrstop
  17. // None of this should get compiled in unless we're in the debug version
  18. // or we need to enable tracing code.
  19. //
  20. #if defined(DBG) || defined(ENABLETRACE)
  21. #include "ncdebug.h"
  22. #include "ncbase.h"
  23. // This is the DebugFlag list that everyone should be modifying.
  24. //
  25. DEBUGFLAGELEMENT g_DebugFlags[] =
  26. {
  27. // :----------- DebugFlagId dfid
  28. // | :--------- CHAR [] szShortName
  29. // | | :------- CHAR [] szDescription
  30. // | | | DWORD dwValue ------------------------------------------------------------:
  31. // | | | |
  32. // | | | |
  33. // | | :-------------------------------------------: |
  34. // | :----------------------: | |
  35. // | | | |
  36. // v v v v
  37. //
  38. { dfidBreakOnAlloc, "BreakOnAlloc", "Break on Specified Alloc", 0 },
  39. { dfidBreakOnDoUnattend, "BreakOnDoUnattend", "Break during HrDoUnattend", 0 },
  40. { dfidBreakOnError, "BreakOnError", "Break on TraceError", 0 },
  41. { dfidBreakOnHr, "BreakOnHr", "Break when hr is specific value", 0 },
  42. { dfidBreakOnHrIteration, "BreakOnHrInteration", "Break when hr is hit N times", 0 },
  43. { dfidBreakOnIteration, "BreakOnIteration", "Break on Nth call to TraceError", 0 },
  44. { dfidBreakOnNetInstall, "BreakOnNetInstall", "Break during HrNetClassInstaller", 0 },
  45. { dfidBreakOnNotifySinkRelease, "BreakOnNotifySinkRelease", "Break when the NotifySink is released",0 },
  46. { dfidBreakOnPrematureDllUnload,"BreakOnPrematureDllUnload","Break when DLL unloaded with open references", 0 },
  47. { dfidBreakOnWizard, "BreakOnWizard", "Break on Wizard", 0 },
  48. { dfidBreakOnStartOfUpgrade, "BreakOnStartOfUpgrade", "Break at the beginning of InstallUpgradeWorkThread", 0 },
  49. { dfidBreakOnEndOfUpgrade, "BreakOnEndOfUpgrade", "Break after all calls to HrDoUnattend have been completed", 0 },
  50. { dfidCheckLegacyMenusAtRuntime,"CheckLegacyMenusAtRuntime","Assert legacy menus during runtime", 0 },
  51. { dfidCheckLegacyMenusOnStartup,"CheckLegacyMenusOnStartup","Assert all legacy menus on startup", 0 },
  52. { dfidDisableShellThreading, "DisableShellThreading", "Disable shell thread pool usage", 0 },
  53. { dfidDisableTray, "DisableTray", "Disable Tray", 0 },
  54. { dfidDontCacheShellIcons, "DontCacheShellIcons", "Don't ever use shell icon caching", 0 },
  55. { dfidExtremeTracing, "ExtremeTracing", "Output all traces, even on success", 0 },
  56. { dfidNetShellBreakOnInit, "NetShellBreakOnInit", "Break on Initialization of NetShell", 0 },
  57. { dfidNoErrorText, "NoErrorText", "Don't show wimpy error strings.", 0 },
  58. { dfidShowIgnoredErrors, "ShowIgnoredErrors", "Displays errors that would otherwise be ignored", 0 },
  59. { dfidShowProcessAndThreadIds, "ShowProcessAndThreadIds", "Displays process and thread id", 0 },
  60. { dfidSkipLanEnum, "SkipLanEnum", "Skip LAN Enumeration", 0 },
  61. { dfidTraceCallStackOnError, "TraceCallStackOnError", "Dump the call stack for all errors", 0 },
  62. { dfidTraceFileFunc, "TraceFileFunc", "Trace Function names & params for every call", 0 },
  63. { dfidTraceMultiLevel, "TraceMultiLevel", "Trace multiple levels", 0 },
  64. { dfidTraceSource, "TraceSource", "Trace source information", 0 },
  65. { dfidTracingTimeStamps, "TracingTimeStamps", "Add time stamps to tracing output", 0 },
  66. { dfidTrackObjectLeaks, "TrackObjectLeaks", "Track object leaks", 0 }
  67. };
  68. const INT g_nDebugFlagCount = celems(g_DebugFlags);
  69. //+---------------------------------------------------------------------------
  70. //
  71. // Function: FIsDebugFlagSet
  72. //
  73. // Purpose: Return the state of a debug flag to the caller.
  74. //
  75. // Arguments:
  76. // dfid [] Debug Flag ID
  77. //
  78. // Returns: TRUE if set, FALSE otherwise.
  79. //
  80. // Author: jeffspr 28 May 1997
  81. //
  82. // Notes:
  83. //
  84. BOOL FIsDebugFlagSet( DEBUGFLAGID dfid )
  85. {
  86. return (g_DebugFlags[dfid].dwValue > 0);
  87. }
  88. DWORD DwReturnDebugFlagValue( DEBUGFLAGID dfid )
  89. {
  90. return (g_DebugFlags[dfid].dwValue);
  91. }
  92. #endif //! DBG || ENABLETRACE