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.

266 lines
8.1 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. loadfn.h
  5. Abstract:
  6. Definitions and globals for dynamically loading the required functions from
  7. the setup dlls
  8. Author:
  9. Mac McLain (MacM) June 11, 1997
  10. Environment:
  11. Revision History:
  12. --*/
  13. #ifndef __LOADFN_H__
  14. #define __LOADFN_H__
  15. //
  16. // All global variables declared as EXTERN will be allocated in the file
  17. // that defines NTDSSET_ALLOCATE
  18. //
  19. #ifdef EXTERN
  20. #undef EXTERN
  21. #endif
  22. #ifdef NTDSSET_ALLOCATE
  23. #define EXTERN
  24. #else
  25. #define EXTERN extern
  26. #endif
  27. #include <scesetup.h>
  28. typedef DWORD ( *DSR_NtdsInstall )(
  29. IN PNTDS_INSTALL_INFO InstallInfo,
  30. OUT LPWSTR *InstalledSiteName, OPTIONAL
  31. OUT GUID *NewDnsDomainGuid, OPTIONAL
  32. OUT PSID *NewDnsDomainSid OPTIONAL
  33. );
  34. typedef DWORD ( *DSR_NtdsInstallShutdown )(
  35. VOID
  36. );
  37. typedef DWORD ( *DSR_NtdsInstallUndo )(
  38. VOID
  39. );
  40. typedef DWORD ( *DSR_NtdsGetDefaultDnsName )(
  41. OUT OPTIONAL WCHAR *DnsName,
  42. IN OUT ULONG *DnsNameLength
  43. );
  44. typedef DWORD ( *DSR_NtdsSetReplicaMachineAccount )(
  45. IN SEC_WINNT_AUTH_IDENTITY *Credentials,
  46. IN HANDLE ClientToken,
  47. IN LPWSTR DcName,
  48. IN LPWSTR AccountName,
  49. IN ULONG AccountFlags,
  50. IN OUT WCHAR** AccountDn OPTIONAL
  51. );
  52. typedef DWORD ( *DSR_NtdsPrepareForDemotion ) (
  53. IN ULONG Flags,
  54. IN LPWSTR ServerName,
  55. IN SEC_WINNT_AUTH_IDENTITY *Credentials, OPTIONAL
  56. IN CALLBACK_STATUS_TYPE pfnStatusCallBack, OPTIONAL
  57. IN CALLBACK_ERROR_TYPE pfnErrorStatus, OPTIONAL
  58. IN HANDLE ClientToken, OPTIONAL
  59. OUT PNTDS_DNS_RR_INFO *pDnsRRInfo
  60. );
  61. typedef DWORD ( *DSR_NtdsPrepareForDemotionUndo ) (
  62. VOID
  63. );
  64. typedef DWORD ( *DSR_NtdsDemote ) (
  65. IN PSEC_WINNT_AUTH_IDENTITY Credentials, OPTIONAL
  66. IN LPWSTR AdminPassword, OPTIONAL
  67. IN DWORD Flags,
  68. IN LPWSTR ServerName,
  69. IN HANDLE ClientToken,
  70. IN CALLBACK_STATUS_TYPE pfnStatusCallBack, OPTIONAL
  71. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  72. );
  73. typedef DWORD ( *DSR_NtdsInstallCancel ) (
  74. VOID
  75. );
  76. typedef DWORD ( *DSR_NtdsInstallReplicateFull ) (
  77. IN CALLBACK_STATUS_TYPE pfnStatusCallBack,
  78. IN HANDLE ClientToken,
  79. IN ULONG ulRepOptions
  80. );
  81. typedef DWORD ( *DSR_NtdsFreeDnsRRInfo ) (
  82. IN PNTDS_DNS_RR_INFO pDnsRRInfo
  83. );
  84. //
  85. // Security editor prototypes
  86. //
  87. typedef DWORD ( WINAPI *DSR_SceDcPromoteSecurityEx ) (
  88. IN HANDLE ClientToken,
  89. IN ULONG Options,
  90. IN CALLBACK_STATUS_TYPE pfnStatusCallBack
  91. );
  92. typedef DWORD ( WINAPI *DSR_SceDcPromoCreateGPOsInSysvolEx ) (
  93. IN HANDLE ClientToken,
  94. IN LPWSTR Domain,
  95. IN LPWSTR SysvolRoot,
  96. IN ULONG Options,
  97. IN CALLBACK_STATUS_TYPE pfnStatusCallBack
  98. );
  99. typedef DWORD ( WINAPI *DSR_SceSetupSystemByInfName ) (
  100. IN PWSTR InfFullName,
  101. IN PCWSTR LogFileName OPTIONAL,
  102. IN AREA_INFORMATION Area,
  103. IN UINT nFlag,
  104. IN PSCE_NOTIFICATION_CALLBACK_ROUTINE pSceNotificationCallBack OPTIONAL,
  105. IN OUT PVOID pValue OPTIONAL
  106. );
  107. //
  108. // NTFRS initialization prototypes
  109. //
  110. typedef DWORD ( *DSR_NtFrsApi_PrepareForPromotionW ) (
  111. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  112. );
  113. typedef DWORD ( *DSR_NtFrsApi_PrepareForDemotionW ) (
  114. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  115. );
  116. typedef DWORD ( *DSR_NtFrsApi_PrepareForDemotionUsingCredW ) (
  117. IN SEC_WINNT_AUTH_IDENTITY *Credentials, OPTIONAL
  118. IN HANDLE ClientToken,
  119. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  120. );
  121. typedef DWORD ( *DSR_NtFrsApi_StartPromotionW ) (
  122. IN PWCHAR ParentComputer, OPTIONAL
  123. IN PWCHAR ParentAccount, OPTIONAL
  124. IN PWCHAR ParentPassword, OPTIONAL
  125. IN DWORD DisplayCallBack(IN PWCHAR Display), OPTIONAL
  126. IN CALLBACK_ERROR_TYPE pfnErrorCallBack, OPTIONAL
  127. IN PWCHAR ReplicaSetName,
  128. IN PWCHAR ReplicaSetType,
  129. IN DWORD ReplicaSetPrimary,
  130. IN PWCHAR ReplicaSetStage,
  131. IN PWCHAR ReplicaSetRoot
  132. );
  133. typedef DWORD ( *DSR_NtFrsApi_StartDemotionW ) (
  134. IN PWCHAR ReplicaSetName,
  135. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  136. );
  137. typedef DWORD ( *DSR_NtFrsApi_WaitForPromotionW ) (
  138. IN DWORD TimeoutInMilliSeconds,
  139. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  140. );
  141. typedef DWORD ( *DSR_NtFrsApi_WaitForDemotionW ) (
  142. IN DWORD TimeoutInMilliSeconds,
  143. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  144. );
  145. typedef DWORD ( *DSR_NtFrsApi_CommitPromotionW ) (
  146. IN DWORD TimeoutInMilliSeconds,
  147. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  148. );
  149. typedef DWORD ( *DSR_NtFrsApi_CommitDemotionW ) (
  150. IN DWORD TimeoutInMilliSeconds,
  151. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  152. );
  153. typedef DWORD ( *DSR_NtFrsApi_AbortPromotionW ) (
  154. VOID
  155. );
  156. typedef DWORD ( *DSR_NtFrsApi_AbortDemotionW ) (
  157. VOID
  158. );
  159. #ifndef W32TIME_PROMOTE
  160. //
  161. // w32time doesn't currently have any exported headers.
  162. //
  163. #define W32TIME_PROMOTE 0x1
  164. #define W32TIME_DEMOTE 0x2
  165. #define W32TIME_PROMOTE_FIRST_DC_IN_TREE 0x4
  166. #endif
  167. typedef VOID ( *DSR_W32TimeDcPromo ) (
  168. DWORD dwFlags
  169. );
  170. EXTERN DSR_NtdsInstall DsrNtdsInstall;
  171. EXTERN DSR_NtdsInstallShutdown DsrNtdsInstallShutdown;
  172. EXTERN DSR_NtdsInstallUndo DsrNtdsInstallUndo;
  173. EXTERN DSR_NtdsGetDefaultDnsName DsrNtdsGetDefaultDnsName;
  174. EXTERN DSR_NtdsSetReplicaMachineAccount DsrNtdsSetReplicaMachineAccount;
  175. EXTERN DSR_NtdsPrepareForDemotion DsrNtdsPrepareForDemotion;
  176. EXTERN DSR_NtdsPrepareForDemotionUndo DsrNtdsPrepareForDemotionUndo;
  177. EXTERN DSR_NtdsDemote DsrNtdsDemote;
  178. EXTERN DSR_NtdsInstallCancel DsrNtdsInstallCancel;
  179. EXTERN DSR_NtdsInstallReplicateFull DsrNtdsInstallReplicateFull;
  180. EXTERN DSR_NtdsFreeDnsRRInfo DsrNtdsFreeDnsRRInfo;
  181. EXTERN DSR_SceDcPromoteSecurityEx DsrSceDcPromoteSecurityEx;
  182. EXTERN DSR_SceDcPromoCreateGPOsInSysvolEx DsrSceDcPromoCreateGPOsInSysvolEx;
  183. EXTERN DSR_SceSetupSystemByInfName DsrSceSetupSystemByInfName;
  184. EXTERN DSR_NtFrsApi_PrepareForPromotionW DsrNtFrsApi_PrepareForPromotionW;
  185. EXTERN DSR_NtFrsApi_PrepareForDemotionW DsrNtFrsApi_PrepareForDemotionW;
  186. EXTERN DSR_NtFrsApi_PrepareForDemotionUsingCredW DsrNtFrsApi_PrepareForDemotionUsingCredW;
  187. EXTERN DSR_NtFrsApi_StartPromotionW DsrNtFrsApi_StartPromotionW;
  188. EXTERN DSR_NtFrsApi_StartDemotionW DsrNtFrsApi_StartDemotionW;
  189. EXTERN DSR_NtFrsApi_WaitForPromotionW DsrNtFrsApi_WaitForPromotionW;
  190. EXTERN DSR_NtFrsApi_WaitForDemotionW DsrNtFrsApi_WaitForDemotionW;
  191. EXTERN DSR_NtFrsApi_CommitPromotionW DsrNtFrsApi_CommitPromotionW;
  192. EXTERN DSR_NtFrsApi_CommitDemotionW DsrNtFrsApi_CommitDemotionW;
  193. EXTERN DSR_NtFrsApi_AbortPromotionW DsrNtFrsApi_AbortPromotionW;
  194. EXTERN DSR_NtFrsApi_AbortDemotionW DsrNtFrsApi_AbortDemotionW;
  195. EXTERN DSR_W32TimeDcPromo DsrW32TimeDcPromo;
  196. DWORD
  197. DsRolepLoadSetupFunctions(
  198. VOID
  199. );
  200. VOID
  201. DsRolepUnloadSetupFunctions(
  202. VOID
  203. );
  204. VOID
  205. DsRolepInitSetupFunctions(
  206. VOID
  207. );
  208. //
  209. // N.B. If this assert fires, then the operation handle lock
  210. // has been misused.
  211. //
  212. #define DSROLE_GET_SETUP_FUNC( status, pfunc ) \
  213. if ( pfunc == NULL ) { \
  214. ASSERT( pfunc ); \
  215. status = DsRolepLoadSetupFunctions(); \
  216. }
  217. #endif