2 Unix SMB/CIFS implementation.
3 SMB parameters and setup
4 Copyright (C) Andrew Tridgell 1992-1997
5 Copyright (C) Luke Kenneth Casson Leighton 1996-1997
6 Copyright (C) Paul Ashton 1997
7 Copyright (C) Jean François Micouleau 2002
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _RPC_NETLOGON_H /* _RPC_NETLOGON_H */
25 #define _RPC_NETLOGON_H
29 #define NET_SAMLOGON 0x02
30 #define NET_SAMLOGOFF 0x03
31 #define NET_REQCHAL 0x04
33 #define NET_SRVPWSET 0x06
34 #define NET_SAM_DELTAS 0x07
35 #define NET_GETDCNAME 0x0b
36 #define NET_LOGON_CTRL 0x0c
37 #define NET_GETANYDCNAME 0x0d
38 #define NET_AUTH2 0x0f
39 #define NET_LOGON_CTRL2 0x0e
40 #define NET_SAM_SYNC 0x10
41 #define NET_TRUST_DOM_LIST 0x13
42 #define NET_DSR_GETDCNAME 0x14
43 #define NET_AUTH3 0x1a
44 #define NET_DSR_GETDCNAMEEX 0x1b
45 #define NET_DSR_GETSITENAME 0x1c
46 #define NET_DSR_GETDCNAMEEX2 0x22
47 #define NET_SAMLOGON_EX 0x27
49 /* Returned delta types */
50 #define SAM_DELTA_DOMAIN_INFO 0x01
51 #define SAM_DELTA_GROUP_INFO 0x02
52 #define SAM_DELTA_RENAME_GROUP 0x04
53 #define SAM_DELTA_ACCOUNT_INFO 0x05
54 #define SAM_DELTA_RENAME_USER 0x07
55 #define SAM_DELTA_GROUP_MEM 0x08
56 #define SAM_DELTA_ALIAS_INFO 0x09
57 #define SAM_DELTA_RENAME_ALIAS 0x0b
58 #define SAM_DELTA_ALIAS_MEM 0x0c
59 #define SAM_DELTA_POLICY_INFO 0x0d
60 #define SAM_DELTA_TRUST_DOMS 0x0e
61 #define SAM_DELTA_PRIVS_INFO 0x10 /* DT_DELTA_ACCOUNTS */
62 #define SAM_DELTA_SECRET_INFO 0x12
63 #define SAM_DELTA_DELETE_GROUP 0x14
64 #define SAM_DELTA_DELETE_USER 0x15
65 #define SAM_DELTA_MODIFIED_COUNT 0x16
67 /* flags use when sending a NETLOGON_CONTROL request */
69 #define NETLOGON_CONTROL_SYNC 0x2
70 #define NETLOGON_CONTROL_REDISCOVER 0x5
71 #define NETLOGON_CONTROL_TC_QUERY 0x6
72 #define NETLOGON_CONTROL_TRANSPORT_NOTIFY 0x7
73 #define NETLOGON_CONTROL_SET_DBFLAG 0xfffe
75 /* Some flag values reverse engineered from NLTEST.EXE */
76 /* used in the NETLOGON_CONTROL[2] reply */
78 #define NL_CTRL_IN_SYNC 0x0000
79 #define NL_CTRL_REPL_NEEDED 0x0001
80 #define NL_CTRL_REPL_IN_PROGRESS 0x0002
81 #define NL_CTRL_FULL_SYNC 0x0004
83 #define LOGON_GUEST 0x00000001
84 #define LOGON_NOENCRYPTION 0x00000002
85 #define LOGON_CACHED_ACCOUNT 0x00000004
86 #define LOGON_USED_LM_PASSWORD 0x00000008
87 #define LOGON_EXTRA_SIDS 0x00000020
88 #define LOGON_SUBAUTH_SESSION_KEY 0x00000040
89 #define LOGON_SERVER_TRUST_ACCOUNT 0x00000080
90 #define LOGON_NTLMV2_ENABLED 0x00000100
91 #define LOGON_RESOURCE_GROUPS 0x00000200
92 #define LOGON_PROFILE_PATH_RETURNED 0x00000400
93 #define LOGON_GRACE_LOGON 0x01000000
94 #define LOGON_KRB5_FAIL_CLOCK_SKEW 0x02000000
96 #define SE_GROUP_MANDATORY 0x00000001
97 #define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
98 #define SE_GROUP_ENABLED 0x00000004
99 #define SE_GROUP_OWNER 0x00000008
100 #define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
101 #define SE_GROUP_LOGON_ID 0xC0000000
102 #define SE_GROUP_RESOURCE 0x20000000
104 /* Flags for controlling the behaviour of a particular logon */
106 /* sets LOGON_SERVER_TRUST_ACCOUNT user_flag */
107 #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x00000020
108 #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x00000800
110 /* updates the "logon time" on network logon */
111 #define MSV1_0_UPDATE_LOGON_STATISTICS 0x00000004
113 /* returns the user parameters in the driveletter */
114 #define MSV1_0_RETURN_USER_PARAMETERS 0x00000008
116 /* returns the profilepath in the driveletter and
117 * sets LOGON_PROFILE_PATH_RETURNED user_flag */
118 #define MSV1_0_RETURN_PROFILE_PATH 0x00000200
121 /* I think this is correct - it's what gets parsed on the wire. JRA. */
122 /* NET_USER_INFO_2 */
123 typedef struct net_user_info_2
{
124 uint32 ptr_user_info
;
126 NTTIME logon_time
; /* logon time */
127 NTTIME logoff_time
; /* logoff time */
128 NTTIME kickoff_time
; /* kickoff time */
129 NTTIME pass_last_set_time
; /* password last set time */
130 NTTIME pass_can_change_time
; /* password can change time */
131 NTTIME pass_must_change_time
; /* password must change time */
133 UNIHDR hdr_user_name
; /* username unicode string header */
134 UNIHDR hdr_full_name
; /* user's full name unicode string header */
135 UNIHDR hdr_logon_script
; /* logon script unicode string header */
136 UNIHDR hdr_profile_path
; /* profile path unicode string header */
137 UNIHDR hdr_home_dir
; /* home directory unicode string header */
138 UNIHDR hdr_dir_drive
; /* home directory drive unicode string header */
140 uint16 logon_count
; /* logon count */
141 uint16 bad_pw_count
; /* bad password count */
143 uint32 user_id
; /* User ID */
144 uint32 group_id
; /* Group ID */
145 uint32 num_groups
; /* num groups */
146 uint32 buffer_groups
; /* undocumented buffer pointer to groups. */
147 uint32 user_flgs
; /* user flags */
149 uint8 user_sess_key
[16]; /* unused user session key */
151 UNIHDR hdr_logon_srv
; /* logon server unicode string header */
152 UNIHDR hdr_logon_dom
; /* logon domain unicode string header */
154 uint32 buffer_dom_id
; /* undocumented logon domain id pointer */
155 uint8 padding
[40]; /* unused padding bytes. expansion room */
157 UNISTR2 uni_user_name
; /* username unicode string */
158 UNISTR2 uni_full_name
; /* user's full name unicode string */
159 UNISTR2 uni_logon_script
; /* logon script unicode string */
160 UNISTR2 uni_profile_path
; /* profile path unicode string */
161 UNISTR2 uni_home_dir
; /* home directory unicode string */
162 UNISTR2 uni_dir_drive
; /* home directory drive unicode string */
164 uint32 num_groups2
; /* num groups */
165 DOM_GID
*gids
; /* group info */
167 UNISTR2 uni_logon_srv
; /* logon server unicode string */
168 UNISTR2 uni_logon_dom
; /* logon domain unicode string */
170 DOM_SID2 dom_sid
; /* domain SID */
172 uint32 num_other_groups
; /* other groups */
173 DOM_GID
*other_gids
; /* group info */
174 DOM_SID2
*other_sids
; /* undocumented - domain SIDs */
179 /* NET_USER_INFO_2 */
180 typedef struct net_user_info_2
{
181 uint32 ptr_user_info
;
183 NTTIME logon_time
; /* logon time */
184 NTTIME logoff_time
; /* logoff time */
185 NTTIME kickoff_time
; /* kickoff time */
186 NTTIME pass_last_set_time
; /* password last set time */
187 NTTIME pass_can_change_time
; /* password can change time */
188 NTTIME pass_must_change_time
; /* password must change time */
190 UNIHDR hdr_user_name
; /* username unicode string header */
191 UNIHDR hdr_full_name
; /* user's full name unicode string header */
192 UNIHDR hdr_logon_script
; /* logon script unicode string header */
193 UNIHDR hdr_profile_path
; /* profile path unicode string header */
194 UNIHDR hdr_home_dir
; /* home directory unicode string header */
195 UNIHDR hdr_dir_drive
; /* home directory drive unicode string header */
197 uint16 logon_count
; /* logon count */
198 uint16 bad_pw_count
; /* bad password count */
200 uint32 user_rid
; /* User RID */
201 uint32 group_rid
; /* Group RID */
203 uint32 num_groups
; /* num groups */
204 uint32 buffer_groups
; /* undocumented buffer pointer to groups. */
205 uint32 user_flgs
; /* user flags */
207 uint8 user_sess_key
[16]; /* user session key */
209 UNIHDR hdr_logon_srv
; /* logon server unicode string header */
210 UNIHDR hdr_logon_dom
; /* logon domain unicode string header */
212 uint32 buffer_dom_id
; /* undocumented logon domain id pointer */
213 uint8 lm_sess_key
[8]; /* lm session key */
214 uint32 acct_flags
; /* account flags */
215 uint32 unknown
[7]; /* unknown */
217 UNISTR2 uni_user_name
; /* username unicode string */
218 UNISTR2 uni_full_name
; /* user's full name unicode string */
219 UNISTR2 uni_logon_script
; /* logon script unicode string */
220 UNISTR2 uni_profile_path
; /* profile path unicode string */
221 UNISTR2 uni_home_dir
; /* home directory unicode string */
222 UNISTR2 uni_dir_drive
; /* home directory drive unicode string */
224 UNISTR2 uni_logon_srv
; /* logon server unicode string */
225 UNISTR2 uni_logon_dom
; /* logon domain unicode string */
227 DOM_SID2 dom_sid
; /* domain SID */
230 /* NET_USER_INFO_3 */
231 typedef struct net_user_info_3
{
232 uint32 ptr_user_info
;
234 NTTIME logon_time
; /* logon time */
235 NTTIME logoff_time
; /* logoff time */
236 NTTIME kickoff_time
; /* kickoff time */
237 NTTIME pass_last_set_time
; /* password last set time */
238 NTTIME pass_can_change_time
; /* password can change time */
239 NTTIME pass_must_change_time
; /* password must change time */
241 UNIHDR hdr_user_name
; /* username unicode string header */
242 UNIHDR hdr_full_name
; /* user's full name unicode string header */
243 UNIHDR hdr_logon_script
; /* logon script unicode string header */
244 UNIHDR hdr_profile_path
; /* profile path unicode string header */
245 UNIHDR hdr_home_dir
; /* home directory unicode string header */
246 UNIHDR hdr_dir_drive
; /* home directory drive unicode string header */
248 uint16 logon_count
; /* logon count */
249 uint16 bad_pw_count
; /* bad password count */
251 uint32 user_rid
; /* User RID */
252 uint32 group_rid
; /* Group RID */
254 uint32 num_groups
; /* num groups */
255 uint32 buffer_groups
; /* undocumented buffer pointer to groups. */
256 uint32 user_flgs
; /* user flags */
258 uint8 user_sess_key
[16]; /* user session key */
260 UNIHDR hdr_logon_srv
; /* logon server unicode string header */
261 UNIHDR hdr_logon_dom
; /* logon domain unicode string header */
263 uint32 buffer_dom_id
; /* undocumented logon domain id pointer */
264 uint8 lm_sess_key
[8]; /* lm session key */
265 uint32 acct_flags
; /* account flags */
266 uint32 unknown
[7]; /* unknown */
268 uint32 num_other_sids
; /* number of foreign/trusted domain sids */
269 uint32 buffer_other_sids
;
271 /* The next three uint32 are not really part of user_info_3 but here
272 * for parsing convenience. They are only valid in Kerberos PAC
273 * parsing - Guenther */
274 uint32 ptr_res_group_dom_sid
;
275 uint32 res_group_count
;
276 uint32 ptr_res_groups
;
278 UNISTR2 uni_user_name
; /* username unicode string */
279 UNISTR2 uni_full_name
; /* user's full name unicode string */
280 UNISTR2 uni_logon_script
; /* logon script unicode string */
281 UNISTR2 uni_profile_path
; /* profile path unicode string */
282 UNISTR2 uni_home_dir
; /* home directory unicode string */
283 UNISTR2 uni_dir_drive
; /* home directory drive unicode string */
285 uint32 num_groups2
; /* num groups */
286 DOM_GID
*gids
; /* group info */
288 UNISTR2 uni_logon_srv
; /* logon server unicode string */
289 UNISTR2 uni_logon_dom
; /* logon domain unicode string */
291 DOM_SID2 dom_sid
; /* domain SID */
293 DOM_SID2
*other_sids
; /* foreign/trusted domain SIDs */
294 uint32
*other_sids_attrib
;
298 /* NETLOGON_INFO_1 - pdc status info, i presume */
299 typedef struct netlogon_1_info
{
300 uint32 flags
; /* 0x0 - undocumented */
301 uint32 pdc_status
; /* 0x0 - undocumented */
304 /* NETLOGON_INFO_2 - pdc status info, plus trusted domain info */
305 typedef struct netlogon_2_info
{
306 uint32 flags
; /* 0x0 - undocumented */
307 uint32 pdc_status
; /* 0x0 - undocumented */
308 uint32 ptr_trusted_dc_name
; /* pointer to trusted domain controller name */
310 UNISTR2 uni_trusted_dc_name
; /* unicode string - trusted dc name */
313 /* NETLOGON_INFO_3 - logon status info, i presume */
314 typedef struct netlogon_3_info
{
315 uint32 flags
; /* 0x0 - undocumented */
316 uint32 logon_attempts
; /* number of logon attempts */
317 uint32 reserved_1
; /* 0x0 - undocumented */
318 uint32 reserved_2
; /* 0x0 - undocumented */
319 uint32 reserved_3
; /* 0x0 - undocumented */
320 uint32 reserved_4
; /* 0x0 - undocumented */
321 uint32 reserved_5
; /* 0x0 - undocumented */
324 /********************************************************
327 This is generated by a nltest /bdc_query:DOMAIN
329 query_level 0x1, function_code 0x1
331 ********************************************************/
333 /* NET_Q_LOGON_CTRL - LSA Netr Logon Control */
335 typedef struct net_q_logon_ctrl_info
{
337 UNISTR2 uni_server_name
;
338 uint32 function_code
;
342 /* NET_R_LOGON_CTRL - LSA Netr Logon Control */
344 typedef struct net_r_logon_ctrl_info
{
349 NETLOGON_INFO_1 info1
;
356 typedef struct ctrl_data_info_5
{
357 uint32 function_code
;
363 typedef struct ctrl_data_info_6
{
364 uint32 function_code
;
371 /********************************************************
374 query_level 0x1 - pdc status
375 query_level 0x3 - number of logon attempts.
377 ********************************************************/
379 /* NET_Q_LOGON_CTRL2 - LSA Netr Logon Control 2 */
380 typedef struct net_q_logon_ctrl2_info
{
381 uint32 ptr
; /* undocumented buffer pointer */
382 UNISTR2 uni_server_name
; /* server name, starting with two '\'s */
384 uint32 function_code
;
387 CTRL_DATA_INFO_5 info5
;
388 CTRL_DATA_INFO_6 info6
;
392 /*******************************************************
393 Logon Control Response
395 switch_value is same as query_level in request
396 *******************************************************/
398 /* NET_R_LOGON_CTRL2 - response to LSA Logon Control2 */
399 typedef struct net_r_logon_ctrl2_info
{
400 uint32 switch_value
; /* 0x1, 0x3 */
405 NETLOGON_INFO_1 info1
;
406 NETLOGON_INFO_2 info2
;
407 NETLOGON_INFO_3 info3
;
411 NTSTATUS status
; /* return code */
414 /* NET_Q_GETANYDCNAME - Ask a DC for a trusted DC name */
416 typedef struct net_q_getanydcname
{
417 uint32 ptr_logon_server
;
418 UNISTR2 uni_logon_server
;
419 uint32 ptr_domainname
;
420 UNISTR2 uni_domainname
;
421 } NET_Q_GETANYDCNAME
;
423 /* NET_R_GETANYDCNAME - Ask a DC for a trusted DC name */
425 typedef struct net_r_getanydcname
{
429 } NET_R_GETANYDCNAME
;
432 /* NET_Q_GETDCNAME - Ask a DC for a trusted DC name */
434 typedef struct net_q_getdcname
{
435 UNISTR2 uni_logon_server
;
436 uint32 ptr_domainname
;
437 UNISTR2 uni_domainname
;
440 /* NET_R_GETDCNAME - Ask a DC for a trusted DC name */
442 typedef struct net_r_getdcname
{
448 /* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */
449 typedef struct net_q_trust_dom_info
{
450 uint32 ptr
; /* undocumented buffer pointer */
451 UNISTR2 uni_server_name
; /* server name, starting with two '\'s */
452 } NET_Q_TRUST_DOM_LIST
;
454 #define MAX_TRUST_DOMS 1
456 /* NET_R_TRUST_DOM_LIST - response to LSA Trusted Domains */
457 typedef struct net_r_trust_dom_info
{
458 UNISTR2 uni_trust_dom_name
[MAX_TRUST_DOMS
];
460 NTSTATUS status
; /* return code */
461 } NET_R_TRUST_DOM_LIST
;
465 typedef struct neg_flags_info
{
466 uint32 neg_flags
; /* negotiated flags */
471 typedef struct net_q_req_chal_info
{
472 uint32 undoc_buffer
; /* undocumented buffer pointer */
473 UNISTR2 uni_logon_srv
; /* logon server unicode string */
474 UNISTR2 uni_logon_clnt
; /* logon client unicode string */
475 DOM_CHAL clnt_chal
; /* client challenge */
480 typedef struct net_r_req_chal_info
{
481 DOM_CHAL srv_chal
; /* server challenge */
482 NTSTATUS status
; /* return code */
486 typedef struct net_q_auth_info
{
487 DOM_LOG_INFO clnt_id
; /* client identification info */
488 DOM_CHAL clnt_chal
; /* client-calculated credentials */
492 typedef struct net_r_auth_info
{
493 DOM_CHAL srv_chal
; /* server-calculated credentials */
494 NTSTATUS status
; /* return code */
498 typedef struct net_q_auth2_info
{
499 DOM_LOG_INFO clnt_id
; /* client identification info */
500 DOM_CHAL clnt_chal
; /* client-calculated credentials */
502 NEG_FLAGS clnt_flgs
; /* usually 0x0000 01ff */
507 typedef struct net_r_auth2_info
{
508 DOM_CHAL srv_chal
; /* server-calculated credentials */
509 NEG_FLAGS srv_flgs
; /* usually 0x0000 01ff */
510 NTSTATUS status
; /* return code */
514 typedef struct net_q_auth3_info
{
515 DOM_LOG_INFO clnt_id
; /* client identification info */
516 DOM_CHAL clnt_chal
; /* client-calculated credentials */
517 NEG_FLAGS clnt_flgs
; /* usually 0x6007 ffff */
521 typedef struct net_r_auth3_info
{
522 DOM_CHAL srv_chal
; /* server-calculated credentials */
523 NEG_FLAGS srv_flgs
; /* usually 0x6007 ffff */
524 uint32 unknown
; /* 0x0000045b */
525 NTSTATUS status
; /* return code */
529 /* NET_Q_SRV_PWSET */
530 typedef struct net_q_srv_pwset_info
{
531 DOM_CLNT_INFO clnt_id
; /* client identification/authentication info */
532 uint8 pwd
[16]; /* new password - undocumented. */
535 /* NET_R_SRV_PWSET */
536 typedef struct net_r_srv_pwset_info
{
537 DOM_CRED srv_cred
; /* server-calculated credentials */
539 NTSTATUS status
; /* return code */
543 typedef struct net_network_info_2
{
544 uint32 ptr_id_info2
; /* pointer to id_info_2 */
545 UNIHDR hdr_domain_name
; /* domain name unicode header */
546 uint32 param_ctrl
; /* param control (0x2) */
547 DOM_LOGON_ID logon_id
; /* logon ID */
548 UNIHDR hdr_user_name
; /* user name unicode header */
549 UNIHDR hdr_wksta_name
; /* workstation name unicode header */
550 uint8 lm_chal
[8]; /* lan manager 8 byte challenge */
551 STRHDR hdr_nt_chal_resp
; /* nt challenge response */
552 STRHDR hdr_lm_chal_resp
; /* lm challenge response */
554 UNISTR2 uni_domain_name
; /* domain name unicode string */
555 UNISTR2 uni_user_name
; /* user name unicode string */
556 UNISTR2 uni_wksta_name
; /* workgroup name unicode string */
557 STRING2 nt_chal_resp
; /* nt challenge response */
558 STRING2 lm_chal_resp
; /* lm challenge response */
562 typedef struct id_info_1
{
563 uint32 ptr_id_info1
; /* pointer to id_info_1 */
564 UNIHDR hdr_domain_name
; /* domain name unicode header */
565 uint32 param_ctrl
; /* param control */
566 DOM_LOGON_ID logon_id
; /* logon ID */
567 UNIHDR hdr_user_name
; /* user name unicode header */
568 UNIHDR hdr_wksta_name
; /* workstation name unicode header */
569 OWF_INFO lm_owf
; /* LM OWF Password */
570 OWF_INFO nt_owf
; /* NT OWF Password */
571 UNISTR2 uni_domain_name
; /* domain name unicode string */
572 UNISTR2 uni_user_name
; /* user name unicode string */
573 UNISTR2 uni_wksta_name
; /* workgroup name unicode string */
576 #define INTERACTIVE_LOGON_TYPE 1
577 #define NET_LOGON_TYPE 2
579 /* NET_ID_INFO_CTR */
580 typedef struct net_id_info_ctr_info
{
584 NET_ID_INFO_1 id1
; /* auth-level 1 - interactive user login */
585 NET_ID_INFO_2 id2
; /* auth-level 2 - workstation referred login */
589 /* SAM_INFO - sam logon/off id structure */
590 typedef struct sam_info
{
591 DOM_CLNT_INFO2 client
;
592 uint32 ptr_rtn_cred
; /* pointer to return credentials */
593 DOM_CRED rtn_cred
; /* return credentials */
595 NET_ID_INFO_CTR
*ctr
;
598 /* SAM_INFO - sam logon/off id structure - no creds */
599 typedef struct sam_info_ex
{
602 NET_ID_INFO_CTR
*ctr
;
605 /* NET_Q_SAM_LOGON */
606 typedef struct net_q_sam_logon_info
{
608 uint16 validation_level
;
611 /* NET_Q_SAM_LOGON_EX */
612 typedef struct net_q_sam_logon_info_ex
{
613 DOM_SAM_INFO_EX sam_id
;
614 uint16 validation_level
;
616 } NET_Q_SAM_LOGON_EX
;
618 /* NET_R_SAM_LOGON */
619 typedef struct net_r_sam_logon_info
{
620 uint32 buffer_creds
; /* undocumented buffer pointer */
621 DOM_CRED srv_creds
; /* server credentials. server time stamp appears to be ignored. */
623 uint16 switch_value
; /* 3 - indicates type of USER INFO */
624 NET_USER_INFO_3
*user
;
626 uint32 auth_resp
; /* 1 - Authoritative response; 0 - Non-Auth? */
628 NTSTATUS status
; /* return code */
631 /* NET_R_SAM_LOGON_EX */
632 typedef struct net_r_sam_logon_info_ex
{
633 uint16 switch_value
; /* 3 - indicates type of USER INFO */
634 NET_USER_INFO_3
*user
;
636 uint32 auth_resp
; /* 1 - Authoritative response; 0 - Non-Auth? */
639 NTSTATUS status
; /* return code */
640 } NET_R_SAM_LOGON_EX
;
643 /* NET_Q_SAM_LOGOFF */
644 typedef struct net_q_sam_logoff_info
{
648 /* NET_R_SAM_LOGOFF */
649 typedef struct net_r_sam_logoff_info
{
650 uint32 buffer_creds
; /* undocumented buffer pointer */
651 DOM_CRED srv_creds
; /* server credentials. server time stamp appears to be ignored. */
652 NTSTATUS status
; /* return code */
656 typedef struct net_q_sam_sync_info
{
657 UNISTR2 uni_srv_name
; /* \\PDC */
658 UNISTR2 uni_cli_name
; /* BDC */
663 uint32 restart_state
;
666 uint32 max_size
; /* preferred maximum length */
670 typedef struct sam_delta_hdr_info
{
671 uint16 type
; /* type of structure attached */
680 typedef struct account_lockout_string
{
684 /* uint16 *bindata; */
685 uint64 lockout_duration
;
687 uint32 bad_attempt_lockout
;
691 /* HDR_LOCKOUT_STRING */
692 typedef struct hdr_account_lockout_string
{
696 } HDR_LOCKOUT_STRING
;
698 /* SAM_DOMAIN_INFO (0x1) */
699 typedef struct sam_domain_info_info
{
705 uint16 pwd_history_len
;
708 uint64 dom_mod_count
;
709 NTTIME creation_time
;
710 uint32 security_information
;
712 BUFHDR4 hdr_sec_desc
; /* security descriptor */
714 HDR_LOCKOUT_STRING hdr_account_lockout
;
720 UNISTR2 uni_dom_name
;
721 UNISTR2 buf_oem_info
;
723 RPC_DATA_BLOB buf_sec_desc
;
725 LOCKOUT_STRING account_lockout
;
727 UNISTR2 buf_unknown2
;
728 UNISTR2 buf_unknown3
;
729 UNISTR2 buf_unknown4
;
731 uint32 logon_chgpass
;
737 /* SAM_GROUP_INFO (0x2) */
738 typedef struct sam_group_info_info
{
742 BUFHDR2 hdr_sec_desc
; /* security descriptor */
745 UNISTR2 uni_grp_name
;
746 UNISTR2 uni_grp_desc
;
747 RPC_DATA_BLOB buf_sec_desc
;
751 typedef struct sam_passwd_info
{
752 /* this structure probably contains password history */
753 /* this is probably a count of lm/nt pairs */
754 uint32 unk_0
; /* 0x0000 0002 */
757 uint8 buf_lm_pwd
[16];
760 uint8 buf_nt_pwd
[16];
766 /* SAM_ACCOUNT_INFO (0x5) */
767 typedef struct sam_account_info_info
{
768 UNIHDR hdr_acct_name
;
769 UNIHDR hdr_full_name
;
775 UNIHDR hdr_dir_drive
;
776 UNIHDR hdr_logon_script
;
777 UNIHDR hdr_acct_desc
;
778 UNIHDR hdr_workstations
;
783 uint32 logon_divs
; /* 0xA8 */
784 uint32 ptr_logon_hrs
;
786 uint16 bad_pwd_count
;
788 NTTIME pwd_last_set_time
;
789 NTTIME acct_expiry_time
;
794 uint8 nt_pwd_present
;
795 uint8 lm_pwd_present
;
799 UNIHDR hdr_parameters
;
803 BUFHDR2 hdr_sec_desc
; /* security descriptor */
806 UNIHDR hdr_reserved
[3]; /* space for more strings */
807 uint32 dw_reserved
[4]; /* space for more data - first two seem to
810 UNISTR2 uni_acct_name
;
811 UNISTR2 uni_full_name
;
812 UNISTR2 uni_home_dir
;
813 UNISTR2 uni_dir_drive
;
814 UNISTR2 uni_logon_script
;
815 UNISTR2 uni_acct_desc
;
816 UNISTR2 uni_workstations
;
818 uint32 unknown1
; /* 0x4EC */
819 uint32 unknown2
; /* 0 */
821 RPC_DATA_BLOB buf_logon_hrs
;
823 UNISTR2 uni_parameters
;
825 RPC_DATA_BLOB buf_sec_desc
;
829 /* SAM_GROUP_MEM_INFO (0x8) */
830 typedef struct sam_group_mem_info_info
{
842 } SAM_GROUP_MEM_INFO
;
844 /* SAM_ALIAS_INFO (0x9) */
845 typedef struct sam_alias_info_info
{
848 BUFHDR2 hdr_sec_desc
; /* security descriptor */
852 UNISTR2 uni_als_name
;
853 RPC_DATA_BLOB buf_sec_desc
;
854 UNISTR2 uni_als_desc
;
857 /* SAM_ALIAS_MEM_INFO (0xC) */
858 typedef struct sam_alias_mem_info_info
{
866 } SAM_ALIAS_MEM_INFO
;
869 /* SAM_DELTA_POLICY (0x0D) */
871 uint32 max_log_size
; /* 0x5000 */
872 uint64 audit_retention_period
; /* 0 */
873 uint32 auditing_mode
; /* 0 */
879 uint32 paged_pool_limit
; /* 0x02000000 */
880 uint32 non_paged_pool_limit
; /* 0x00100000 */
881 uint32 min_workset_size
; /* 0x00010000 */
882 uint32 max_workset_size
; /* 0x0f000000 */
883 uint32 page_file_limit
; /* 0 */
884 uint64 time_limit
; /* 0 */
885 NTTIME modify_time
; /* 0x3c*/
886 NTTIME create_time
; /* a7080110 */
887 BUFHDR2 hdr_sec_desc
;
889 uint32 num_event_audit_options
;
890 uint32 event_audit_option
;
895 RPC_DATA_BLOB buf_sec_desc
;
898 /* SAM_DELTA_TRUST_DOMS */
914 } SAM_DELTA_TRUSTDOMS
;
916 /* SAM_DELTA_PRIVS (0x10) */
923 uint32 priv_attr_ptr
;
924 uint32 priv_name_ptr
;
926 uint32 paged_pool_limit
; /* 0x02000000 */
927 uint32 non_paged_pool_limit
; /* 0x00100000 */
928 uint32 min_workset_size
; /* 0x00010000 */
929 uint32 max_workset_size
; /* 0x0f000000 */
930 uint32 page_file_limit
; /* 0 */
931 uint64 time_limit
; /* 0 */
932 uint32 system_flags
; /* 1 */
933 BUFHDR2 hdr_sec_desc
;
937 uint32 attribute_count
;
940 uint32 privlist_count
;
941 UNIHDR
*hdr_privslist
;
942 UNISTR2
*uni_privslist
;
944 RPC_DATA_BLOB buf_sec_desc
;
947 /* SAM_DELTA_SECRET */
965 uint32 unknow2
; /* 0x0 12 times */
968 uint32 reserved1
; /* 0 */
973 uint32 reserved2
; /* 0 */
981 /* SAM_DELTA_MOD_COUNT (0x16) */
984 uint32 dom_mod_count_ptr
;
985 uint64 dom_mod_count
; /* domain mod count at last sync */
986 } SAM_DELTA_MOD_COUNT
;
988 typedef union sam_delta_ctr_info
{
989 SAM_DOMAIN_INFO domain_info
;
990 SAM_GROUP_INFO group_info
;
991 SAM_ACCOUNT_INFO account_info
;
992 SAM_GROUP_MEM_INFO grp_mem_info
;
993 SAM_ALIAS_INFO alias_info
;
994 SAM_ALIAS_MEM_INFO als_mem_info
;
995 SAM_DELTA_POLICY policy_info
;
996 SAM_DELTA_PRIVS privs_info
;
997 SAM_DELTA_MOD_COUNT mod_count
;
998 SAM_DELTA_TRUSTDOMS trustdoms_info
;
999 SAM_DELTA_SECRET secret_info
;
1002 /* NET_R_SAM_SYNC */
1003 typedef struct net_r_sam_sync_info
{
1006 uint32 sync_context
;
1013 SAM_DELTA_HDR
*hdr_deltas
;
1014 SAM_DELTA_CTR
*deltas
;
1019 /* NET_Q_SAM_DELTAS */
1020 typedef struct net_q_sam_deltas_info
{
1021 UNISTR2 uni_srv_name
;
1022 UNISTR2 uni_cli_name
;
1027 uint64 dom_mod_count
; /* domain mod count at last sync */
1029 uint32 max_size
; /* preferred maximum length */
1032 /* NET_R_SAM_DELTAS */
1033 typedef struct net_r_sam_deltas_info
{
1036 uint64 dom_mod_count
; /* new domain mod count */
1042 SAM_DELTA_HDR
*hdr_deltas
;
1043 SAM_DELTA_CTR
*deltas
;
1048 #define DS_FORCE_REDISCOVERY 0x00000001
1049 #define DS_DIRECTORY_SERVICE_REQUIRED 0x00000010
1050 #define DS_DIRECTORY_SERVICE_PREFERRED 0x00000020
1051 #define DS_GC_SERVER_REQUIRED 0x00000040
1052 #define DS_PDC_REQUIRED 0x00000080
1053 #define DS_BACKGROUND_ONLY 0x00000100
1054 #define DS_IP_REQUIRED 0x00000200
1055 #define DS_KDC_REQUIRED 0x00000400
1056 #define DS_TIMESERV_REQUIRED 0x00000800
1057 #define DS_WRITABLE_REQUIRED 0x00001000
1058 #define DS_GOOD_TIMESERV_PREFERRED 0x00002000
1059 #define DS_AVOID_SELF 0x00004000
1060 #define DS_ONLY_LDAP_NEEDED 0x00008000
1062 #define DS_IS_FLAT_NAME 0x00010000
1063 #define DS_IS_DNS_NAME 0x00020000
1065 #define DS_RETURN_DNS_NAME 0x40000000
1066 #define DS_RETURN_FLAT_NAME 0x80000000
1068 #if 0 /* unknown yet */
1069 #define DS_IP_VERSION_AGNOSTIC
1070 #define DS_TRY_NEXTCLOSEST_SITE
1073 #define DSGETDC_VALID_FLAGS ( \
1074 DS_FORCE_REDISCOVERY | \
1075 DS_DIRECTORY_SERVICE_REQUIRED | \
1076 DS_DIRECTORY_SERVICE_PREFERRED | \
1077 DS_GC_SERVER_REQUIRED | \
1079 DS_BACKGROUND_ONLY | \
1082 DS_TIMESERV_REQUIRED | \
1083 DS_WRITABLE_REQUIRED | \
1084 DS_GOOD_TIMESERV_PREFERRED | \
1086 DS_ONLY_LDAP_NEEDED | \
1089 DS_RETURN_FLAT_NAME | \
1090 DS_RETURN_DNS_NAME )
1092 struct DS_DOMAIN_CONTROLLER_INFO
{
1093 const char *domain_controller_name
;
1094 const char *domain_controller_address
;
1095 int32 domain_controller_address_type
;
1096 struct GUID
*domain_guid
;
1097 const char *domain_name
;
1098 const char *dns_forest_name
;
1100 const char *dc_site_name
;
1101 const char *client_site_name
;
1104 /* NET_Q_DSR_GETDCNAME */
1105 typedef struct net_q_dsr_getdcname
{
1106 uint32 ptr_server_unc
;
1107 UNISTR2 uni_server_unc
;
1108 uint32 ptr_domain_name
;
1109 UNISTR2 uni_domain_name
;
1110 uint32 ptr_domain_guid
;
1111 struct GUID
*domain_guid
;
1112 uint32 ptr_site_guid
;
1113 struct GUID
*site_guid
;
1115 } NET_Q_DSR_GETDCNAME
;
1117 /* NET_R_DSR_GETDCNAME */
1118 typedef struct net_r_dsr_getdcname
{
1121 uint32 ptr_dc_address
;
1122 UNISTR2 uni_dc_address
;
1123 int32 dc_address_type
;
1124 struct GUID domain_guid
;
1125 uint32 ptr_domain_name
;
1126 UNISTR2 uni_domain_name
;
1127 uint32 ptr_forest_name
;
1128 UNISTR2 uni_forest_name
;
1130 uint32 ptr_dc_site_name
;
1131 UNISTR2 uni_dc_site_name
;
1132 uint32 ptr_client_site_name
;
1133 UNISTR2 uni_client_site_name
;
1135 } NET_R_DSR_GETDCNAME
;
1137 /* NET_Q_DSR_GETDCNAMEEX */
1138 typedef struct net_q_dsr_getdcnameex
{
1139 uint32 ptr_server_unc
;
1140 UNISTR2 uni_server_unc
;
1141 uint32 ptr_domain_name
;
1142 UNISTR2 uni_domain_name
;
1143 uint32 ptr_domain_guid
;
1144 struct GUID
*domain_guid
;
1145 uint32 ptr_site_name
;
1146 UNISTR2 uni_site_name
;
1148 } NET_Q_DSR_GETDCNAMEEX
;
1150 /* NET_R_DSR_GETDCNAMEEX */
1151 typedef struct NET_R_DSR_GETDCNAME NET_R_DSR_GETDCNAMEEX
;
1153 /* NET_Q_DSR_GETDCNAMEEX2 */
1154 typedef struct net_q_dsr_getdcnameex2
{
1155 uint32 ptr_server_unc
;
1156 UNISTR2 uni_server_unc
;
1157 uint32 ptr_client_account
;
1158 UNISTR2 uni_client_account
;
1160 uint32 ptr_domain_name
;
1161 UNISTR2 uni_domain_name
;
1162 uint32 ptr_domain_guid
;
1163 struct GUID
*domain_guid
;
1164 uint32 ptr_site_name
;
1165 UNISTR2 uni_site_name
;
1167 } NET_Q_DSR_GETDCNAMEEX2
;
1169 /* NET_R_DSR_GETDCNAMEEX */
1170 typedef struct NET_R_DSR_GETDCNAME NET_R_DSR_GETDCNAMEEX2
;
1172 /* NET_Q_DSR_GESITENAME */
1173 typedef struct net_q_dsr_getsitename
{
1174 uint32 ptr_computer_name
;
1175 UNISTR2 uni_computer_name
;
1176 } NET_Q_DSR_GETSITENAME
;
1178 /* NET_R_DSR_GETSITENAME */
1179 typedef struct net_r_dsr_getsitename
{
1180 uint32 ptr_site_name
;
1181 UNISTR2 uni_site_name
;
1183 } NET_R_DSR_GETSITENAME
;
1186 #endif /* _RPC_NETLOGON_H */