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.

71 lines
1.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1999.
  5. //
  6. // File: D I A G C T X . H
  7. //
  8. // Contents: Implements the optional diagnostic context used by
  9. // CNetConfig.
  10. //
  11. // Notes:
  12. //
  13. // Author: shaunco 10 Feb 1999
  14. //
  15. //----------------------------------------------------------------------------
  16. #pragma once
  17. #include <tracetag.h>
  18. enum DIAG_FLAGS
  19. {
  20. DF_SHOW_CONSOLE_OUTPUT = 0x00000001,
  21. DF_DONT_START_SERVICES = 0x00000002,
  22. DF_DONT_DO_PNP_BINDS = 0x00000004,
  23. DF_SUPRESS_E_NEED_REBOOT = 0x00000010,
  24. };
  25. // This structure is allocated dynamically by CDiagContext. Place anything
  26. // big in this structure (as opposed to CDiagContext) so that the size of
  27. // CNetConfig is not directly increased.
  28. //
  29. struct DIAG_CONTEXT
  30. {
  31. CHAR szPrintBuffer [4096];
  32. };
  33. class CDiagContext
  34. {
  35. private:
  36. DWORD m_dwFlags; // DIAG_FLAGS
  37. DIAG_CONTEXT* m_pCtx;
  38. public:
  39. CDiagContext ()
  40. {
  41. m_dwFlags = 0;
  42. m_pCtx = NULL;
  43. }
  44. ~CDiagContext ()
  45. {
  46. MemFree (m_pCtx);
  47. }
  48. VOID
  49. SetFlags (
  50. DWORD dwFlags /* DIAG_FLAGS */);
  51. DWORD
  52. Flags () const;
  53. VOID
  54. Printf (
  55. TRACETAGID ttid,
  56. PCSTR pszFormat,
  57. ...);
  58. };
  59. extern CDiagContext* g_pDiagCtx;