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.

183 lines
5.2 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, // upgrade from TS4.
  27. eUpgradeFrom50TS, // upgrade from Win2k
  28. eUpgradeFrom51TS, // upgrade from Xp
  29. eUpgradeFrom52TS, // upgrade from Windows Server 2003 builds
  30. eStandAloneSetup // stand alone setup. (add remove programs)
  31. };
  32. enum ETSMode
  33. {
  34. eTSDisabled,
  35. eRemoteAdmin,
  36. eAppServer,
  37. ePersonalTS
  38. };
  39. // This must be in the same order as IDs in lscore
  40. enum ETSLicensingMode
  41. {
  42. eLicPTS,
  43. eLicRemoteAdmin,
  44. eLicPerDevice,
  45. eLicInternetConnector, // not supported in Whistler
  46. eLicPerUser,
  47. eLicUnset
  48. };
  49. class TSState
  50. {
  51. public:
  52. TSState ();
  53. virtual ~TSState ();
  54. BOOL Initialize (PSETUP_INIT_COMPONENT pSetupData);
  55. const PSETUP_INIT_COMPONENT GetSetupData() const;
  56. ETSInstallType GetInstalltype () const;
  57. ETSMode OriginalTSMode () const;
  58. ETSMode CurrentTSMode () const;
  59. EPermMode OriginalPermMode () const;
  60. EPermMode CurrentPermMode () const;
  61. ETSLicensingMode NewLicMode () const;
  62. BOOL IsUpgrade () const;
  63. BOOL IsFreshInstall () const;
  64. BOOL IsTSFreshInstall () const;
  65. BOOL IsUpgradeFrom40TS () const;
  66. BOOL IsUpgradeFrom50TS () const;
  67. BOOL IsUpgradeFrom51TS () const;
  68. BOOL IsUpgradeFrom52TS () const;
  69. BOOL IsUnattended () const;
  70. BOOL IsGuiModeSetup () const;
  71. BOOL IsStandAlone () const;
  72. BOOL IsWorkstation () const;
  73. BOOL IsServer () const;
  74. BOOL IsSBS () const;
  75. BOOL IsBlade () const;
  76. BOOL CanInstallAppServer () const;
  77. BOOL IsAdvServerOrHigher () const;
  78. BOOL IsPersonal () const;
  79. BOOL IsProfessional () const;
  80. BOOL IsX86 () const;
  81. BOOL IsAMD64 () const;
  82. BOOL IsCheckedBuild () const;
  83. BOOL WasTSInstalled () const;
  84. BOOL WasTSEnabled () const;
  85. BOOL WasItAppServer () const;
  86. BOOL WasItRemoteAdmin () const;
  87. BOOL IsAppSrvModeSwitch () const;
  88. BOOL IsStandAloneModeSwitch () const;
  89. BOOL IsTSModeChanging () const;
  90. BOOL IsItAppServer () const;
  91. BOOL IsAppServerSelected () const;
  92. BOOL IsItRemoteAdmin () const;
  93. BOOL HasChanged () const;
  94. BOOL IsTSEnableSelected () const;
  95. void SetCurrentTSMode (ETSMode eNewMode);
  96. void SetCurrentPermMode (EPermMode eNewMode);
  97. void SetNewLicMode (ETSLicensingMode eNewMode);
  98. void UpdateState ();
  99. BOOL Assert () const;
  100. BOOL LogState () const;
  101. BOOL GetCurrentConnAllowed () const;
  102. BOOL GetOrigConnAllowed () const;
  103. void UpdateConnectionAllowed ();
  104. BOOL CanShowStartupPopup () const;
  105. private:
  106. ETSInstallType m_eInstallType;
  107. ETSMode m_eOriginalTSMode;
  108. ETSMode m_eCurrentTSMode;
  109. EPermMode m_eOriginalPermMode;
  110. EPermMode m_eCurrentPermMode;
  111. BOOL m_bCurrentConnAllowed;
  112. BOOL m_bOrigConnAllowed;
  113. BOOL m_bNewStateValid;
  114. ETSLicensingMode m_eNewLicMode;
  115. PSETUP_INIT_COMPONENT m_gpInitComponentData;
  116. OSVERSIONINFOEX m_osVersion;
  117. BOOL GetNTType ();
  118. BOOL SetSetupData (PSETUP_INIT_COMPONENT pSetupData);
  119. ETSInstallType ReadInstallType () const;
  120. ETSMode ReadTSMode () const;
  121. EPermMode ReadPermMode () const;
  122. BOOL AreConnectionsAllowed () const;
  123. void SetCurrentConnAllowed (BOOL bAllowed);
  124. };
  125. extern TSState StateObject;
  126. #endif // __TSOC_STATE_H__