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.

304 lines
7.9 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. dsrolep.h
  5. Abstract:
  6. Private definitions for DsRole routines used for upgrading downlevel domains
  7. Author:
  8. Mac McLain (MacM) 24-January-1998
  9. Environment:
  10. Revision History:
  11. --*/
  12. #ifndef __DSROLEP_H__
  13. #define __DSROLEP_H__
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. //
  18. // Data structures for configuring the role of a Dc in a domain
  19. //
  20. typedef PVOID DSROLE_SERVEROP_HANDLE;
  21. //
  22. // Type of display strings to query for
  23. //
  24. typedef enum {
  25. DsRoleOperationPromote = 1,
  26. DsRoleOperationReplicaPromote,
  27. DsRoleOperationDemote,
  28. DsRoleOperationUpgrade
  29. } DSROLE_SERVEROP_OPERATION;
  30. //
  31. // Status of an existing operation
  32. //
  33. typedef struct _DSROLE_SERVEROP_STATUS {
  34. LPWSTR CurrentOperationDisplayString;
  35. ULONG OperationStatus;
  36. ULONG CurrentOperationDisplayStringIndex;
  37. } DSROLE_SERVEROP_STATUS, *PDSROLE_SERVEROP_STATUS;
  38. //
  39. // where:
  40. // CurrentOperationDisplayString is a displayable status of the current operation. For example:
  41. // Locating a domain controller for the domain BRIDGE.NTDEV.MICROSOFT.COM
  42. // Replicating Ds Data from parent domain controller FRANK.BRIDGE.NTDEV.MICROSOFT.COM
  43. // Configuring KDC service to autostart
  44. //
  45. //
  46. // Status returned from a GetOperationResults call
  47. //
  48. typedef struct _DSROLE_SERVEROP_RESULTS {
  49. ULONG OperationStatus;
  50. LPWSTR OperationStatusDisplayString;
  51. LPWSTR ServerInstalledSite;
  52. ULONG OperationResultsFlags;
  53. } DSROLE_SERVEROP_RESULTS, *PDSROLE_SERVEROP_RESULTS;
  54. //
  55. // where:
  56. // OperationStatus is the status code returned from the operation.
  57. // OperationStatusDisplayString is a displayable status of the current operation. For example:
  58. // Successfully installed a domain controller for the domain BRIDGE.NTDEV.MICROSOFT.COM
  59. // Failed to create the trust between BRIDGE.NTDEV.MICROSOFT.COM and
  60. // FRANK.BRIDGE.NTDEV.MICROSOFT.COM because the trust object already exists on the parent
  61. // ServerInstalledSite is where the site the server was installed in is returned
  62. // OperationResultsFlags is where any flags are returned determine any specifics about the results
  63. //
  64. //
  65. #define IFM_SYSTEM_KEY L"ifmSystem"
  66. #define IFM_SECURITY_KEY L"ifmSecurity"
  67. //
  68. // Operation states
  69. //
  70. #define DSROLE_CRITICAL_OPERATIONS_COMPLETED 0x00000001
  71. //
  72. // Operation results flags
  73. //
  74. #define DSROLE_NON_FATAL_ERROR_OCCURRED 0x00000001
  75. #define DSROLE_NON_CRITICAL_REPL_NOT_FINISHED 0x00000002
  76. #define DSROLE_IFM_RESTORED_DATABASE_FILES_MOVED 0x00000004
  77. #define DSROLE_IFM_GC_REQUEST_CANNOT_BE_SERVICED 0x00000008
  78. //
  79. // Determines the role of DC following a demotion
  80. //
  81. typedef enum _DSROLE_SERVEROP_DEMOTE_ROLE {
  82. DsRoleServerStandalone = 0,
  83. DsRoleServerMember
  84. } DSROLE_SERVEROP_DEMOTE_ROLE, *PDSROLE_SERVEROP_DEMOTE_ROLE;
  85. //
  86. // Valid options for various DsRole apis
  87. //
  88. #define DSROLE_DC_PARENT_TRUST_EXISTS 0x00000001
  89. #define DSROLE_DC_ROOT_TRUST_EXISTS 0x00000001
  90. #define DSROLE_DC_DELETE_PARENT_TRUST 0x00000002
  91. #define DSROLE_DC_DELETE_ROOT_TRUST 0x00000002
  92. #define DSROLE_DC_ALLOW_DC_REINSTALL 0x00000004
  93. #define DSROLE_DC_ALLOW_DOMAIN_REINSTALL 0x00000008
  94. #define DSROLE_DC_TRUST_AS_ROOT 0x00000010
  95. #define DSROLE_DC_DOWNLEVEL_UPGRADE 0x00000020
  96. #define DSROLE_DC_FORCE_TIME_SYNC 0x00000040
  97. #define DSROLE_DC_CREATE_TRUST_AS_REQUIRED 0x00000080
  98. #define DSROLE_DC_DELETE_SYSVOL_PATH 0x00000100
  99. #define DSROLE_DC_DONT_DELETE_DOMAIN 0x00000200
  100. #define DSROLE_DC_CRITICAL_REPLICATION_ONLY 0x00000400
  101. #define DSROLE_DC_ALLOW_ANONYMOUS_ACCESS 0x00000800
  102. #define DSROLE_DC_NO_NET 0x00001000
  103. #define DSROLE_DC_REQUEST_GC 0x00002000
  104. #define DSROLE_DC_DEFAULT_REPAIR_PWD 0x00004000
  105. #define DSROLE_DC_SET_FOREST_CURRENT 0x00008000
  106. //
  107. // Options to be used for fixing up a domain controller
  108. //
  109. #define DSROLE_DC_FIXUP_ACCOUNT 0x00000001
  110. #define DSROLE_DC_FIXUP_ACCOUNT_PASSWORD 0x00000002
  111. #define DSROLE_DC_FIXUP_ACCOUNT_TYPE 0x00000004
  112. #define DSROLE_DC_FIXUP_TIME_SERVICE 0x00000008
  113. #define DSROLE_DC_FIXUP_DC_SERVICES 0x00000010
  114. #define DSROLE_DC_FIXUP_FORCE_SYNC 0x00000020
  115. #define DSROLE_DC_FIXUP_SYNC_LSA_POLICY 0x00000040
  116. #define DSROLE_DC_FIXUP_TIME_SYNC 0x00000080
  117. #define DSROLE_DC_FIXUP_CLEAN_TRUST 0x00000100
  118. //
  119. // Returns from DsRoleGetDatabaseFacts
  120. //
  121. #define DSROLE_DC_IS_GC 0x00000001
  122. #define DSROLE_KEY_STORED 0x00000002
  123. #define DSROLE_KEY_DISK 0x00000004
  124. #define DSROLE_KEY_PROMPT 0x00000008
  125. //
  126. // Flags returned by DsRoleDnsNameToFlatName
  127. //
  128. #define DSROLE_FLATNAME_DEFAULT 0x00000001
  129. #define DSROLE_FLATNAME_UPGRADE 0x00000002
  130. DWORD
  131. WINAPI
  132. DsRoleDnsNameToFlatName(
  133. IN LPCWSTR lpServer OPTIONAL,
  134. IN LPCWSTR lpDnsName,
  135. OUT LPWSTR *lpFlatName,
  136. OUT PULONG lpStatusFlag
  137. );
  138. DWORD
  139. WINAPI
  140. DsRoleDcAsDc(
  141. IN LPCWSTR lpServer OPTIONAL,
  142. IN LPCWSTR lpDnsDomainName,
  143. IN LPCWSTR lpFlatDomainName,
  144. IN LPCWSTR lpDomainAdminPassword OPTIONAL,
  145. IN LPCWSTR lpSiteName, OPTIONAL
  146. IN LPCWSTR lpDsDatabasePath,
  147. IN LPCWSTR lpDsLogPath,
  148. IN LPCWSTR lpSystemVolumeRootPath,
  149. IN LPCWSTR lpParentDnsDomainName OPTIONAL,
  150. IN LPCWSTR lpParentServer OPTIONAL,
  151. IN LPCWSTR lpAccount OPTIONAL,
  152. IN LPCWSTR lpPassword OPTIONAL,
  153. IN LPCWSTR lpDsRepairPassword OPTIONAL,
  154. IN ULONG Options,
  155. OUT DSROLE_SERVEROP_HANDLE *DsOperationHandle
  156. );
  157. DWORD
  158. WINAPI
  159. DsRoleDcAsReplica(
  160. IN LPCWSTR lpServer OPTIONAL,
  161. IN LPCWSTR lpDnsDomainName,
  162. IN LPCWSTR lpReplicaServer,
  163. IN LPCWSTR lpSiteName, OPTIONAL
  164. IN LPCWSTR lpDsDatabasePath,
  165. IN LPCWSTR lpDsLogPath,
  166. IN LPCWSTR lpRestorePath OPTIONAL,
  167. IN LPCWSTR lpSystemVolumeRootPath,
  168. IN OUT LPWSTR lpBootkey OPTIONAL,
  169. IN LPCWSTR lpAccount OPTIONAL,
  170. IN LPCWSTR lpPassword OPTIONAL,
  171. IN LPCWSTR lpDsRepairPassword OPTIONAL,
  172. IN ULONG Options,
  173. OUT DSROLE_SERVEROP_HANDLE *DsOperationHandle
  174. );
  175. DWORD
  176. WINAPI
  177. DsRoleDemoteDc(
  178. IN LPCWSTR lpServer OPTIONAL,
  179. IN LPCWSTR lpDnsDomainName OPTIONAL,
  180. IN DSROLE_SERVEROP_DEMOTE_ROLE ServerRole,
  181. IN LPCWSTR lpAccount OPTIONAL,
  182. IN LPCWSTR lpPassword OPTIONAL,
  183. IN ULONG Options,
  184. IN BOOL fLastDcInDomain,
  185. IN LPCWSTR lpDomainAdminPassword OPTIONAL,
  186. OUT DSROLE_SERVEROP_HANDLE *DsOperationHandle
  187. );
  188. DWORD
  189. WINAPI
  190. DsRoleGetDcOperationProgress(
  191. IN LPCWSTR lpServer OPTIONAL,
  192. IN DSROLE_SERVEROP_HANDLE DsOperationHandle,
  193. OUT PDSROLE_SERVEROP_STATUS *ServerOperationStatus
  194. );
  195. DWORD
  196. WINAPI
  197. DsRoleGetDcOperationResults(
  198. IN LPCWSTR lpServer OPTIONAL,
  199. IN DSROLE_SERVEROP_HANDLE DsOperationHandle,
  200. OUT PDSROLE_SERVEROP_RESULTS *ServerOperationResults
  201. );
  202. DWORD
  203. WINAPI
  204. DsRoleCancel(
  205. IN LPCWSTR lpServer OPTIONAL,
  206. IN DSROLE_SERVEROP_HANDLE DsOperationHandle
  207. );
  208. #define DSROLEP_ABORT_FOR_REPLICA_INSTALL 0x0000001
  209. DWORD
  210. WINAPI
  211. DsRoleServerSaveStateForUpgrade(
  212. IN LPCWSTR AnswerFile OPTIONAL
  213. );
  214. DWORD
  215. WINAPI
  216. DsRoleUpgradeDownlevelServer(
  217. IN LPCWSTR lpDnsDomainName,
  218. IN LPCWSTR lpSiteName,
  219. IN LPCWSTR lpDsDatabasePath,
  220. IN LPCWSTR lpDsLogPath,
  221. IN LPCWSTR lpSystemVolumeRootPath,
  222. IN LPCWSTR lpParentDnsDomainName OPTIONAL,
  223. IN LPCWSTR lpParentServer OPTIONAL,
  224. IN LPCWSTR lpAccount OPTIONAL,
  225. IN LPCWSTR lpPassword OPTIONAL,
  226. IN LPCWSTR lpDsRepairPassword OPTIONAL,
  227. IN ULONG Options,
  228. OUT DSROLE_SERVEROP_HANDLE *DsOperationHandle
  229. );
  230. DWORD
  231. WINAPI
  232. DsRoleAbortDownlevelServerUpgrade(
  233. IN LPCWSTR lpAdminPassword,
  234. IN LPCWSTR lpAccount OPTIONAL,
  235. IN LPCWSTR lpPassword OPTIONAL,
  236. IN ULONG Options
  237. );
  238. DWORD
  239. WINAPI
  240. DsRoleGetDatabaseFacts(
  241. IN LPCWSTR lpServer OPTIONAL,
  242. IN LPCWSTR lpRestorePath,
  243. OUT LPWSTR *lpDNSDomainName,
  244. OUT PULONG State
  245. );
  246. #ifdef __cplusplus
  247. }
  248. #endif
  249. #endif // __DSROLEP_H__