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 3 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, see <http://www.gnu.org/licenses/>.
23 #ifndef _RPC_NETLOGON_H /* _RPC_NETLOGON_H */
24 #define _RPC_NETLOGON_H
28 #define NET_SAMLOGON 0x02
29 #define NET_SAMLOGOFF 0x03
30 #define NET_REQCHAL 0x04
32 #define NET_SRVPWSET 0x06
33 #define NET_SAM_DELTAS 0x07
34 #define NET_GETDCNAME 0x0b
35 #define NET_LOGON_CTRL 0x0c
36 #define NET_GETANYDCNAME 0x0d
37 #define NET_AUTH2 0x0f
38 #define NET_LOGON_CTRL2 0x0e
39 #define NET_SAM_SYNC 0x10
40 #define NET_TRUST_DOM_LIST 0x13
41 #define NET_DSR_GETDCNAME 0x14
42 #define NET_AUTH3 0x1a
43 #define NET_DSR_GETDCNAMEEX 0x1b
44 #define NET_DSR_GETSITENAME 0x1c
45 #define NET_DSR_GETDCNAMEEX2 0x22
46 #define NET_SAMLOGON_EX 0x27
48 /* Returned delta types */
49 #define SAM_DELTA_DOMAIN_INFO 0x01
50 #define SAM_DELTA_GROUP_INFO 0x02
51 #define SAM_DELTA_RENAME_GROUP 0x04
52 #define SAM_DELTA_ACCOUNT_INFO 0x05
53 #define SAM_DELTA_RENAME_USER 0x07
54 #define SAM_DELTA_GROUP_MEM 0x08
55 #define SAM_DELTA_ALIAS_INFO 0x09
56 #define SAM_DELTA_RENAME_ALIAS 0x0b
57 #define SAM_DELTA_ALIAS_MEM 0x0c
58 #define SAM_DELTA_POLICY_INFO 0x0d
59 #define SAM_DELTA_TRUST_DOMS 0x0e
60 #define SAM_DELTA_PRIVS_INFO 0x10 /* DT_DELTA_ACCOUNTS */
61 #define SAM_DELTA_SECRET_INFO 0x12
62 #define SAM_DELTA_DELETE_GROUP 0x14
63 #define SAM_DELTA_DELETE_USER 0x15
64 #define SAM_DELTA_MODIFIED_COUNT 0x16
66 /* flags use when sending a NETLOGON_CONTROL request */
68 #define NETLOGON_CONTROL_SYNC 0x2
69 #define NETLOGON_CONTROL_REDISCOVER 0x5
70 #define NETLOGON_CONTROL_TC_QUERY 0x6
71 #define NETLOGON_CONTROL_TRANSPORT_NOTIFY 0x7
72 #define NETLOGON_CONTROL_SET_DBFLAG 0xfffe
74 /* Some flag values reverse engineered from NLTEST.EXE */
75 /* used in the NETLOGON_CONTROL[2] reply */
77 #define NL_CTRL_IN_SYNC 0x0000
78 #define NL_CTRL_REPL_NEEDED 0x0001
79 #define NL_CTRL_REPL_IN_PROGRESS 0x0002
80 #define NL_CTRL_FULL_SYNC 0x0004
82 #define LOGON_GUEST 0x00000001
83 #define LOGON_NOENCRYPTION 0x00000002
84 #define LOGON_CACHED_ACCOUNT 0x00000004
85 #define LOGON_USED_LM_PASSWORD 0x00000008
86 #define LOGON_EXTRA_SIDS 0x00000020
87 #define LOGON_SUBAUTH_SESSION_KEY 0x00000040
88 #define LOGON_SERVER_TRUST_ACCOUNT 0x00000080
89 #define LOGON_NTLMV2_ENABLED 0x00000100
90 #define LOGON_RESOURCE_GROUPS 0x00000200
91 #define LOGON_PROFILE_PATH_RETURNED 0x00000400
92 #define LOGON_GRACE_LOGON 0x01000000
93 #define LOGON_KRB5_FAIL_CLOCK_SKEW 0x02000000
95 #define SE_GROUP_MANDATORY 0x00000001
96 #define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
97 #define SE_GROUP_ENABLED 0x00000004
98 #define SE_GROUP_OWNER 0x00000008
99 #define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
100 #define SE_GROUP_LOGON_ID 0xC0000000
101 #define SE_GROUP_RESOURCE 0x20000000 /* Domain Local Group */
103 /* Flags for controlling the behaviour of a particular logon */
105 /* sets LOGON_SERVER_TRUST_ACCOUNT user_flag */
106 #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x00000020
107 #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x00000800
109 /* updates the "logon time" on network logon */
110 #define MSV1_0_UPDATE_LOGON_STATISTICS 0x00000004
112 /* returns the user parameters in the driveletter */
113 #define MSV1_0_RETURN_USER_PARAMETERS 0x00000008
115 /* returns the profilepath in the driveletter and
116 * sets LOGON_PROFILE_PATH_RETURNED user_flag */
117 #define MSV1_0_RETURN_PROFILE_PATH 0x00000200
120 /* I think this is correct - it's what gets parsed on the wire. JRA. */
121 /* NET_USER_INFO_2 */
122 typedef struct net_user_info_2 {
123 uint32 ptr_user_info;
125 NTTIME logon_time; /* logon time */
126 NTTIME logoff_time; /* logoff time */
127 NTTIME kickoff_time; /* kickoff time */
128 NTTIME pass_last_set_time; /* password last set time */
129 NTTIME pass_can_change_time; /* password can change time */
130 NTTIME pass_must_change_time; /* password must change time */
132 UNIHDR hdr_user_name; /* username unicode string header */
133 UNIHDR hdr_full_name; /* user's full name unicode string header */
134 UNIHDR hdr_logon_script; /* logon script unicode string header */
135 UNIHDR hdr_profile_path; /* profile path unicode string header */
136 UNIHDR hdr_home_dir; /* home directory unicode string header */
137 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
139 uint16 logon_count; /* logon count */
140 uint16 bad_pw_count; /* bad password count */
142 uint32 user_id; /* User ID */
143 uint32 group_id; /* Group ID */
144 uint32 num_groups; /* num groups */
145 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
146 uint32 user_flgs; /* user flags */
148 uint8 user_sess_key[16]; /* unused user session key */
150 UNIHDR hdr_logon_srv; /* logon server unicode string header */
151 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
153 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
154 uint8 padding[40]; /* unused padding bytes. expansion room */
156 UNISTR2 uni_user_name; /* username unicode string */
157 UNISTR2 uni_full_name; /* user's full name unicode string */
158 UNISTR2 uni_logon_script; /* logon script unicode string */
159 UNISTR2 uni_profile_path; /* profile path unicode string */
160 UNISTR2 uni_home_dir; /* home directory unicode string */
161 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
163 uint32 num_groups2; /* num groups */
164 DOM_GID *gids; /* group info */
166 UNISTR2 uni_logon_srv; /* logon server unicode string */
167 UNISTR2 uni_logon_dom; /* logon domain unicode string */
169 DOM_SID2 dom_sid; /* domain SID */
171 uint32 num_other_groups; /* other groups */
172 DOM_GID *other_gids; /* group info */
173 DOM_SID2 *other_sids; /* undocumented - domain SIDs */
178 /* NET_USER_INFO_2 */
179 typedef struct net_user_info_2 {
180 uint32 ptr_user_info;
182 NTTIME logon_time; /* logon time */
183 NTTIME logoff_time; /* logoff time */
184 NTTIME kickoff_time; /* kickoff time */
185 NTTIME pass_last_set_time; /* password last set time */
186 NTTIME pass_can_change_time; /* password can change time */
187 NTTIME pass_must_change_time; /* password must change time */
189 UNIHDR hdr_user_name; /* username unicode string header */
190 UNIHDR hdr_full_name; /* user's full name unicode string header */
191 UNIHDR hdr_logon_script; /* logon script unicode string header */
192 UNIHDR hdr_profile_path; /* profile path unicode string header */
193 UNIHDR hdr_home_dir; /* home directory unicode string header */
194 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
196 uint16 logon_count; /* logon count */
197 uint16 bad_pw_count; /* bad password count */
199 uint32 user_rid; /* User RID */
200 uint32 group_rid; /* Group RID */
202 uint32 num_groups; /* num groups */
203 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
204 uint32 user_flgs; /* user flags */
206 uint8 user_sess_key[16]; /* user session key */
208 UNIHDR hdr_logon_srv; /* logon server unicode string header */
209 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
211 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
212 uint8 lm_sess_key[8]; /* lm session key */
213 uint32 acct_flags; /* account flags */
214 uint32 unknown[7]; /* unknown */
216 UNISTR2 uni_user_name; /* username unicode string */
217 UNISTR2 uni_full_name; /* user's full name unicode string */
218 UNISTR2 uni_logon_script; /* logon script unicode string */
219 UNISTR2 uni_profile_path; /* profile path unicode string */
220 UNISTR2 uni_home_dir; /* home directory unicode string */
221 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
223 UNISTR2 uni_logon_srv; /* logon server unicode string */
224 UNISTR2 uni_logon_dom; /* logon domain unicode string */
226 DOM_SID2 dom_sid; /* domain SID */
229 /* NET_USER_INFO_3 */
230 typedef struct net_user_info_3 {
231 uint32 ptr_user_info;
233 NTTIME logon_time; /* logon time */
234 NTTIME logoff_time; /* logoff time */
235 NTTIME kickoff_time; /* kickoff time */
236 NTTIME pass_last_set_time; /* password last set time */
237 NTTIME pass_can_change_time; /* password can change time */
238 NTTIME pass_must_change_time; /* password must change time */
240 UNIHDR hdr_user_name; /* username unicode string header */
241 UNIHDR hdr_full_name; /* user's full name unicode string header */
242 UNIHDR hdr_logon_script; /* logon script unicode string header */
243 UNIHDR hdr_profile_path; /* profile path unicode string header */
244 UNIHDR hdr_home_dir; /* home directory unicode string header */
245 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
247 uint16 logon_count; /* logon count */
248 uint16 bad_pw_count; /* bad password count */
250 uint32 user_rid; /* User RID */
251 uint32 group_rid; /* Group RID */
253 uint32 num_groups; /* num groups */
254 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
255 uint32 user_flgs; /* user flags */
257 uint8 user_sess_key[16]; /* user session key */
259 UNIHDR hdr_logon_srv; /* logon server unicode string header */
260 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
262 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
263 uint8 lm_sess_key[8]; /* lm session key */
264 uint32 acct_flags; /* account flags */
265 uint32 unknown[7]; /* unknown */
267 uint32 num_other_sids; /* number of foreign/trusted domain sids */
268 uint32 buffer_other_sids;
270 /* The next three uint32 are not really part of user_info_3 but here
271 * for parsing convenience. They are only valid in Kerberos PAC
272 * parsing - Guenther */
273 uint32 ptr_res_group_dom_sid;
274 uint32 res_group_count;
275 uint32 ptr_res_groups;
277 UNISTR2 uni_user_name; /* username unicode string */
278 UNISTR2 uni_full_name; /* user's full name unicode string */
279 UNISTR2 uni_logon_script; /* logon script unicode string */
280 UNISTR2 uni_profile_path; /* profile path unicode string */
281 UNISTR2 uni_home_dir; /* home directory unicode string */
282 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
284 uint32 num_groups2; /* num groups */
285 DOM_GID *gids; /* group info */
287 UNISTR2 uni_logon_srv; /* logon server unicode string */
288 UNISTR2 uni_logon_dom; /* logon domain unicode string */
290 DOM_SID2 dom_sid; /* domain SID */
292 DOM_SID2 *other_sids; /* foreign/trusted domain SIDs */
293 uint32 *other_sids_attrib;
297 /* NETLOGON_INFO_1 - pdc status info, i presume */
298 typedef struct netlogon_1_info {
299 uint32 flags; /* 0x0 - undocumented */
300 uint32 pdc_status; /* 0x0 - undocumented */
303 /* NETLOGON_INFO_2 - pdc status info, plus trusted domain info */
304 typedef struct netlogon_2_info {
305 uint32 flags; /* 0x0 - undocumented */
306 uint32 pdc_status; /* 0x0 - undocumented */
307 uint32 ptr_trusted_dc_name; /* pointer to trusted domain controller name */
309 UNISTR2 uni_trusted_dc_name; /* unicode string - trusted dc name */
312 /* NETLOGON_INFO_3 - logon status info, i presume */
313 typedef struct netlogon_3_info {
314 uint32 flags; /* 0x0 - undocumented */
315 uint32 logon_attempts; /* number of logon attempts */
316 uint32 reserved_1; /* 0x0 - undocumented */
317 uint32 reserved_2; /* 0x0 - undocumented */
318 uint32 reserved_3; /* 0x0 - undocumented */
319 uint32 reserved_4; /* 0x0 - undocumented */
320 uint32 reserved_5; /* 0x0 - undocumented */
323 /********************************************************
326 This is generated by a nltest /bdc_query:DOMAIN
328 query_level 0x1, function_code 0x1
330 ********************************************************/
332 /* NET_Q_LOGON_CTRL - LSA Netr Logon Control */
334 typedef struct net_q_logon_ctrl_info {
336 UNISTR2 uni_server_name;
337 uint32 function_code;
341 /* NET_R_LOGON_CTRL - LSA Netr Logon Control */
343 typedef struct net_r_logon_ctrl_info {
348 NETLOGON_INFO_1 info1;
355 typedef struct ctrl_data_info_5 {
356 uint32 function_code;
362 typedef struct ctrl_data_info_6 {
363 uint32 function_code;
370 /********************************************************
373 query_level 0x1 - pdc status
374 query_level 0x3 - number of logon attempts.
376 ********************************************************/
378 /* NET_Q_LOGON_CTRL2 - LSA Netr Logon Control 2 */
379 typedef struct net_q_logon_ctrl2_info {
380 uint32 ptr; /* undocumented buffer pointer */
381 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
383 uint32 function_code;
386 CTRL_DATA_INFO_5 info5;
387 CTRL_DATA_INFO_6 info6;
391 /*******************************************************
392 Logon Control Response
394 switch_value is same as query_level in request
395 *******************************************************/
397 /* NET_R_LOGON_CTRL2 - response to LSA Logon Control2 */
398 typedef struct net_r_logon_ctrl2_info {
399 uint32 switch_value; /* 0x1, 0x3 */
404 NETLOGON_INFO_1 info1;
405 NETLOGON_INFO_2 info2;
406 NETLOGON_INFO_3 info3;
410 NTSTATUS status; /* return code */
413 /* NET_Q_GETANYDCNAME - Ask a DC for a trusted DC name */
415 typedef struct net_q_getanydcname {
416 uint32 ptr_logon_server;
417 UNISTR2 uni_logon_server;
418 uint32 ptr_domainname;
419 UNISTR2 uni_domainname;
420 } NET_Q_GETANYDCNAME;
422 /* NET_R_GETANYDCNAME - Ask a DC for a trusted DC name */
424 typedef struct net_r_getanydcname {
428 } NET_R_GETANYDCNAME;
431 /* NET_Q_GETDCNAME - Ask a DC for a trusted DC name */
433 typedef struct net_q_getdcname {
434 UNISTR2 uni_logon_server;
435 uint32 ptr_domainname;
436 UNISTR2 uni_domainname;
439 /* NET_R_GETDCNAME - Ask a DC for a trusted DC name */
441 typedef struct net_r_getdcname {
447 /* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */
448 typedef struct net_q_trust_dom_info {
449 uint32 ptr; /* undocumented buffer pointer */
450 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
451 } NET_Q_TRUST_DOM_LIST;
453 #define MAX_TRUST_DOMS 1
455 /* NET_R_TRUST_DOM_LIST - response to LSA Trusted Domains */
456 typedef struct net_r_trust_dom_info {
457 UNISTR2 uni_trust_dom_name[MAX_TRUST_DOMS];
459 NTSTATUS status; /* return code */
460 } NET_R_TRUST_DOM_LIST;
464 typedef struct neg_flags_info {
465 uint32 neg_flags; /* negotiated flags */
470 typedef struct net_q_req_chal_info {
471 uint32 undoc_buffer; /* undocumented buffer pointer */
472 UNISTR2 uni_logon_srv; /* logon server unicode string */
473 UNISTR2 uni_logon_clnt; /* logon client unicode string */
474 DOM_CHAL clnt_chal; /* client challenge */
479 typedef struct net_r_req_chal_info {
480 DOM_CHAL srv_chal; /* server challenge */
481 NTSTATUS status; /* return code */
485 typedef struct net_q_auth_info {
486 DOM_LOG_INFO clnt_id; /* client identification info */
487 DOM_CHAL clnt_chal; /* client-calculated credentials */
491 typedef struct net_r_auth_info {
492 DOM_CHAL srv_chal; /* server-calculated credentials */
493 NTSTATUS status; /* return code */
497 typedef struct net_q_auth2_info {
498 DOM_LOG_INFO clnt_id; /* client identification info */
499 DOM_CHAL clnt_chal; /* client-calculated credentials */
501 NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */
506 typedef struct net_r_auth2_info {
507 DOM_CHAL srv_chal; /* server-calculated credentials */
508 NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */
509 NTSTATUS status; /* return code */
513 typedef struct net_q_auth3_info {
514 DOM_LOG_INFO clnt_id; /* client identification info */
515 DOM_CHAL clnt_chal; /* client-calculated credentials */
516 NEG_FLAGS clnt_flgs; /* usually 0x6007 ffff */
520 typedef struct net_r_auth3_info {
521 DOM_CHAL srv_chal; /* server-calculated credentials */
522 NEG_FLAGS srv_flgs; /* usually 0x6007 ffff */
523 uint32 unknown; /* 0x0000045b */
524 NTSTATUS status; /* return code */
528 /* NET_Q_SRV_PWSET */
529 typedef struct net_q_srv_pwset_info {
530 DOM_CLNT_INFO clnt_id; /* client identification/authentication info */
531 uint8 pwd[16]; /* new password - undocumented. */
534 /* NET_R_SRV_PWSET */
535 typedef struct net_r_srv_pwset_info {
536 DOM_CRED srv_cred; /* server-calculated credentials */
538 NTSTATUS status; /* return code */
542 typedef struct net_network_info_2 {
543 uint32 ptr_id_info2; /* pointer to id_info_2 */
544 UNIHDR hdr_domain_name; /* domain name unicode header */
545 uint32 param_ctrl; /* param control (0x2) */
546 DOM_LOGON_ID logon_id; /* logon ID */
547 UNIHDR hdr_user_name; /* user name unicode header */
548 UNIHDR hdr_wksta_name; /* workstation name unicode header */
549 uint8 lm_chal[8]; /* lan manager 8 byte challenge */
550 STRHDR hdr_nt_chal_resp; /* nt challenge response */
551 STRHDR hdr_lm_chal_resp; /* lm challenge response */
553 UNISTR2 uni_domain_name; /* domain name unicode string */
554 UNISTR2 uni_user_name; /* user name unicode string */
555 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
556 STRING2 nt_chal_resp; /* nt challenge response */
557 STRING2 lm_chal_resp; /* lm challenge response */
561 typedef struct id_info_1 {
562 uint32 ptr_id_info1; /* pointer to id_info_1 */
563 UNIHDR hdr_domain_name; /* domain name unicode header */
564 uint32 param_ctrl; /* param control */
565 DOM_LOGON_ID logon_id; /* logon ID */
566 UNIHDR hdr_user_name; /* user name unicode header */
567 UNIHDR hdr_wksta_name; /* workstation name unicode header */
568 OWF_INFO lm_owf; /* LM OWF Password */
569 OWF_INFO nt_owf; /* NT OWF Password */
570 UNISTR2 uni_domain_name; /* domain name unicode string */
571 UNISTR2 uni_user_name; /* user name unicode string */
572 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
575 #define INTERACTIVE_LOGON_TYPE 1
576 #define NET_LOGON_TYPE 2
578 /* NET_ID_INFO_CTR */
579 typedef struct net_id_info_ctr_info {
583 NET_ID_INFO_1 id1; /* auth-level 1 - interactive user login */
584 NET_ID_INFO_2 id2; /* auth-level 2 - workstation referred login */
588 /* SAM_INFO - sam logon/off id structure */
589 typedef struct sam_info {
590 DOM_CLNT_INFO2 client;
591 uint32 ptr_rtn_cred; /* pointer to return credentials */
592 DOM_CRED rtn_cred; /* return credentials */
594 NET_ID_INFO_CTR *ctr;
597 /* SAM_INFO - sam logon/off id structure - no creds */
598 typedef struct sam_info_ex {
601 NET_ID_INFO_CTR *ctr;
604 /* NET_Q_SAM_LOGON */
605 typedef struct net_q_sam_logon_info {
607 uint16 validation_level;
610 /* NET_Q_SAM_LOGON_EX */
611 typedef struct net_q_sam_logon_info_ex {
612 DOM_SAM_INFO_EX sam_id;
613 uint16 validation_level;
615 } NET_Q_SAM_LOGON_EX;
617 /* NET_R_SAM_LOGON */
618 typedef struct net_r_sam_logon_info {
619 uint32 buffer_creds; /* undocumented buffer pointer */
620 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
622 uint16 switch_value; /* 3 - indicates type of USER INFO */
623 NET_USER_INFO_3 *user;
625 uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
627 NTSTATUS status; /* return code */
630 /* NET_R_SAM_LOGON_EX */
631 typedef struct net_r_sam_logon_info_ex {
632 uint16 switch_value; /* 3 - indicates type of USER INFO */
633 NET_USER_INFO_3 *user;
635 uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
638 NTSTATUS status; /* return code */
639 } NET_R_SAM_LOGON_EX;
642 /* NET_Q_SAM_LOGOFF */
643 typedef struct net_q_sam_logoff_info {
647 /* NET_R_SAM_LOGOFF */
648 typedef struct net_r_sam_logoff_info {
649 uint32 buffer_creds; /* undocumented buffer pointer */
650 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
651 NTSTATUS status; /* return code */
655 typedef struct net_q_sam_sync_info {
656 UNISTR2 uni_srv_name; /* \\PDC */
657 UNISTR2 uni_cli_name; /* BDC */
662 uint32 restart_state;
665 uint32 max_size; /* preferred maximum length */
669 typedef struct sam_delta_hdr_info {
670 uint16 type; /* type of structure attached */
679 typedef struct account_lockout_string {
683 /* uint16 *bindata; */
684 uint64 lockout_duration;
686 uint32 bad_attempt_lockout;
690 /* HDR_LOCKOUT_STRING */
691 typedef struct hdr_account_lockout_string {
695 } HDR_LOCKOUT_STRING;
697 /* SAM_DOMAIN_INFO (0x1) */
698 typedef struct sam_domain_info_info {
704 uint16 pwd_history_len;
707 uint64 dom_mod_count;
708 NTTIME creation_time;
709 uint32 security_information;
711 BUFHDR4 hdr_sec_desc; /* security descriptor */
713 HDR_LOCKOUT_STRING hdr_account_lockout;
719 UNISTR2 uni_dom_name;
720 UNISTR2 buf_oem_info;
722 RPC_DATA_BLOB buf_sec_desc;
724 LOCKOUT_STRING account_lockout;
726 UNISTR2 buf_unknown2;
727 UNISTR2 buf_unknown3;
728 UNISTR2 buf_unknown4;
730 uint32 logon_chgpass;
736 /* SAM_GROUP_INFO (0x2) */
737 typedef struct sam_group_info_info {
741 BUFHDR2 hdr_sec_desc; /* security descriptor */
744 UNISTR2 uni_grp_name;
745 UNISTR2 uni_grp_desc;
746 RPC_DATA_BLOB buf_sec_desc;
750 typedef struct sam_passwd_info {
751 /* this structure probably contains password history */
752 /* this is probably a count of lm/nt pairs */
753 uint32 unk_0; /* 0x0000 0002 */
756 uint8 buf_lm_pwd[16];
759 uint8 buf_nt_pwd[16];
765 /* SAM_ACCOUNT_INFO (0x5) */
766 typedef struct sam_account_info_info {
767 UNIHDR hdr_acct_name;
768 UNIHDR hdr_full_name;
774 UNIHDR hdr_dir_drive;
775 UNIHDR hdr_logon_script;
776 UNIHDR hdr_acct_desc;
777 UNIHDR hdr_workstations;
782 uint32 logon_divs; /* 0xA8 */
783 uint32 ptr_logon_hrs;
785 uint16 bad_pwd_count;
787 NTTIME pwd_last_set_time;
788 NTTIME acct_expiry_time;
793 uint8 nt_pwd_present;
794 uint8 lm_pwd_present;
798 UNIHDR hdr_parameters;
802 BUFHDR2 hdr_sec_desc; /* security descriptor */
805 UNIHDR hdr_reserved[3]; /* space for more strings */
806 uint32 dw_reserved[4]; /* space for more data - first two seem to
809 UNISTR2 uni_acct_name;
810 UNISTR2 uni_full_name;
811 UNISTR2 uni_home_dir;
812 UNISTR2 uni_dir_drive;
813 UNISTR2 uni_logon_script;
814 UNISTR2 uni_acct_desc;
815 UNISTR2 uni_workstations;
817 uint32 unknown1; /* 0x4EC */
818 uint32 unknown2; /* 0 */
820 RPC_DATA_BLOB buf_logon_hrs;
822 UNISTR2 uni_parameters;
824 RPC_DATA_BLOB buf_sec_desc;
828 /* SAM_GROUP_MEM_INFO (0x8) */
829 typedef struct sam_group_mem_info_info {
841 } SAM_GROUP_MEM_INFO;
843 /* SAM_ALIAS_INFO (0x9) */
844 typedef struct sam_alias_info_info {
847 BUFHDR2 hdr_sec_desc; /* security descriptor */
851 UNISTR2 uni_als_name;
852 RPC_DATA_BLOB buf_sec_desc;
853 UNISTR2 uni_als_desc;
856 /* SAM_ALIAS_MEM_INFO (0xC) */
857 typedef struct sam_alias_mem_info_info {
865 } SAM_ALIAS_MEM_INFO;
868 /* SAM_DELTA_POLICY (0x0D) */
870 uint32 max_log_size; /* 0x5000 */
871 uint64 audit_retention_period; /* 0 */
872 uint32 auditing_mode; /* 0 */
878 uint32 paged_pool_limit; /* 0x02000000 */
879 uint32 non_paged_pool_limit; /* 0x00100000 */
880 uint32 min_workset_size; /* 0x00010000 */
881 uint32 max_workset_size; /* 0x0f000000 */
882 uint32 page_file_limit; /* 0 */
883 uint64 time_limit; /* 0 */
884 NTTIME modify_time; /* 0x3c*/
885 NTTIME create_time; /* a7080110 */
886 BUFHDR2 hdr_sec_desc;
888 uint32 num_event_audit_options;
889 uint32 event_audit_option;
894 RPC_DATA_BLOB buf_sec_desc;
897 /* SAM_DELTA_TRUST_DOMS */
913 } SAM_DELTA_TRUSTDOMS;
915 /* SAM_DELTA_PRIVS (0x10) */
922 uint32 priv_attr_ptr;
923 uint32 priv_name_ptr;
925 uint32 paged_pool_limit; /* 0x02000000 */
926 uint32 non_paged_pool_limit; /* 0x00100000 */
927 uint32 min_workset_size; /* 0x00010000 */
928 uint32 max_workset_size; /* 0x0f000000 */
929 uint32 page_file_limit; /* 0 */
930 uint64 time_limit; /* 0 */
931 uint32 system_flags; /* 1 */
932 BUFHDR2 hdr_sec_desc;
936 uint32 attribute_count;
939 uint32 privlist_count;
940 UNIHDR *hdr_privslist;
941 UNISTR2 *uni_privslist;
943 RPC_DATA_BLOB buf_sec_desc;
946 /* SAM_DELTA_SECRET */
964 uint32 unknow2; /* 0x0 12 times */
967 uint32 reserved1; /* 0 */
972 uint32 reserved2; /* 0 */
980 /* SAM_DELTA_MOD_COUNT (0x16) */
983 uint32 dom_mod_count_ptr;
984 uint64 dom_mod_count; /* domain mod count at last sync */
985 } SAM_DELTA_MOD_COUNT;
987 typedef union sam_delta_ctr_info {
988 SAM_DOMAIN_INFO domain_info ;
989 SAM_GROUP_INFO group_info ;
990 SAM_ACCOUNT_INFO account_info;
991 SAM_GROUP_MEM_INFO grp_mem_info;
992 SAM_ALIAS_INFO alias_info ;
993 SAM_ALIAS_MEM_INFO als_mem_info;
994 SAM_DELTA_POLICY policy_info;
995 SAM_DELTA_PRIVS privs_info;
996 SAM_DELTA_MOD_COUNT mod_count;
997 SAM_DELTA_TRUSTDOMS trustdoms_info;
998 SAM_DELTA_SECRET secret_info;
1001 /* NET_R_SAM_SYNC */
1002 typedef struct net_r_sam_sync_info {
1005 uint32 sync_context;
1012 SAM_DELTA_HDR *hdr_deltas;
1013 SAM_DELTA_CTR *deltas;
1018 /* NET_Q_SAM_DELTAS */
1019 typedef struct net_q_sam_deltas_info {
1020 UNISTR2 uni_srv_name;
1021 UNISTR2 uni_cli_name;
1026 uint64 dom_mod_count; /* domain mod count at last sync */
1028 uint32 max_size; /* preferred maximum length */
1031 /* NET_R_SAM_DELTAS */
1032 typedef struct net_r_sam_deltas_info {
1035 uint64 dom_mod_count; /* new domain mod count */
1041 SAM_DELTA_HDR *hdr_deltas;
1042 SAM_DELTA_CTR *deltas;
1047 #define DS_FORCE_REDISCOVERY 0x00000001
1048 #define DS_DIRECTORY_SERVICE_REQUIRED 0x00000010
1049 #define DS_DIRECTORY_SERVICE_PREFERRED 0x00000020
1050 #define DS_GC_SERVER_REQUIRED 0x00000040
1051 #define DS_PDC_REQUIRED 0x00000080
1052 #define DS_BACKGROUND_ONLY 0x00000100
1053 #define DS_IP_REQUIRED 0x00000200
1054 #define DS_KDC_REQUIRED 0x00000400
1055 #define DS_TIMESERV_REQUIRED 0x00000800
1056 #define DS_WRITABLE_REQUIRED 0x00001000
1057 #define DS_GOOD_TIMESERV_PREFERRED 0x00002000
1058 #define DS_AVOID_SELF 0x00004000
1059 #define DS_ONLY_LDAP_NEEDED 0x00008000
1061 #define DS_IS_FLAT_NAME 0x00010000
1062 #define DS_IS_DNS_NAME 0x00020000
1064 #define DS_RETURN_DNS_NAME 0x40000000
1065 #define DS_RETURN_FLAT_NAME 0x80000000
1067 #if 0 /* unknown yet */
1068 #define DS_IP_VERSION_AGNOSTIC
1069 #define DS_TRY_NEXTCLOSEST_SITE
1072 #define DSGETDC_VALID_FLAGS ( \
1073 DS_FORCE_REDISCOVERY | \
1074 DS_DIRECTORY_SERVICE_REQUIRED | \
1075 DS_DIRECTORY_SERVICE_PREFERRED | \
1076 DS_GC_SERVER_REQUIRED | \
1078 DS_BACKGROUND_ONLY | \
1081 DS_TIMESERV_REQUIRED | \
1082 DS_WRITABLE_REQUIRED | \
1083 DS_GOOD_TIMESERV_PREFERRED | \
1085 DS_ONLY_LDAP_NEEDED | \
1088 DS_RETURN_FLAT_NAME | \
1089 DS_RETURN_DNS_NAME )
1091 struct DS_DOMAIN_CONTROLLER_INFO {
1092 const char *domain_controller_name;
1093 const char *domain_controller_address;
1094 int32 domain_controller_address_type;
1095 struct GUID *domain_guid;
1096 const char *domain_name;
1097 const char *dns_forest_name;
1099 const char *dc_site_name;
1100 const char *client_site_name;
1103 /* NET_Q_DSR_GETDCNAME */
1104 typedef struct net_q_dsr_getdcname {
1105 uint32 ptr_server_unc;
1106 UNISTR2 uni_server_unc;
1107 uint32 ptr_domain_name;
1108 UNISTR2 uni_domain_name;
1109 uint32 ptr_domain_guid;
1110 struct GUID *domain_guid;
1111 uint32 ptr_site_guid;
1112 struct GUID *site_guid;
1114 } NET_Q_DSR_GETDCNAME;
1116 /* NET_R_DSR_GETDCNAME */
1117 typedef struct net_r_dsr_getdcname {
1120 uint32 ptr_dc_address;
1121 UNISTR2 uni_dc_address;
1122 int32 dc_address_type;
1123 struct GUID domain_guid;
1124 uint32 ptr_domain_name;
1125 UNISTR2 uni_domain_name;
1126 uint32 ptr_forest_name;
1127 UNISTR2 uni_forest_name;
1129 uint32 ptr_dc_site_name;
1130 UNISTR2 uni_dc_site_name;
1131 uint32 ptr_client_site_name;
1132 UNISTR2 uni_client_site_name;
1134 } NET_R_DSR_GETDCNAME;
1136 /* NET_Q_DSR_GETDCNAMEEX */
1137 typedef struct net_q_dsr_getdcnameex {
1138 uint32 ptr_server_unc;
1139 UNISTR2 uni_server_unc;
1140 uint32 ptr_domain_name;
1141 UNISTR2 uni_domain_name;
1142 uint32 ptr_domain_guid;
1143 struct GUID *domain_guid;
1144 uint32 ptr_site_name;
1145 UNISTR2 uni_site_name;
1147 } NET_Q_DSR_GETDCNAMEEX;
1149 /* NET_R_DSR_GETDCNAMEEX */
1150 typedef struct net_r_dsr_getdcnameex NET_R_DSR_GETDCNAMEEX;
1152 /* NET_Q_DSR_GETDCNAMEEX2 */
1153 typedef struct net_q_dsr_getdcnameex2 {
1154 uint32 ptr_server_unc;
1155 UNISTR2 uni_server_unc;
1156 uint32 ptr_client_account;
1157 UNISTR2 uni_client_account;
1159 uint32 ptr_domain_name;
1160 UNISTR2 uni_domain_name;
1161 uint32 ptr_domain_guid;
1162 struct GUID *domain_guid;
1163 uint32 ptr_site_name;
1164 UNISTR2 uni_site_name;
1166 } NET_Q_DSR_GETDCNAMEEX2;
1168 /* NET_R_DSR_GETDCNAMEEX2 */
1169 typedef struct net_r_dsr_getdcnameex2 NET_R_DSR_GETDCNAMEEX2;
1171 /* NET_Q_DSR_GESITENAME */
1172 typedef struct net_q_dsr_getsitename {
1173 uint32 ptr_computer_name;
1174 UNISTR2 uni_computer_name;
1175 } NET_Q_DSR_GETSITENAME;
1177 /* NET_R_DSR_GETSITENAME */
1178 typedef struct net_r_dsr_getsitename {
1179 uint32 ptr_site_name;
1180 UNISTR2 uni_site_name;
1182 } NET_R_DSR_GETSITENAME;
1185 #endif /* _RPC_NETLOGON_H */