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.

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