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.

141 lines
3.6 KiB

  1. // Copyright (c) 2002 Microsoft Corporation
  2. //
  3. // File: CYS.h
  4. //
  5. // Synopsis: Declares the common data structures
  6. // and types for the CYS.exe and CYSlib.lib
  7. //
  8. // History: 01/21/2002 JeffJon Created
  9. #ifndef __CYS_H
  10. #define __CYS_H
  11. // NOTE: you must have $(ENDUSER_INC_PATH) in your INCLUDES list
  12. // to get this file
  13. #include "sainstallcom.h"
  14. // Get the staticly defined initialization guard to manage resources
  15. #include "init.h"
  16. // This enum defines the installation unit types. It is used as the key to
  17. // the map in the InstallationUnitProvider to get the InstallationUnit
  18. // associated with the type. Not all of these roles are exposed to the user
  19. // through MYS/CYS. Some, like the indexing service, are used by other roles
  20. // to provide a means of installing the service. Do not enumerate through
  21. // this list to discover the exposed roles. Use the serverRoleStatusTable
  22. // instead.
  23. enum ServerRole
  24. {
  25. DNS_SERVER,
  26. DHCP_SERVER,
  27. WINS_SERVER,
  28. RRAS_SERVER,
  29. TERMINALSERVER_SERVER,
  30. FILESERVER_SERVER,
  31. PRINTSERVER_SERVER,
  32. MEDIASERVER_SERVER,
  33. WEBAPP_SERVER,
  34. EXPRESS_SERVER,
  35. DC_SERVER,
  36. POP3_SERVER,
  37. INDEXING_SERVICE,
  38. NO_SERVER
  39. };
  40. // These are the values that can be returned from
  41. // InstallationUnit::GetStatus()
  42. enum InstallationStatus
  43. {
  44. STATUS_NONE,
  45. STATUS_CONFIGURED,
  46. STATUS_COMPLETED,
  47. STATUS_NOT_AVAILABLE
  48. };
  49. // String representations of the status codes
  50. // above. These are used for logging purposes
  51. const String statusStrings[] =
  52. {
  53. String(L"STATUS_NONE"),
  54. String(L"STATUS_CONFIGURED"),
  55. String(L"STATUS_COMPLETED"),
  56. String(L"STATUS_NOT_AVAILABLE")
  57. };
  58. // Macro to help with logging of status results
  59. #define LOG_ROLE_STATUS(status) LOG(statusStrings[status]);
  60. // Helper to get the status if all you have is the installation type
  61. InstallationStatus
  62. GetInstallationStatusForServerRole(
  63. ServerRole role);
  64. // Functions to determine the server role status
  65. InstallationStatus GetDNSStatus();
  66. InstallationStatus GetDHCPStats();
  67. InstallationStatus GetWINSStatus();
  68. InstallationStatus GetRRASStatus();
  69. InstallationStatus GetTerminalServerStatus();
  70. InstallationStatus GetFileServerStatus();
  71. InstallationStatus GetPrintServerStatus();
  72. InstallationStatus GetMediaServerStatus();
  73. InstallationStatus GetWebServerStatus();
  74. InstallationStatus GetDCStatus();
  75. // NTRAID#NTBUG9-698722-2002/09/03-artm
  76. InstallationStatus GetDCStatusForMYS();
  77. InstallationStatus GetPOP3Status();
  78. // Declares a function pointer type to use in the
  79. typedef InstallationStatus (*CYSRoleStatusFunction)();
  80. struct ServerRoleStatus
  81. {
  82. ServerRole role;
  83. CYSRoleStatusFunction Status;
  84. };
  85. // table of items that are available in the server type list box
  86. extern ServerRoleStatus serverRoleStatusTable[];
  87. // returns the number of items in the serverTypeTable
  88. size_t
  89. GetServerRoleStatusTableElementCount();
  90. // Determines if a particular Server Appliance Kit component
  91. // is installed. SA_TYPE is defined in sainstallcom.h
  92. bool
  93. IsSAKUnitInstalled(SA_TYPE unitType);
  94. // Determines if the current server is a cluster server
  95. bool
  96. IsClusterServer();
  97. // Returns the URL of the SAK webpages
  98. String
  99. GetSAKURL();
  100. // Returns true if CYS/MYS is supported on this SKU
  101. bool
  102. IsSupportedSku();
  103. // Checks all the regkeys associated with MYS/CYS to see if MYS should
  104. // be run
  105. bool
  106. IsStartupFlagSet();
  107. // Checks the policy registry keys to see if MYS should be run
  108. bool
  109. ShouldShowMYSAccordingToPolicy();
  110. #endif __CYS_H