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.

99 lines
1.9 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Windows NT Secure Server Roles Security Configuration Wizard
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992 - 2002
  7. //
  8. // File: state.h
  9. //
  10. // Contents: Wizard state object declaration.
  11. //
  12. // History: 4-Oct-01 EricB created
  13. //
  14. //-----------------------------------------------------------------------------
  15. #ifndef STATE_H_INCLUDED
  16. #define STATE_H_INCLUDED
  17. #include "RoleObj.h"
  18. #include "ServiceObj.h"
  19. class State
  20. {
  21. public:
  22. // call from WinMain to init the global instance
  23. static
  24. void
  25. Init();
  26. // call from WinMain to delete the global instance
  27. static
  28. void
  29. Destroy();
  30. static
  31. State&
  32. GetInstance();
  33. bool
  34. NeedsCommandLineHelp() const {return _fNeedsCommandLineHelp;};
  35. void
  36. SetInputFileName(String & FileName);
  37. PCWSTR
  38. GetInputFileName(void) const {return _strInputFile.c_str();};
  39. enum InputType
  40. {
  41. CreateNew,
  42. OpenExisting,
  43. Rollback
  44. };
  45. void
  46. SetInputType(InputType type) {_InputType = type;};
  47. InputType
  48. GetInputType(void) const {return _InputType;};
  49. HRESULT
  50. ParseInputFile(void);
  51. long
  52. GetNumRoles(void) const {return _NumRoles;};
  53. HRESULT
  54. GetRole(long index, RoleObject ** ppRole);
  55. HRESULT
  56. DoRollback(void);
  57. private:
  58. // can only be created/destroyed by Init/Destroy
  59. State();
  60. ~State() {};
  61. bool _fNeedsCommandLineHelp;
  62. String _strInputFile;
  63. InputType _InputType;
  64. SmartInterface<IXMLDOMNode> _siXmlMainNode;
  65. SmartInterface<IXMLDOMNodeList> _siXmlRoleNodeList;
  66. long _NumRoles;
  67. // not defined: no copying.
  68. State(const State&);
  69. State& operator=(const State&);
  70. };
  71. #endif // STATE_H_INCLUDED