3 much of this was derived from the ethereal sources - thanks to everyone
7 import "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),
16 pointer_default_top(unique)
21 declare bitmap samr_AcctFlags;
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] [string,charset(UTF16)] uint16 *server_name,
47 [in] [string,charset(UTF16)] uint16 account_name[],
48 [in] [string,charset(UTF16)] uint16 workstation[],
49 [out] netr_UasInfo *info
61 WERROR netr_LogonUasLogoff(
62 [in] [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 const int MSV1_0_CLEARTEXT_PASSWORD_ALLOWED = 0x002;
90 const int MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT = 0x020;
91 const int MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT = 0x800;
94 lsa_String domain_name;
95 uint32 parameter_control; /* see MSV1_0_* */
98 lsa_String account_name;
99 lsa_String workstation;
103 netr_IdentityInfo identity_info;
104 samr_Password lmpassword;
105 samr_Password ntpassword;
108 typedef [flag(NDR_PAHEX)] struct {
110 [value(length)] uint16 size;
111 [size_is(length),length_is(length)] uint8 *data;
112 } netr_ChallengeResponse;
114 typedef [flag(NDR_PAHEX)] struct {
115 netr_IdentityInfo identity_info;
117 netr_ChallengeResponse nt;
118 netr_ChallengeResponse lm;
121 typedef [public,switch_type(uint16)] union {
122 [case(1)] netr_PasswordInfo *password;
123 [case(2)] netr_NetworkInfo *network;
124 [case(3)] netr_PasswordInfo *password;
125 [case(5)] netr_PasswordInfo *password;
126 [case(6)] netr_NetworkInfo *network;
129 typedef [public] struct {
132 } netr_GroupMembership;
134 typedef [public,flag(NDR_PAHEX)] struct {
136 } netr_UserSessionKey;
138 typedef [public,flag(NDR_PAHEX)] struct {
142 /* Flags for user_flags below */
143 typedef [public,bitmap32bit] bitmap {
144 NETLOGON_GUEST = 0x0001,
145 NETLOGON_NOENCRYPTION = 0x0002,
146 NETLOGON_CACHED_ACCOUNT = 0x0004,
147 NETLOGON_USED_LM_PASSWORD = 0x0008,
148 NETLOGON_EXTRA_SIDS = 0x0020,
149 NETLOGON_SUBAUTH_SESSION_KEY = 0x0040,
150 NETLOGON_SERVER_TRUST_ACCOUNT = 0x0080,
151 NETLOGON_NTLMV2_ENABLED = 0x0100,
152 NETLOGON_RESOURCE_GROUPS = 0x0200,
153 NETLOGON_PROFILE_PATH_RETURNED = 0x0400
160 NTTIME last_password_change;
161 NTTIME allow_password_change;
162 NTTIME force_password_change;
163 lsa_String account_name;
164 lsa_String full_name;
165 lsa_String logon_script;
166 lsa_String profile_path;
167 lsa_String home_directory;
168 lsa_String home_drive;
170 uint16 bad_password_count;
173 samr_RidWithAttributeArray groups;
174 netr_UserFlags user_flags;
175 netr_UserSessionKey key;
176 lsa_StringLarge logon_server;
177 lsa_StringLarge domain;
178 dom_sid2 *domain_sid;
179 netr_LMSessionKey LMSessKey;
180 samr_AcctFlags acct_flags;
185 netr_SamBaseInfo base;
193 typedef [public] struct {
194 netr_SamBaseInfo base;
196 [size_is(sidcount)] netr_SidAttr *sids;
200 netr_SamBaseInfo base;
202 [size_is(sidcount)] netr_SidAttr *sids;
204 lsa_String principle;
210 [size_is(pac_size)] uint8 *pac;
211 lsa_String logon_domain;
212 lsa_String logon_server;
213 lsa_String principal_name;
215 [size_is(auth_size)] uint8 *auth;
216 netr_UserSessionKey user_session_key;
217 uint32 expansionroom[10];
224 typedef [public,switch_type(uint16)] union {
225 [case(2)] netr_SamInfo2 *sam2;
226 [case(3)] netr_SamInfo3 *sam3;
227 [case(4)] netr_PacInfo *pac;
228 [case(5)] netr_PacInfo *pac;
229 [case(6)] netr_SamInfo6 *sam6;
232 typedef [public, flag(NDR_PAHEX)] struct {
236 typedef [public] struct {
237 netr_Credential cred;
239 } netr_Authenticator;
241 NTSTATUS netr_LogonSamLogon(
242 [in] [string,charset(UTF16)] uint16 *server_name,
243 [in] [string,charset(UTF16)] uint16 *computer_name,
244 [in] netr_Authenticator *credential,
245 [in][out] netr_Authenticator *return_authenticator,
246 [in] uint16 logon_level,
247 [in] [switch_is(logon_level)] netr_LogonLevel logon,
248 [in] uint16 validation_level,
249 [out] [switch_is(validation_level)] netr_Validation validation,
250 [out] uint8 authoritative
257 NTSTATUS netr_LogonSamLogoff(
258 [in] [string,charset(UTF16)] uint16 *server_name,
259 [in] [string,charset(UTF16)] uint16 *computer_name,
260 [in] netr_Authenticator *credential,
261 [in][out] netr_Authenticator *return_authenticator,
262 [in] uint16 logon_level,
263 [in] [switch_is(logon_level)] netr_LogonLevel logon
271 [public] NTSTATUS netr_ServerReqChallenge(
272 [in,string,charset(UTF16)] uint16 *server_name,
273 [in,string,charset(UTF16)] uint16 computer_name[],
274 [in,out,ref] netr_Credential *credentials
281 declare enum netr_SchannelType;
283 NTSTATUS netr_ServerAuthenticate(
284 [in,string,charset(UTF16)] uint16 *server_name,
285 [in,string,charset(UTF16)] uint16 account_name[],
286 [in] netr_SchannelType secure_channel_type,
287 [in,string,charset(UTF16)] uint16 computer_name[],
288 [in,out,ref] netr_Credential *credentials
295 NTSTATUS netr_ServerPasswordSet(
296 [in] [string,charset(UTF16)] uint16 *server_name,
297 [in] [string,charset(UTF16)] uint16 account_name[],
298 [in] netr_SchannelType secure_channel_type,
299 [in] [string,charset(UTF16)] uint16 computer_name[],
300 [in] netr_Authenticator credential,
301 [in] samr_Password new_password,
302 [out] netr_Authenticator return_authenticator
309 declare enum netr_SamDatabaseID;
312 [string,charset(UTF16)] uint16 *account_name;
321 } netr_DELTA_DELETE_USER;
325 [value(length)] uint16 size;
332 [value(nt_length)] uint16 nt_size;
335 [value(lm_length)] uint16 lm_size;
337 uint8 nt_history[nt_length];
338 uint8 lm_history[lm_length];
339 } netr_PasswordHistory;
342 netr_USER_KEY16 lmpassword;
343 netr_USER_KEY16 ntpassword;
344 netr_PasswordHistory history;
347 typedef struct { /* TODO: make this a union! */
348 netr_USER_KEYS2 keys2;
349 } netr_USER_KEY_UNION;
351 typedef [public] struct {
353 netr_USER_KEY_UNION keys;
357 boolean8 SensitiveDataFlag;
360 /* netr_USER_KEYS encrypted with the session key */
361 [size_is(DataLength)][flag(NDR_PAHEX)] uint8 *SensitiveData;
362 } netr_USER_PRIVATE_INFO;
365 lsa_String account_name;
366 lsa_String full_name;
369 lsa_String home_directory;
370 lsa_String home_drive;
371 lsa_String logon_script;
372 lsa_String description;
373 lsa_String workstations;
376 samr_LogonHours logon_hours;
377 uint16 bad_password_count;
379 NTTIME last_password_change;
381 samr_AcctFlags acct_flags;
382 samr_Password lmpassword;
383 samr_Password ntpassword;
384 boolean8 nt_password_present;
385 boolean8 lm_password_present;
386 boolean8 password_expired;
388 lsa_String parameters;
391 netr_USER_PRIVATE_INFO user_private_info;
392 uint32 SecurityInformation;
394 lsa_String profile_path;
405 lsa_String domain_name;
407 dlong force_logoff_time;
408 uint16 min_password_length;
409 uint16 password_history_length;
410 /* yes, these are signed. They are in negative 100ns */
411 dlong max_password_age;
412 dlong min_password_age;
414 NTTIME domain_create_time;
415 uint32 SecurityInformation;
417 netr_AcctLockStr account_lockout;
421 uint32 logon_to_chgpass;
428 lsa_String group_name;
431 lsa_String description;
432 uint32 SecurityInformation;
458 [size_is(num_rids)] uint32 *rids;
459 [size_is(num_rids)] uint32 *attribs;
465 } netr_DELTA_GROUP_MEMBER;
468 lsa_String alias_name;
470 uint32 SecurityInformation;
472 lsa_String description;
488 } netr_DELTA_ALIAS_MEMBER;
491 uint32 pagedpoollimit;
492 uint32 nonpagedpoollimit;
493 uint32 minimumworkingsetsize;
494 uint32 maximumworkingsetsize;
495 uint32 pagefilelimit;
501 NTTIME auditretentionperiod;
502 boolean8 auditingmode;
503 uint32 maxauditeventcount;
504 [size_is(maxauditeventcount+1)] uint32 *eventauditoptions;
505 lsa_String primary_domain_name;
507 netr_QUOTA_LIMITS quota_limits;
509 NTTIME db_create_time;
510 uint32 SecurityInformation;
523 lsa_String domain_name;
524 uint32 num_controllers;
525 [size_is(num_controllers)] lsa_String *controller_names;
526 uint32 SecurityInformation;
536 } netr_DELTA_TRUSTED_DOMAIN;
540 } netr_DELTA_DELETE_TRUST;
543 uint32 privilege_entries;
544 uint32 privilege_control;
545 [size_is(privilege_entries)] uint32 *privilege_attrib;
546 [size_is(privilege_entries)] lsa_String *privilege_name;
547 netr_QUOTA_LIMITS quotalimits;
549 uint32 SecurityInformation;
559 } netr_DELTA_ACCOUNT;
563 } netr_DELTA_DELETE_ACCOUNT;
567 } netr_DELTA_DELETE_SECRET;
572 [size_is(maxlen)][length_is(len)] uint8 *cipher_data;
576 netr_CIPHER_VALUE current_cipher;
577 NTTIME current_cipher_set_time;
578 netr_CIPHER_VALUE old_cipher;
579 NTTIME old_cipher_set_time;
580 uint32 SecurityInformation;
593 NETR_DELTA_DOMAIN = 1,
594 NETR_DELTA_GROUP = 2,
595 NETR_DELTA_DELETE_GROUP = 3,
596 NETR_DELTA_RENAME_GROUP = 4,
598 NETR_DELTA_DELETE_USER = 6,
599 NETR_DELTA_RENAME_USER = 7,
600 NETR_DELTA_GROUP_MEMBER = 8,
601 NETR_DELTA_ALIAS = 9,
602 NETR_DELTA_DELETE_ALIAS = 10,
603 NETR_DELTA_RENAME_ALIAS = 11,
604 NETR_DELTA_ALIAS_MEMBER = 12,
605 NETR_DELTA_POLICY = 13,
606 NETR_DELTA_TRUSTED_DOMAIN = 14,
607 NETR_DELTA_DELETE_TRUST = 15,
608 NETR_DELTA_ACCOUNT = 16,
609 NETR_DELTA_DELETE_ACCOUNT = 17,
610 NETR_DELTA_SECRET = 18,
611 NETR_DELTA_DELETE_SECRET = 19,
612 NETR_DELTA_DELETE_GROUP2 = 20,
613 NETR_DELTA_DELETE_USER2 = 21,
614 NETR_DELTA_MODIFY_COUNT = 22
617 typedef [switch_type(netr_DeltaEnum)] union {
618 [case(NETR_DELTA_DOMAIN)] netr_DELTA_DOMAIN *domain;
619 [case(NETR_DELTA_GROUP)] netr_DELTA_GROUP *group;
620 [case(NETR_DELTA_DELETE_GROUP)] ; /* rid only */
621 [case(NETR_DELTA_RENAME_GROUP)] netr_DELTA_RENAME *rename_group;
622 [case(NETR_DELTA_USER)] netr_DELTA_USER *user;
623 [case(NETR_DELTA_DELETE_USER)] ; /* rid only */
624 [case(NETR_DELTA_RENAME_USER)] netr_DELTA_RENAME *rename_user;
625 [case(NETR_DELTA_GROUP_MEMBER)] netr_DELTA_GROUP_MEMBER *group_member;
626 [case(NETR_DELTA_ALIAS)] netr_DELTA_ALIAS *alias;
627 [case(NETR_DELTA_DELETE_ALIAS)] ; /* rid only */
628 [case(NETR_DELTA_RENAME_ALIAS)] netr_DELTA_RENAME *rename_alias;
629 [case(NETR_DELTA_ALIAS_MEMBER)] netr_DELTA_ALIAS_MEMBER *alias_member;
630 [case(NETR_DELTA_POLICY)] netr_DELTA_POLICY *policy;
631 [case(NETR_DELTA_TRUSTED_DOMAIN)] netr_DELTA_TRUSTED_DOMAIN *trusted_domain;
632 [case(NETR_DELTA_DELETE_TRUST)] netr_DELTA_DELETE_TRUST delete_trust;
633 [case(NETR_DELTA_ACCOUNT)] netr_DELTA_ACCOUNT *account;
634 [case(NETR_DELTA_DELETE_ACCOUNT)] netr_DELTA_DELETE_ACCOUNT delete_account;
635 [case(NETR_DELTA_SECRET)] netr_DELTA_SECRET *secret;
636 [case(NETR_DELTA_DELETE_SECRET)] netr_DELTA_DELETE_SECRET delete_secret;
637 [case(NETR_DELTA_DELETE_GROUP2)] netr_DELTA_DELETE_USER *delete_group;
638 [case(NETR_DELTA_DELETE_USER2)] netr_DELTA_DELETE_USER *delete_user;
639 [case(NETR_DELTA_MODIFY_COUNT)] udlong *modified_count;
642 typedef [switch_type(netr_DeltaEnum)] union {
643 [case(NETR_DELTA_DOMAIN)] uint32 rid;
644 [case(NETR_DELTA_GROUP)] uint32 rid;
645 [case(NETR_DELTA_DELETE_GROUP)] uint32 rid;
646 [case(NETR_DELTA_RENAME_GROUP)] uint32 rid;
647 [case(NETR_DELTA_USER)] uint32 rid;
648 [case(NETR_DELTA_DELETE_USER)] uint32 rid;
649 [case(NETR_DELTA_RENAME_USER)] uint32 rid;
650 [case(NETR_DELTA_GROUP_MEMBER)] uint32 rid;
651 [case(NETR_DELTA_ALIAS)] uint32 rid;
652 [case(NETR_DELTA_DELETE_ALIAS)] uint32 rid;
653 [case(NETR_DELTA_RENAME_ALIAS)] uint32 rid;
654 [case(NETR_DELTA_ALIAS_MEMBER)] uint32 rid;
655 [case(NETR_DELTA_POLICY)] dom_sid2 *sid;
656 [case(NETR_DELTA_TRUSTED_DOMAIN)] dom_sid2 *sid;
657 [case(NETR_DELTA_DELETE_TRUST)] dom_sid2 *sid;
658 [case(NETR_DELTA_ACCOUNT)] dom_sid2 *sid;
659 [case(NETR_DELTA_DELETE_ACCOUNT)] dom_sid2 *sid;
660 [case(NETR_DELTA_SECRET)] [string,charset(UTF16)] uint16 *name;
661 [case(NETR_DELTA_DELETE_SECRET)] [string,charset(UTF16)] uint16 *name;
662 [case(NETR_DELTA_DELETE_GROUP2)] uint32 rid;
663 [case(NETR_DELTA_DELETE_USER2)] uint32 rid;
664 [case(NETR_DELTA_MODIFY_COUNT)] ;
665 } netr_DELTA_ID_UNION;
668 netr_DeltaEnum delta_type;
669 [switch_is(delta_type)] netr_DELTA_ID_UNION delta_id_union;
670 [switch_is(delta_type)] netr_DELTA_UNION delta_union;
675 [size_is(num_deltas)] netr_DELTA_ENUM *delta_enum;
676 } netr_DELTA_ENUM_ARRAY;
679 NTSTATUS netr_DatabaseDeltas(
680 [in] [string,charset(UTF16)] uint16 logon_server[],
681 [in] [string,charset(UTF16)] uint16 computername[],
682 [in] netr_Authenticator credential,
683 [in,out] netr_Authenticator return_authenticator,
684 [in] netr_SamDatabaseID database_id,
685 [in,out] udlong sequence_num,
686 [in] uint32 preferredmaximumlength,
687 [out] netr_DELTA_ENUM_ARRAY *delta_enum_array
694 NTSTATUS netr_DatabaseSync(
695 [in] [string,charset(UTF16)] uint16 logon_server[],
696 [in] [string,charset(UTF16)] uint16 computername[],
697 [in] netr_Authenticator credential,
698 [in,out] netr_Authenticator return_authenticator,
699 [in] netr_SamDatabaseID database_id,
700 [in,out] uint32 sync_context,
701 [in] uint32 preferredmaximumlength,
702 [out] netr_DELTA_ENUM_ARRAY *delta_enum_array
709 /* w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this call */
711 typedef [flag(NDR_PAHEX)] struct {
712 uint8 computer_name[16];
714 uint32 serial_number;
718 [flag(NDR_REMAINING)] DATA_BLOB blob;
719 } netr_AccountBuffer;
721 NTSTATUS netr_AccountDeltas(
722 [in] [string,charset(UTF16)] uint16 *logon_server,
723 [in] [string,charset(UTF16)] uint16 computername[],
724 [in] netr_Authenticator credential,
725 [in,out] netr_Authenticator return_authenticator,
726 [in] netr_UAS_INFO_0 uas,
729 [in] uint32 buffersize,
730 [out,subcontext(4)] netr_AccountBuffer buffer,
731 [out] uint32 count_returned,
732 [out] uint32 total_entries,
733 [out] netr_UAS_INFO_0 recordid
740 NTSTATUS netr_AccountSync(
741 [in] [string,charset(UTF16)] uint16 *logon_server,
742 [in] [string,charset(UTF16)] uint16 computername[],
743 [in] netr_Authenticator credential,
744 [in,out] netr_Authenticator return_authenticator,
745 [in] uint32 reference,
747 [in] uint32 buffersize,
748 [out,subcontext(4)] netr_AccountBuffer buffer,
749 [out] uint32 count_returned,
750 [out] uint32 total_entries,
751 [out] uint32 next_reference,
752 [in,out] netr_UAS_INFO_0 recordid
759 WERROR netr_GetDcName(
760 [in] [string,charset(UTF16)] uint16 logon_server[],
761 [in] [string,charset(UTF16)] uint16 *domainname,
762 [out] [string,charset(UTF16)] uint16 *dcname
770 uint32 pdc_connection_status;
771 } netr_NETLOGON_INFO_1;
775 uint32 pdc_connection_status;
776 [string,charset(UTF16)] uint16 trusted_dc_name[];
777 uint32 tc_connection_status;
778 } netr_NETLOGON_INFO_2;
782 uint32 logon_attempts;
788 } netr_NETLOGON_INFO_3;
791 [case(1)] netr_NETLOGON_INFO_1 *info1;
792 [case(2)] netr_NETLOGON_INFO_2 *info2;
793 [case(3)] netr_NETLOGON_INFO_3 *info3;
794 } netr_CONTROL_QUERY_INFORMATION;
796 /* function_code values */
797 typedef [v1_enum] enum {
798 NETLOGON_CONTROL_REDISCOVER = 5,
799 NETLOGON_CONTROL_TC_QUERY = 6,
800 NETLOGON_CONTROL_TRANSPORT_NOTIFY = 7,
801 NETLOGON_CONTROL_SET_DBFLAG = 65534
802 } netr_LogonControlCode;
804 WERROR netr_LogonControl(
805 [in] [string,charset(UTF16)] uint16 *logon_server,
806 [in] netr_LogonControlCode function_code,
808 [out,switch_is(level)] netr_CONTROL_QUERY_INFORMATION info
815 WERROR netr_GetAnyDCName(
816 [in] [string,charset(UTF16)] uint16 *logon_server,
817 [in] [string,charset(UTF16)] uint16 *domainname,
818 [out] [string,charset(UTF16)] uint16 *dcname
826 [case(NETLOGON_CONTROL_REDISCOVER)] [string,charset(UTF16)] uint16 *domain;
827 [case(NETLOGON_CONTROL_TC_QUERY)] [string,charset(UTF16)] uint16 *domain;
828 [case(NETLOGON_CONTROL_TRANSPORT_NOTIFY)] [string,charset(UTF16)] uint16 *domain;
829 [case(NETLOGON_CONTROL_SET_DBFLAG)] uint32 debug_level;
830 } netr_CONTROL_DATA_INFORMATION;
832 WERROR netr_LogonControl2(
833 [in] [string,charset(UTF16)] uint16 *logon_server,
834 [in] uint32 function_code,
836 [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION data,
837 [out][switch_is(level)] netr_CONTROL_QUERY_INFORMATION query
841 /* If this flag is not set, then the passwords and LM session keys are
842 * encrypted with DES calls. (And the user session key is
844 const int NETLOGON_NEG_ARCFOUR = 0x00000004;
845 const int NETLOGON_NEG_128BIT = 0x00004000;
846 const int NETLOGON_NEG_SCHANNEL = 0x40000000;
851 NTSTATUS netr_ServerAuthenticate2(
852 [in] [string,charset(UTF16)] uint16 *server_name,
853 [in] [string,charset(UTF16)] uint16 account_name[],
854 [in] netr_SchannelType secure_channel_type,
855 [in] [string,charset(UTF16)] uint16 computer_name[],
856 [in,out,ref] netr_Credential *credentials,
857 [in,out,ref] uint32 *negotiate_flags
864 NTSTATUS netr_DatabaseSync2(
865 [in] [string,charset(UTF16)] uint16 logon_server[],
866 [in] [string,charset(UTF16)] uint16 computername[],
867 [in] netr_Authenticator credential,
868 [in,out] netr_Authenticator return_authenticator,
869 [in] netr_SamDatabaseID database_id,
870 [in] uint16 restart_state,
871 [in,out] uint32 sync_context,
872 [in] uint32 preferredmaximumlength,
873 [out] netr_DELTA_ENUM_ARRAY *delta_enum_array
880 /* i'm not at all sure how this call works */
882 NTSTATUS netr_DatabaseRedo(
883 [in] [string,charset(UTF16)] uint16 logon_server[],
884 [in] [string,charset(UTF16)] uint16 computername[],
885 [in] netr_Authenticator credential,
886 [in,out] netr_Authenticator return_authenticator,
887 [in][size_is(change_log_entry_size)] uint8 *change_log_entry,
888 [in] uint32 change_log_entry_size,
889 [out] netr_DELTA_ENUM_ARRAY *delta_enum_array
896 WERROR netr_LogonControl2Ex(
897 [in] [string,charset(UTF16)] uint16 *logon_server,
898 [in] uint32 function_code,
900 [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION data,
901 [out][switch_is(level)] netr_CONTROL_QUERY_INFORMATION query
908 [size_is(length)] uint8 *data;
911 WERROR netr_NetrEnumerateTrustedDomains(
912 [in] [string,charset(UTF16)] uint16 *server_name,
913 [out,ref] netr_Blob *trusted_domains_blob
919 /* two unkown bits still: DS_IP_VERSION_AGNOSTIC and
920 * DS_TRY_NEXTCLOSEST_SITE - Guenther */
922 typedef [bitmap32bit] bitmap {
923 DS_FORCE_REDISCOVERY = 0x00000001,
924 DS_DIRECTORY_SERVICE_REQUIRED = 0x00000010,
925 DS_DIRECTORY_SERVICE_PREFERRED = 0x00000020,
926 DS_GC_SERVER_REQUIRED = 0x00000040,
927 DS_PDC_REQUIRED = 0x00000080,
928 DS_BACKGROUND_ONLY = 0x00000100,
929 DS_IP_REQUIRED = 0x00000200,
930 DS_KDC_REQUIRED = 0x00000400,
931 DS_TIMESERV_REQUIRED = 0x00000800,
932 DS_WRITABLE_REQUIRED = 0x00001000,
933 DS_GOOD_TIMESERV_PREFERRED = 0x00002000,
934 DS_AVOID_SELF = 0x00004000,
935 DS_ONLY_LDAP_NEEDED = 0x00008000,
936 DS_IS_FLAT_NAME = 0x00010000,
937 DS_IS_DNS_NAME = 0x00020000,
938 DS_RETURN_DNS_NAME = 0x40000000,
939 DS_RETURN_FLAT_NAME = 0x80000000
940 } netr_DsRGetDCName_flags;
942 typedef [v1_enum] enum {
943 DS_ADDRESS_TYPE_INET = 1,
944 DS_ADDRESS_TYPE_NETBIOS = 2
945 } netr_DsRGetDCNameInfo_AddressType;
947 typedef [bitmap32bit] bitmap {
948 DS_SERVER_PDC = NBT_SERVER_PDC,
949 DS_SERVER_GC = NBT_SERVER_GC,
950 DS_SERVER_LDAP = NBT_SERVER_LDAP,
951 DS_SERVER_DS = NBT_SERVER_DS,
952 DS_SERVER_KDC = NBT_SERVER_KDC,
953 DS_SERVER_TIMESERV = NBT_SERVER_TIMESERV,
954 DS_SERVER_CLOSEST = NBT_SERVER_CLOSEST,
955 DS_SERVER_WRITABLE = NBT_SERVER_WRITABLE,
956 DS_SERVER_GOOD_TIMESERV = NBT_SERVER_GOOD_TIMESERV,
957 DS_SERVER_NDNC = 0x00000400,
958 DS_DNS_CONTROLLER = 0x20000000,
959 DS_DNS_DOMAIN = 0x40000000,
960 DS_DNS_FOREST = 0x80000000
964 [string,charset(UTF16)] uint16 *dc_unc;
965 [string,charset(UTF16)] uint16 *dc_address;
966 netr_DsRGetDCNameInfo_AddressType dc_address_type;
968 [string,charset(UTF16)] uint16 *domain_name;
969 [string,charset(UTF16)] uint16 *forest_name;
970 netr_DsR_DcFlags dc_flags;
971 [string,charset(UTF16)] uint16 *dc_site_name;
972 [string,charset(UTF16)] uint16 *client_site_name;
973 } netr_DsRGetDCNameInfo;
975 WERROR netr_DsRGetDCName(
976 [in] [string,charset(UTF16)] uint16 *server_unc,
977 [in] [string,charset(UTF16)] uint16 *domain_name,
978 [in] GUID *domain_guid,
979 [in] GUID *site_guid,
980 [in] netr_DsRGetDCName_flags flags,
981 [out] netr_DsRGetDCNameInfo *info
986 WERROR netr_NETRLOGONDUMMYROUTINE1();
990 WERROR netr_NETRLOGONSETSERVICEBITS();
994 WERROR netr_NETRLOGONGETTRUSTRID();
998 WERROR netr_NETRLOGONCOMPUTESERVERDIGEST();
1002 WERROR netr_NETRLOGONCOMPUTECLIENTDIGEST();
1006 [public] NTSTATUS netr_ServerAuthenticate3(
1007 [in] [string,charset(UTF16)] uint16 *server_name,
1008 [in] [string,charset(UTF16)] uint16 account_name[],
1009 [in] netr_SchannelType secure_channel_type,
1010 [in] [string,charset(UTF16)] uint16 computer_name[],
1011 [in,out,ref] netr_Credential *credentials,
1012 [in,out,ref] uint32 *negotiate_flags,
1013 [out,ref] uint32 *rid
1019 WERROR netr_DsRGetDCNameEx(
1020 [in] [string,charset(UTF16)] uint16 *server_unc,
1021 [in] [string,charset(UTF16)] uint16 *domain_name,
1022 [in] GUID *domain_guid,
1023 [in] [string,charset(UTF16)] uint16 *site_name,
1024 [in] netr_DsRGetDCName_flags flags,
1025 [out] netr_DsRGetDCNameInfo *info
1030 WERROR netr_DsRGetSiteName(
1031 [in] [string,charset(UTF16)] uint16 *computer_name,
1032 [out] [string,charset(UTF16)] uint16 *site
1038 typedef [flag(NDR_PAHEX)] struct {
1041 [size_is(size/2),length_is(length/2)] uint16 *data;
1042 } netr_BinaryString;
1046 [string,charset(UTF16)] uint16 *workstation_domain;
1047 [string,charset(UTF16)] uint16 *workstation_site;
1048 [string,charset(UTF16)] uint16 *unknown1;
1049 [string,charset(UTF16)] uint16 *unknown2;
1050 [string,charset(UTF16)] uint16 *unknown3;
1051 [string,charset(UTF16)] uint16 *unknown4;
1052 netr_BinaryString blob2;
1054 lsa_String unknown5;
1055 lsa_String unknown6;
1057 } netr_DomainQuery1;
1060 [case(1)] netr_DomainQuery1 *query1;
1061 [case(2)] netr_DomainQuery1 *query1;
1065 lsa_String domainname;
1066 lsa_String fulldomainname;
1070 netr_BinaryString unknown1[4];
1072 } netr_DomainTrustInfo;
1075 netr_DomainTrustInfo domaininfo;
1077 [size_is(num_trusts)] netr_DomainTrustInfo *trusts;
1078 uint32 unknown[14]; /* room for expansion? */
1082 [case(1)] netr_DomainInfo1 *info1;
1083 [case(2)] netr_DomainInfo1 *info1;
1086 NTSTATUS netr_LogonGetDomainInfo(
1087 [in] [string,charset(UTF16)] uint16 server_name[],
1088 [in] [string,charset(UTF16)] uint16 *computer_name,
1089 [in,ref] netr_Authenticator *credential,
1090 [in,out,ref] netr_Authenticator *return_authenticator,
1092 [in,switch_is(level)] netr_DomainQuery query,
1093 [out,switch_is(level)] netr_DomainInfo info
1096 typedef [flag(NDR_PAHEX)] struct {
1099 } netr_CryptPassword;
1103 NTSTATUS netr_ServerPasswordSet2(
1104 [in] [string,charset(UTF16)] uint16 *server_name,
1105 [in] [string,charset(UTF16)] uint16 account_name[],
1106 [in] netr_SchannelType secure_channel_type,
1107 [in] [string,charset(UTF16)] uint16 computer_name[],
1108 [in] netr_Authenticator credential,
1109 [in] netr_CryptPassword new_password,
1110 [out] netr_Authenticator return_authenticator
1115 WERROR netr_ServerPasswordGet(
1116 [in] [string,charset(UTF16)] uint16 *server_name,
1117 [in] [string,charset(UTF16)] uint16 account_name[],
1118 [in] netr_SchannelType secure_channel_type,
1119 [in] [string,charset(UTF16)] uint16 computer_name[],
1120 [in,ref] netr_Authenticator *credential,
1121 [out,ref] netr_Authenticator *return_authenticator,
1122 [out,ref] samr_Password *password
1127 WERROR netr_NETRLOGONSENDTOSAM();
1133 [size_is(count)] lsa_String *sitename;
1134 } netr_DsRAddressToSitenamesWCtr;
1137 [size_is(size)] uint8 *buffer;
1141 WERROR netr_DsRAddressToSitenamesW(
1142 [in] [string,charset(UTF16)] uint16 *server_name,
1143 [in] [range(0,32000)] uint32 count,
1144 [in] [size_is(count)] [ref] netr_DsRAddress *addresses,
1145 [out] [ref] netr_DsRAddressToSitenamesWCtr **ctr
1150 WERROR netr_DsRGetDCNameEx2(
1151 [in] [string,charset(UTF16)] uint16 *server_unc,
1152 [in] [string,charset(UTF16)] uint16 *client_account,
1153 [in] samr_AcctFlags mask,
1154 [in] [string,charset(UTF16)] uint16 *domain_name,
1155 [in] GUID *domain_guid,
1156 [in] [string,charset(UTF16)] uint16 *site_name,
1157 [in] netr_DsRGetDCName_flags flags,
1158 [out] netr_DsRGetDCNameInfo *info
1163 WERROR netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN();
1167 typedef [bitmap32bit] bitmap {
1168 NETR_TRUST_FLAG_IN_FOREST = 0x00000001,
1169 NETR_TRUST_FLAG_OUTBOUND = 0x00000002,
1170 NETR_TRUST_FLAG_TREEROOT = 0x00000004,
1171 NETR_TRUST_FLAG_PRIMARY = 0x00000008,
1172 NETR_TRUST_FLAG_NATIVE = 0x00000010,
1173 NETR_TRUST_FLAG_INBOUND = 0x00000020
1176 typedef [v1_enum] enum {
1177 NETR_TRUST_TYPE_DOWNLEVEL = 1,
1178 NETR_TRUST_TYPE_UPLEVEL = 2,
1179 NETR_TRUST_TYPE_MIT = 3,
1180 NETR_TRUST_TYPE_DCE = 4
1183 typedef [bitmap32bit] bitmap {
1184 NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE = 0x00000001,
1185 NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY = 0x00000002,
1186 NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN = 0x00000004,
1187 NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE = 0x00000008,
1188 NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION = 0x00000010,
1189 NETR_TRUST_ATTRIBUTE_WITHIN_FOREST = 0x00000020,
1190 NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL = 0x00000040
1191 } netr_TrustAttributes;
1194 [string,charset(UTF16)] uint16 *netbios_name;
1195 [string,charset(UTF16)] uint16 *dns_name;
1196 netr_TrustFlags trust_flags;
1197 uint32 parent_index;
1198 netr_TrustType trust_type;
1199 netr_TrustAttributes trust_attributes;
1206 [size_is(count)] netr_DomainTrust *array;
1207 } netr_DomainTrustList;
1209 WERROR netr_NetrEnumerateTrustedDomainsEx(
1210 [in] [string,charset(UTF16)] uint16 *server_name,
1211 [out,ref] netr_DomainTrustList *dom_trust_list
1218 [size_is(count)] lsa_String *sitename;
1219 [size_is(count)] lsa_String *subnetname;
1220 } netr_DsRAddressToSitenamesExWCtr;
1222 WERROR netr_DsRAddressToSitenamesExW(
1223 [in] [string,charset(UTF16)] uint16 *server_name,
1224 [in] [range(0,32000)] uint32 count,
1225 [in] [size_is(count)] [ref] netr_DsRAddress *addresses,
1226 [out] [ref] netr_DsRAddressToSitenamesExWCtr **ctr
1234 [size_is(num_sites)] [unique] lsa_String *sites;
1237 WERROR netr_DsrGetDcSiteCoverageW(
1238 [in] [string,charset(UTF16)] uint16 *server_name,
1239 [out] DcSitesCtr *ctr
1244 NTSTATUS netr_LogonSamLogonEx(
1245 [in] [string,charset(UTF16)] uint16 *server_name,
1246 [in] [string,charset(UTF16)] uint16 *computer_name,
1247 [in] uint16 logon_level,
1248 [in] [switch_is(logon_level)] netr_LogonLevel logon,
1249 [in] uint16 validation_level,
1250 [out] [switch_is(validation_level)] netr_Validation validation,
1251 [out] uint8 authoritative,
1252 [in,out] uint32 flags
1258 WERROR netr_DsrEnumerateDomainTrusts(
1259 [in] [string,charset(UTF16)] uint16 *server_name,
1260 [in] netr_TrustFlags trust_flags,
1262 [out,size_is(count)] netr_DomainTrust *trusts
1268 WERROR netr_DSRDEREGISTERDNSHOSTRECORDS();
1272 NTSTATUS netr_ServerTrustPasswordsGet(
1273 [in] [string,charset(UTF16)] uint16 *server_name,
1274 [in] [string,charset(UTF16)] uint16 account_name[],
1275 [in] netr_SchannelType secure_channel_type,
1276 [in] [string,charset(UTF16)] uint16 computer_name[],
1277 [in,ref] netr_Authenticator *credential,
1278 [out,ref] netr_Authenticator *return_authenticator,
1279 [out,ref] samr_Password *password,
1280 [out,ref] samr_Password *password2
1286 const int DS_GFTI_UPDATE_TDO = 0x1;
1288 WERROR netr_DsRGetForestTrustInformation(
1289 [in] [string,charset(UTF16)] uint16 *server_name,
1290 [in] [string,charset(UTF16)] uint16 *trusted_domain_name,
1292 [out,ref] lsa_ForestTrustInformation **forest_trust_info
1297 WERROR netr_GetForestTrustInformation(
1298 [in] [string,charset(UTF16)] uint16 *server_name,
1299 [in,ref] [string,charset(UTF16)] uint16 *trusted_domain_name,
1300 [in,ref] netr_Authenticator *credential,
1301 [out,ref] netr_Authenticator *return_authenticator,
1303 [out,ref] lsa_ForestTrustInformation **forest_trust_info
1309 /* this is the ADS varient. I don't yet know what the "flags" are for */
1310 NTSTATUS netr_LogonSamLogonWithFlags(
1311 [in] [string,charset(UTF16)] uint16 *server_name,
1312 [in] [string,charset(UTF16)] uint16 *computer_name,
1313 [in] netr_Authenticator *credential,
1314 [in][out] netr_Authenticator *return_authenticator,
1315 [in] uint16 logon_level,
1316 [in] [switch_is(logon_level)] netr_LogonLevel logon,
1317 [in] uint16 validation_level,
1318 [out] [switch_is(validation_level)] netr_Validation validation,
1319 [out] uint8 authoritative,
1320 [in,out] uint32 flags
1325 WERROR netr_NETRSERVERGETTRUSTINFO();