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";
11 cpp_quote
("#define netr_DeltaEnum8Bit netr_DeltaEnum")
12 cpp_quote
("#define netr_SamDatabaseID8Bit netr_SamDatabaseID")
14 cpp_quote
("#define ENC_CRC32 KERB_ENCTYPE_DES_CBC_CRC")
15 cpp_quote
("#define ENC_RSA_MD5 KERB_ENCTYPE_DES_CBC_MD5")
16 cpp_quote
("#define ENC_RC4_HMAC_MD5 KERB_ENCTYPE_RC4_HMAC_MD5")
17 cpp_quote
("#define ENC_HMAC_SHA1_96_AES128 KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96")
18 cpp_quote
("#define ENC_HMAC_SHA1_96_AES256 KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96")
19 cpp_quote
("#define ENC_HMAC_SHA1_96_AES256_SK KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96_SK")
20 cpp_quote
("#define ENC_FAST_SUPPORTED KERB_ENCTYPE_FAST_SUPPORTED")
21 cpp_quote
("#define ENC_COMPOUND_IDENTITY_SUPPORTED KERB_ENCTYPE_COMPOUND_IDENTITY_SUPPORTED")
22 cpp_quote
("#define ENC_CLAIMS_SUPPORTED KERB_ENCTYPE_CLAIMS_SUPPORTED")
23 cpp_quote
("#define ENC_RESOURCE_SID_COMPRESSION_DISABLED KERB_ENCTYPE_RESOURCE_SID_COMPRESSION_DISABLED")
24 cpp_quote
("#define NETLOGON_SERVER_PIPE_STATE_MAGIC 0x4f555358")
26 cpp_quote
("#define DS_SERVER_PDC NBT_SERVER_PDC")
27 cpp_quote
("#define DS_SERVER_GC NBT_SERVER_GC")
28 cpp_quote
("#define DS_SERVER_LDAP NBT_SERVER_LDAP")
29 cpp_quote
("#define DS_SERVER_DS NBT_SERVER_DS")
30 cpp_quote
("#define DS_SERVER_KDC NBT_SERVER_KDC")
31 cpp_quote
("#define DS_SERVER_TIMESERV NBT_SERVER_TIMESERV")
32 cpp_quote
("#define DS_SERVER_CLOSEST NBT_SERVER_CLOSEST")
33 cpp_quote
("#define DS_SERVER_WRITABLE NBT_SERVER_WRITABLE")
34 cpp_quote
("#define DS_SERVER_GOOD_TIMESERV NBT_SERVER_GOOD_TIMESERV")
35 cpp_quote
("#define DS_SERVER_NDNC NBT_SERVER_NDNC")
36 cpp_quote
("#define DS_SERVER_SELECT_SECRET_DOMAIN_6 NBT_SERVER_SELECT_SECRET_DOMAIN_6 /* 2008 / RODC */")
37 cpp_quote
("#define DS_SERVER_FULL_SECRET_DOMAIN_6 NBT_SERVER_FULL_SECRET_DOMAIN_6 /* 2008 */")
38 cpp_quote
("#define DS_SERVER_WEBSERV NBT_SERVER_ADS_WEB_SERVICE")
39 cpp_quote
("#define DS_SERVER_DS_8 NBT_SERVER_DS_8 /* 2012 */")
40 cpp_quote
("#define DS_SERVER_DS_9 NBT_SERVER_DS_9 /* 2012R2 */")
41 cpp_quote
("#define DS_SERVER_DS_10 NBT_SERVER_DS_10 /* 2016 */")
42 cpp_quote
("#define DS_DNS_CONTROLLER NBT_SERVER_HAS_DNS_NAME")
43 cpp_quote
("#define DS_DNS_DOMAIN NBT_SERVER_IS_DEFAULT_NC")
44 cpp_quote
("#define DS_DNS_FOREST_ROOT NBT_SERVER_FOREST_ROOT")
47 uuid("12345678-1234-abcd-ef00-01234567cffb"),
49 endpoint("ncacn_np:[\\pipe\\netlogon]","ncacn_ip_tcp:","ncalrpc:"),
50 helper
("../librpc/ndr/ndr_netlogon.h"),
52 pointer_default(unique)
57 typedef bitmap samr_AcctFlags samr_AcctFlags
;
58 typedef bitmap security_GroupAttrs security_GroupAttrs
;
59 typedef enum netr_DeltaEnum8Bit netr_DeltaEnum8Bit
;
60 typedef enum netr_SamDatabaseID8Bit netr_SamDatabaseID8Bit
;
66 [string,charset
(UTF16
)] uint16
*account_name
;
77 time_t pw_must_change
;
78 [string,charset
(UTF16
)] uint16
*computer
;
79 [string,charset
(UTF16
)] uint16
*domain
;
80 [string,charset
(UTF16
)] uint16
*script_path
;
84 WERROR netr_LogonUasLogon
(
85 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
86 [in] [string,charset
(UTF16
)] uint16
*account_name
,
87 [in] [string,charset
(UTF16
)] uint16
*workstation
,
88 [out,ref] netr_UasInfo
**info
100 WERROR netr_LogonUasLogoff
(
101 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
102 [in] [string,charset
(UTF16
)] uint16
*account_name
,
103 [in] [string,charset
(UTF16
)] uint16
*workstation
,
104 [out,ref] netr_UasLogoffInfo
*info
111 /* in netr_AcctLockStr size seems to be be 24, and rrenard thinks
112 that the structure of the bindata looks like this:
114 dlong lockout_duration;
116 uint32 bad_attempt_lockout;
119 but it doesn't look as though this structure is reflected at the
120 NDR level. Maybe it is left to the application to decode the bindata array.
122 typedef [public] struct {
123 dlong lockout_duration
;
125 uint32 bad_attempt_lockout
;
129 /* - MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT
130 * sets the NETLOGON_SERVER_TRUST_ACCOUNT user_flag
131 * - MSV1_0_UPDATE_LOGON_STATISTICS
132 * sets the logon time on network logon
133 * - MSV1_0_RETURN_USER_PARAMETERS
134 * sets the user parameters in the driveletter
135 * - MSV1_0_RETURN_PROFILE_PATH
136 * returns the profilepath in the driveletter and
137 * sets LOGON_PROFILE_PATH_RETURNED user_flag
140 typedef [public,bitmap32bit
] bitmap
{
141 MSV1_0_CLEARTEXT_PASSWORD_ALLOWED
= 0x00000002,
142 MSV1_0_UPDATE_LOGON_STATISTICS
= 0x00000004,
143 MSV1_0_RETURN_USER_PARAMETERS
= 0x00000008,
144 MSV1_0_DONT_TRY_GUEST_ACCOUNT
= 0x00000010,
145 MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT
= 0x00000020,
146 MSV1_0_RETURN_PASSWORD_EXPIRY
= 0x00000040,
147 MSV1_0_USE_CLIENT_CHALLENGE
= 0x00000080,
148 MSV1_0_TRY_GUEST_ACCOUNT_ONLY
= 0x00000100,
149 MSV1_0_RETURN_PROFILE_PATH
= 0x00000200,
150 MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY
= 0x00000400,
151 MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT
= 0x00000800,
152 MSV1_0_DISABLE_PERSONAL_FALLBACK
= 0x00001000,
153 MSV1_0_ALLOW_FORCE_GUEST
= 0x00002000,
154 MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED
= 0x00004000,
155 MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY
= 0x00008000,
156 MSV1_0_ALLOW_MSVCHAPV2
= 0x00010000,
157 MSV1_0_S4U2SELF
= 0x00020000,
158 MSV1_0_CHECK_LOGONHOURS_FOR_S4U
= 0x00040000,
159 MSV1_0_SUBAUTHENTICATION_DLL_EX
= 0x00100000
160 } netr_LogonParameterControl
;
162 /* Summary of the of the Query and Response from Microsoft on
163 * the usage of logon_id in netr_IdendityInfo
165 * [REG:119013019612095] [MS-NRPC]: NETLOGON_LOGON_IDENTITY_INFO: Does
166 * the Reserved field have LogonId meaning?
169 * In NetrLogonSamLogonEx does the Reserved field
170 * (of NETLOGON_LOGON_IDENTITY_INFO) have LogonId meaning?
172 * What is a valid LogonID, and does have any audit usage?
174 * Samba is sending a constant "deadbeef" in hex and would like to
175 * understand any usage of this field.
178 * The NRPC spec is accurate in defining the field as Reserved, and
179 * without protocol significance. In the header file in our source
180 * code, it is defined as LogonId and commented as such, but it’s
181 * effectively not used. This is probably why the API structure has
182 * that field name. It may have been intended as such but it’s not
185 * Samba now sends a random value in this field.
188 lsa_String domain_name
;
189 netr_LogonParameterControl parameter_control
; /* see MSV1_0_* */
191 lsa_String account_name
;
192 lsa_String workstation
;
196 netr_IdentityInfo identity_info
;
197 samr_Password lmpassword
;
198 samr_Password ntpassword
;
201 typedef [flag
(NDR_PAHEX
)] struct {
203 [value
(length
)] uint16 size
;
204 [size_is(length
),length_is(length
)] uint8
*data
;
205 } netr_ChallengeResponse
;
207 typedef [flag
(NDR_PAHEX
)] struct {
208 netr_IdentityInfo identity_info
;
210 netr_ChallengeResponse nt
;
211 netr_ChallengeResponse lm
;
214 typedef [flag
(NDR_PAHEX
)] struct {
215 netr_IdentityInfo identity_info
;
216 lsa_String package_name
;
218 [size_is(length
)] uint8
*data
;
221 typedef [public] enum {
222 NetlogonInteractiveInformation
= 1,
223 NetlogonNetworkInformation
= 2,
224 NetlogonServiceInformation
= 3,
225 NetlogonGenericInformation
= 4,
226 NetlogonInteractiveTransitiveInformation
= 5,
227 NetlogonNetworkTransitiveInformation
= 6,
228 NetlogonServiceTransitiveInformation
= 7
229 } netr_LogonInfoClass
;
231 typedef [public,switch_type(netr_LogonInfoClass
)] union {
232 [case(NetlogonInteractiveInformation
)] netr_PasswordInfo
*password
;
233 [case(NetlogonNetworkInformation
)] netr_NetworkInfo
*network
;
234 [case(NetlogonServiceInformation
)] netr_PasswordInfo
*password
;
235 [case(NetlogonGenericInformation
)] netr_GenericInfo
*generic
;
236 [case(NetlogonInteractiveTransitiveInformation
)] netr_PasswordInfo
*password
;
237 [case(NetlogonNetworkTransitiveInformation
)] netr_NetworkInfo
*network
;
238 [case(NetlogonServiceTransitiveInformation
)] netr_PasswordInfo
*password
;
242 typedef [public,flag
(NDR_PAHEX
)] struct {
244 } netr_UserSessionKey
;
246 typedef [public,flag
(NDR_PAHEX
)] struct {
250 /* Flags for user_flags below */
251 typedef [public,bitmap32bit
] bitmap
{
252 NETLOGON_GUEST
= 0x00000001,
253 NETLOGON_NOENCRYPTION
= 0x00000002,
254 NETLOGON_CACHED_ACCOUNT
= 0x00000004,
255 NETLOGON_USED_LM_PASSWORD
= 0x00000008,
256 NETLOGON_EXTRA_SIDS
= 0x00000020,
257 NETLOGON_SUBAUTH_SESSION_KEY
= 0x00000040,
258 NETLOGON_SERVER_TRUST_ACCOUNT
= 0x00000080,
259 NETLOGON_NTLMV2_ENABLED
= 0x00000100,
260 NETLOGON_RESOURCE_GROUPS
= 0x00000200,
261 NETLOGON_PROFILE_PATH_RETURNED
= 0x00000400,
262 NETLOGON_GRACE_LOGON
= 0x01000000
269 NTTIME last_password_change
;
270 NTTIME allow_password_change
;
271 NTTIME force_password_change
;
272 lsa_String account_name
;
273 lsa_String full_name
;
274 lsa_String logon_script
;
275 lsa_String profile_path
;
276 lsa_String home_directory
;
277 lsa_String home_drive
;
279 uint16 bad_password_count
;
282 samr_RidWithAttributeArray groups
;
283 netr_UserFlags user_flags
;
284 [flag
(NDR_SECRET
)] netr_UserSessionKey key
;
285 lsa_StringLarge logon_server
;
286 lsa_StringLarge logon_domain
;
287 dom_sid2
*domain_sid
;
288 [flag
(NDR_SECRET
)] netr_LMSessionKey LMSessKey
;
289 samr_AcctFlags acct_flags
;
290 uint32 sub_auth_status
;
291 NTTIME last_successful_logon
;
292 NTTIME last_failed_logon
;
293 uint32 failed_logon_count
;
298 netr_SamBaseInfo base
;
301 typedef [public] struct {
303 security_GroupAttrs attributes
;
306 typedef [public] struct {
307 netr_SamBaseInfo base
;
309 [size_is(sidcount
)] netr_SidAttr
*sids
;
313 netr_SamBaseInfo base
;
315 [size_is(sidcount
)] netr_SidAttr
*sids
;
318 * Should pointer values be allocated
319 * of sids[*].sid before the following ones?
321 * That's at least the case for
324 lsa_String dns_domainname
;
325 lsa_String principal_name
;
331 [size_is(pac_size
)] uint8
*pac
;
332 lsa_String logon_domain
;
333 lsa_String logon_server
;
334 lsa_String principal_name
;
336 [size_is(auth_size
)] uint8
*auth
;
337 netr_UserSessionKey user_session_key
;
338 uint32 expansionroom
[10];
345 typedef [flag
(NDR_PAHEX
)] struct {
347 [size_is(length
)] uint8
*data
;
351 NetlogonValidationUasInfo
= 1,
352 NetlogonValidationSamInfo
= 2,
353 NetlogonValidationSamInfo2
= 3,
354 NetlogonValidationGenericInfo2
= 5,
355 NetlogonValidationSamInfo4
= 6
356 } netr_ValidationInfoClass
;
358 typedef [public,switch_type(uint16
)] union {
359 [case(NetlogonValidationSamInfo
)] netr_SamInfo2
*sam2
;
360 [case(NetlogonValidationSamInfo2
)] netr_SamInfo3
*sam3
;
361 [case(4)] netr_PacInfo
*pac
;
362 [case(NetlogonValidationGenericInfo2
)] netr_GenericInfo2
*generic
;
363 [case(NetlogonValidationSamInfo4
)] netr_SamInfo6
*sam6
;
367 typedef [public, flag
(NDR_PAHEX
)] struct {
371 typedef [public] struct {
372 netr_Credential client_challenge
;
373 netr_Credential server_challenge
;
374 } netlogon_server_pipe_state
;
376 typedef [public] struct {
377 netr_Credential cred
;
379 } netr_Authenticator
;
381 [public] NTSTATUS netr_LogonSamLogon
(
382 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
383 [in,unique] [string,charset
(UTF16
)] uint16
*computer_name
,
384 [in,unique] netr_Authenticator
*credential
,
385 [in,out,unique] netr_Authenticator
*return_authenticator
,
386 [in] netr_LogonInfoClass logon_level
,
387 [in,ref] [switch_is(logon_level
)] netr_LogonLevel
*logon
,
388 [in] uint16 validation_level
,
389 [out,ref] [switch_is(validation_level
)] netr_Validation
*validation
,
390 [out,ref] uint8
*authoritative
397 NTSTATUS netr_LogonSamLogoff
(
398 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
399 [in,unique] [string,charset
(UTF16
)] uint16
*computer_name
,
400 [in,unique] netr_Authenticator
*credential
,
401 [in,out,unique] netr_Authenticator
*return_authenticator
,
402 [in] netr_LogonInfoClass logon_level
,
403 [in] [switch_is(logon_level
)] netr_LogonLevel logon
411 [public] NTSTATUS netr_ServerReqChallenge
(
412 [in,unique,string,charset
(UTF16
)] uint16
*server_name
,
413 [in,string,charset
(UTF16
)] uint16
*computer_name
,
414 [in,ref] netr_Credential
*credentials
,
415 [out,ref] netr_Credential
*return_credentials
422 typedef enum netr_SchannelType netr_SchannelType
;
424 NTSTATUS netr_ServerAuthenticate
(
425 [in,unique,string,charset
(UTF16
)] uint16
*server_name
,
426 [in,string,charset
(UTF16
)] uint16
*account_name
,
427 [in] netr_SchannelType secure_channel_type
,
428 [in,string,charset
(UTF16
)] uint16
*computer_name
,
429 [in,ref] netr_Credential
*credentials
,
430 [out,ref] netr_Credential
*return_credentials
437 NTSTATUS netr_ServerPasswordSet
(
438 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
439 [in] [string,charset
(UTF16
)] uint16
*account_name
,
440 [in] netr_SchannelType secure_channel_type
,
441 [in] [string,charset
(UTF16
)] uint16
*computer_name
,
442 [in,ref] netr_Authenticator
*credential
,
443 [out,ref] netr_Authenticator
*return_authenticator
,
444 [in,ref] samr_Password
*new_password
451 typedef enum netr_SamDatabaseID netr_SamDatabaseID
;
454 [string,charset
(UTF16
)] uint16
*account_name
;
463 } netr_DELTA_DELETE_USER
;
467 [value
(length
)] uint16 size
;
474 [value
(nt_length
)] uint16 nt_size
;
477 [value
(lm_length
)] uint16 lm_size
;
479 uint8 nt_history
[nt_length
];
480 uint8 lm_history
[lm_length
];
481 } netr_PasswordHistory
;
484 netr_USER_KEY16 lmpassword
;
485 netr_USER_KEY16 ntpassword
;
486 netr_PasswordHistory history
;
489 typedef struct { /* TODO: make this a union! */
490 netr_USER_KEYS2 keys2
;
491 } netr_USER_KEY_UNION
;
493 typedef [public] struct {
495 netr_USER_KEY_UNION keys
;
499 boolean8 SensitiveDataFlag
;
502 /* netr_USER_KEYS encrypted with the session key */
503 [size_is(DataLength
)][flag
(NDR_PAHEX
)] uint8
*SensitiveData
;
504 } netr_USER_PRIVATE_INFO
;
507 lsa_String account_name
;
508 lsa_String full_name
;
511 lsa_String home_directory
;
512 lsa_String home_drive
;
513 lsa_String logon_script
;
514 lsa_String description
;
515 lsa_String workstations
;
518 samr_LogonHours logon_hours
;
519 uint16 bad_password_count
;
521 NTTIME last_password_change
;
523 samr_AcctFlags acct_flags
;
524 samr_Password lmpassword
;
525 samr_Password ntpassword
;
526 boolean8 nt_password_present
;
527 boolean8 lm_password_present
;
528 boolean8 password_expired
;
530 lsa_BinaryString parameters
;
533 netr_USER_PRIVATE_INFO user_private_info
;
534 uint32 SecurityInformation
;
536 lsa_String profile_path
;
547 lsa_String domain_name
;
548 lsa_String oem_information
; /* comment */
549 dlong force_logoff_time
;
550 uint16 min_password_length
;
551 uint16 password_history_length
;
552 /* yes, these are signed. They are in negative 100ns */
553 dlong max_password_age
;
554 dlong min_password_age
;
556 NTTIME domain_create_time
;
557 uint32 SecurityInformation
;
559 lsa_BinaryString account_lockout
;
563 uint32 logon_to_chgpass
;
570 lsa_String group_name
;
573 lsa_String description
;
574 uint32 SecurityInformation
;
600 [size_is(num_rids
)] uint32
*rids
;
601 [size_is(num_rids
)] uint32
*attribs
;
607 } netr_DELTA_GROUP_MEMBER
;
610 lsa_String alias_name
;
612 uint32 SecurityInformation
;
614 lsa_String description
;
630 } netr_DELTA_ALIAS_MEMBER
;
633 uint32 pagedpoollimit
;
634 uint32 nonpagedpoollimit
;
635 uint32 minimumworkingsetsize
;
636 uint32 maximumworkingsetsize
;
637 uint32 pagefilelimit
;
643 NTTIME auditretentionperiod
;
644 boolean8 auditingmode
;
645 uint32 maxauditeventcount
;
646 [size_is(maxauditeventcount
+1)] uint32
*eventauditoptions
;
647 lsa_String primary_domain_name
;
649 netr_QUOTA_LIMITS quota_limits
;
651 NTTIME db_create_time
;
652 uint32 SecurityInformation
;
665 lsa_String domain_name
;
666 uint32 num_controllers
;
667 [size_is(num_controllers
)] lsa_String
*controller_names
;
668 uint32 SecurityInformation
;
678 } netr_DELTA_TRUSTED_DOMAIN
;
681 uint32 privilege_entries
;
682 uint32 privilege_control
;
683 [size_is(privilege_entries
)] uint32
*privilege_attrib
;
684 [size_is(privilege_entries
)] lsa_String
*privilege_name
;
685 netr_QUOTA_LIMITS quotalimits
;
687 uint32 SecurityInformation
;
697 } netr_DELTA_ACCOUNT
;
702 [size_is(maxlen
)][length_is(len
)] uint8
*cipher_data
;
706 netr_CIPHER_VALUE current_cipher
;
707 NTTIME current_cipher_set_time
;
708 netr_CIPHER_VALUE old_cipher
;
709 NTTIME old_cipher_set_time
;
710 uint32 SecurityInformation
;
723 NETR_DELTA_DOMAIN
= 1,
724 NETR_DELTA_GROUP
= 2,
725 NETR_DELTA_DELETE_GROUP
= 3,
726 NETR_DELTA_RENAME_GROUP
= 4,
728 NETR_DELTA_DELETE_USER
= 6,
729 NETR_DELTA_RENAME_USER
= 7,
730 NETR_DELTA_GROUP_MEMBER
= 8,
731 NETR_DELTA_ALIAS
= 9,
732 NETR_DELTA_DELETE_ALIAS
= 10,
733 NETR_DELTA_RENAME_ALIAS
= 11,
734 NETR_DELTA_ALIAS_MEMBER
= 12,
735 NETR_DELTA_POLICY
= 13,
736 NETR_DELTA_TRUSTED_DOMAIN
= 14,
737 NETR_DELTA_DELETE_TRUST
= 15,
738 NETR_DELTA_ACCOUNT
= 16,
739 NETR_DELTA_DELETE_ACCOUNT
= 17,
740 NETR_DELTA_SECRET
= 18,
741 NETR_DELTA_DELETE_SECRET
= 19,
742 NETR_DELTA_DELETE_GROUP2
= 20,
743 NETR_DELTA_DELETE_USER2
= 21,
744 NETR_DELTA_MODIFY_COUNT
= 22
747 typedef [switch_type(netr_DeltaEnum
)] union {
748 [case(NETR_DELTA_DOMAIN
)] netr_DELTA_DOMAIN
*domain
;
749 [case(NETR_DELTA_GROUP
)] netr_DELTA_GROUP
*group
;
750 [case(NETR_DELTA_DELETE_GROUP
)] ; /* rid only */
751 [case(NETR_DELTA_RENAME_GROUP
)] netr_DELTA_RENAME
*rename_group
;
752 [case(NETR_DELTA_USER
)] netr_DELTA_USER
*user
;
753 [case(NETR_DELTA_DELETE_USER
)] ; /* rid only */
754 [case(NETR_DELTA_RENAME_USER
)] netr_DELTA_RENAME
*rename_user
;
755 [case(NETR_DELTA_GROUP_MEMBER
)] netr_DELTA_GROUP_MEMBER
*group_member
;
756 [case(NETR_DELTA_ALIAS
)] netr_DELTA_ALIAS
*alias
;
757 [case(NETR_DELTA_DELETE_ALIAS
)] ; /* rid only */
758 [case(NETR_DELTA_RENAME_ALIAS
)] netr_DELTA_RENAME
*rename_alias
;
759 [case(NETR_DELTA_ALIAS_MEMBER
)] netr_DELTA_ALIAS_MEMBER
*alias_member
;
760 [case(NETR_DELTA_POLICY
)] netr_DELTA_POLICY
*policy
;
761 [case(NETR_DELTA_TRUSTED_DOMAIN
)] netr_DELTA_TRUSTED_DOMAIN
*trusted_domain
;
762 [case(NETR_DELTA_DELETE_TRUST
)] ; /* sid only */
763 [case(NETR_DELTA_ACCOUNT
)] netr_DELTA_ACCOUNT
*account
;
764 [case(NETR_DELTA_DELETE_ACCOUNT
)] ; /* sid only */
765 [case(NETR_DELTA_SECRET
)] netr_DELTA_SECRET
*secret
;
766 [case(NETR_DELTA_DELETE_SECRET
)] ; /* name only */
767 [case(NETR_DELTA_DELETE_GROUP2
)] netr_DELTA_DELETE_USER
*delete_group
;
768 [case(NETR_DELTA_DELETE_USER2
)] netr_DELTA_DELETE_USER
*delete_user
;
769 [case(NETR_DELTA_MODIFY_COUNT
)] udlong
*modified_count
;
773 typedef [switch_type(netr_DeltaEnum
)] union {
774 [case(NETR_DELTA_DOMAIN
)] uint32 rid
;
775 [case(NETR_DELTA_GROUP
)] uint32 rid
;
776 [case(NETR_DELTA_DELETE_GROUP
)] uint32 rid
;
777 [case(NETR_DELTA_RENAME_GROUP
)] uint32 rid
;
778 [case(NETR_DELTA_USER
)] uint32 rid
;
779 [case(NETR_DELTA_DELETE_USER
)] uint32 rid
;
780 [case(NETR_DELTA_RENAME_USER
)] uint32 rid
;
781 [case(NETR_DELTA_GROUP_MEMBER
)] uint32 rid
;
782 [case(NETR_DELTA_ALIAS
)] uint32 rid
;
783 [case(NETR_DELTA_DELETE_ALIAS
)] uint32 rid
;
784 [case(NETR_DELTA_RENAME_ALIAS
)] uint32 rid
;
785 [case(NETR_DELTA_ALIAS_MEMBER
)] uint32 rid
;
786 [case(NETR_DELTA_POLICY
)] dom_sid2
*sid
;
787 [case(NETR_DELTA_TRUSTED_DOMAIN
)] dom_sid2
*sid
;
788 [case(NETR_DELTA_DELETE_TRUST
)] dom_sid2
*sid
;
789 [case(NETR_DELTA_ACCOUNT
)] dom_sid2
*sid
;
790 [case(NETR_DELTA_DELETE_ACCOUNT
)] dom_sid2
*sid
;
791 [case(NETR_DELTA_SECRET
)] [string,charset
(UTF16
)] uint16
*name
;
792 [case(NETR_DELTA_DELETE_SECRET
)] [string,charset
(UTF16
)] uint16
*name
;
793 [case(NETR_DELTA_DELETE_GROUP2
)] uint32 rid
;
794 [case(NETR_DELTA_DELETE_USER2
)] uint32 rid
;
795 [case(NETR_DELTA_MODIFY_COUNT
)] ;
797 } netr_DELTA_ID_UNION
;
800 netr_DeltaEnum delta_type
;
801 [switch_is(delta_type
)] netr_DELTA_ID_UNION delta_id_union
;
802 [switch_is(delta_type
)] netr_DELTA_UNION delta_union
;
807 [size_is(num_deltas
)] netr_DELTA_ENUM
*delta_enum
;
808 } netr_DELTA_ENUM_ARRAY
;
810 NTSTATUS netr_DatabaseDeltas
(
811 [in] [string,charset
(UTF16
)] uint16
*logon_server
,
812 [in] [string,charset
(UTF16
)] uint16
*computername
,
813 [in,ref] netr_Authenticator
*credential
,
814 [in,out,ref] netr_Authenticator
*return_authenticator
,
815 [in] netr_SamDatabaseID database_id
,
816 [in,out,ref] udlong
*sequence_num
,
817 [out,ref] netr_DELTA_ENUM_ARRAY
**delta_enum_array
,
818 [in] uint32 preferredmaximumlength
825 NTSTATUS netr_DatabaseSync
(
826 [in] [string,charset
(UTF16
)] uint16
*logon_server
,
827 [in] [string,charset
(UTF16
)] uint16
*computername
,
828 [in,ref] netr_Authenticator
*credential
,
829 [in,out,ref] netr_Authenticator
*return_authenticator
,
830 [in] netr_SamDatabaseID database_id
,
831 [in,out,ref] uint32
*sync_context
,
832 [out,ref] netr_DELTA_ENUM_ARRAY
**delta_enum_array
,
833 [in] uint32 preferredmaximumlength
840 /* w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this call */
842 typedef [flag
(NDR_PAHEX
)] struct {
843 uint8 computer_name
[16];
845 uint32 serial_number
;
849 [flag
(NDR_REMAINING
)] DATA_BLOB blob
;
850 } netr_AccountBuffer
;
852 NTSTATUS netr_AccountDeltas
(
853 [in,unique] [string,charset
(UTF16
)] uint16
*logon_server
,
854 [in] [string,charset
(UTF16
)] uint16
*computername
,
855 [in] netr_Authenticator credential
,
856 [in,out,ref] netr_Authenticator
*return_authenticator
,
857 [in] netr_UAS_INFO_0 uas
,
860 [in] uint32 buffersize
,
861 [out,ref,subcontext
(4)] netr_AccountBuffer
*buffer
,
862 [out,ref] uint32
*count_returned
,
863 [out,ref] uint32
*total_entries
,
864 [out,ref] netr_UAS_INFO_0
*recordid
871 NTSTATUS netr_AccountSync
(
872 [in,unique] [string,charset
(UTF16
)] uint16
*logon_server
,
873 [in] [string,charset
(UTF16
)] uint16
*computername
,
874 [in] netr_Authenticator credential
,
875 [in,out,ref] netr_Authenticator
*return_authenticator
,
876 [in] uint32 reference
,
878 [in] uint32 buffersize
,
879 [out,ref,subcontext
(4)] netr_AccountBuffer
*buffer
,
880 [out,ref] uint32
*count_returned
,
881 [out,ref] uint32
*total_entries
,
882 [out,ref] uint32
*next_reference
,
883 [in,out,ref] netr_UAS_INFO_0
*recordid
890 WERROR netr_GetDcName
(
891 [in] [string,charset
(UTF16
)] uint16
*logon_server
,
892 [in,unique] [string,charset
(UTF16
)] uint16
*domainname
,
893 [out,ref] [string,charset
(UTF16
)] uint16
**dcname
899 typedef [bitmap32bit
] bitmap
{
900 NETLOGON_REPLICATION_NEEDED
= 0x00000001,
901 NETLOGON_REPLICATION_IN_PROGRESS
= 0x00000002,
902 NETLOGON_FULL_SYNC_REPLICATION
= 0x00000004,
903 NETLOGON_REDO_NEEDED
= 0x00000008,
904 NETLOGON_HAS_IP
= 0x00000010,
905 NETLOGON_HAS_TIMESERV
= 0x00000020,
906 NETLOGON_DNS_UPDATE_FAILURE
= 0x00000040,
907 NETLOGON_VERIFY_STATUS_RETURNED
= 0x00000080
911 netr_InfoFlags flags
;
912 WERROR pdc_connection_status
;
913 } netr_NETLOGON_INFO_1
;
916 netr_InfoFlags flags
;
917 WERROR pdc_connection_status
;
918 [string,charset
(UTF16
)] uint16
*trusted_dc_name
;
919 WERROR tc_connection_status
;
920 } netr_NETLOGON_INFO_2
;
923 netr_InfoFlags flags
;
924 uint32 logon_attempts
;
930 } netr_NETLOGON_INFO_3
;
933 [string,charset
(UTF16
)] uint16
*trusted_dc_name
;
934 [string,charset
(UTF16
)] uint16
*trusted_domain_name
;
935 } netr_NETLOGON_INFO_4
;
937 typedef [public] union {
938 [case(1)] netr_NETLOGON_INFO_1
*info1
;
939 [case(2)] netr_NETLOGON_INFO_2
*info2
;
940 [case(3)] netr_NETLOGON_INFO_3
*info3
;
941 [case(4)] netr_NETLOGON_INFO_4
*info4
;
943 } netr_CONTROL_QUERY_INFORMATION
;
945 /* function_code values */
946 typedef [v1_enum,public] enum {
947 NETLOGON_CONTROL_QUERY
= 0x00000001,
948 NETLOGON_CONTROL_REPLICATE
= 0x00000002,
949 NETLOGON_CONTROL_SYNCHRONIZE
= 0x00000003,
950 NETLOGON_CONTROL_PDC_REPLICATE
= 0x00000004,
951 NETLOGON_CONTROL_REDISCOVER
= 0x00000005,
952 NETLOGON_CONTROL_TC_QUERY
= 0x00000006,
953 NETLOGON_CONTROL_TRANSPORT_NOTIFY
= 0x00000007,
954 NETLOGON_CONTROL_FIND_USER
= 0x00000008,
955 NETLOGON_CONTROL_CHANGE_PASSWORD
= 0x00000009,
956 NETLOGON_CONTROL_TC_VERIFY
= 0x0000000A,
957 NETLOGON_CONTROL_FORCE_DNS_REG
= 0x0000000B,
958 NETLOGON_CONTROL_QUERY_DNS_REG
= 0x0000000C,
959 NETLOGON_CONTROL_BACKUP_CHANGE_LOG
= 0x0000FFFC,
960 NETLOGON_CONTROL_TRUNCATE_LOG
= 0x0000FFFD,
961 NETLOGON_CONTROL_SET_DBFLAG
= 0x0000FFFE,
962 NETLOGON_CONTROL_BREAKPOINT
= 0x0000FFFF
963 } netr_LogonControlCode
;
965 WERROR netr_LogonControl
(
966 [in,unique] [string,charset
(UTF16
)] uint16
*logon_server
,
967 [in] netr_LogonControlCode function_code
,
969 [out,ref,switch_is(level
)] netr_CONTROL_QUERY_INFORMATION
*query
976 WERROR netr_GetAnyDCName
(
977 [in,unique] [string,charset
(UTF16
)] uint16
*logon_server
,
978 [in,unique] [string,charset
(UTF16
)] uint16
*domainname
,
979 [out,ref] [string,charset
(UTF16
)] uint16
**dcname
986 typedef [public,switch_type(netr_LogonControlCode
)] union {
987 [case(NETLOGON_CONTROL_REDISCOVER
)] [string,charset
(UTF16
)] uint16
*domain
;
988 [case(NETLOGON_CONTROL_TC_QUERY
)] [string,charset
(UTF16
)] uint16
*domain
;
989 [case(NETLOGON_CONTROL_TRANSPORT_NOTIFY
)] [string,charset
(UTF16
)] uint16
*domain
;
990 [case(NETLOGON_CONTROL_CHANGE_PASSWORD
)] [string,charset
(UTF16
)] uint16
*domain
;
991 [case(NETLOGON_CONTROL_TC_VERIFY
)] [string,charset
(UTF16
)] uint16
*domain
;
992 [case(NETLOGON_CONTROL_FIND_USER
)] [string,charset
(UTF16
)] uint16
*user
;
993 [case(NETLOGON_CONTROL_SET_DBFLAG
)] uint32 debug_level
;
995 } netr_CONTROL_DATA_INFORMATION
;
997 WERROR netr_LogonControl2
(
998 [in,unique] [string,charset
(UTF16
)] uint16
*logon_server
,
999 [in] netr_LogonControlCode function_code
,
1001 [in,ref][switch_is(function_code
)] netr_CONTROL_DATA_INFORMATION
*data
,
1002 [out,ref][switch_is(level
)] netr_CONTROL_QUERY_INFORMATION
*query
1006 /* If NETLOGON_NEG_ARCFOUR flag is not set, then the passwords and LM
1007 * session keys are encrypted with DES calls. (And the user session key
1008 * is unencrypted) */
1013 typedef [public,bitmap32bit
] bitmap
{
1014 NETLOGON_NEG_ACCOUNT_LOCKOUT
= 0x00000001,
1015 NETLOGON_NEG_PERSISTENT_SAMREPL
= 0x00000002,
1016 NETLOGON_NEG_ARCFOUR
= 0x00000004,
1017 NETLOGON_NEG_PROMOTION_COUNT
= 0x00000008,
1018 NETLOGON_NEG_CHANGELOG_BDC
= 0x00000010,
1019 NETLOGON_NEG_FULL_SYNC_REPL
= 0x00000020,
1020 NETLOGON_NEG_MULTIPLE_SIDS
= 0x00000040,
1021 NETLOGON_NEG_REDO
= 0x00000080,
1022 NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL
= 0x00000100,
1023 NETLOGON_NEG_SEND_PASSWORD_INFO_PDC
= 0x00000200,
1024 NETLOGON_NEG_GENERIC_PASSTHROUGH
= 0x00000400,
1025 NETLOGON_NEG_CONCURRENT_RPC
= 0x00000800,
1026 NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL
= 0x00001000,
1027 NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL
= 0x00002000,
1028 NETLOGON_NEG_STRONG_KEYS
= 0x00004000,
1029 NETLOGON_NEG_TRANSITIVE_TRUSTS
= 0x00008000,
1030 NETLOGON_NEG_DNS_DOMAIN_TRUSTS
= 0x00010000,
1031 NETLOGON_NEG_PASSWORD_SET2
= 0x00020000,
1032 NETLOGON_NEG_GETDOMAININFO
= 0x00040000,
1033 NETLOGON_NEG_CROSS_FOREST_TRUSTS
= 0x00080000,
1034 NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION
= 0x00100000,
1035 NETLOGON_NEG_RODC_PASSTHROUGH
= 0x00200000,
1036 NETLOGON_NEG_SUPPORTS_AES_SHA2
= 0x00400000,
1037 NETLOGON_NEG_SUPPORTS_AES
= 0x01000000,
1038 NETLOGON_NEG_AUTHENTICATED_RPC_LSASS
= 0x20000000,
1039 NETLOGON_NEG_AUTHENTICATED_RPC
= 0x40000000
1040 } netr_NegotiateFlags
;
1042 const uint32 NETLOGON_NEG_128BIT
= NETLOGON_NEG_STRONG_KEYS
;
1043 const uint32 NETLOGON_NEG_SCHANNEL
= NETLOGON_NEG_AUTHENTICATED_RPC
;
1045 NTSTATUS netr_ServerAuthenticate2
(
1046 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1047 [in] [string,charset
(UTF16
)] uint16
*account_name
,
1048 [in] netr_SchannelType secure_channel_type
,
1049 [in] [string,charset
(UTF16
)] uint16
*computer_name
,
1050 [in,ref] netr_Credential
*credentials
,
1051 [out,ref] netr_Credential
*return_credentials
,
1052 [in,out,ref] netr_NegotiateFlags
*negotiate_flags
1060 SYNCSTATE_NORMAL_STATE
= 0,
1061 SYNCSTATE_DOMAIN_STATE
= 1,
1062 SYNCSTATE_GROUP_STATE
= 2,
1063 SYNCSTATE_UAS_BUILT_IN_GROUP_STATE
= 3,
1064 SYNCSTATE_USER_STATE
= 4,
1065 SYNCSTATE_GROUP_MEMBER_STATE
= 5,
1066 SYNCSTATE_ALIAS_STATE
= 6,
1067 SYNCSTATE_ALIAS_MEMBER_STATE
= 7,
1068 SYNCSTATE_SAM_DONE_STATE
= 8
1071 NTSTATUS netr_DatabaseSync2
(
1072 [in] [string,charset
(UTF16
)] uint16
*logon_server
,
1073 [in] [string,charset
(UTF16
)] uint16
*computername
,
1074 [in,ref] netr_Authenticator
*credential
,
1075 [in,out,ref] netr_Authenticator
*return_authenticator
,
1076 [in] netr_SamDatabaseID database_id
,
1077 [in] SyncStateEnum restart_state
,
1078 [in,out,ref] uint32
*sync_context
,
1079 [out,ref] netr_DELTA_ENUM_ARRAY
**delta_enum_array
,
1080 [in] uint32 preferredmaximumlength
1087 /* i'm not at all sure how this call works */
1089 typedef [bitmap16bit
] bitmap
{
1090 NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED
= 0x0001,
1091 NETR_CHANGELOG_CHANGED_PASSWORD
= 0x0002,
1092 NETR_CHANGELOG_SID_INCLUDED
= 0x0004,
1093 NETR_CHANGELOG_NAME_INCLUDED
= 0x0008,
1094 NETR_CHANGELOG_FIRST_PROMOTION_OBJ
= 0x0010
1095 } netr_ChangeLogFlags
;
1097 typedef [nodiscriminant
] union {
1098 [case(NETR_CHANGELOG_SID_INCLUDED
)] dom_sid object_sid
;
1099 [case(NETR_CHANGELOG_NAME_INCLUDED
)] nstring object_name
;
1101 } netr_ChangeLogObject
;
1103 typedef [public,gensize
] struct {
1104 uint32 serial_number1
;
1105 uint32 serial_number2
;
1107 netr_ChangeLogFlags flags
;
1108 netr_SamDatabaseID8Bit db_index
;
1109 netr_DeltaEnum8Bit delta_type
;
1110 [switch_is(flags
& (NETR_CHANGELOG_SID_INCLUDED|NETR_CHANGELOG_NAME_INCLUDED
))] netr_ChangeLogObject
object;
1111 } netr_ChangeLogEntry
;
1113 NTSTATUS netr_DatabaseRedo
(
1114 [in] [string,charset
(UTF16
)] uint16
*logon_server
,
1115 [in] [string,charset
(UTF16
)] uint16
*computername
,
1116 [in] netr_Authenticator
*credential
,
1117 [in,out,ref] netr_Authenticator
*return_authenticator
,
1119 * we cannot use subcontext_size() here, as
1120 * change_log_entry_size is encoded after the subcontext
1122 [in] [subcontext
(4)/*,subcontext_size(change_log_entry_size)*/]
1123 netr_ChangeLogEntry change_log_entry
,
1124 [in] [value
(ndr_size_netr_ChangeLogEntry
(&change_log_entry
,
1126 uint32 change_log_entry_size
,
1127 [out,ref] netr_DELTA_ENUM_ARRAY
**delta_enum_array
1134 WERROR netr_LogonControl2Ex
(
1135 [in,unique] [string,charset
(UTF16
)] uint16
*logon_server
,
1136 [in] netr_LogonControlCode function_code
,
1138 [in,ref][switch_is(function_code
)] netr_CONTROL_DATA_INFORMATION
*data
,
1139 [out,ref][switch_is(level
)] netr_CONTROL_QUERY_INFORMATION
*query
1146 [size_is(length
)] uint8
*data
;
1149 NTSTATUS netr_NetrEnumerateTrustedDomains
(
1150 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1151 [out,ref] netr_Blob
*trusted_domains_blob
1157 /* one unknown bit still: DS_IP_VERSION_AGNOSTIC - gd*/
1159 const int DSGETDC_VALID_FLAGS
= (DS_FORCE_REDISCOVERY |
1160 DS_DIRECTORY_SERVICE_REQUIRED |
1161 DS_DIRECTORY_SERVICE_PREFERRED |
1162 DS_GC_SERVER_REQUIRED |
1164 DS_BACKGROUND_ONLY |
1167 DS_TIMESERV_REQUIRED |
1168 DS_WRITABLE_REQUIRED |
1169 DS_GOOD_TIMESERV_PREFERRED |
1171 DS_ONLY_LDAP_NEEDED |
1174 DS_TRY_NEXTCLOSEST_SITE |
1175 DS_DIRECTORY_SERVICE_6_REQUIRED |
1176 DS_WEB_SERVICE_REQUIRED |
1177 DS_DIRECTORY_SERVICE_8_REQUIRED |
1178 DS_DIRECTORY_SERVICE_9_REQUIRED |
1179 DS_DIRECTORY_SERVICE_10_REQUIRED |
1180 DS_RETURN_FLAT_NAME |
1181 DS_RETURN_DNS_NAME
);
1183 typedef [bitmap32bit
] bitmap
{
1184 DS_FORCE_REDISCOVERY
= 0x00000001,
1185 DS_DIRECTORY_SERVICE_REQUIRED
= 0x00000010,
1186 DS_DIRECTORY_SERVICE_PREFERRED
= 0x00000020,
1187 DS_GC_SERVER_REQUIRED
= 0x00000040,
1188 DS_PDC_REQUIRED
= 0x00000080,
1189 DS_BACKGROUND_ONLY
= 0x00000100,
1190 DS_IP_REQUIRED
= 0x00000200,
1191 DS_KDC_REQUIRED
= 0x00000400,
1192 DS_TIMESERV_REQUIRED
= 0x00000800,
1193 DS_WRITABLE_REQUIRED
= 0x00001000,
1194 DS_GOOD_TIMESERV_PREFERRED
= 0x00002000,
1195 DS_AVOID_SELF
= 0x00004000,
1196 DS_ONLY_LDAP_NEEDED
= 0x00008000,
1197 DS_IS_FLAT_NAME
= 0x00010000,
1198 DS_IS_DNS_NAME
= 0x00020000,
1199 DS_TRY_NEXTCLOSEST_SITE
= 0x00040000,
1200 DS_DIRECTORY_SERVICE_6_REQUIRED
= 0x00080000, /* 2008 */
1201 DS_WEB_SERVICE_REQUIRED
= 0x00100000,
1202 DS_DIRECTORY_SERVICE_8_REQUIRED
= 0x00200000, /* 2012 */
1203 DS_DIRECTORY_SERVICE_9_REQUIRED
= 0x00400000, /* 2012R2 */
1204 DS_DIRECTORY_SERVICE_10_REQUIRED
= 0x00800000, /* 2016 */
1205 DS_RETURN_DNS_NAME
= 0x40000000,
1206 DS_RETURN_FLAT_NAME
= 0x80000000
1207 } netr_DsRGetDCName_flags
;
1209 typedef [v1_enum] enum {
1210 DS_ADDRESS_TYPE_INET
= 1,
1211 DS_ADDRESS_TYPE_NETBIOS
= 2
1212 } netr_DsRGetDCNameInfo_AddressType
;
1214 typedef [public] struct {
1215 [string,charset
(UTF16
)] uint16
*dc_unc
;
1216 [string,charset
(UTF16
)] uint16
*dc_address
;
1217 netr_DsRGetDCNameInfo_AddressType dc_address_type
;
1219 [string,charset
(UTF16
)] uint16
*domain_name
;
1220 [string,charset
(UTF16
)] uint16
*forest_name
;
1221 nbt_server_type dc_flags
;
1222 [string,charset
(UTF16
)] uint16
*dc_site_name
;
1223 [string,charset
(UTF16
)] uint16
*client_site_name
;
1224 } netr_DsRGetDCNameInfo
;
1226 WERROR netr_DsRGetDCName
(
1227 [in,unique] [string,charset
(UTF16
)] uint16
*server_unc
,
1228 [in,unique] [string,charset
(UTF16
)] uint16
*domain_name
,
1229 [in,unique] GUID
*domain_guid
,
1230 [in,unique] GUID
*site_guid
,
1231 [in] netr_DsRGetDCName_flags flags
,
1232 [out,ref] netr_DsRGetDCNameInfo
**info
1237 typedef [switch_type(uint32
)] union {
1238 [case(1)] netr_NegotiateFlags server_capabilities
;
1239 [case(2)] netr_NegotiateFlags server_capabilities
;
1240 } netr_Capabilities
;
1242 NTSTATUS netr_LogonGetCapabilities
(
1243 [in] [string,charset
(UTF16
)] uint16
*server_name
,
1244 [in,unique] [string,charset
(UTF16
)] uint16
*computer_name
,
1245 [in,ref] netr_Authenticator
*credential
,
1246 [in,out,ref] netr_Authenticator
*return_authenticator
,
1247 [in] uint32 query_level
,
1248 [out,ref,switch_is(query_level
)] netr_Capabilities
*capabilities
1253 [todo
] WERROR netr_NETRLOGONSETSERVICEBITS
();
1257 WERROR netr_LogonGetTrustRid
(
1258 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1259 [in,unique] [string,charset
(UTF16
)] uint16
*domain_name
,
1260 [out,ref] uint32
*rid
1265 [todo
] WERROR netr_NETRLOGONCOMPUTESERVERDIGEST
();
1269 [todo
] WERROR netr_NETRLOGONCOMPUTECLIENTDIGEST
();
1273 [public] NTSTATUS netr_ServerAuthenticate3
(
1274 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1275 [in] [string,charset
(UTF16
)] uint16
*account_name
,
1276 [in] netr_SchannelType secure_channel_type
,
1277 [in] [string,charset
(UTF16
)] uint16
*computer_name
,
1278 [in,ref] netr_Credential
*credentials
,
1279 [out,ref] netr_Credential
*return_credentials
,
1280 [in,out,ref] netr_NegotiateFlags
*negotiate_flags
,
1281 [out,ref] uint32
*rid
1287 WERROR netr_DsRGetDCNameEx
(
1288 [in,unique] [string,charset
(UTF16
)] uint16
*server_unc
,
1289 [in,unique] [string,charset
(UTF16
)] uint16
*domain_name
,
1290 [in,unique] GUID
*domain_guid
,
1291 [in,unique] [string,charset
(UTF16
)] uint16
*site_name
,
1292 [in] netr_DsRGetDCName_flags flags
,
1293 [out,ref] netr_DsRGetDCNameInfo
**info
1299 WERROR netr_DsRGetSiteName
(
1300 [in,unique] [string,charset
(UTF16
)] uint16
*computer_name
,
1301 [out,ref] [string,charset
(UTF16
)] uint16
**site
1306 typedef [public,bitmap32bit
] bitmap
{
1307 NETR_TRUST_FLAG_IN_FOREST
= 0x00000001,
1308 NETR_TRUST_FLAG_OUTBOUND
= 0x00000002,
1309 NETR_TRUST_FLAG_TREEROOT
= 0x00000004,
1310 NETR_TRUST_FLAG_PRIMARY
= 0x00000008,
1311 NETR_TRUST_FLAG_NATIVE
= 0x00000010,
1312 NETR_TRUST_FLAG_INBOUND
= 0x00000020,
1313 NETR_TRUST_FLAG_MIT_KRB5
= 0x00000080,
1314 NETR_TRUST_FLAG_AES
= 0x00000100
1317 typedef [bitmap32bit
] bitmap
{
1318 NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS
= 0x00000001,
1319 NETR_WS_FLAG_HANDLES_SPN_UPDATE
= 0x00000002
1320 } netr_WorkstationFlags
;
1322 typedef [bitmap16bit
] bitmap
{
1323 NETR_VER_SUITE_BACKOFFICE
= 0x0004,
1324 NETR_VER_SUITE_BLADE
= 0x0400,
1325 NETR_VER_SUITE_COMPUTE_SERVER
= 0x4000,
1326 NETR_VER_SUITE_DATACENTER
= 0x0080,
1327 NETR_VER_SUITE_ENTERPRISE
= 0x0002,
1328 NETR_VER_SUITE_EMBEDDEDNT
= 0x0040,
1329 NETR_VER_SUITE_PERSONAL
= 0x0200,
1330 NETR_VER_SUITE_SINGLEUSERTS
= 0x0100,
1331 NETR_VER_SUITE_SMALLBUSINESS
= 0x0001,
1332 NETR_VER_SUITE_SMALLBUSINESS_RESTRICTED
= 0x0020,
1333 NETR_VER_SUITE_STORAGE_SERVER
= 0x2000,
1334 NETR_VER_SUITE_TERMINAL
= 0x0010,
1335 NETR_VER_SUITE_WH_SERVER
= 0x8000
1338 typedef [bitmap8bit
] bitmap
{
1339 NETR_VER_NT_DOMAIN_CONTROLLER
= 0x02,
1340 NETR_VER_NT_SERVER
= 0x03,
1341 NETR_VER_NT_WORKSTATION
= 0x01
1346 [size_is(policy_size
)] uint8
*policy
;
1347 } netr_LsaPolicyInformation
;
1350 [value
(284)] uint32 OSVersionInfoSize
;
1351 uint32 MajorVersion
;
1352 uint32 MinorVersion
;
1355 [subcontext
(0),subcontext_size
(256)] nstring CSDVersion
;
1356 uint16 ServicePackMajor
;
1357 uint16 ServicePackMinor
;
1358 netr_SuiteMask SuiteMask
;
1359 netr_ProductType ProductType
;
1361 } netr_OsVersionInfoEx
;
1364 /* these first 3 values come from the fact windows
1365 actually encodes this structure as a UNICODE_STRING
1366 - see MS-NRPC section 2.2.1.3.9 */
1367 /* 142 * 2 = 284 (length of structure "netr_OsVersionInfoEx") */
1368 [value
(142)] uint3264 length
;
1369 [value
(0)] uint3264 dummy
;
1370 [value
(142)] uint3264 size
;
1371 [subcontext
(0),subcontext_size
(size
*2)]
1372 netr_OsVersionInfoEx os
;
1376 /* value is 284 when info != os, otherwise 0 (for length and
1378 [value
(os
== NULL ?
0 : 284)] uint16 length
;
1379 [value
(os
== NULL ?
0 : 284)] uint16 size
;
1381 } netr_OsVersionContainer
;
1384 netr_LsaPolicyInformation lsa_policy
;
1385 [string,charset
(UTF16
)] uint16
*dns_hostname
;
1386 [string,charset
(UTF16
)] uint16
*sitename
;
1387 [string,charset
(UTF16
)] uint16
*dummy1
;
1388 [string,charset
(UTF16
)] uint16
*dummy2
;
1389 [string,charset
(UTF16
)] uint16
*dummy3
;
1390 [string,charset
(UTF16
)] uint16
*dummy4
;
1391 netr_OsVersionContainer os_version
;
1393 lsa_String dummy_string3
;
1394 lsa_String dummy_string4
;
1395 netr_WorkstationFlags workstation_flags
;
1396 kerb_EncTypes supported_enc_types
;
1399 } netr_WorkstationInformation
;
1402 [case(1)] netr_WorkstationInformation
*workstation_info
;
1403 [case(2)] netr_WorkstationInformation
*lsa_policy_info
;
1404 } netr_WorkstationInfo
;
1407 netr_TrustFlags flags
;
1408 uint32 parent_index
;
1409 lsa_TrustType trust_type
;
1410 lsa_TrustAttributes trust_attributes
;
1411 } netr_trust_extension_info
;
1414 /* these first 3 values come from the fact windows
1415 actually encodes this structure as a UNICODE_STRING
1416 - see MS-NRPC section 2.2.1.3.9 */
1417 [value
(8)] uint3264 length
;
1418 [value
(0)] uint3264 dummy
;
1419 [value
(8)] uint3264 size
;
1420 [subcontext
(0),subcontext_size
(size
*2)]
1421 netr_trust_extension_info info
;
1422 } netr_trust_extension
;
1425 /* value is 16 when info != NULL, otherwise 0 */
1426 [value
(info
== NULL ?
0 : 16)] uint16 length
;
1427 [value
(info
== NULL ?
0 : 16)] uint16 size
;
1428 netr_trust_extension
*info
;
1429 } netr_trust_extension_container
;
1432 lsa_StringLarge domainname
;
1433 lsa_StringLarge dns_domainname
;
1434 lsa_StringLarge dns_forestname
;
1436 dom_sid2
*domain_sid
;
1437 netr_trust_extension_container trust_extension
;
1438 lsa_StringLarge dummy_string2
;
1439 lsa_StringLarge dummy_string3
;
1440 lsa_StringLarge dummy_string4
;
1445 } netr_OneDomainInfo
;
1448 netr_OneDomainInfo primary_domain
;
1449 uint32 trusted_domain_count
;
1450 [size_is(trusted_domain_count
)] netr_OneDomainInfo
*trusted_domains
;
1451 netr_LsaPolicyInformation lsa_policy
;
1452 lsa_StringLarge dns_hostname
;
1453 lsa_StringLarge dummy_string2
;
1454 lsa_StringLarge dummy_string3
;
1455 lsa_StringLarge dummy_string4
;
1456 netr_WorkstationFlags workstation_flags
;
1457 kerb_EncTypes supported_enc_types
;
1460 } netr_DomainInformation
;
1463 [case(1)] netr_DomainInformation
*domain_info
;
1464 [case(2)] netr_LsaPolicyInformation
*lsa_policy_info
;
1467 [public] NTSTATUS netr_LogonGetDomainInfo
(
1468 [in] [string,charset
(UTF16
)] uint16
*server_name
,
1469 [in,unique] [string,charset
(UTF16
)] uint16
*computer_name
,
1470 [in,ref] netr_Authenticator
*credential
,
1471 [in,out,ref] netr_Authenticator
*return_authenticator
,
1473 [in,ref,switch_is(level
)] netr_WorkstationInfo
*query
,
1474 [out,ref,switch_is(level
)] netr_DomainInfo
*info
1480 /* [MS-NRPC] 2.2.1.3.8 NL_PASSWORD_VERSION */
1482 /* someone's birthday ? */
1483 const int NETLOGON_PASSWORD_VERSION_NUMBER_PRESENT
= 0x02231968;
1486 uint32 ReservedField
;
1487 uint32 PasswordVersionNumber
;
1488 uint32 PasswordVersionPresent
;
1489 } NL_PASSWORD_VERSION
;
1491 typedef [flag
(NDR_PAHEX
)] struct {
1494 } netr_CryptPassword
;
1496 NTSTATUS netr_ServerPasswordSet2
(
1497 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1498 [in] [string,charset
(UTF16
)] uint16
*account_name
,
1499 [in] netr_SchannelType secure_channel_type
,
1500 [in] [string,charset
(UTF16
)] uint16
*computer_name
,
1501 [in,ref] netr_Authenticator
*credential
,
1502 [out,ref] netr_Authenticator
*return_authenticator
,
1503 [in,ref] netr_CryptPassword
*new_password
1508 NTSTATUS netr_ServerPasswordGet
(
1509 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1510 [in] [string,charset
(UTF16
)] uint16
*account_name
,
1511 [in] netr_SchannelType secure_channel_type
,
1512 [in] [string,charset
(UTF16
)] uint16
*computer_name
,
1513 [in,ref] netr_Authenticator
*credential
,
1514 [out,ref] netr_Authenticator
*return_authenticator
,
1515 [out,ref] samr_Password
*password
1518 typedef [public] enum {
1519 SendToSamUpdatePassword
= 0,
1520 SendToSamResetBadPasswordCount
= 1,
1521 SendToSamUpdatePasswordForward
= 2,
1522 SendToSamUpdateLastLogonTimestamp
= 3,
1523 SendToSamResetSmartCardPassword
= 4
1524 } netr_SendToSamType
;
1528 } netr_SendToSamResetBadPasswordCount
;
1530 typedef [nodiscriminant
, public,switch_type(netr_SendToSamType
)] union {
1531 /* TODO Implement other SendToSam message types
1532 * [case(SendToSamUpdatePassword)] netr_SendToSamUpdatePassword ...; */
1533 [case(SendToSamResetBadPasswordCount
)] netr_SendToSamResetBadPasswordCount reset_bad_password
;
1535 * [case(SendToSamUpdatePasswordForward)] netrSendToSamUpdatePasswordForward ...;
1536 * [case(SendToSamUpdateLastLogonTimestamp)] netrSendToSamUpdateLastLogonTimestamp ...;
1537 * [case(SendToSamResetSmartCardPassword)] netrSendToSamResetSmartCardPassword ...;
1540 } netr_SendToSamMessage
;
1542 typedef [public] struct {
1543 netr_SendToSamType message_type
;
1544 uint32 message_size
;
1545 [switch_is(message_type
), subcontext
(0), subcontext_size
(message_size
)] netr_SendToSamMessage
message;
1546 } netr_SendToSamBase
;
1550 NTSTATUS netr_NetrLogonSendToSam
(
1551 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1552 [in] [string,charset
(UTF16
)] uint16
*computer_name
,
1553 [in,ref] netr_Authenticator
*credential
,
1554 [out,ref] netr_Authenticator
*return_authenticator
,
1555 [in,ref] [size_is(buffer_len
)] uint8
*opaque_buffer
,
1556 [in] uint32 buffer_len
1563 [size_is(count
)] lsa_String
*sitename
;
1564 } netr_DsRAddressToSitenamesWCtr
;
1567 [size_is(size
)] uint8
*buffer
;
1571 WERROR netr_DsRAddressToSitenamesW
(
1572 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1573 [in] [range(0,32000)] uint32 count
,
1574 [in] [size_is(count
)] [ref] netr_DsRAddress
*addresses
,
1575 [out] [ref] netr_DsRAddressToSitenamesWCtr
**ctr
1580 WERROR netr_DsRGetDCNameEx2
(
1581 [in,unique] [string,charset
(UTF16
)] uint16
*server_unc
,
1582 [in,unique] [string,charset
(UTF16
)] uint16
*client_account
,
1583 [in] samr_AcctFlags mask
,
1584 [in,unique] [string,charset
(UTF16
)] uint16
*domain_name
,
1585 [in,unique] GUID
*domain_guid
,
1586 [in,unique] [string,charset
(UTF16
)] uint16
*site_name
,
1587 [in] netr_DsRGetDCName_flags flags
,
1588 [out,ref] netr_DsRGetDCNameInfo
**info
1593 [todo
] WERROR netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
();
1598 typedef [public] struct {
1599 [string,charset
(UTF16
)] uint16
*netbios_name
;
1600 [string,charset
(UTF16
)] uint16
*dns_name
;
1601 netr_TrustFlags trust_flags
;
1602 uint32 parent_index
;
1603 lsa_TrustType trust_type
;
1604 lsa_TrustAttributes trust_attributes
;
1609 typedef [public] struct {
1611 [size_is(count
)] netr_DomainTrust
*array
;
1612 } netr_DomainTrustList
;
1614 WERROR netr_NetrEnumerateTrustedDomainsEx
(
1615 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1616 [out,ref] netr_DomainTrustList
*dom_trust_list
1623 [size_is(count
)] lsa_String
*sitename
;
1624 [size_is(count
)] lsa_String
*subnetname
;
1625 } netr_DsRAddressToSitenamesExWCtr
;
1627 WERROR netr_DsRAddressToSitenamesExW
(
1628 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1629 [in] [range(0,32000)] uint32 count
,
1630 [in] [size_is(count
)] [ref] netr_DsRAddress
*addresses
,
1631 [out] [ref] netr_DsRAddressToSitenamesExWCtr
**ctr
1639 [size_is(num_sites
)] [unique] lsa_String
*sites
;
1642 WERROR netr_DsrGetDcSiteCoverageW
(
1643 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1644 [out,ref] DcSitesCtr
**ctr
1649 typedef [public,bitmap32bit
] bitmap
{
1650 /* Request MUST be passed to the domain controller at the root of the forest. */
1651 NETLOGON_SAMLOGON_FLAG_PASS_TO_FOREST_ROOT
= 0x00000001,
1652 /* Request MUST be passed to the DC at the end of the first hop over a cross-forest trust. */
1653 NETLOGON_SAMLOGON_FLAG_PASS_CROSS_FOREST_HOP
= 0x00000002,
1654 /* Request was passed by an RODC to a DC in a different domain. */
1655 NETLOGON_SAMLOGON_FLAG_RODC_TO_OTHER_DOMAIN
= 0x00000004,
1656 /* Request is an NTLM authentication package request passed by an RODC. */
1657 NETLOGON_SAMLOGON_FLAG_RODC_NTLM_REQUEST
= 0x00000008
1658 } netr_LogonSamLogon_flags
;
1660 NTSTATUS netr_LogonSamLogonEx
(
1661 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1662 [in,unique] [string,charset
(UTF16
)] uint16
*computer_name
,
1663 [in] netr_LogonInfoClass logon_level
,
1664 [in,ref] [switch_is(logon_level
)] netr_LogonLevel
*logon
,
1665 [in] uint16 validation_level
,
1666 [out,ref] [switch_is(validation_level
)] netr_Validation
*validation
,
1667 [out,ref] uint8
*authoritative
,
1668 [in,out,ref] netr_LogonSamLogon_flags
*flags
1674 WERROR netr_DsrEnumerateDomainTrusts
(
1675 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1676 [in] netr_TrustFlags trust_flags
,
1677 [out,ref] netr_DomainTrustList
*trusts
1683 WERROR netr_DsrDeregisterDNSHostRecords
(
1684 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1685 [in,unique] [string,charset
(UTF16
)] uint16
*domain
,
1686 [in,unique] GUID
*domain_guid
,
1687 [in,unique] GUID
*dsa_guid
,
1688 [in,ref] [string,charset
(UTF16
)] uint16
*dns_host
1693 NTSTATUS netr_ServerTrustPasswordsGet
(
1694 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1695 [in] [string,charset
(UTF16
)] uint16
*account_name
,
1696 [in] netr_SchannelType secure_channel_type
,
1697 [in] [string,charset
(UTF16
)] uint16
*computer_name
,
1698 [in,ref] netr_Authenticator
*credential
,
1699 [out,ref] netr_Authenticator
*return_authenticator
,
1700 [out,ref] samr_Password
*new_owf_password
,
1701 [out,ref] samr_Password
*old_owf_password
1707 const int DS_GFTI_UPDATE_TDO
= 0x1;
1709 WERROR netr_DsRGetForestTrustInformation
(
1710 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1711 [in,unique] [string,charset
(UTF16
)] uint16
*trusted_domain_name
,
1713 [out,ref] lsa_ForestTrustInformation
**forest_trust_info
1718 NTSTATUS netr_GetForestTrustInformation
(
1719 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1720 [in,ref] [string,charset
(UTF16
)] uint16
*computer_name
,
1721 [in,ref] netr_Authenticator
*credential
,
1722 [out,ref] netr_Authenticator
*return_authenticator
,
1724 [out,ref] lsa_ForestTrustInformation
**forest_trust_info
1730 /* this is the ADS variant. I don't yet know what the "flags" are for */
1731 NTSTATUS netr_LogonSamLogonWithFlags
(
1732 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1733 [in,unique] [string,charset
(UTF16
)] uint16
*computer_name
,
1734 [in,unique] netr_Authenticator
*credential
,
1735 [in,out,unique] netr_Authenticator
*return_authenticator
,
1736 [in] netr_LogonInfoClass logon_level
,
1737 [in,ref] [switch_is(logon_level
)] netr_LogonLevel
*logon
,
1738 [in] uint16 validation_level
,
1739 [out,ref] [switch_is(validation_level
)] netr_Validation
*validation
,
1740 [out,ref] uint8
*authoritative
,
1741 [in,out,ref] netr_LogonSamLogon_flags
*flags
1749 [size_is(count
)] uint32
*data
;
1751 [size_is(count
)] lsa_String
*entries
;
1754 NTSTATUS netr_ServerGetTrustInfo
(
1755 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1756 [in,ref] [string,charset
(UTF16
)] uint16
*account_name
,
1757 [in] netr_SchannelType secure_channel_type
,
1758 [in,ref] [string,charset
(UTF16
)] uint16
*computer_name
,
1759 [in,ref] netr_Authenticator
*credential
,
1760 [out,ref] netr_Authenticator
*return_authenticator
,
1761 [out,ref] samr_Password
*new_owf_password
,
1762 [out,ref] samr_Password
*old_owf_password
,
1763 [out,ref] netr_TrustInfo
**trust_info
1769 NTSTATUS netr_Unused47
(void);
1776 NlDnsLdapAtSite
= 22,
1779 NlDnsKdcAtSite
= 30,
1781 NlDnsRfc1510KdcAtSite
= 34,
1782 NlDnsGenericGcAtSite
= 36
1786 NlDnsInfoTypeNone
= 0,
1787 NlDnsDomainName
= 1,
1788 NlDnsDomainNameAlias
= 2,
1789 NlDnsForestName
= 3,
1790 NlDnsForestNameAlias
= 4,
1791 NlDnsNdncDomainName
= 5,
1793 } netr_DnsDomainInfoType
;
1797 [string,charset
(UTF16
)] uint16
*dns_domain_info
;
1798 netr_DnsDomainInfoType dns_domain_info_type
;
1802 boolean32 dns_register
;
1806 typedef [public] struct {
1808 [size_is(count
)] NL_DNS_NAME_INFO
*names
;
1809 } NL_DNS_NAME_INFO_ARRAY
;
1811 NTSTATUS netr_DsrUpdateReadOnlyServerDnsRecords
(
1812 [in,unique] [string,charset
(UTF16
)] uint16
*server_name
,
1813 [in,ref] [string,charset
(UTF16
)] uint16
*computer_name
,
1814 [in, ref] netr_Authenticator
*credential
,
1815 [out,ref] netr_Authenticator
*return_authenticator
,
1816 [in,unique] [string,charset
(UTF16
)] uint16
*site_name
,
1817 [in] uint32 dns_ttl
,
1818 [in,out,ref] NL_DNS_NAME_INFO_ARRAY
*dns_names