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.

279 lines
5.4 KiB

  1. /*++
  2. Copyright (c) 1987-1991 Microsoft Corporation
  3. Module Name:
  4. nlrepl.h
  5. Abstract:
  6. Prototypes of the database replication functions called either from
  7. LSA OR SAM.
  8. Author:
  9. Madan Appiah
  10. Environment:
  11. User mode only.
  12. Contains NT-specific code.
  13. Requires ANSI C extensions: slash-slash comments, long external names.
  14. Revision History:
  15. 14-Apr-1992 (madana)
  16. Created.
  17. --*/
  18. #ifndef _NLREPL_H_
  19. #define _NLREPL_H_
  20. //
  21. // Don't require the DS to include every .h in the world
  22. //
  23. #include <lmcons.h>
  24. #include <dsgetdc.h>
  25. #ifndef _AVOID_REPL_API
  26. NTSTATUS
  27. I_NetNotifyDelta (
  28. IN SECURITY_DB_TYPE DbType,
  29. IN LARGE_INTEGER ModificationCount,
  30. IN SECURITY_DB_DELTA_TYPE DeltaType,
  31. IN SECURITY_DB_OBJECT_TYPE ObjectType,
  32. IN ULONG ObjectRid,
  33. IN PSID ObjectSid,
  34. IN PUNICODE_STRING ObjectName,
  35. IN DWORD ReplicationImmediately,
  36. IN PSAM_DELTA_DATA DeltaData
  37. );
  38. NTSTATUS
  39. I_NetNotifyRole(
  40. IN POLICY_LSA_SERVER_ROLE Role
  41. );
  42. NTSTATUS
  43. I_NetNotifyMachineAccount (
  44. IN ULONG ObjectRid,
  45. IN PSID DomainSid,
  46. IN ULONG OldUserAccountControl,
  47. IN ULONG NewUserAccountControl,
  48. IN PUNICODE_STRING ObjectName
  49. );
  50. NTSTATUS
  51. I_NetNotifyTrustedDomain (
  52. IN PSID HostedDomainSid,
  53. IN PSID TrustedDomainSid,
  54. IN BOOLEAN IsDeletion
  55. );
  56. typedef enum {
  57. //
  58. // Indicates that a subnet object has been added, deleted, renamed, or
  59. // the site containing the subnet has changed.
  60. //
  61. NlSubnetObjectChanged,
  62. //
  63. // Indicates that a site object has been added, deleted or renamed.
  64. //
  65. NlSiteObjectChanged,
  66. //
  67. // Indicates that the site this DC is in has changed.
  68. //
  69. NlSiteChanged,
  70. //
  71. // Indicates that the org tree changed
  72. //
  73. NlOrgChanged,
  74. //
  75. // Indicate that the DC demotion is in progress
  76. //
  77. NlDcDemotionInProgress,
  78. //
  79. // Indicate that the DC demotion is completed
  80. //
  81. NlDcDemotionCompleted,
  82. //
  83. // Indicate that NDNC info has changed
  84. //
  85. NlNdncChanged,
  86. //
  87. // Indicate that DnsRootAlias has changed
  88. //
  89. NlDnsRootAliasChanged
  90. } NL_DS_CHANGE_TYPE, *PNL_DS_CHANGE_TYPE;
  91. NTSTATUS
  92. I_NetNotifyDsChange(
  93. IN NL_DS_CHANGE_TYPE DsChangeType
  94. );
  95. NTSTATUS
  96. I_NetLogonGetSerialNumber (
  97. IN SECURITY_DB_TYPE DbType,
  98. IN PSID DomainSid,
  99. OUT PLARGE_INTEGER SerialNumber
  100. );
  101. NTSTATUS
  102. I_NetLogonReadChangeLog(
  103. IN PVOID InContext,
  104. IN ULONG InContextSize,
  105. IN ULONG ChangeBufferSize,
  106. OUT PVOID *ChangeBuffer,
  107. OUT PULONG BytesRead,
  108. OUT PVOID *OutContext,
  109. OUT PULONG OutContextSize
  110. );
  111. NTSTATUS
  112. I_NetLogonNewChangeLog(
  113. OUT HANDLE *ChangeLogHandle
  114. );
  115. NTSTATUS
  116. I_NetLogonAppendChangeLog(
  117. IN HANDLE ChangeLogHandle,
  118. IN PVOID ChangeBuffer,
  119. IN ULONG ChangeBufferSize
  120. );
  121. NTSTATUS
  122. I_NetLogonCloseChangeLog(
  123. IN HANDLE ChangeLogHandle,
  124. IN BOOLEAN Commit
  125. );
  126. NTSTATUS
  127. I_NetLogonSendToSamOnPdc(
  128. IN LPWSTR DomainName,
  129. IN LPBYTE OpaqueBuffer,
  130. IN ULONG OpaqueBufferSize
  131. );
  132. #endif // _AVOID_REPL_API
  133. NET_API_STATUS
  134. I_DsGetDcCache(
  135. IN LPCWSTR NetbiosDomainName OPTIONAL,
  136. IN LPCWSTR DnsDomainName OPTIONAL,
  137. OUT PBOOLEAN InNt4Domain,
  138. OUT LPDWORD InNt4DomainTime
  139. );
  140. NET_API_STATUS
  141. DsrGetDcNameEx2(
  142. IN LPWSTR ComputerName OPTIONAL,
  143. IN LPWSTR AccountName OPTIONAL,
  144. IN ULONG AllowableAccountControlBits,
  145. IN LPWSTR DomainName OPTIONAL,
  146. IN GUID *DomainGuid OPTIONAL,
  147. IN LPWSTR SiteName OPTIONAL,
  148. IN ULONG Flags,
  149. OUT PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo
  150. );
  151. NTSTATUS
  152. I_NetLogonSetServiceBits(
  153. IN DWORD ServiceBitsOfInterest,
  154. IN DWORD ServiceBits
  155. );
  156. NTSTATUS
  157. I_NetLogonLdapLookupEx(
  158. IN PVOID Filter,
  159. IN PVOID SockAddr,
  160. OUT PVOID *Response,
  161. OUT PULONG ResponseSize
  162. );
  163. NET_API_STATUS
  164. I_NetLogonGetIpAddresses(
  165. OUT PULONG IpAddressCount,
  166. OUT LPBYTE *IpAddresses
  167. );
  168. //
  169. // OS verion number from I_NetLogonGetAuthDataEx
  170. //
  171. typedef enum _NL_OS_VERSION {
  172. NlNt35_or_older = 1,
  173. NlNt351,
  174. NlNt40,
  175. NlWin2000, // NT 5.0
  176. NlWhistler // NT 5.1
  177. } NL_OS_VERSION, *PNL_OS_VERSION;
  178. //
  179. // Flags to I_NetLogonGetAuthDataEx
  180. //
  181. #define NL_DIRECT_TRUST_REQUIRED 0x01
  182. #define NL_RETURN_CLOSEST_HOP 0x02
  183. #define NL_ROLE_PRIMARY_OK 0x04
  184. #define NL_REQUIRE_DOMAIN_IN_FOREST 0x08
  185. NTSTATUS
  186. I_NetLogonGetAuthDataEx(
  187. IN LPWSTR HostedDomainName OPTIONAL,
  188. IN LPWSTR TrustedDomainName,
  189. IN ULONG Flags,
  190. IN PLARGE_INTEGER FailedSessionSetupTime OPTIONAL,
  191. OUT LPWSTR *OurClientPrincipleName,
  192. OUT PVOID *ClientContext OPTIONAL,
  193. OUT LPWSTR *ServerName,
  194. OUT PNL_OS_VERSION ServerOsVersion,
  195. OUT PULONG AuthnLevel,
  196. OUT PLARGE_INTEGER SessionSetupTime
  197. );
  198. NTSTATUS
  199. I_NetNotifyNtdsDsaDeletion (
  200. IN LPWSTR DnsDomainName OPTIONAL,
  201. IN GUID *DomainGuid OPTIONAL,
  202. IN GUID *DsaGuid,
  203. IN LPWSTR DnsHostName
  204. );
  205. VOID
  206. I_NetLogonFree(
  207. IN PVOID Buffer
  208. );
  209. NTSTATUS
  210. I_NetLogonMixedDomain(
  211. OUT PBOOL MixedMode
  212. );
  213. #ifdef _WINSOCK2API_
  214. NET_API_STATUS
  215. I_NetLogonAddressToSiteName(
  216. IN PSOCKET_ADDRESS SocketAddress,
  217. OUT LPWSTR *SiteName
  218. );
  219. #endif
  220. #endif // _NLREPL_H_