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.

271 lines
8.7 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. IN ULONG cRemoveNCs,
  60. IN LPWSTR * pszRemoveNCs, OPTIONAL
  61. OUT PNTDS_DNS_RR_INFO *pDnsRRInfo
  62. );
  63. typedef DWORD ( *DSR_NtdsPrepareForDemotionUndo ) (
  64. VOID
  65. );
  66. typedef DWORD ( *DSR_NtdsDemote ) (
  67. IN PSEC_WINNT_AUTH_IDENTITY Credentials, OPTIONAL
  68. IN LPWSTR AdminPassword, OPTIONAL
  69. IN DWORD Flags,
  70. IN LPWSTR ServerName,
  71. IN HANDLE ClientToken,
  72. IN CALLBACK_STATUS_TYPE pfnStatusCallBack, OPTIONAL
  73. IN CALLBACK_ERROR_TYPE pfnErrorCallBack, OPTIONAL
  74. IN ULONG cRemoveNCs,
  75. IN LPWSTR * pszRemoveNCs OPTIONAL
  76. );
  77. typedef DWORD ( *DSR_NtdsInstallCancel ) (
  78. VOID
  79. );
  80. typedef DWORD ( *DSR_NtdsInstallReplicateFull ) (
  81. IN CALLBACK_STATUS_TYPE pfnStatusCallBack,
  82. IN HANDLE ClientToken,
  83. IN ULONG ulRepOptions
  84. );
  85. typedef DWORD ( *DSR_NtdsFreeDnsRRInfo ) (
  86. IN PNTDS_DNS_RR_INFO pDnsRRInfo
  87. );
  88. //
  89. // Security editor prototypes
  90. //
  91. typedef DWORD ( WINAPI *DSR_SceDcPromoteSecurityEx ) (
  92. IN HANDLE ClientToken,
  93. IN ULONG Options,
  94. IN CALLBACK_STATUS_TYPE pfnStatusCallBack
  95. );
  96. typedef DWORD ( WINAPI *DSR_SceDcPromoCreateGPOsInSysvolEx ) (
  97. IN HANDLE ClientToken,
  98. IN LPWSTR Domain,
  99. IN LPWSTR SysvolRoot,
  100. IN ULONG Options,
  101. IN CALLBACK_STATUS_TYPE pfnStatusCallBack
  102. );
  103. typedef DWORD ( WINAPI *DSR_SceSetupSystemByInfName ) (
  104. IN PWSTR InfFullName,
  105. IN PCWSTR LogFileName OPTIONAL,
  106. IN AREA_INFORMATION Area,
  107. IN UINT nFlag,
  108. IN PSCE_NOTIFICATION_CALLBACK_ROUTINE pSceNotificationCallBack OPTIONAL,
  109. IN OUT PVOID pValue OPTIONAL
  110. );
  111. //
  112. // NTFRS initialization prototypes
  113. //
  114. typedef DWORD ( *DSR_NtFrsApi_PrepareForPromotionW ) (
  115. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  116. );
  117. typedef DWORD ( *DSR_NtFrsApi_PrepareForDemotionW ) (
  118. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  119. );
  120. typedef DWORD ( *DSR_NtFrsApi_PrepareForDemotionUsingCredW ) (
  121. IN SEC_WINNT_AUTH_IDENTITY *Credentials, OPTIONAL
  122. IN HANDLE ClientToken,
  123. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  124. );
  125. typedef DWORD ( *DSR_NtFrsApi_StartPromotionW ) (
  126. IN PWCHAR ParentComputer, OPTIONAL
  127. IN PWCHAR ParentAccount, OPTIONAL
  128. IN PWCHAR ParentPassword, OPTIONAL
  129. IN DWORD DisplayCallBack(IN PWCHAR Display), OPTIONAL
  130. IN CALLBACK_ERROR_TYPE pfnErrorCallBack, OPTIONAL
  131. IN PWCHAR ReplicaSetName,
  132. IN PWCHAR ReplicaSetType,
  133. IN DWORD ReplicaSetPrimary,
  134. IN PWCHAR ReplicaSetStage,
  135. IN PWCHAR ReplicaSetRoot
  136. );
  137. typedef DWORD ( *DSR_NtFrsApi_StartDemotionW ) (
  138. IN PWCHAR ReplicaSetName,
  139. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  140. );
  141. typedef DWORD ( *DSR_NtFrsApi_WaitForPromotionW ) (
  142. IN DWORD TimeoutInMilliSeconds,
  143. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  144. );
  145. typedef DWORD ( *DSR_NtFrsApi_WaitForDemotionW ) (
  146. IN DWORD TimeoutInMilliSeconds,
  147. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  148. );
  149. typedef DWORD ( *DSR_NtFrsApi_CommitPromotionW ) (
  150. IN DWORD TimeoutInMilliSeconds,
  151. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  152. );
  153. typedef DWORD ( *DSR_NtFrsApi_CommitDemotionW ) (
  154. IN DWORD TimeoutInMilliSeconds,
  155. IN CALLBACK_ERROR_TYPE pfnErrorCallBack OPTIONAL
  156. );
  157. typedef DWORD ( *DSR_NtFrsApi_AbortPromotionW ) (
  158. VOID
  159. );
  160. typedef DWORD ( *DSR_NtFrsApi_AbortDemotionW ) (
  161. VOID
  162. );
  163. #ifndef W32TIME_PROMOTE
  164. //
  165. // w32time doesn't currently have any exported headers.
  166. //
  167. #define W32TIME_PROMOTE 0x1
  168. #define W32TIME_DEMOTE 0x2
  169. #define W32TIME_PROMOTE_FIRST_DC_IN_TREE 0x4
  170. #define W32TIME_DEMOTE_LAST_DC_IN_DOMAIN 0x8
  171. #endif
  172. typedef VOID ( *DSR_W32TimeDcPromo ) (
  173. DWORD dwFlags
  174. );
  175. EXTERN DSR_NtdsInstall DsrNtdsInstall;
  176. EXTERN DSR_NtdsInstallShutdown DsrNtdsInstallShutdown;
  177. EXTERN DSR_NtdsInstallUndo DsrNtdsInstallUndo;
  178. EXTERN DSR_NtdsGetDefaultDnsName DsrNtdsGetDefaultDnsName;
  179. EXTERN DSR_NtdsSetReplicaMachineAccount DsrNtdsSetReplicaMachineAccount;
  180. EXTERN DSR_NtdsPrepareForDemotion DsrNtdsPrepareForDemotion;
  181. EXTERN DSR_NtdsPrepareForDemotionUndo DsrNtdsPrepareForDemotionUndo;
  182. EXTERN DSR_NtdsDemote DsrNtdsDemote;
  183. EXTERN DSR_NtdsInstallCancel DsrNtdsInstallCancel;
  184. EXTERN DSR_NtdsInstallReplicateFull DsrNtdsInstallReplicateFull;
  185. EXTERN DSR_NtdsFreeDnsRRInfo DsrNtdsFreeDnsRRInfo;
  186. EXTERN DSR_SceDcPromoteSecurityEx DsrSceDcPromoteSecurityEx;
  187. EXTERN DSR_SceDcPromoCreateGPOsInSysvolEx DsrSceDcPromoCreateGPOsInSysvolEx;
  188. EXTERN DSR_SceSetupSystemByInfName DsrSceSetupSystemByInfName;
  189. EXTERN DSR_NtFrsApi_PrepareForPromotionW DsrNtFrsApi_PrepareForPromotionW;
  190. EXTERN DSR_NtFrsApi_PrepareForDemotionW DsrNtFrsApi_PrepareForDemotionW;
  191. EXTERN DSR_NtFrsApi_PrepareForDemotionUsingCredW DsrNtFrsApi_PrepareForDemotionUsingCredW;
  192. EXTERN DSR_NtFrsApi_StartPromotionW DsrNtFrsApi_StartPromotionW;
  193. EXTERN DSR_NtFrsApi_StartDemotionW DsrNtFrsApi_StartDemotionW;
  194. EXTERN DSR_NtFrsApi_WaitForPromotionW DsrNtFrsApi_WaitForPromotionW;
  195. EXTERN DSR_NtFrsApi_WaitForDemotionW DsrNtFrsApi_WaitForDemotionW;
  196. EXTERN DSR_NtFrsApi_CommitPromotionW DsrNtFrsApi_CommitPromotionW;
  197. EXTERN DSR_NtFrsApi_CommitDemotionW DsrNtFrsApi_CommitDemotionW;
  198. EXTERN DSR_NtFrsApi_AbortPromotionW DsrNtFrsApi_AbortPromotionW;
  199. EXTERN DSR_NtFrsApi_AbortDemotionW DsrNtFrsApi_AbortDemotionW;
  200. EXTERN DSR_W32TimeDcPromo DsrW32TimeDcPromo;
  201. DWORD
  202. DsRolepLoadSetupFunctions(
  203. VOID
  204. );
  205. VOID
  206. DsRolepUnloadSetupFunctions(
  207. VOID
  208. );
  209. VOID
  210. DsRolepInitSetupFunctions(
  211. VOID
  212. );
  213. //
  214. // N.B. If this assert fires, then the operation handle lock
  215. // has been misused.
  216. //
  217. #define DSROLE_GET_SETUP_FUNC( status, pfunc ) \
  218. if ( pfunc == NULL ) { \
  219. ASSERT( pfunc ); \
  220. status = DsRolepLoadSetupFunctions(); \
  221. }
  222. #endif