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.

1313 lines
40 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. LOGON.IDL
  5. Abstract:
  6. Contains the Netr (Net Remote) RPC interface specification for the
  7. API associated with the Netlogon Service.
  8. Also contains the RPC specific data structures for these API.
  9. Author:
  10. Cliff Van Dyke (CliffV) 25-Jun-1991
  11. Environment:
  12. User Mode - Win32
  13. Revision History:
  14. 25-Jun-1991 CliffV
  15. created
  16. 04-Apr-1992 MadanA
  17. Added support for LSA replication.
  18. --*/
  19. //
  20. // Interface Attributes
  21. //
  22. [
  23. uuid(12345678-1234-ABCD-EF00-01234567CFFB),
  24. version(1.0),
  25. #ifdef __midl
  26. ms_union,
  27. #endif // __midl
  28. pointer_default(unique)
  29. ]
  30. //
  31. // Interface Keyword
  32. //
  33. interface logon
  34. //
  35. // Interface Body
  36. //
  37. {
  38. #define _RPC_
  39. import "imports.idl"; // import all the include files
  40. #include <lmcons.h> // Needed for prototype below
  41. #define NL_MAX_RPC_ENTRY_COUNT 32000 // max number of entries that the server should allocate memory for
  42. //
  43. // FunctionCode values for I_NetLogonControl.
  44. //
  45. #define NETLOGON_CONTROL_QUERY 1 // No-op: just query
  46. #define NETLOGON_CONTROL_REPLICATE 2 // Force replicate on BDC
  47. #define NETLOGON_CONTROL_SYNCHRONIZE 3 // Force synchronize on BDC
  48. #define NETLOGON_CONTROL_PDC_REPLICATE 4 // Force PDC to broadcast change
  49. #define NETLOGON_CONTROL_REDISCOVER 5 // Force to re-discover trusted domain DCs
  50. #define NETLOGON_CONTROL_TC_QUERY 6 // Query status of specified trusted channel status
  51. #define NETLOGON_CONTROL_TRANSPORT_NOTIFY 7 // Notify netlogon that a new transport has come online
  52. #define NETLOGON_CONTROL_FIND_USER 8 // Find named user in a trusted domain
  53. #define NETLOGON_CONTROL_CHANGE_PASSWORD 9 // Change machine password on a secure channel to a trusted domain
  54. #define NETLOGON_CONTROL_TC_VERIFY 10 // Verify status of specified trusted channel
  55. #define NETLOGON_CONTROL_FORCE_DNS_REG 11 // Force DNS re-registration of all registered records
  56. #define NETLOGON_CONTROL_QUERY_DNS_REG 12 // Query the status of DNS updates
  57. // Debug function codes
  58. #define NETLOGON_CONTROL_BACKUP_CHANGE_LOG 0xFFFC
  59. #define NETLOGON_CONTROL_TRUNCATE_LOG 0xFFFD
  60. #define NETLOGON_CONTROL_SET_DBFLAG 0xFFFE
  61. #define NETLOGON_CONTROL_BREAKPOINT 0xFFFF
  62. typedef [handle] wchar_t * LOGONSRV_HANDLE;
  63. //
  64. // Data types for rpc stubs.
  65. //
  66. // ?? the following data types should come from LSA or SAM idl definitions
  67. //
  68. // We must hide the PSID in a structure to avoid too many *'s in a
  69. // field that uses size_is - otherwise MIDL has a fit.
  70. //
  71. typedef struct _NLPR_SID_INFORMATION {
  72. PISID SidPointer;
  73. } NLPR_SID_INFORMATION, *PNLPR_SID_INFORMATION;
  74. //
  75. // Define an array of pointers to SIDs
  76. //
  77. typedef struct _NLPR_SID_ARRAY {
  78. //
  79. // Indicates the number of Elements in the array.
  80. //
  81. ULONG Count;
  82. //
  83. // Points to the array of sid-pointers
  84. //
  85. [size_is(Count)] PNLPR_SID_INFORMATION Sids;
  86. } NLPR_SID_ARRAY, *PNLPR_SID_ARRAY;
  87. //
  88. // Two-way encrypted value structure in Self-relative form. This
  89. // is just like a String.
  90. //
  91. typedef struct _NLPR_CR_CIPHER_VALUE {
  92. ULONG Length;
  93. ULONG MaximumLength;
  94. [size_is(MaximumLength), length_is(Length)] PUCHAR Buffer;
  95. } NLPR_CR_CIPHER_VALUE, *PNLPR_CR_CIPHER_VALUE;
  96. typedef struct _NLPR_LOGON_HOURS {
  97. USHORT UnitsPerWeek;
  98. //
  99. // Points to an array of bitmask. The bits represent either days,
  100. // hours or minutes in the week depending upon the value of
  101. // UnitsPerWeek. (Technically, they could represent any division of
  102. // time not finer than minute granularity).
  103. // Day granularity is specified by specifying SAM_DAYS_PER_WEEK.
  104. // Hours granularity is specified by specifying SAM_HOURS_PER_WEEK.
  105. // Minute granularity is specified by specifying
  106. // SAM_MINUTES_PER_WEEK. The number of bytes pointed to by this
  107. // field is ((UnitsPerWeek + 7) / 8) and may not exceed
  108. // ((SAM_MINUTES_PER_WEEK+7)/8 == 1260).
  109. //
  110. [size_is(1260), length_is((UnitsPerWeek+7)/8)] PUCHAR LogonHours;
  111. } NLPR_LOGON_HOURS, *PNLPR_LOGON_HOURS;
  112. typedef struct _NLPR_USER_PRIVATE_INFO {
  113. BOOLEAN SensitiveData;
  114. //
  115. // If SesitiveData is TRUE then the data is encrypted using
  116. // sessionkey across wire.
  117. //
  118. ULONG DataLength;
  119. [size_is(DataLength)] PUCHAR Data;
  120. } NLPR_USER_PRIVATE_INFO, *PNLPR_USER_PRIVATE_INFO;
  121. typedef struct _NLPR_MODIFIED_COUNT {
  122. OLD_LARGE_INTEGER ModifiedCount;
  123. } NLPR_MODIFIED_COUNT, *PNLPR_MODIFIED_COUNT;
  124. typedef struct _NLPR_QUOTA_LIMITS {
  125. ULONG PagedPoolLimit;
  126. ULONG NonPagedPoolLimit;
  127. ULONG MinimumWorkingSetSize;
  128. ULONG MaximumWorkingSetSize;
  129. ULONG PagefileLimit;
  130. OLD_LARGE_INTEGER TimeLimit;
  131. } NLPR_QUOTA_LIMITS, *PNLPR_QUOTA_LIMITS;
  132. //
  133. // Enumeration structure returned from I_NetSamDeltas and I_NetSamSync
  134. //
  135. //
  136. // Structure to completely describe a user.
  137. //
  138. typedef struct _NETLOGON_DELTA_USER {
  139. UNICODE_STRING UserName;
  140. UNICODE_STRING FullName;
  141. ULONG UserId;
  142. ULONG PrimaryGroupId;
  143. UNICODE_STRING HomeDirectory;
  144. UNICODE_STRING HomeDirectoryDrive;
  145. UNICODE_STRING ScriptPath;
  146. UNICODE_STRING AdminComment;
  147. UNICODE_STRING WorkStations;
  148. OLD_LARGE_INTEGER LastLogon;
  149. OLD_LARGE_INTEGER LastLogoff;
  150. NLPR_LOGON_HOURS LogonHours;
  151. USHORT BadPasswordCount;
  152. USHORT LogonCount;
  153. OLD_LARGE_INTEGER PasswordLastSet;
  154. OLD_LARGE_INTEGER AccountExpires;
  155. ULONG UserAccountControl;
  156. //
  157. // The following fields are duplicates of information already in
  158. // the Private data. Starting in NT 3.51, these fields are zeroed.
  159. //
  160. ENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword;
  161. ENCRYPTED_LM_OWF_PASSWORD EncryptedLmOwfPassword;
  162. BOOLEAN NtPasswordPresent;
  163. BOOLEAN LmPasswordPresent;
  164. BOOLEAN PasswordExpired;
  165. UNICODE_STRING UserComment;
  166. UNICODE_STRING Parameters;
  167. USHORT CountryCode;
  168. USHORT CodePage;
  169. NLPR_USER_PRIVATE_INFO PrivateData; // password history
  170. SECURITY_INFORMATION SecurityInformation;
  171. ULONG SecuritySize;
  172. [size_is(SecuritySize)] PUCHAR SecurityDescriptor;
  173. UNICODE_STRING DummyString1; // used for profile path.
  174. UNICODE_STRING DummyString2;
  175. UNICODE_STRING DummyString3;
  176. UNICODE_STRING DummyString4;
  177. ULONG DummyLong1; // used for LastBadPasswordTime.HighPart
  178. ULONG DummyLong2; // used for LastBadPasswordTime.LowPart
  179. ULONG DummyLong3;
  180. ULONG DummyLong4;
  181. } NETLOGON_DELTA_USER, *PNETLOGON_DELTA_USER;
  182. //
  183. // Structure to completely describe a group.
  184. //
  185. typedef struct _NETLOGON_DELTA_GROUP {
  186. UNICODE_STRING Name;
  187. ULONG RelativeId;
  188. ULONG Attributes;
  189. UNICODE_STRING AdminComment;
  190. SECURITY_INFORMATION SecurityInformation;
  191. ULONG SecuritySize;
  192. [size_is(SecuritySize)] PUCHAR SecurityDescriptor;
  193. UNICODE_STRING DummyString1;
  194. UNICODE_STRING DummyString2;
  195. UNICODE_STRING DummyString3;
  196. UNICODE_STRING DummyString4;
  197. ULONG DummyLong1;
  198. ULONG DummyLong2;
  199. ULONG DummyLong3;
  200. ULONG DummyLong4;
  201. } NETLOGON_DELTA_GROUP, *PNETLOGON_DELTA_GROUP;
  202. //
  203. // Structure to completely describe all the members of a group.
  204. //
  205. typedef struct _NETLOGON_DELTA_GROUP_MEMBER {
  206. [size_is(MemberCount)] PULONG MemberIds;
  207. [size_is(MemberCount)] PULONG Attributes;
  208. ULONG MemberCount;
  209. ULONG DummyLong1;
  210. ULONG DummyLong2;
  211. ULONG DummyLong3;
  212. ULONG DummyLong4;
  213. } NETLOGON_DELTA_GROUP_MEMBER, *PNETLOGON_DELTA_GROUP_MEMBER;
  214. //
  215. // Structure to completely describe a alias.
  216. //
  217. typedef struct _NETLOGON_DELTA_ALIAS {
  218. UNICODE_STRING Name;
  219. ULONG RelativeId;
  220. // UNICODE_STRING AdminComment;
  221. SECURITY_INFORMATION SecurityInformation;
  222. ULONG SecuritySize;
  223. [size_is(SecuritySize)] PUCHAR SecurityDescriptor;
  224. UNICODE_STRING DummyString1; // used for admin comment
  225. UNICODE_STRING DummyString2;
  226. UNICODE_STRING DummyString3;
  227. UNICODE_STRING DummyString4;
  228. ULONG DummyLong1;
  229. ULONG DummyLong2;
  230. ULONG DummyLong3;
  231. ULONG DummyLong4;
  232. } NETLOGON_DELTA_ALIAS, *PNETLOGON_DELTA_ALIAS;
  233. //
  234. // Structure to completely describe all the members of a alias.
  235. //
  236. typedef struct _NETLOGON_DELTA_ALIAS_MEMBER {
  237. NLPR_SID_ARRAY Members;
  238. ULONG DummyLong1;
  239. ULONG DummyLong2;
  240. ULONG DummyLong3;
  241. ULONG DummyLong4;
  242. } NETLOGON_DELTA_ALIAS_MEMBER, *PNETLOGON_DELTA_ALIAS_MEMBER;
  243. //
  244. // Structure to completely describe a domain.
  245. //
  246. typedef struct _NETLOGON_DELTA_DOMAIN {
  247. UNICODE_STRING DomainName;
  248. UNICODE_STRING OemInformation;
  249. OLD_LARGE_INTEGER ForceLogoff;
  250. USHORT MinPasswordLength;
  251. USHORT PasswordHistoryLength;
  252. OLD_LARGE_INTEGER MaxPasswordAge;
  253. OLD_LARGE_INTEGER MinPasswordAge;
  254. OLD_LARGE_INTEGER DomainModifiedCount;
  255. OLD_LARGE_INTEGER DomainCreationTime;
  256. // All this information is maintained separately on each system.
  257. #ifdef notdef
  258. UNICODE_STRING ReplicaSourceNodeName;
  259. DOMAIN_SERVER_ENABLE_STATE DomainServerState;
  260. DOMAIN_SERVER_ROLE DomainServerRole;
  261. #endif // notdef
  262. SECURITY_INFORMATION SecurityInformation;
  263. ULONG SecuritySize;
  264. [size_is(SecuritySize)] PUCHAR SecurityDescriptor;
  265. UNICODE_STRING DummyString1; // used to replicate DOMAIN_LOCKOUT_INFORMATION
  266. UNICODE_STRING DummyString2;
  267. UNICODE_STRING DummyString3;
  268. UNICODE_STRING DummyString4;
  269. ULONG DummyLong1; // used to replicate PasswordProperties
  270. ULONG DummyLong2;
  271. ULONG DummyLong3;
  272. ULONG DummyLong4;
  273. } NETLOGON_DELTA_DOMAIN, *PNETLOGON_DELTA_DOMAIN;
  274. typedef struct _NETLOGON_DELTA_RENAME {
  275. UNICODE_STRING OldName;
  276. UNICODE_STRING NewName;
  277. UNICODE_STRING DummyString1;
  278. UNICODE_STRING DummyString2;
  279. UNICODE_STRING DummyString3;
  280. UNICODE_STRING DummyString4;
  281. ULONG DummyLong1;
  282. ULONG DummyLong2;
  283. ULONG DummyLong3;
  284. ULONG DummyLong4;
  285. } NETLOGON_RENAME_GROUP, *PNETLOGON_DELTA_RENAME_GROUP,
  286. NETLOGON_RENAME_USER, *PNETLOGON_DELTA_RENAME_USER,
  287. NETLOGON_RENAME_ALIAS, *PNETLOGON_DELTA_RENAME_ALIAS;
  288. typedef struct _NETLOGON_DELTA_POLICY {
  289. ULONG MaximumLogSize;
  290. OLD_LARGE_INTEGER AuditRetentionPeriod;
  291. BOOLEAN AuditingMode;
  292. ULONG MaximumAuditEventCount;
  293. [size_is(MaximumAuditEventCount + 1)] PULONG EventAuditingOptions;
  294. UNICODE_STRING PrimaryDomainName;
  295. PISID PrimaryDomainSid;
  296. NLPR_QUOTA_LIMITS QuotaLimits;
  297. OLD_LARGE_INTEGER ModifiedId;
  298. OLD_LARGE_INTEGER DatabaseCreationTime;
  299. SECURITY_INFORMATION SecurityInformation;
  300. ULONG SecuritySize;
  301. [size_is(SecuritySize)] PUCHAR SecurityDescriptor;
  302. UNICODE_STRING DummyString1;
  303. UNICODE_STRING DummyString2;
  304. UNICODE_STRING DummyString3;
  305. UNICODE_STRING DummyString4;
  306. ULONG DummyLong1;
  307. ULONG DummyLong2;
  308. ULONG DummyLong3;
  309. ULONG DummyLong4;
  310. } NETLOGON_DELTA_POLICY, *PNETLOGON_DELTA_POLICY;
  311. typedef struct _NETLOGON_DELTA_TRUSTED_DOMAINS {
  312. UNICODE_STRING DomainName;
  313. ULONG NumControllerEntries;
  314. [size_is(NumControllerEntries)] PUNICODE_STRING ControllerNames;
  315. SECURITY_INFORMATION SecurityInformation;
  316. ULONG SecuritySize;
  317. [size_is(SecuritySize)] PUCHAR SecurityDescriptor;
  318. UNICODE_STRING DummyString1;
  319. UNICODE_STRING DummyString2;
  320. UNICODE_STRING DummyString3;
  321. UNICODE_STRING DummyString4;
  322. ULONG DummyLong1; // used for posix offset.
  323. ULONG DummyLong2;
  324. ULONG DummyLong3;
  325. ULONG DummyLong4;
  326. } NETLOGON_DELTA_TRUSTED_DOMAINS, *PNETLOGON_DELTA_TRUSTED_DOMAINS;
  327. typedef struct _NETLOGON_DELTA_ACCOUNTS {
  328. ULONG PrivilegeEntries;
  329. ULONG PrivilegeControl;
  330. [size_is(PrivilegeEntries)] PULONG PrivilegeAttributes;
  331. [size_is(PrivilegeEntries)] PUNICODE_STRING PrivilegeNames;
  332. NLPR_QUOTA_LIMITS QuotaLimits;
  333. ULONG SystemAccessFlags;
  334. SECURITY_INFORMATION SecurityInformation;
  335. ULONG SecuritySize;
  336. [size_is(SecuritySize)] PUCHAR SecurityDescriptor;
  337. UNICODE_STRING DummyString1;
  338. UNICODE_STRING DummyString2;
  339. UNICODE_STRING DummyString3;
  340. UNICODE_STRING DummyString4;
  341. ULONG DummyLong1;
  342. ULONG DummyLong2;
  343. ULONG DummyLong3;
  344. ULONG DummyLong4;
  345. } NETLOGON_DELTA_ACCOUNTS, *PNETLOGON_DELTA_ACCOUNTS;
  346. typedef struct _NETLOGON_DELTA_SECRET {
  347. NLPR_CR_CIPHER_VALUE CurrentValue;
  348. OLD_LARGE_INTEGER CurrentValueSetTime;
  349. NLPR_CR_CIPHER_VALUE OldValue;
  350. OLD_LARGE_INTEGER OldValueSetTime;
  351. SECURITY_INFORMATION SecurityInformation;
  352. ULONG SecuritySize;
  353. [size_is(SecuritySize)] PUCHAR SecurityDescriptor;
  354. UNICODE_STRING DummyString1;
  355. UNICODE_STRING DummyString2;
  356. UNICODE_STRING DummyString3;
  357. UNICODE_STRING DummyString4;
  358. ULONG DummyLong1;
  359. ULONG DummyLong2;
  360. ULONG DummyLong3;
  361. ULONG DummyLong4;
  362. } NETLOGON_DELTA_SECRET, *PNETLOGON_DELTA_SECRET;
  363. typedef struct _NETLOGON_DELTA_DELETE {
  364. [string] wchar_t * AccountName;
  365. UNICODE_STRING DummyString1;
  366. UNICODE_STRING DummyString2;
  367. UNICODE_STRING DummyString3;
  368. UNICODE_STRING DummyString4;
  369. ULONG DummyLong1;
  370. ULONG DummyLong2;
  371. ULONG DummyLong3;
  372. ULONG DummyLong4;
  373. } NETLOGON_DELTA_DELETE_GROUP, *PNETLOGON_DELTA_DELETE_GROUP,
  374. NETLOGON_DELTA_DELETE_USER, *PNETLOGON_DELTA_DELETE_USER;
  375. //
  376. // A Union of each of the above types.
  377. //
  378. typedef [switch_type(NETLOGON_DELTA_TYPE)] union _NETLOGON_DELTA_UNION {
  379. [case(AddOrChangeDomain)] PNETLOGON_DELTA_DOMAIN DeltaDomain;
  380. [case(AddOrChangeGroup)] PNETLOGON_DELTA_GROUP DeltaGroup;
  381. [case(RenameGroup)] PNETLOGON_DELTA_RENAME_GROUP DeltaRenameGroup;
  382. [case(AddOrChangeUser)] PNETLOGON_DELTA_USER DeltaUser;
  383. [case(RenameUser)] PNETLOGON_DELTA_RENAME_USER DeltaRenameUser;
  384. [case(ChangeGroupMembership)] PNETLOGON_DELTA_GROUP_MEMBER DeltaGroupMember;
  385. [case(AddOrChangeAlias)] PNETLOGON_DELTA_ALIAS DeltaAlias;
  386. [case(RenameAlias)] PNETLOGON_DELTA_RENAME_ALIAS DeltaRenameAlias;
  387. [case(ChangeAliasMembership)] PNETLOGON_DELTA_ALIAS_MEMBER DeltaAliasMember;
  388. [case(AddOrChangeLsaPolicy)] PNETLOGON_DELTA_POLICY DeltaPolicy;
  389. [case(AddOrChangeLsaTDomain)] PNETLOGON_DELTA_TRUSTED_DOMAINS DeltaTDomains;
  390. [case(AddOrChangeLsaAccount)] PNETLOGON_DELTA_ACCOUNTS DeltaAccounts;
  391. [case(AddOrChangeLsaSecret)] PNETLOGON_DELTA_SECRET DeltaSecret;
  392. [case(DeleteGroupByName)] PNETLOGON_DELTA_DELETE_GROUP DeltaDeleteGroup;
  393. [case(DeleteUserByName)] PNETLOGON_DELTA_DELETE_USER DeltaDeleteUser;
  394. [case(SerialNumberSkip)] PNLPR_MODIFIED_COUNT DeltaSerialNumberSkip;
  395. [default] ; // Ship nothing for Delete Cases
  396. } NETLOGON_DELTA_UNION, *PNETLOGON_DELTA_UNION;
  397. typedef [switch_type(NETLOGON_DELTA_TYPE)] union _NETLOGON_DELTA_ID_UNION {
  398. [case(AddOrChangeDomain,
  399. AddOrChangeGroup,
  400. DeleteGroup,
  401. RenameGroup,
  402. AddOrChangeUser,
  403. DeleteUser,
  404. RenameUser,
  405. ChangeGroupMembership,
  406. AddOrChangeAlias,
  407. DeleteAlias,
  408. RenameAlias,
  409. ChangeAliasMembership,
  410. DeleteGroupByName,
  411. DeleteUserByName )] ULONG Rid;
  412. [case(AddOrChangeLsaPolicy,
  413. AddOrChangeLsaTDomain,
  414. DeleteLsaTDomain,
  415. AddOrChangeLsaAccount,
  416. DeleteLsaAccount)] PISID Sid;
  417. [case(AddOrChangeLsaSecret,
  418. DeleteLsaSecret)] [string] wchar_t * Name;
  419. [default] ;
  420. } NETLOGON_DELTA_ID_UNION, *PNETLOGON_DELTA_ID_UNION;
  421. //
  422. // A common structure to describe a single enumerated object.
  423. //
  424. typedef struct _NETLOGON_DELTA_ENUM {
  425. NETLOGON_DELTA_TYPE DeltaType;
  426. [switch_is(DeltaType)] NETLOGON_DELTA_ID_UNION DeltaID;
  427. [switch_is(DeltaType)] NETLOGON_DELTA_UNION DeltaUnion;
  428. } NETLOGON_DELTA_ENUM, *PNETLOGON_DELTA_ENUM;
  429. //
  430. // Structure that defines the array of enumerated objects.
  431. //
  432. typedef struct _NETLOGON_DELTA_ENUM_ARRAY {
  433. DWORD CountReturned;
  434. [size_is(CountReturned)] PNETLOGON_DELTA_ENUM Deltas;
  435. } NETLOGON_DELTA_ENUM_ARRAY, *PNETLOGON_DELTA_ENUM_ARRAY;
  436. //
  437. // Function Prototypes - Logon Service
  438. //
  439. NET_API_STATUS
  440. NetrLogonUasLogon (
  441. [in,unique,string] LOGONSRV_HANDLE ServerName,
  442. [in, string] wchar_t * UserName,
  443. [in, string] wchar_t * Workstation,
  444. [out] PNETLOGON_VALIDATION_UAS_INFO *ValidationInformation
  445. );
  446. NET_API_STATUS
  447. NetrLogonUasLogoff (
  448. [in,unique,string] LOGONSRV_HANDLE ServerName,
  449. [in, string] wchar_t * UserName,
  450. [in, string] wchar_t * Workstation,
  451. [out] PNETLOGON_LOGOFF_UAS_INFO LogoffInformation
  452. );
  453. //
  454. // NetrLogonSam routines
  455. //
  456. typedef [switch_type(enum _NETLOGON_LOGON_INFO_CLASS)]
  457. union _NETLOGON_LEVEL {
  458. [case(NetlogonInteractiveInformation)]
  459. PNETLOGON_INTERACTIVE_INFO LogonInteractive;
  460. [case(NetlogonInteractiveTransitiveInformation)]
  461. PNETLOGON_INTERACTIVE_INFO LogonInteractiveTransitive;
  462. [case(NetlogonServiceInformation)]
  463. PNETLOGON_SERVICE_INFO LogonService;
  464. [case(NetlogonServiceTransitiveInformation)]
  465. PNETLOGON_SERVICE_INFO LogonServiceTransitive;
  466. [case(NetlogonNetworkInformation)]
  467. PNETLOGON_NETWORK_INFO LogonNetwork;
  468. [case(NetlogonNetworkTransitiveInformation)]
  469. PNETLOGON_NETWORK_INFO LogonNetworkTransitive;
  470. [case(NetlogonGenericInformation)]
  471. PNETLOGON_GENERIC_INFO LogonGeneric;
  472. [default]
  473. ;
  474. } NETLOGON_LEVEL, * PNETLOGON_LEVEL;
  475. typedef [switch_type(enum _NETLOGON_VALIDATION_INFO_CLASS)]
  476. union _NETLOGON_VALIDATION {
  477. [case(NetlogonValidationSamInfo)]
  478. PNETLOGON_VALIDATION_SAM_INFO ValidationSam;
  479. [case(NetlogonValidationSamInfo2)]
  480. PNETLOGON_VALIDATION_SAM_INFO2 ValidationSam2;
  481. [case(NetlogonValidationGenericInfo)]
  482. PNETLOGON_VALIDATION_GENERIC_INFO ValidationGeneric;
  483. [case(NetlogonValidationGenericInfo2)]
  484. PNETLOGON_VALIDATION_GENERIC_INFO2 ValidationGeneric2;
  485. [case(NetlogonValidationSamInfo4)]
  486. PNETLOGON_VALIDATION_SAM_INFO4 ValidationSam4;
  487. [default]
  488. ;
  489. } NETLOGON_VALIDATION, * PNETLOGON_VALIDATION;
  490. NTSTATUS
  491. NetrLogonSamLogon (
  492. [in,unique,string] LOGONSRV_HANDLE LogonServer,
  493. [in,string,unique] wchar_t * ComputerName,
  494. [in,unique] PNETLOGON_AUTHENTICATOR Authenticator,
  495. [in,out,unique] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  496. [in] NETLOGON_LOGON_INFO_CLASS LogonLevel,
  497. [in,switch_is(LogonLevel)] PNETLOGON_LEVEL LogonInformation,
  498. [in] NETLOGON_VALIDATION_INFO_CLASS ValidationLevel,
  499. [out,switch_is(ValidationLevel)] PNETLOGON_VALIDATION ValidationInformation,
  500. [out] PBOOLEAN Authoritative
  501. );
  502. NTSTATUS
  503. NetrLogonSamLogoff (
  504. [in,unique,string] LOGONSRV_HANDLE LogonServer,
  505. [in,string,unique] wchar_t * ComputerName,
  506. [in,unique] PNETLOGON_AUTHENTICATOR Authenticator,
  507. [in,out,unique] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  508. [in] NETLOGON_LOGON_INFO_CLASS LogonLevel,
  509. [in,switch_is(LogonLevel)] PNETLOGON_LEVEL LogonInformation
  510. );
  511. NTSTATUS
  512. NetrServerReqChallenge (
  513. [in,unique,string] LOGONSRV_HANDLE PrimaryName,
  514. [in, string] wchar_t * ComputerName,
  515. [in] PNETLOGON_CREDENTIAL ClientChallenge,
  516. [out] PNETLOGON_CREDENTIAL ServerChallenge
  517. );
  518. NTSTATUS
  519. NetrServerAuthenticate (
  520. [in,unique,string] LOGONSRV_HANDLE PrimaryName,
  521. [in,string] wchar_t * AccountName,
  522. [in] NETLOGON_SECURE_CHANNEL_TYPE AccountType,
  523. [in, string] wchar_t * ComputerName,
  524. [in] PNETLOGON_CREDENTIAL ClientCredential,
  525. [out] PNETLOGON_CREDENTIAL ServerCredential
  526. );
  527. NTSTATUS
  528. NetrServerPasswordSet (
  529. [in,unique,string] LOGONSRV_HANDLE PrimaryName,
  530. [in,string] wchar_t * AccountName,
  531. [in] NETLOGON_SECURE_CHANNEL_TYPE AccountType,
  532. [in, string] wchar_t * ComputerName,
  533. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  534. [out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  535. [in] PENCRYPTED_LM_OWF_PASSWORD UasNewPassword
  536. );
  537. //
  538. // Replication Routines
  539. //
  540. NTSTATUS
  541. NetrDatabaseDeltas (
  542. [in, string] LOGONSRV_HANDLE primaryname,
  543. [in, string] wchar_t * computername,
  544. [in] PNETLOGON_AUTHENTICATOR authenticator,
  545. [in,out] PNETLOGON_AUTHENTICATOR ret_auth,
  546. [in] DWORD DatabaseID,
  547. [in, out] PNLPR_MODIFIED_COUNT DomainModifiedCount,
  548. [out] PNETLOGON_DELTA_ENUM_ARRAY *DeltaArray,
  549. [in] DWORD PreferredMaximumLength
  550. );
  551. NTSTATUS
  552. NetrDatabaseSync (
  553. [in, string] LOGONSRV_HANDLE PrimaryName,
  554. [in, string] wchar_t * ComputerName,
  555. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  556. [in,out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  557. [in] DWORD DatabaseID,
  558. [in, out] PULONG SyncContext,
  559. [out] PNETLOGON_DELTA_ENUM_ARRAY *DeltaArray,
  560. [in] DWORD PreferredMaximumLength
  561. );
  562. NTSTATUS
  563. NetrAccountDeltas (
  564. [in, unique, string] LOGONSRV_HANDLE PrimaryName,
  565. [in, string] wchar_t * ComputerName,
  566. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  567. [in,out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  568. [in] PUAS_INFO_0 RecordId,
  569. [in] DWORD Count,
  570. [in] DWORD Level,
  571. [out, size_is(BufferSize)] LPBYTE Buffer,
  572. [in] DWORD BufferSize,
  573. [out] PULONG CountReturned,
  574. [out] PULONG TotalEntries,
  575. [out] PUAS_INFO_0 NextRecordId
  576. );
  577. NTSTATUS
  578. NetrAccountSync (
  579. [in, unique, string] LOGONSRV_HANDLE PrimaryName,
  580. [in, string] wchar_t * ComputerName,
  581. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  582. [in,out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  583. [in] DWORD Reference,
  584. [in] DWORD Level,
  585. [out, size_is(BufferSize) ] LPBYTE Buffer,
  586. [in] DWORD BufferSize,
  587. [out] PULONG CountReturned,
  588. [out] PULONG TotalEntries,
  589. [out] PULONG NextReference,
  590. [out] PUAS_INFO_0 LastRecordId
  591. );
  592. NET_API_STATUS
  593. NetrGetDCName (
  594. [in, string] LOGONSRV_HANDLE ServerName,
  595. [in, unique, string] wchar_t *DomainName,
  596. [out, string] wchar_t **Buffer
  597. );
  598. //
  599. // I_NetLogonControl
  600. //
  601. typedef [switch_type(DWORD)] union _NETLOGON_CONTROL_DATA_INFORMATION {
  602. [case(NETLOGON_CONTROL_REDISCOVER,
  603. NETLOGON_CONTROL_TC_QUERY,
  604. NETLOGON_CONTROL_CHANGE_PASSWORD,
  605. NETLOGON_CONTROL_TC_VERIFY)] [string] wchar_t * TrustedDomainName;
  606. [case(NETLOGON_CONTROL_SET_DBFLAG)] DWORD DebugFlag;
  607. [case(NETLOGON_CONTROL_FIND_USER)] [string] wchar_t * UserName;
  608. [default]
  609. ;
  610. } NETLOGON_CONTROL_DATA_INFORMATION, * PNETLOGON_CONTROL_DATA_INFORMATION;
  611. typedef [switch_type(DWORD)] union _NETLOGON_CONTROL_QUERY_INFORMATION {
  612. [case(1)] PNETLOGON_INFO_1 NetlogonInfo1;
  613. [case(2)] PNETLOGON_INFO_2 NetlogonInfo2;
  614. [case(3)] PNETLOGON_INFO_3 NetlogonInfo3;
  615. [case(4)] PNETLOGON_INFO_4 NetlogonInfo4;
  616. [default] ;
  617. } NETLOGON_CONTROL_QUERY_INFORMATION, * PNETLOGON_CONTROL_QUERY_INFORMATION;
  618. NET_API_STATUS
  619. NetrLogonControl(
  620. [in, unique, string] LOGONSRV_HANDLE ServerName,
  621. [in] DWORD FunctionCode,
  622. [in] DWORD QueryLevel,
  623. [out,switch_is(QueryLevel)] PNETLOGON_CONTROL_QUERY_INFORMATION Buffer
  624. );
  625. NET_API_STATUS
  626. NetrGetAnyDCName (
  627. [in, unique, string] LOGONSRV_HANDLE ServerName,
  628. [in, unique, string] wchar_t *DomainName,
  629. [out, string] wchar_t **Buffer
  630. );
  631. NET_API_STATUS
  632. NetrLogonControl2(
  633. [in, unique, string] LOGONSRV_HANDLE ServerName,
  634. [in] DWORD FunctionCode,
  635. [in] DWORD QueryLevel,
  636. [in,switch_is(FunctionCode)] PNETLOGON_CONTROL_DATA_INFORMATION Data,
  637. [out,switch_is(QueryLevel)] PNETLOGON_CONTROL_QUERY_INFORMATION Buffer
  638. );
  639. NTSTATUS
  640. NetrServerAuthenticate2 (
  641. [in,unique,string] LOGONSRV_HANDLE PrimaryName,
  642. [in,string] wchar_t * AccountName,
  643. [in] NETLOGON_SECURE_CHANNEL_TYPE AccountType,
  644. [in, string] wchar_t * ComputerName,
  645. [in] PNETLOGON_CREDENTIAL ClientCredential,
  646. [out] PNETLOGON_CREDENTIAL ServerCredential,
  647. [in,out] PULONG NegotiateFlags
  648. );
  649. //
  650. // The Sync state indicates tracks the progression of the sync.
  651. // NlSynchronize() depends on these being in order.
  652. //
  653. typedef enum _SYNC_STATE {
  654. NormalState,
  655. DomainState,
  656. GroupState,
  657. UasBuiltinGroupState,
  658. UserState,
  659. GroupMemberState,
  660. AliasState,
  661. AliasMemberState,
  662. SamDoneState
  663. } SYNC_STATE, *PSYNC_STATE;
  664. NTSTATUS
  665. NetrDatabaseSync2 (
  666. [in, string] LOGONSRV_HANDLE PrimaryName,
  667. [in, string] wchar_t * ComputerName,
  668. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  669. [in,out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  670. [in] DWORD DatabaseID,
  671. [in] SYNC_STATE RestartState,
  672. [in, out] PULONG SyncContext,
  673. [out] PNETLOGON_DELTA_ENUM_ARRAY *DeltaArray,
  674. [in] DWORD PreferredMaximumLength
  675. );
  676. NTSTATUS
  677. NetrDatabaseRedo(
  678. [in, string] LOGONSRV_HANDLE PrimaryName,
  679. [in, string] wchar_t * ComputerName,
  680. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  681. [in,out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  682. [in, size_is(ChangeLogEntrySize)] PUCHAR ChangeLogEntry,
  683. [in] DWORD ChangeLogEntrySize,
  684. [out] PNETLOGON_DELTA_ENUM_ARRAY *DeltaArray
  685. );
  686. // Same as NetrLogonControl2, but support QueryLevel of 4
  687. // and function code of NETLOGON_CONTROL_FIND_USER
  688. NET_API_STATUS
  689. NetrLogonControl2Ex(
  690. [in, unique, string] LOGONSRV_HANDLE ServerName,
  691. [in] DWORD FunctionCode,
  692. [in] DWORD QueryLevel,
  693. [in,switch_is(FunctionCode)] PNETLOGON_CONTROL_DATA_INFORMATION Data,
  694. [out,switch_is(QueryLevel)] PNETLOGON_CONTROL_QUERY_INFORMATION Buffer
  695. );
  696. //
  697. // Routine to enumerate trusted domains.
  698. //
  699. typedef struct _DOMAIN_NAME_BUFFER {
  700. ULONG DomainNameByteCount;
  701. [unique, size_is(DomainNameByteCount)] PUCHAR DomainNames;
  702. } DOMAIN_NAME_BUFFER, *PDOMAIN_NAME_BUFFER;
  703. NTSTATUS
  704. NetrEnumerateTrustedDomains (
  705. [in, unique, string] LOGONSRV_HANDLE ServerName,
  706. [out] PDOMAIN_NAME_BUFFER DomainNameBuffer
  707. );
  708. //
  709. // Routine to find a DC.
  710. //
  711. NET_API_STATUS
  712. DsrGetDcName(
  713. [in, unique, string ] LOGONSRV_HANDLE ComputerName,
  714. [in, unique, string] wchar_t * DomainName,
  715. [in, unique] GUID *DomainGuid,
  716. [in, unique] GUID *SiteGuid,
  717. [in] ULONG Flags,
  718. [out] PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo
  719. );
  720. //
  721. // Routine used between NT 4.0 and NT 5.0 beta 1
  722. //
  723. typedef [switch_type(DWORD)] union _NETLOGON_DUMMY1 {
  724. [case(1)] ULONG Dummy;
  725. } NETLOGON_DUMMY1, *PNETLOGON_DUMMY1;
  726. NTSTATUS
  727. NetrLogonDummyRoutine1(
  728. [in, string] LOGONSRV_HANDLE ServerName,
  729. [in,string,unique] wchar_t * ComputerName,
  730. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  731. [in,out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  732. [in] DWORD QueryLevel,
  733. [out,switch_is(QueryLevel)] PNETLOGON_DUMMY1 Buffer
  734. );
  735. NTSTATUS
  736. NetrLogonSetServiceBits(
  737. [in, unique, string] LOGONSRV_HANDLE ServerName,
  738. [in] DWORD ServiceBitsOfInterest,
  739. [in] DWORD ServiceBits
  740. );
  741. //
  742. // Routines to compute a digest for a specified message using the machine trust account.
  743. //
  744. NET_API_STATUS
  745. NetrLogonGetTrustRid(
  746. [in, unique, string] LOGONSRV_HANDLE ServerName,
  747. [in,string,unique] wchar_t * DomainName,
  748. [out] PULONG Rid
  749. );
  750. #define NL_DIGEST_SIZE 16
  751. NET_API_STATUS
  752. NetrLogonComputeServerDigest(
  753. [in, unique, string] LOGONSRV_HANDLE ServerName,
  754. [in] ULONG Rid,
  755. [in, size_is(MessageSize)] LPBYTE Message,
  756. [in] ULONG MessageSize,
  757. [out] CHAR NewMessageDigest[NL_DIGEST_SIZE],
  758. [out] CHAR OldMessageDigest[NL_DIGEST_SIZE]
  759. );
  760. NET_API_STATUS
  761. NetrLogonComputeClientDigest(
  762. [in, unique, string] LOGONSRV_HANDLE ServerName,
  763. [in,string,unique] wchar_t * DomainName,
  764. [in, size_is(MessageSize)] LPBYTE Message,
  765. [in] ULONG MessageSize,
  766. [out] CHAR NewMessageDigest[NL_DIGEST_SIZE],
  767. [out] CHAR OldMessageDigest[NL_DIGEST_SIZE]
  768. );
  769. NTSTATUS
  770. NetrServerAuthenticate3 (
  771. [in,unique,string] LOGONSRV_HANDLE PrimaryName,
  772. [in,string] wchar_t * AccountName,
  773. [in] NETLOGON_SECURE_CHANNEL_TYPE AccountType,
  774. [in, string] wchar_t * ComputerName,
  775. [in] PNETLOGON_CREDENTIAL ClientCredential,
  776. [out] PNETLOGON_CREDENTIAL ServerCredential,
  777. [in,out] PULONG NegotiateFlags,
  778. [out] PULONG AccountRid
  779. );
  780. //
  781. // Routine to find a DC.
  782. //
  783. NET_API_STATUS
  784. DsrGetDcNameEx(
  785. [in, unique, string ] LOGONSRV_HANDLE ComputerName,
  786. [in, unique, string] wchar_t * DomainName,
  787. [in, unique] GUID *DomainGuid,
  788. [in, unique, string] wchar_t * SiteName,
  789. [in] ULONG Flags,
  790. [out] PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo
  791. );
  792. NET_API_STATUS
  793. DsrGetSiteName(
  794. [in, unique, string ] LOGONSRV_HANDLE ComputerName,
  795. [out, string] wchar_t **SiteName
  796. );
  797. //
  798. // Routine to return information about the domain to a workstaion.
  799. //
  800. //
  801. // Values of QueryLevel
  802. #define NETLOGON_QUERY_DOMAIN_INFO 1
  803. #define NETLOGON_QUERY_LSA_POLICY_INFO 2
  804. typedef struct _NETLOGON_LSA_POLICY_INFO {
  805. //
  806. // LSA Policy
  807. //
  808. ULONG LsaPolicySize;
  809. [size_is(LsaPolicySize)] PUCHAR LsaPolicy;
  810. } NETLOGON_LSA_POLICY_INFO, *PNETLOGON_LSA_POLICY_INFO;
  811. typedef struct _NETLOGON_ONE_DOMAIN_INFO {
  812. UNICODE_STRING DomainName;
  813. UNICODE_STRING DnsDomainName;
  814. UNICODE_STRING DnsForestName;
  815. GUID DomainGuid;
  816. PISID DomainSid;
  817. // Passes NL_TRUST_EXTENSION structure starting after NT 5 beta 2
  818. UNICODE_STRING TrustExtension;
  819. UNICODE_STRING DummyString2;
  820. UNICODE_STRING DummyString3;
  821. UNICODE_STRING DummyString4;
  822. ULONG DummyLong1;
  823. ULONG DummyLong2;
  824. ULONG DummyLong3;
  825. ULONG DummyLong4;
  826. } NETLOGON_ONE_DOMAIN_INFO, *PNETLOGON_ONE_DOMAIN_INFO;
  827. typedef struct _NETLOGON_DOMAIN_INFO {
  828. //
  829. // Information about the domain we're a member of.
  830. //
  831. NETLOGON_ONE_DOMAIN_INFO PrimaryDomain;
  832. //
  833. // Information about the domains trusted by the domain we're a member of.
  834. //
  835. ULONG TrustedDomainCount;
  836. [size_is(TrustedDomainCount)] PNETLOGON_ONE_DOMAIN_INFO TrustedDomains;
  837. //
  838. // LSA Policy
  839. //
  840. NETLOGON_LSA_POLICY_INFO LsaPolicy;
  841. //
  842. // Room for expansion.
  843. //
  844. UNICODE_STRING DnsHostNameInDs;
  845. UNICODE_STRING DummyString2;
  846. UNICODE_STRING DummyString3;
  847. UNICODE_STRING DummyString4;
  848. ULONG WorkstationFlags;
  849. ULONG DummyLong2;
  850. ULONG DummyLong3;
  851. ULONG DummyLong4;
  852. } NETLOGON_DOMAIN_INFO, *PNETLOGON_DOMAIN_INFO;
  853. typedef [switch_type(DWORD)] union _NETLOGON_DOMAIN_INFORMATION {
  854. [case(NETLOGON_QUERY_DOMAIN_INFO)] PNETLOGON_DOMAIN_INFO DomainInfo;
  855. [case(NETLOGON_QUERY_LSA_POLICY_INFO)] PNETLOGON_LSA_POLICY_INFO LsaPolicyInfo;
  856. } NETLOGON_DOMAIN_INFORMATION, *PNETLOGON_DOMAIN_INFORMATION;
  857. typedef struct _NETLOGON_WORKSTATION_INFO {
  858. //
  859. // LSA Policy
  860. //
  861. NETLOGON_LSA_POLICY_INFO LsaPolicy;
  862. //
  863. // Information describing the workstation.
  864. //
  865. [string] wchar_t * DnsHostName;
  866. [string] wchar_t * SiteName;
  867. [string] wchar_t * Dummy1;
  868. [string] wchar_t * Dummy2;
  869. [string] wchar_t * Dummy3;
  870. [string] wchar_t * Dummy4;
  871. UNICODE_STRING OsVersion;
  872. UNICODE_STRING OsName;
  873. UNICODE_STRING DummyString3;
  874. UNICODE_STRING DummyString4;
  875. ULONG WorkstationFlags;
  876. ULONG DummyLong2;
  877. ULONG DummyLong3;
  878. ULONG DummyLong4;
  879. } NETLOGON_WORKSTATION_INFO, *PNETLOGON_WORKSTATION_INFO;
  880. typedef [switch_type(DWORD)] union _NETLOGON_WORKSTATION_INFORMATION {
  881. [case(NETLOGON_QUERY_DOMAIN_INFO)] PNETLOGON_WORKSTATION_INFO WorkstationInfo;
  882. [case(NETLOGON_QUERY_LSA_POLICY_INFO)] PNETLOGON_WORKSTATION_INFO LsaPolicyInfo;
  883. } NETLOGON_WORKSTATION_INFORMATION, *PNETLOGON_WORKSTATION_INFORMATION;
  884. NTSTATUS
  885. NetrLogonGetDomainInfo(
  886. [in, string] LOGONSRV_HANDLE ServerName,
  887. [in,string,unique] wchar_t * ComputerName,
  888. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  889. [in,out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  890. [in] DWORD Level,
  891. [in,switch_is(Level)] PNETLOGON_WORKSTATION_INFORMATION WkstaBuffer,
  892. [out,switch_is(Level)] PNETLOGON_DOMAIN_INFORMATION DomBuffer
  893. );
  894. NTSTATUS
  895. NetrServerPasswordSet2 (
  896. [in,unique,string] LOGONSRV_HANDLE PrimaryName,
  897. [in,string] wchar_t * AccountName,
  898. [in] NETLOGON_SECURE_CHANNEL_TYPE AccountType,
  899. [in, string] wchar_t * ComputerName,
  900. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  901. [out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  902. [in] PNL_TRUST_PASSWORD ClearNewPassword
  903. );
  904. NTSTATUS
  905. NetrServerPasswordGet (
  906. [in,unique,string] LOGONSRV_HANDLE PrimaryName,
  907. [in,string] wchar_t * AccountName,
  908. [in] NETLOGON_SECURE_CHANNEL_TYPE AccountType,
  909. [in, string] wchar_t * ComputerName,
  910. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  911. [out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  912. [out] PENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword
  913. );
  914. NTSTATUS
  915. NetrLogonSendToSam (
  916. [in,unique,string] LOGONSRV_HANDLE PrimaryName,
  917. [in, string] wchar_t * ComputerName,
  918. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  919. [out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  920. [in,size_is(OpaqueBufferSize)] PUCHAR OpaqueBuffer,
  921. [in] ULONG OpaqueBufferSize
  922. );
  923. typedef struct _NL_SOCKET_ADDRESS {
  924. [size_is(iSockaddrLength)] PUCHAR lpSockaddr;
  925. ULONG iSockaddrLength;
  926. } NL_SOCKET_ADDRESS, *PNL_SOCKET_ADDRESS;
  927. typedef struct _NL_SITE_NAME_ARRAY {
  928. ULONG EntryCount;
  929. [size_is(EntryCount)] PUNICODE_STRING SiteNames;
  930. } NL_SITE_NAME_ARRAY, *PNL_SITE_NAME_ARRAY;
  931. NET_API_STATUS
  932. DsrAddressToSiteNamesW(
  933. [in,unique,string] LOGONSRV_HANDLE ComputerName,
  934. [in, range(0,NL_MAX_RPC_ENTRY_COUNT)] DWORD EntryCount,
  935. [in,size_is(EntryCount)] PNL_SOCKET_ADDRESS SocketAddresses,
  936. [out] PNL_SITE_NAME_ARRAY *SiteNames
  937. );
  938. NET_API_STATUS
  939. DsrGetDcNameEx2(
  940. [in, unique, string ] LOGONSRV_HANDLE ComputerName,
  941. [in, unique, string] wchar_t * AccountName,
  942. [in] ULONG AllowableAccountControlBits,
  943. [in, unique, string] wchar_t * DomainName,
  944. [in, unique] GUID *DomainGuid,
  945. [in, unique, string] wchar_t * SiteName,
  946. [in] ULONG Flags,
  947. [out] PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo
  948. );
  949. NET_API_STATUS
  950. NetrLogonGetTimeServiceParentDomain(
  951. [in, unique, string] LOGONSRV_HANDLE ServerName,
  952. [out, string] wchar_t **DomainName,
  953. [out] PBOOL PdcSameSite
  954. );
  955. typedef struct _NETLOGON_TRUSTED_DOMAIN_ARRAY {
  956. DWORD DomainCount;
  957. [size_is(DomainCount)] PDS_DOMAIN_TRUSTSW Domains;
  958. } NETLOGON_TRUSTED_DOMAIN_ARRAY, *PNETLOGON_TRUSTED_DOMAIN_ARRAY;
  959. NET_API_STATUS
  960. NetrEnumerateTrustedDomainsEx (
  961. [in, unique, string] LOGONSRV_HANDLE ServerName,
  962. [out] PNETLOGON_TRUSTED_DOMAIN_ARRAY Domains
  963. );
  964. typedef struct _NL_SITE_NAME_EX_ARRAY {
  965. ULONG EntryCount;
  966. [size_is(EntryCount)] PUNICODE_STRING SiteNames;
  967. [size_is(EntryCount)] PUNICODE_STRING SubnetNames;
  968. } NL_SITE_NAME_EX_ARRAY, *PNL_SITE_NAME_EX_ARRAY;
  969. NET_API_STATUS
  970. DsrAddressToSiteNamesExW(
  971. [in,unique,string] LOGONSRV_HANDLE ComputerName,
  972. [in, range(0,NL_MAX_RPC_ENTRY_COUNT)] DWORD EntryCount,
  973. [in,size_is(EntryCount)] PNL_SOCKET_ADDRESS SocketAddresses,
  974. [out] PNL_SITE_NAME_EX_ARRAY *SiteNames
  975. );
  976. NET_API_STATUS
  977. DsrGetDcSiteCoverageW(
  978. [in,unique,string] LOGONSRV_HANDLE ServerName,
  979. [out] PNL_SITE_NAME_ARRAY *SiteNames
  980. );
  981. //
  982. // Define a logon routine that uses a passed in RPC handle.
  983. // This will allow us to do multiple simultaneous RPCs over a secure channel.
  984. //
  985. NTSTATUS
  986. NetrLogonSamLogonEx (
  987. [in] handle_t ContextHandle,
  988. [in,unique,string] wchar_t * LogonServer,
  989. [in,unique,string] wchar_t * ComputerName,
  990. [in] NETLOGON_LOGON_INFO_CLASS LogonLevel,
  991. [in,switch_is(LogonLevel)] PNETLOGON_LEVEL LogonInformation,
  992. [in] NETLOGON_VALIDATION_INFO_CLASS ValidationLevel,
  993. [out,switch_is(ValidationLevel)] PNETLOGON_VALIDATION ValidationInformation,
  994. [out] PBOOLEAN Authoritative,
  995. [in,out] PULONG ExtraFlags
  996. );
  997. NET_API_STATUS
  998. DsrEnumerateDomainTrusts (
  999. [in, unique, string] LOGONSRV_HANDLE ServerName,
  1000. [in] ULONG Flags,
  1001. [out] PNETLOGON_TRUSTED_DOMAIN_ARRAY Domains
  1002. );
  1003. NET_API_STATUS
  1004. DsrDeregisterDnsHostRecords (
  1005. [in, unique, string] LOGONSRV_HANDLE ServerName,
  1006. [in, unique, string] wchar_t * DnsDomainName,
  1007. [in, unique] GUID *DomainGuid,
  1008. [in, unique] GUID *DsaGuid,
  1009. [in, string] wchar_t * DnsHostName
  1010. );
  1011. NTSTATUS
  1012. NetrServerTrustPasswordsGet (
  1013. [in,unique,string] LOGONSRV_HANDLE TrustedDcName,
  1014. [in,string] wchar_t * AccountName,
  1015. [in] NETLOGON_SECURE_CHANNEL_TYPE AccountType,
  1016. [in, string] wchar_t * ComputerName,
  1017. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  1018. [out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  1019. [out] PENCRYPTED_NT_OWF_PASSWORD EncryptedNewOwfPassword,
  1020. [out] PENCRYPTED_NT_OWF_PASSWORD EncryptedOldOwfPassword
  1021. );
  1022. NET_API_STATUS
  1023. DsrGetForestTrustInformation (
  1024. [in, unique, string] LOGONSRV_HANDLE ServerName,
  1025. [in, unique, string] wchar_t * TrustedDomainName,
  1026. [in] DWORD Flags,
  1027. [out] PLSA_FOREST_TRUST_INFORMATION * ForestTrustInfo
  1028. );
  1029. NTSTATUS
  1030. NetrGetForestTrustInformation (
  1031. [in,unique,string] LOGONSRV_HANDLE ServerName,
  1032. [in, string] wchar_t * ComputerName,
  1033. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  1034. [out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  1035. [in] DWORD Flags,
  1036. [out] PLSA_FOREST_TRUST_INFORMATION * ForestTrustInfo
  1037. );
  1038. // This is the non-Ex version but with Flags
  1039. NTSTATUS
  1040. NetrLogonSamLogonWithFlags (
  1041. [in,unique,string] LOGONSRV_HANDLE LogonServer,
  1042. [in,string,unique] wchar_t * ComputerName,
  1043. [in,unique] PNETLOGON_AUTHENTICATOR Authenticator,
  1044. [in,out,unique] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  1045. [in] NETLOGON_LOGON_INFO_CLASS LogonLevel,
  1046. [in,switch_is(LogonLevel)] PNETLOGON_LEVEL LogonInformation,
  1047. [in] NETLOGON_VALIDATION_INFO_CLASS ValidationLevel,
  1048. [out,switch_is(ValidationLevel)] PNETLOGON_VALIDATION ValidationInformation,
  1049. [out] PBOOLEAN Authoritative,
  1050. [in,out] PULONG ExtraFlags
  1051. );
  1052. //
  1053. // Generic data sent over netlogon RPC interfaces.
  1054. //
  1055. // The following data structure can be used to send generic data
  1056. // from the server to teh client. Suppose the client requests
  1057. // an info about some property from the server over an RPC interface.
  1058. // Suppose that property has several attributes (which can be
  1059. // generically represented as ULONGs and/or UNICODE_STRINGS) and
  1060. // suppose that the property has several versions where older versions
  1061. // have more attributes. Using this generic data structure, the server
  1062. // will send all N attributes for the version the server supports. Here
  1063. // N is the number of attributes for the version teh server supports.
  1064. // If the client is older than the server, the client will be able to
  1065. // understand the first M attributes and the client will ignore the rest
  1066. // of attributes. Here M is the number of attributes the client version
  1067. // supports. If the client is newer than the server, the client will be
  1068. // able to understand all N attributes from the server and the client
  1069. // will realize that the server supports an old version of the property.
  1070. // This scheme works provided the attributes are ordered by their creation
  1071. // time. This technique avoids new RPC interfaces as property gets new
  1072. // attributes and avoids special case coding.
  1073. //
  1074. typedef struct _NL_GENERIC_RPC_DATA {
  1075. ULONG UlongEntryCount;
  1076. [size_is(UlongEntryCount)] PULONG UlongData;
  1077. ULONG UnicodeStringEntryCount;
  1078. [size_is(UnicodeStringEntryCount)] PUNICODE_STRING UnicodeStringData;
  1079. } NL_GENERIC_RPC_DATA, *PNL_GENERIC_RPC_DATA;
  1080. NTSTATUS
  1081. NetrServerGetTrustInfo (
  1082. [in,unique,string] LOGONSRV_HANDLE TrustedDcName,
  1083. [in,string] wchar_t * AccountName,
  1084. [in] NETLOGON_SECURE_CHANNEL_TYPE AccountType,
  1085. [in, string] wchar_t * ComputerName,
  1086. [in] PNETLOGON_AUTHENTICATOR Authenticator,
  1087. [out] PNETLOGON_AUTHENTICATOR ReturnAuthenticator,
  1088. [out] PENCRYPTED_NT_OWF_PASSWORD EncryptedNewOwfPassword,
  1089. [out] PENCRYPTED_NT_OWF_PASSWORD EncryptedOldOwfPassword,
  1090. [out] PNL_GENERIC_RPC_DATA *TrustInfo
  1091. );
  1092. }