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.

175 lines
4.5 KiB

  1. //Copyright (c) 1998 - 1999 Microsoft Corporation
  2. /*
  3. *
  4. * State.h
  5. *
  6. * Routines to gather various state information.
  7. *
  8. */
  9. #ifndef __TSOC_STATE_H__
  10. #define __TSOC_STATE_H__
  11. //
  12. // Type Definitions
  13. //
  14. typedef enum {
  15. PERM_WIN2K = 0,
  16. PERM_TS4 = 1
  17. } EPermMode;
  18. //
  19. // OC State Function Prototypes
  20. //
  21. DWORD SetTSVersion (LPCTSTR pszVersion);
  22. PSETUP_INIT_COMPONENT GetSetupData(VOID);
  23. enum ETSInstallType
  24. {
  25. eFreshInstallTS, // it could be an upgrade, but from non TS machine.
  26. eUpgradeFrom40TS,
  27. eUpgradeFrom50TS,
  28. eUpgradeFrom51TS,
  29. eStandAloneSetup
  30. };
  31. enum ETSMode
  32. {
  33. eTSDisabled,
  34. eRemoteAdmin,
  35. eAppServer,
  36. ePersonalTS
  37. };
  38. // This must be in the same order as IDs in lscore
  39. enum ETSLicensingMode
  40. {
  41. eLicPTS,
  42. eLicRemoteAdmin,
  43. eLicPerSeat,
  44. eLicInternetConnector, // not supported in Whistler
  45. eLicPerSession,
  46. eLicUnset
  47. };
  48. class TSState
  49. {
  50. public:
  51. TSState ();
  52. virtual ~TSState ();
  53. BOOL Initialize (PSETUP_INIT_COMPONENT pSetupData);
  54. const PSETUP_INIT_COMPONENT GetSetupData() const;
  55. ETSInstallType GetInstalltype () const;
  56. ETSMode OriginalTSMode () const;
  57. ETSMode CurrentTSMode () const;
  58. EPermMode OriginalPermMode () const;
  59. EPermMode CurrentPermMode () const;
  60. ETSLicensingMode NewLicMode () const;
  61. BOOL IsUpgrade () const;
  62. BOOL IsFreshInstall () const;
  63. BOOL IsTSFreshInstall () const;
  64. BOOL IsUpgradeFrom40TS () const;
  65. BOOL IsUpgradeFrom50TS () const;
  66. BOOL IsUpgradeFrom51TS () const;
  67. BOOL IsUnattended () const;
  68. BOOL IsGuiModeSetup () const;
  69. BOOL IsStandAlone () const;
  70. BOOL IsWorkstation () const;
  71. BOOL IsServer () const;
  72. BOOL IsSBS () const;
  73. BOOL CanInstallAppServer () const;
  74. BOOL IsAdvServerOrHigher () const;
  75. BOOL IsPersonal () const;
  76. BOOL IsProfessional () const;
  77. BOOL IsX86 () const;
  78. BOOL IsCheckedBuild () const;
  79. BOOL WasTSInstalled () const;
  80. BOOL WasTSEnabled () const;
  81. BOOL WasItAppServer () const;
  82. BOOL WasItRemoteAdmin () const;
  83. BOOL IsAppSrvModeSwitch () const;
  84. BOOL IsTSModeChanging () const;
  85. BOOL IsItAppServer () const;
  86. BOOL IsAppServerSelected () const;
  87. BOOL IsItRemoteAdmin () const;
  88. BOOL HasChanged () const;
  89. BOOL IsTSEnableSelected () const;
  90. void SetCurrentTSMode (ETSMode eNewMode);
  91. void SetCurrentPermMode (EPermMode eNewMode);
  92. void SetNewLicMode (ETSLicensingMode eNewMode);
  93. void UpdateState ();
  94. BOOL Assert () const;
  95. BOOL LogState () const;
  96. BOOL GetCurrentConnAllowed () const;
  97. BOOL GetOrigConnAllowed () const;
  98. private:
  99. ETSInstallType m_eInstallType;
  100. ETSMode m_eOriginalTSMode;
  101. ETSMode m_eCurrentTSMode;
  102. EPermMode m_eOriginalPermMode;
  103. EPermMode m_eCurrentPermMode;
  104. BOOL m_bCurrentConnAllowed;
  105. BOOL m_bOrigConnAllowed;
  106. BOOL m_bNewStateValid;
  107. ETSLicensingMode m_eNewLicMode;
  108. PSETUP_INIT_COMPONENT m_gpInitComponentData;
  109. OSVERSIONINFOEX m_osVersion;
  110. BOOL GetNTType ();
  111. BOOL SetSetupData (PSETUP_INIT_COMPONENT pSetupData);
  112. ETSInstallType ReadInstallType () const;
  113. ETSMode ReadTSMode () const;
  114. EPermMode ReadPermMode () const;
  115. BOOL AreConnectionsAllowed () const;
  116. void SetCurrentConnAllowed (BOOL bAllowed);
  117. };
  118. extern TSState StateObject;
  119. #endif // __TSOC_STATE_H__