3 much of this was derived from the ethereal sources - thanks to everyone
7 import "misc.idl", "lsa.idl", "samr.idl", "security.idl", "nbt.idl";
12 uuid("12345678-1234-abcd-ef00-01234567cffb"),
14 endpoint("ncacn_np:[\\pipe\\netlogon]","ncacn_ip_tcp:","ncalrpc:"),
15 pointer_default(unique)
20 typedef bitmap samr_AcctFlags samr_AcctFlags;
21 typedef bitmap samr_GroupAttrs samr_GroupAttrs;
27 [string,charset(UTF16)] uint16 *account_name;
38 time_t pw_must_change;
39 [string,charset(UTF16)] uint16 *computer;
40 [string,charset(UTF16)] uint16 *domain;
41 [string,charset(UTF16)] uint16 *script_path;
45 WERROR netr_LogonUasLogon(
46 [in,unique] [string,charset(UTF16)] uint16 *server_name,
47 [in] [string,charset(UTF16)] uint16 account_name[],
48 [in] [string,charset(UTF16)] uint16 workstation[],
49 [out,unique] netr_UasInfo *info
61 WERROR netr_LogonUasLogoff(
62 [in,unique] [string,charset(UTF16)] uint16 *server_name,
63 [in] [string,charset(UTF16)] uint16 account_name[],
64 [in] [string,charset(UTF16)] uint16 workstation[],
65 [out] netr_UasLogoffInfo info
72 /* in netr_AcctLockStr size seems to be be 24, and rrenard thinks
73 that the structure of the bindata looks like this:
75 dlong lockout_duration;
77 uint32 bad_attempt_lockout;
80 but it doesn't look as though this structure is reflected at the
81 NDR level. Maybe it is left to the application to decode the bindata array.
86 [size_is(size/2),length_is(length/2)] uint16 *bindata;
89 typedef [public,bitmap32bit] bitmap {
90 MSV1_0_CLEARTEXT_PASSWORD_ALLOWED = 0x00000002,
91 MSV1_0_UPDATE_LOGON_STATISTICS = 0x00000004,
92 MSV1_0_RETURN_USER_PARAMETERS = 0x00000008,
93 MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT = 0x00000020,
94 MSV1_0_RETURN_PROFILE_PATH = 0x00000200,
95 MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT = 0x00000800
96 } netr_LogonParameterControl;
99 lsa_String domain_name;
100 netr_LogonParameterControl parameter_control; /* see MSV1_0_* */
102 uint32 logon_id_high;
103 lsa_String account_name;
104 lsa_String workstation;
108 netr_IdentityInfo identity_info;
109 samr_Password lmpassword;
110 samr_Password ntpassword;
113 typedef [flag(NDR_PAHEX)] struct {
115 [value(length)] uint16 size;
116 [size_is(length),length_is(length)] uint8 *data;
117 } netr_ChallengeResponse;
119 typedef [flag(NDR_PAHEX)] struct {
120 netr_IdentityInfo identity_info;
122 netr_ChallengeResponse nt;
123 netr_ChallengeResponse lm;
126 typedef [flag(NDR_PAHEX)] struct {
127 netr_IdentityInfo identity_info;
128 lsa_String package_name;
130 [size_is(length)] uint8 *data;
134 NetlogonInteractiveInformation = 1,
135 NetlogonNetworkInformation = 2,
136 NetlogonServiceInformation = 3,
137 NetlogonGenericInformation = 4,
138 NetlogonInteractiveTransitiveInformation = 5,
139 NetlogonNetworkTransitiveInformation = 6,
140 NetlogonServiceTransitiveInformation = 7
141 } netr_LogonInfoClass;
143 typedef [public,switch_type(netr_LogonInfoClass)] union {
144 [case(NetlogonInteractiveInformation)] netr_PasswordInfo *password;
145 [case(NetlogonNetworkInformation)] netr_NetworkInfo *network;
146 [case(NetlogonServiceInformation)] netr_PasswordInfo *password;
147 [case(NetlogonGenericInformation)] netr_GenericInfo *generic;
148 [case(NetlogonInteractiveTransitiveInformation)] netr_PasswordInfo *password;
149 [case(NetlogonNetworkTransitiveInformation)] netr_NetworkInfo *network;
150 [case(NetlogonServiceTransitiveInformation)] netr_PasswordInfo *password;
153 typedef [public,flag(NDR_PAHEX)] struct {
155 } netr_UserSessionKey;
157 typedef [public,flag(NDR_PAHEX)] struct {
161 /* Flags for user_flags below */
162 typedef [public,bitmap32bit] bitmap {
163 NETLOGON_GUEST = 0x0001,
164 NETLOGON_NOENCRYPTION = 0x0002,
165 NETLOGON_CACHED_ACCOUNT = 0x0004,
166 NETLOGON_USED_LM_PASSWORD = 0x0008,
167 NETLOGON_EXTRA_SIDS = 0x0020,
168 NETLOGON_SUBAUTH_SESSION_KEY = 0x0040,
169 NETLOGON_SERVER_TRUST_ACCOUNT = 0x0080,
170 NETLOGON_NTLMV2_ENABLED = 0x0100,
171 NETLOGON_RESOURCE_GROUPS = 0x0200,
172 NETLOGON_PROFILE_PATH_RETURNED = 0x0400
179 NTTIME last_password_change;
180 NTTIME allow_password_change;
181 NTTIME force_password_change;
182 lsa_String account_name;
183 lsa_String full_name;
184 lsa_String logon_script;
185 lsa_String profile_path;
186 lsa_String home_directory;
187 lsa_String home_drive;
189 uint16 bad_password_count;
192 samr_RidWithAttributeArray groups;
193 netr_UserFlags user_flags;
194 netr_UserSessionKey key;
195 lsa_StringLarge logon_server;
196 lsa_StringLarge domain;
197 dom_sid2 *domain_sid;
198 netr_LMSessionKey LMSessKey;
199 samr_AcctFlags acct_flags;
204 netr_SamBaseInfo base;
209 samr_GroupAttrs attributes;
212 typedef [public] struct {
213 netr_SamBaseInfo base;
215 [size_is(sidcount)] netr_SidAttr *sids;
219 netr_SamBaseInfo base;
221 [size_is(sidcount)] netr_SidAttr *sids;
223 lsa_String principle;
229 [size_is(pac_size)] uint8 *pac;
230 lsa_String logon_domain;
231 lsa_String logon_server;
232 lsa_String principal_name;
234 [size_is(auth_size)] uint8 *auth;
235 netr_UserSessionKey user_session_key;
236 uint32 expansionroom[10];
243 typedef [flag(NDR_PAHEX)] struct {
245 [size_is(length)] uint8 *data;
249 NetlogonValidationUasInfo = 1,
250 NetlogonValidationSamInfo = 2,
251 NetlogonValidationSamInfo2 = 3,
252 NetlogonValidationGenericInfo2 = 5,
253 NetlogonValidationSamInfo4 = 6
254 } netr_ValidationInfoClass;
256 typedef [public,switch_type(uint16)] union {
257 [case(NetlogonValidationSamInfo)] netr_SamInfo2 *sam2;
258 [case(NetlogonValidationSamInfo2)] netr_SamInfo3 *sam3;
259 [case(4)] netr_PacInfo *pac;
260 [case(NetlogonValidationGenericInfo2)] netr_GenericInfo2 *generic;
261 [case(NetlogonValidationSamInfo4)] netr_SamInfo6 *sam6;
264 typedef [public, flag(NDR_PAHEX)] struct {
268 typedef [public] struct {
269 netr_Credential cred;
271 } netr_Authenticator;
273 NTSTATUS netr_LogonSamLogon(
274 [in,unique] [string,charset(UTF16)] uint16 *server_name,
275 [in,unique] [string,charset(UTF16)] uint16 *computer_name,
276 [in,unique] netr_Authenticator *credential,
277 [in,out,unique] netr_Authenticator *return_authenticator,
278 [in] netr_LogonInfoClass logon_level,
279 [in] [switch_is(logon_level)] netr_LogonLevel logon,
280 [in] uint16 validation_level,
281 [out] [switch_is(validation_level)] netr_Validation validation,
282 [out] uint8 authoritative
289 NTSTATUS netr_LogonSamLogoff(
290 [in,unique] [string,charset(UTF16)] uint16 *server_name,
291 [in,unique] [string,charset(UTF16)] uint16 *computer_name,
292 [in,unique] netr_Authenticator *credential,
293 [in,out,unique] netr_Authenticator *return_authenticator,
294 [in] uint16 logon_level,
295 [in] [switch_is(logon_level)] netr_LogonLevel logon
303 [public] NTSTATUS netr_ServerReqChallenge(
304 [in,unique,string,charset(UTF16)] uint16 *server_name,
305 [in,string,charset(UTF16)] uint16 computer_name[],
306 [in,out,ref] netr_Credential *credentials
313 typedef enum netr_SchannelType netr_SchannelType;
315 NTSTATUS netr_ServerAuthenticate(
316 [in,unique,string,charset(UTF16)] uint16 *server_name,
317 [in,string,charset(UTF16)] uint16 account_name[],
318 [in] netr_SchannelType secure_channel_type,
319 [in,string,charset(UTF16)] uint16 computer_name[],
320 [in,out,ref] netr_Credential *credentials
327 NTSTATUS netr_ServerPasswordSet(
328 [in,unique] [string,charset(UTF16)] uint16 *server_name,
329 [in] [string,charset(UTF16)] uint16 account_name[],
330 [in] netr_SchannelType secure_channel_type,
331 [in] [string,charset(UTF16)] uint16 computer_name[],
332 [in] netr_Authenticator credential,
333 [in] samr_Password new_password,
334 [out] netr_Authenticator return_authenticator
341 typedef enum netr_SamDatabaseID netr_SamDatabaseID;
344 [string,charset(UTF16)] uint16 *account_name;
353 } netr_DELTA_DELETE_USER;
357 [value(length)] uint16 size;
364 [value(nt_length)] uint16 nt_size;
367 [value(lm_length)] uint16 lm_size;
369 uint8 nt_history[nt_length];
370 uint8 lm_history[lm_length];
371 } netr_PasswordHistory;
374 netr_USER_KEY16 lmpassword;
375 netr_USER_KEY16 ntpassword;
376 netr_PasswordHistory history;
379 typedef struct { /* TODO: make this a union! */
380 netr_USER_KEYS2 keys2;
381 } netr_USER_KEY_UNION;
383 typedef [public] struct {
385 netr_USER_KEY_UNION keys;
389 boolean8 SensitiveDataFlag;
392 /* netr_USER_KEYS encrypted with the session key */
393 [size_is(DataLength)][flag(NDR_PAHEX)] uint8 *SensitiveData;
394 } netr_USER_PRIVATE_INFO;
397 lsa_String account_name;
398 lsa_String full_name;
401 lsa_String home_directory;
402 lsa_String home_drive;
403 lsa_String logon_script;
404 lsa_String description;
405 lsa_String workstations;
408 samr_LogonHours logon_hours;
409 uint16 bad_password_count;
411 NTTIME last_password_change;
413 samr_AcctFlags acct_flags;
414 samr_Password lmpassword;
415 samr_Password ntpassword;
416 boolean8 nt_password_present;
417 boolean8 lm_password_present;
418 boolean8 password_expired;
420 lsa_String parameters;
423 netr_USER_PRIVATE_INFO user_private_info;
424 uint32 SecurityInformation;
426 lsa_String profile_path;
437 lsa_String domain_name;
438 lsa_String oem_information; /* comment */
439 dlong force_logoff_time;
440 uint16 min_password_length;
441 uint16 password_history_length;
442 /* yes, these are signed. They are in negative 100ns */
443 dlong max_password_age;
444 dlong min_password_age;
446 NTTIME domain_create_time;
447 uint32 SecurityInformation;
449 netr_AcctLockStr account_lockout;
453 uint32 logon_to_chgpass;
460 lsa_String group_name;
463 lsa_String description;
464 uint32 SecurityInformation;
490 [size_is(num_rids)] uint32 *rids;
491 [size_is(num_rids)] uint32 *attribs;
497 } netr_DELTA_GROUP_MEMBER;
500 lsa_String alias_name;
502 uint32 SecurityInformation;
504 lsa_String description;
520 } netr_DELTA_ALIAS_MEMBER;
523 uint32 pagedpoollimit;
524 uint32 nonpagedpoollimit;
525 uint32 minimumworkingsetsize;
526 uint32 maximumworkingsetsize;
527 uint32 pagefilelimit;
533 NTTIME auditretentionperiod;
534 boolean8 auditingmode;
535 uint32 maxauditeventcount;
536 [size_is(maxauditeventcount+1)] uint32 *eventauditoptions;
537 lsa_String primary_domain_name;
539 netr_QUOTA_LIMITS quota_limits;
541 NTTIME db_create_time;
542 uint32 SecurityInformation;
555 lsa_String domain_name;
556 uint32 num_controllers;
557 [size_is(num_controllers)] lsa_String *controller_names;
558 uint32 SecurityInformation;
568 } netr_DELTA_TRUSTED_DOMAIN;
572 } netr_DELTA_DELETE_TRUST;
575 uint32 privilege_entries;
576 uint32 privilege_control;
577 [size_is(privilege_entries)] uint32 *privilege_attrib;
578 [size_is(privilege_entries)] lsa_String *privilege_name;
579 netr_QUOTA_LIMITS quotalimits;
581 uint32 SecurityInformation;
591 } netr_DELTA_ACCOUNT;
595 } netr_DELTA_DELETE_ACCOUNT;
599 } netr_DELTA_DELETE_SECRET;
604 [size_is(maxlen)][length_is(len)] uint8 *cipher_data;
608 netr_CIPHER_VALUE current_cipher;
609 NTTIME current_cipher_set_time;
610 netr_CIPHER_VALUE old_cipher;
611 NTTIME old_cipher_set_time;
612 uint32 SecurityInformation;
625 NETR_DELTA_DOMAIN = 1,
626 NETR_DELTA_GROUP = 2,
627 NETR_DELTA_DELETE_GROUP = 3,
628 NETR_DELTA_RENAME_GROUP = 4,
630 NETR_DELTA_DELETE_USER = 6,
631 NETR_DELTA_RENAME_USER = 7,
632 NETR_DELTA_GROUP_MEMBER = 8,
633 NETR_DELTA_ALIAS = 9,
634 NETR_DELTA_DELETE_ALIAS = 10,
635 NETR_DELTA_RENAME_ALIAS = 11,
636 NETR_DELTA_ALIAS_MEMBER = 12,
637 NETR_DELTA_POLICY = 13,
638 NETR_DELTA_TRUSTED_DOMAIN = 14,
639 NETR_DELTA_DELETE_TRUST = 15,
640 NETR_DELTA_ACCOUNT = 16,
641 NETR_DELTA_DELETE_ACCOUNT = 17,
642 NETR_DELTA_SECRET = 18,
643 NETR_DELTA_DELETE_SECRET = 19,
644 NETR_DELTA_DELETE_GROUP2 = 20,
645 NETR_DELTA_DELETE_USER2 = 21,
646 NETR_DELTA_MODIFY_COUNT = 22
649 typedef [switch_type(netr_DeltaEnum)] union {
650 [case(NETR_DELTA_DOMAIN)] netr_DELTA_DOMAIN *domain;
651 [case(NETR_DELTA_GROUP)] netr_DELTA_GROUP *group;
652 [case(NETR_DELTA_DELETE_GROUP)] ; /* rid only */
653 [case(NETR_DELTA_RENAME_GROUP)] netr_DELTA_RENAME *rename_group;
654 [case(NETR_DELTA_USER)] netr_DELTA_USER *user;
655 [case(NETR_DELTA_DELETE_USER)] ; /* rid only */
656 [case(NETR_DELTA_RENAME_USER)] netr_DELTA_RENAME *rename_user;
657 [case(NETR_DELTA_GROUP_MEMBER)] netr_DELTA_GROUP_MEMBER *group_member;
658 [case(NETR_DELTA_ALIAS)] netr_DELTA_ALIAS *alias;
659 [case(NETR_DELTA_DELETE_ALIAS)] ; /* rid only */
660 [case(NETR_DELTA_RENAME_ALIAS)] netr_DELTA_RENAME *rename_alias;
661 [case(NETR_DELTA_ALIAS_MEMBER)] netr_DELTA_ALIAS_MEMBER *alias_member;
662 [case(NETR_DELTA_POLICY)] netr_DELTA_POLICY *policy;
663 [case(NETR_DELTA_TRUSTED_DOMAIN)] netr_DELTA_TRUSTED_DOMAIN *trusted_domain;
664 [case(NETR_DELTA_DELETE_TRUST)] netr_DELTA_DELETE_TRUST delete_trust;
665 [case(NETR_DELTA_ACCOUNT)] netr_DELTA_ACCOUNT *account;
666 [case(NETR_DELTA_DELETE_ACCOUNT)] netr_DELTA_DELETE_ACCOUNT delete_account;
667 [case(NETR_DELTA_SECRET)] netr_DELTA_SECRET *secret;
668 [case(NETR_DELTA_DELETE_SECRET)] netr_DELTA_DELETE_SECRET delete_secret;
669 [case(NETR_DELTA_DELETE_GROUP2)] netr_DELTA_DELETE_USER *delete_group;
670 [case(NETR_DELTA_DELETE_USER2)] netr_DELTA_DELETE_USER *delete_user;
671 [case(NETR_DELTA_MODIFY_COUNT)] udlong *modified_count;
674 typedef [switch_type(netr_DeltaEnum)] union {
675 [case(NETR_DELTA_DOMAIN)] uint32 rid;
676 [case(NETR_DELTA_GROUP)] uint32 rid;
677 [case(NETR_DELTA_DELETE_GROUP)] uint32 rid;
678 [case(NETR_DELTA_RENAME_GROUP)] uint32 rid;
679 [case(NETR_DELTA_USER)] uint32 rid;
680 [case(NETR_DELTA_DELETE_USER)] uint32 rid;
681 [case(NETR_DELTA_RENAME_USER)] uint32 rid;
682 [case(NETR_DELTA_GROUP_MEMBER)] uint32 rid;
683 [case(NETR_DELTA_ALIAS)] uint32 rid;
684 [case(NETR_DELTA_DELETE_ALIAS)] uint32 rid;
685 [case(NETR_DELTA_RENAME_ALIAS)] uint32 rid;
686 [case(NETR_DELTA_ALIAS_MEMBER)] uint32 rid;
687 [case(NETR_DELTA_POLICY)] dom_sid2 *sid;
688 [case(NETR_DELTA_TRUSTED_DOMAIN)] dom_sid2 *sid;
689 [case(NETR_DELTA_DELETE_TRUST)] dom_sid2 *sid;
690 [case(NETR_DELTA_ACCOUNT)] dom_sid2 *sid;
691 [case(NETR_DELTA_DELETE_ACCOUNT)] dom_sid2 *sid;
692 [case(NETR_DELTA_SECRET)] [string,charset(UTF16)] uint16 *name;
693 [case(NETR_DELTA_DELETE_SECRET)] [string,charset(UTF16)] uint16 *name;
694 [case(NETR_DELTA_DELETE_GROUP2)] uint32 rid;
695 [case(NETR_DELTA_DELETE_USER2)] uint32 rid;
696 [case(NETR_DELTA_MODIFY_COUNT)] ;
697 } netr_DELTA_ID_UNION;
700 netr_DeltaEnum delta_type;
701 [switch_is(delta_type)] netr_DELTA_ID_UNION delta_id_union;
702 [switch_is(delta_type)] netr_DELTA_UNION delta_union;
707 [size_is(num_deltas)] netr_DELTA_ENUM *delta_enum;
708 } netr_DELTA_ENUM_ARRAY;
711 NTSTATUS netr_DatabaseDeltas(
712 [in] [string,charset(UTF16)] uint16 logon_server[],
713 [in] [string,charset(UTF16)] uint16 computername[],
714 [in] netr_Authenticator credential,
715 [in,out] netr_Authenticator return_authenticator,
716 [in] netr_SamDatabaseID database_id,
717 [in,out] udlong sequence_num,
718 [in] uint32 preferredmaximumlength,
719 [out,unique] netr_DELTA_ENUM_ARRAY *delta_enum_array
726 NTSTATUS netr_DatabaseSync(
727 [in] [string,charset(UTF16)] uint16 logon_server[],
728 [in] [string,charset(UTF16)] uint16 computername[],
729 [in] netr_Authenticator credential,
730 [in,out] netr_Authenticator return_authenticator,
731 [in] netr_SamDatabaseID database_id,
732 [in,out] uint32 sync_context,
733 [in] uint32 preferredmaximumlength,
734 [out,unique] netr_DELTA_ENUM_ARRAY *delta_enum_array
741 /* w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this call */
743 typedef [flag(NDR_PAHEX)] struct {
744 uint8 computer_name[16];
746 uint32 serial_number;
750 [flag(NDR_REMAINING)] DATA_BLOB blob;
751 } netr_AccountBuffer;
753 NTSTATUS netr_AccountDeltas(
754 [in,unique] [string,charset(UTF16)] uint16 *logon_server,
755 [in] [string,charset(UTF16)] uint16 computername[],
756 [in] netr_Authenticator credential,
757 [in,out] netr_Authenticator return_authenticator,
758 [in] netr_UAS_INFO_0 uas,
761 [in] uint32 buffersize,
762 [out,subcontext(4)] netr_AccountBuffer buffer,
763 [out] uint32 count_returned,
764 [out] uint32 total_entries,
765 [out] netr_UAS_INFO_0 recordid
772 NTSTATUS netr_AccountSync(
773 [in,unique] [string,charset(UTF16)] uint16 *logon_server,
774 [in] [string,charset(UTF16)] uint16 computername[],
775 [in] netr_Authenticator credential,
776 [in,out] netr_Authenticator return_authenticator,
777 [in] uint32 reference,
779 [in] uint32 buffersize,
780 [out,subcontext(4)] netr_AccountBuffer buffer,
781 [out] uint32 count_returned,
782 [out] uint32 total_entries,
783 [out] uint32 next_reference,
784 [in,out] netr_UAS_INFO_0 recordid
791 WERROR netr_GetDcName(
792 [in] [string,charset(UTF16)] uint16 logon_server[],
793 [in,unique] [string,charset(UTF16)] uint16 *domainname,
794 [out,unique] [string,charset(UTF16)] uint16 *dcname
802 uint32 pdc_connection_status;
803 } netr_NETLOGON_INFO_1;
807 uint32 pdc_connection_status;
808 [string,charset(UTF16)] uint16 trusted_dc_name[];
809 uint32 tc_connection_status;
810 } netr_NETLOGON_INFO_2;
814 uint32 logon_attempts;
820 } netr_NETLOGON_INFO_3;
823 [case(1)] netr_NETLOGON_INFO_1 *info1;
824 [case(2)] netr_NETLOGON_INFO_2 *info2;
825 [case(3)] netr_NETLOGON_INFO_3 *info3;
826 } netr_CONTROL_QUERY_INFORMATION;
828 /* function_code values */
829 typedef [v1_enum] enum {
830 NETLOGON_CONTROL_REDISCOVER = 5,
831 NETLOGON_CONTROL_TC_QUERY = 6,
832 NETLOGON_CONTROL_TRANSPORT_NOTIFY = 7,
833 NETLOGON_CONTROL_SET_DBFLAG = 65534
834 } netr_LogonControlCode;
836 WERROR netr_LogonControl(
837 [in,unique] [string,charset(UTF16)] uint16 *logon_server,
838 [in] netr_LogonControlCode function_code,
840 [out,switch_is(level)] netr_CONTROL_QUERY_INFORMATION info
847 WERROR netr_GetAnyDCName(
848 [in,unique] [string,charset(UTF16)] uint16 *logon_server,
849 [in,unique] [string,charset(UTF16)] uint16 *domainname,
850 [out,unique] [string,charset(UTF16)] uint16 *dcname
858 [case(NETLOGON_CONTROL_REDISCOVER)] [string,charset(UTF16)] uint16 *domain;
859 [case(NETLOGON_CONTROL_TC_QUERY)] [string,charset(UTF16)] uint16 *domain;
860 [case(NETLOGON_CONTROL_TRANSPORT_NOTIFY)] [string,charset(UTF16)] uint16 *domain;
861 [case(NETLOGON_CONTROL_SET_DBFLAG)] uint32 debug_level;
862 } netr_CONTROL_DATA_INFORMATION;
864 WERROR netr_LogonControl2(
865 [in,unique] [string,charset(UTF16)] uint16 *logon_server,
866 [in] uint32 function_code,
868 [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION data,
869 [out][switch_is(level)] netr_CONTROL_QUERY_INFORMATION query
873 /* If this flag is not set, then the passwords and LM session keys are
874 * encrypted with DES calls. (And the user session key is
876 const int NETLOGON_NEG_ARCFOUR = 0x00000004;
877 const int NETLOGON_NEG_128BIT = 0x00004000;
878 const int NETLOGON_NEG_SCHANNEL = 0x40000000;
883 NTSTATUS netr_ServerAuthenticate2(
884 [in,unique] [string,charset(UTF16)] uint16 *server_name,
885 [in] [string,charset(UTF16)] uint16 account_name[],
886 [in] netr_SchannelType secure_channel_type,
887 [in] [string,charset(UTF16)] uint16 computer_name[],
888 [in,out,ref] netr_Credential *credentials,
889 [in,out,ref] uint32 *negotiate_flags
896 NTSTATUS netr_DatabaseSync2(
897 [in] [string,charset(UTF16)] uint16 logon_server[],
898 [in] [string,charset(UTF16)] uint16 computername[],
899 [in] netr_Authenticator credential,
900 [in,out] netr_Authenticator return_authenticator,
901 [in] netr_SamDatabaseID database_id,
902 [in] uint16 restart_state,
903 [in,out] uint32 sync_context,
904 [in] uint32 preferredmaximumlength,
905 [out,unique] netr_DELTA_ENUM_ARRAY *delta_enum_array
912 /* i'm not at all sure how this call works */
914 NTSTATUS netr_DatabaseRedo(
915 [in] [string,charset(UTF16)] uint16 logon_server[],
916 [in] [string,charset(UTF16)] uint16 computername[],
917 [in] netr_Authenticator credential,
918 [in,out] netr_Authenticator return_authenticator,
919 [in,unique][size_is(change_log_entry_size)] uint8 *change_log_entry,
920 [in] uint32 change_log_entry_size,
921 [out,unique] netr_DELTA_ENUM_ARRAY *delta_enum_array
928 WERROR netr_LogonControl2Ex(
929 [in,unique] [string,charset(UTF16)] uint16 *logon_server,
930 [in] uint32 function_code,
932 [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION data,
933 [out][switch_is(level)] netr_CONTROL_QUERY_INFORMATION query
940 [size_is(length)] uint8 *data;
943 WERROR netr_NetrEnumerateTrustedDomains(
944 [in,unique] [string,charset(UTF16)] uint16 *server_name,
945 [out,ref] netr_Blob *trusted_domains_blob
951 /* two unkown bits still: DS_IP_VERSION_AGNOSTIC and
952 * DS_TRY_NEXTCLOSEST_SITE - Guenther */
954 typedef [bitmap32bit] bitmap {
955 DS_FORCE_REDISCOVERY = 0x00000001,
956 DS_DIRECTORY_SERVICE_REQUIRED = 0x00000010,
957 DS_DIRECTORY_SERVICE_PREFERRED = 0x00000020,
958 DS_GC_SERVER_REQUIRED = 0x00000040,
959 DS_PDC_REQUIRED = 0x00000080,
960 DS_BACKGROUND_ONLY = 0x00000100,
961 DS_IP_REQUIRED = 0x00000200,
962 DS_KDC_REQUIRED = 0x00000400,
963 DS_TIMESERV_REQUIRED = 0x00000800,
964 DS_WRITABLE_REQUIRED = 0x00001000,
965 DS_GOOD_TIMESERV_PREFERRED = 0x00002000,
966 DS_AVOID_SELF = 0x00004000,
967 DS_ONLY_LDAP_NEEDED = 0x00008000,
968 DS_IS_FLAT_NAME = 0x00010000,
969 DS_IS_DNS_NAME = 0x00020000,
970 DS_RETURN_DNS_NAME = 0x40000000,
971 DS_RETURN_FLAT_NAME = 0x80000000
972 } netr_DsRGetDCName_flags;
974 typedef [v1_enum] enum {
975 DS_ADDRESS_TYPE_INET = 1,
976 DS_ADDRESS_TYPE_NETBIOS = 2
977 } netr_DsRGetDCNameInfo_AddressType;
979 typedef [bitmap32bit] bitmap {
980 DS_SERVER_PDC = NBT_SERVER_PDC,
981 DS_SERVER_GC = NBT_SERVER_GC,
982 DS_SERVER_LDAP = NBT_SERVER_LDAP,
983 DS_SERVER_DS = NBT_SERVER_DS,
984 DS_SERVER_KDC = NBT_SERVER_KDC,
985 DS_SERVER_TIMESERV = NBT_SERVER_TIMESERV,
986 DS_SERVER_CLOSEST = NBT_SERVER_CLOSEST,
987 DS_SERVER_WRITABLE = NBT_SERVER_WRITABLE,
988 DS_SERVER_GOOD_TIMESERV = NBT_SERVER_GOOD_TIMESERV,
989 DS_SERVER_NDNC = 0x00000400,
990 DS_DNS_CONTROLLER = 0x20000000,
991 DS_DNS_DOMAIN = 0x40000000,
992 DS_DNS_FOREST = 0x80000000
996 [string,charset(UTF16)] uint16 *dc_unc;
997 [string,charset(UTF16)] uint16 *dc_address;
998 netr_DsRGetDCNameInfo_AddressType dc_address_type;
1000 [string,charset(UTF16)] uint16 *domain_name;
1001 [string,charset(UTF16)] uint16 *forest_name;
1002 netr_DsR_DcFlags dc_flags;
1003 [string,charset(UTF16)] uint16 *dc_site_name;
1004 [string,charset(UTF16)] uint16 *client_site_name;
1005 } netr_DsRGetDCNameInfo;
1007 WERROR netr_DsRGetDCName(
1008 [in,unique] [string,charset(UTF16)] uint16 *server_unc,
1009 [in,unique] [string,charset(UTF16)] uint16 *domain_name,
1010 [in,unique] GUID *domain_guid,
1011 [in,unique] GUID *site_guid,
1012 [in] netr_DsRGetDCName_flags flags,
1013 [out,unique] netr_DsRGetDCNameInfo *info
1018 [todo] WERROR netr_NETRLOGONDUMMYROUTINE1();
1022 [todo] WERROR netr_NETRLOGONSETSERVICEBITS();
1026 WERROR netr_LogonGetTrustRid(
1027 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1028 [in,unique] [string,charset(UTF16)] uint16 *domain_name,
1029 [out,ref] uint32 *rid
1034 [todo] WERROR netr_NETRLOGONCOMPUTESERVERDIGEST();
1038 [todo] WERROR netr_NETRLOGONCOMPUTECLIENTDIGEST();
1042 [public] NTSTATUS netr_ServerAuthenticate3(
1043 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1044 [in] [string,charset(UTF16)] uint16 account_name[],
1045 [in] netr_SchannelType secure_channel_type,
1046 [in] [string,charset(UTF16)] uint16 computer_name[],
1047 [in,out,ref] netr_Credential *credentials,
1048 [in,out,ref] uint32 *negotiate_flags,
1049 [out,ref] uint32 *rid
1055 WERROR netr_DsRGetDCNameEx(
1056 [in,unique] [string,charset(UTF16)] uint16 *server_unc,
1057 [in,unique] [string,charset(UTF16)] uint16 *domain_name,
1058 [in,unique] GUID *domain_guid,
1059 [in,unique] [string,charset(UTF16)] uint16 *site_name,
1060 [in] netr_DsRGetDCName_flags flags,
1061 [out,unique] netr_DsRGetDCNameInfo *info
1066 WERROR netr_DsRGetSiteName(
1067 [in,unique] [string,charset(UTF16)] uint16 *computer_name,
1068 [out,unique] [string,charset(UTF16)] uint16 *site
1074 typedef [flag(NDR_PAHEX)] struct {
1077 [size_is(size/2),length_is(length/2)] uint16 *data;
1078 } netr_BinaryString;
1082 [string,charset(UTF16)] uint16 *workstation_domain;
1083 [string,charset(UTF16)] uint16 *workstation_site;
1084 [string,charset(UTF16)] uint16 *unknown1;
1085 [string,charset(UTF16)] uint16 *unknown2;
1086 [string,charset(UTF16)] uint16 *unknown3;
1087 [string,charset(UTF16)] uint16 *unknown4;
1088 netr_BinaryString blob2;
1090 lsa_String unknown5;
1091 lsa_String unknown6;
1093 } netr_DomainQuery1;
1096 [case(1)] netr_DomainQuery1 *query1;
1097 [case(2)] netr_DomainQuery1 *query1;
1101 lsa_String domainname;
1102 lsa_String fulldomainname;
1106 netr_BinaryString unknown1[4];
1108 } netr_DomainTrustInfo;
1111 netr_DomainTrustInfo domaininfo;
1113 [size_is(num_trusts)] netr_DomainTrustInfo *trusts;
1114 uint32 unknown[14]; /* room for expansion? */
1118 [case(1)] netr_DomainInfo1 *info1;
1119 [case(2)] netr_DomainInfo1 *info1;
1122 NTSTATUS netr_LogonGetDomainInfo(
1123 [in] [string,charset(UTF16)] uint16 server_name[],
1124 [in,unique] [string,charset(UTF16)] uint16 *computer_name,
1125 [in,ref] netr_Authenticator *credential,
1126 [in,out,ref] netr_Authenticator *return_authenticator,
1128 [in,switch_is(level)] netr_DomainQuery query,
1129 [out,switch_is(level)] netr_DomainInfo info
1132 typedef [flag(NDR_PAHEX)] struct {
1135 } netr_CryptPassword;
1139 NTSTATUS netr_ServerPasswordSet2(
1140 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1141 [in] [string,charset(UTF16)] uint16 account_name[],
1142 [in] netr_SchannelType secure_channel_type,
1143 [in] [string,charset(UTF16)] uint16 computer_name[],
1144 [in] netr_Authenticator credential,
1145 [in] netr_CryptPassword new_password,
1146 [out] netr_Authenticator return_authenticator
1151 WERROR netr_ServerPasswordGet(
1152 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1153 [in] [string,charset(UTF16)] uint16 account_name[],
1154 [in] netr_SchannelType secure_channel_type,
1155 [in] [string,charset(UTF16)] uint16 computer_name[],
1156 [in,ref] netr_Authenticator *credential,
1157 [out,ref] netr_Authenticator *return_authenticator,
1158 [out,ref] samr_Password *password
1163 [todo] WERROR netr_NETRLOGONSENDTOSAM();
1169 [size_is(count)] lsa_String *sitename;
1170 } netr_DsRAddressToSitenamesWCtr;
1173 [size_is(size)] uint8 *buffer;
1177 WERROR netr_DsRAddressToSitenamesW(
1178 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1179 [in] [range(0,32000)] uint32 count,
1180 [in] [size_is(count)] [ref] netr_DsRAddress *addresses,
1181 [out] [ref] netr_DsRAddressToSitenamesWCtr **ctr
1186 WERROR netr_DsRGetDCNameEx2(
1187 [in,unique] [string,charset(UTF16)] uint16 *server_unc,
1188 [in,unique] [string,charset(UTF16)] uint16 *client_account,
1189 [in] samr_AcctFlags mask,
1190 [in,unique] [string,charset(UTF16)] uint16 *domain_name,
1191 [in,unique] GUID *domain_guid,
1192 [in,unique] [string,charset(UTF16)] uint16 *site_name,
1193 [in] netr_DsRGetDCName_flags flags,
1194 [out,unique] netr_DsRGetDCNameInfo *info
1199 [todo] WERROR netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN();
1203 typedef [bitmap32bit] bitmap {
1204 NETR_TRUST_FLAG_IN_FOREST = 0x00000001,
1205 NETR_TRUST_FLAG_OUTBOUND = 0x00000002,
1206 NETR_TRUST_FLAG_TREEROOT = 0x00000004,
1207 NETR_TRUST_FLAG_PRIMARY = 0x00000008,
1208 NETR_TRUST_FLAG_NATIVE = 0x00000010,
1209 NETR_TRUST_FLAG_INBOUND = 0x00000020
1212 typedef [v1_enum] enum {
1213 NETR_TRUST_TYPE_DOWNLEVEL = 1,
1214 NETR_TRUST_TYPE_UPLEVEL = 2,
1215 NETR_TRUST_TYPE_MIT = 3,
1216 NETR_TRUST_TYPE_DCE = 4
1219 typedef [bitmap32bit] bitmap {
1220 NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE = 0x00000001,
1221 NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY = 0x00000002,
1222 NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN = 0x00000004,
1223 NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE = 0x00000008,
1224 NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION = 0x00000010,
1225 NETR_TRUST_ATTRIBUTE_WITHIN_FOREST = 0x00000020,
1226 NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL = 0x00000040
1227 } netr_TrustAttributes;
1230 [string,charset(UTF16)] uint16 *netbios_name;
1231 [string,charset(UTF16)] uint16 *dns_name;
1232 netr_TrustFlags trust_flags;
1233 uint32 parent_index;
1234 netr_TrustType trust_type;
1235 netr_TrustAttributes trust_attributes;
1242 [size_is(count)] netr_DomainTrust *array;
1243 } netr_DomainTrustList;
1245 WERROR netr_NetrEnumerateTrustedDomainsEx(
1246 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1247 [out,ref] netr_DomainTrustList *dom_trust_list
1254 [size_is(count)] lsa_String *sitename;
1255 [size_is(count)] lsa_String *subnetname;
1256 } netr_DsRAddressToSitenamesExWCtr;
1258 WERROR netr_DsRAddressToSitenamesExW(
1259 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1260 [in] [range(0,32000)] uint32 count,
1261 [in] [size_is(count)] [ref] netr_DsRAddress *addresses,
1262 [out] [ref] netr_DsRAddressToSitenamesExWCtr **ctr
1270 [size_is(num_sites)] [unique] lsa_String *sites;
1273 WERROR netr_DsrGetDcSiteCoverageW(
1274 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1275 [out,unique] DcSitesCtr *ctr
1280 NTSTATUS netr_LogonSamLogonEx(
1281 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1282 [in,unique] [string,charset(UTF16)] uint16 *computer_name,
1283 [in] uint16 logon_level,
1284 [in] [switch_is(logon_level)] netr_LogonLevel logon,
1285 [in] uint16 validation_level,
1286 [out] [switch_is(validation_level)] netr_Validation validation,
1287 [out] uint8 authoritative,
1288 [in,out] uint32 flags
1294 WERROR netr_DsrEnumerateDomainTrusts(
1295 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1296 [in] netr_TrustFlags trust_flags,
1298 [out,unique,size_is(count)] netr_DomainTrust *trusts
1304 WERROR netr_DsrDeregisterDNSHostRecords(
1305 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1306 [in,unique] [string,charset(UTF16)] uint16 *domain,
1307 [in,unique] GUID *domain_guid,
1308 [in,unique] GUID *dsa_guid,
1309 [in,ref] [string,charset(UTF16)] uint16 *dns_host
1314 NTSTATUS netr_ServerTrustPasswordsGet(
1315 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1316 [in] [string,charset(UTF16)] uint16 account_name[],
1317 [in] netr_SchannelType secure_channel_type,
1318 [in] [string,charset(UTF16)] uint16 computer_name[],
1319 [in,ref] netr_Authenticator *credential,
1320 [out,ref] netr_Authenticator *return_authenticator,
1321 [out,ref] samr_Password *password,
1322 [out,ref] samr_Password *password2
1328 const int DS_GFTI_UPDATE_TDO = 0x1;
1330 WERROR netr_DsRGetForestTrustInformation(
1331 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1332 [in,unique] [string,charset(UTF16)] uint16 *trusted_domain_name,
1334 [out,ref] lsa_ForestTrustInformation **forest_trust_info
1339 WERROR netr_GetForestTrustInformation(
1340 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1341 [in,ref] [string,charset(UTF16)] uint16 *trusted_domain_name,
1342 [in,ref] netr_Authenticator *credential,
1343 [out,ref] netr_Authenticator *return_authenticator,
1345 [out,ref] lsa_ForestTrustInformation **forest_trust_info
1351 /* this is the ADS varient. I don't yet know what the "flags" are for */
1352 NTSTATUS netr_LogonSamLogonWithFlags(
1353 [in,unique] [string,charset(UTF16)] uint16 *server_name,
1354 [in,unique] [string,charset(UTF16)] uint16 *computer_name,
1355 [in,unique] netr_Authenticator *credential,
1356 [in,out,unique] netr_Authenticator *return_authenticator,
1357 [in] uint16 logon_level,
1358 [in] [switch_is(logon_level)] netr_LogonLevel logon,
1359 [in] uint16 validation_level,
1360 [out] [switch_is(validation_level)] netr_Validation validation,
1361 [out] uint8 authoritative,
1362 [in,out] uint32 flags
1367 [todo] WERROR netr_NETRSERVERGETTRUSTINFO();