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_GETANYDCNAME 0x0b
36 #define NET_LOGON_CTRL 0x0c
37 #define NET_GETDCNAME 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_GETSITENAME 0x1c
45 #define NET_SAMLOGON_EX 0x27
47 /* Returned delta types */
48 #define SAM_DELTA_DOMAIN_INFO 0x01
49 #define SAM_DELTA_GROUP_INFO 0x02
50 #define SAM_DELTA_RENAME_GROUP 0x04
51 #define SAM_DELTA_ACCOUNT_INFO 0x05
52 #define SAM_DELTA_RENAME_USER 0x07
53 #define SAM_DELTA_GROUP_MEM 0x08
54 #define SAM_DELTA_ALIAS_INFO 0x09
55 #define SAM_DELTA_RENAME_ALIAS 0x0b
56 #define SAM_DELTA_ALIAS_MEM 0x0c
57 #define SAM_DELTA_POLICY_INFO 0x0d
58 #define SAM_DELTA_TRUST_DOMS 0x0e
59 #define SAM_DELTA_PRIVS_INFO 0x10 /* DT_DELTA_ACCOUNTS */
60 #define SAM_DELTA_SECRET_INFO 0x12
61 #define SAM_DELTA_DELETE_GROUP 0x14
62 #define SAM_DELTA_DELETE_USER 0x15
63 #define SAM_DELTA_MODIFIED_COUNT 0x16
65 /* flags use when sending a NETLOGON_CONTROL request */
67 #define NETLOGON_CONTROL_SYNC 0x2
68 #define NETLOGON_CONTROL_REDISCOVER 0x5
69 #define NETLOGON_CONTROL_TC_QUERY 0x6
70 #define NETLOGON_CONTROL_TRANSPORT_NOTIFY 0x7
71 #define NETLOGON_CONTROL_SET_DBFLAG 0xfffe
73 /* Some flag values reverse engineered from NLTEST.EXE */
74 /* used in the NETLOGON_CONTROL[2] reply */
76 #define NL_CTRL_IN_SYNC 0x0000
77 #define NL_CTRL_REPL_NEEDED 0x0001
78 #define NL_CTRL_REPL_IN_PROGRESS 0x0002
79 #define NL_CTRL_FULL_SYNC 0x0004
81 #define LOGON_GUEST 0x00000001
82 #define LOGON_NOENCRYPTION 0x00000002
83 #define LOGON_CACHED_ACCOUNT 0x00000004
84 #define LOGON_USED_LM_PASSWORD 0x00000008
85 #define LOGON_EXTRA_SIDS 0x00000020
86 #define LOGON_SUBAUTH_SESSION_KEY 0x00000040
87 #define LOGON_SERVER_TRUST_ACCOUNT 0x00000080
88 #define LOGON_NTLMV2_ENABLED 0x00000100
89 #define LOGON_RESOURCE_GROUPS 0x00000200
90 #define LOGON_PROFILE_PATH_RETURNED 0x00000400
91 #define LOGON_GRACE_LOGON 0x01000000
93 #define SE_GROUP_MANDATORY 0x00000001
94 #define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
95 #define SE_GROUP_ENABLED 0x00000004
96 #define SE_GROUP_OWNER 0x00000008
97 #define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
98 #define SE_GROUP_LOGON_ID 0xC0000000
99 #define SE_GROUP_RESOURCE 0x20000000
101 /* Flags for controlling the behaviour of a particular logon */
103 /* sets LOGON_SERVER_TRUST_ACCOUNT user_flag */
104 #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x00000020
105 #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x00000800
107 /* updates the "logon time" on network logon */
108 #define MSV1_0_UPDATE_LOGON_STATISTICS 0x00000004
110 /* returns the user parameters in the driveletter */
111 #define MSV1_0_RETURN_USER_PARAMETERS 0x00000008
113 /* returns the profilepath in the driveletter and
114 * sets LOGON_PROFILE_PATH_RETURNED user_flag */
115 #define MSV1_0_RETURN_PROFILE_PATH 0x00000200
118 /* I think this is correct - it's what gets parsed on the wire. JRA. */
119 /* NET_USER_INFO_2 */
120 typedef struct net_user_info_2 {
121 uint32 ptr_user_info;
123 NTTIME logon_time; /* logon time */
124 NTTIME logoff_time; /* logoff time */
125 NTTIME kickoff_time; /* kickoff time */
126 NTTIME pass_last_set_time; /* password last set time */
127 NTTIME pass_can_change_time; /* password can change time */
128 NTTIME pass_must_change_time; /* password must change time */
130 UNIHDR hdr_user_name; /* username unicode string header */
131 UNIHDR hdr_full_name; /* user's full name unicode string header */
132 UNIHDR hdr_logon_script; /* logon script unicode string header */
133 UNIHDR hdr_profile_path; /* profile path unicode string header */
134 UNIHDR hdr_home_dir; /* home directory unicode string header */
135 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
137 uint16 logon_count; /* logon count */
138 uint16 bad_pw_count; /* bad password count */
140 uint32 user_id; /* User ID */
141 uint32 group_id; /* Group ID */
142 uint32 num_groups; /* num groups */
143 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
144 uint32 user_flgs; /* user flags */
146 uint8 user_sess_key[16]; /* unused user session key */
148 UNIHDR hdr_logon_srv; /* logon server unicode string header */
149 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
151 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
152 uint8 padding[40]; /* unused padding bytes. expansion room */
154 UNISTR2 uni_user_name; /* username unicode string */
155 UNISTR2 uni_full_name; /* user's full name unicode string */
156 UNISTR2 uni_logon_script; /* logon script unicode string */
157 UNISTR2 uni_profile_path; /* profile path unicode string */
158 UNISTR2 uni_home_dir; /* home directory unicode string */
159 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
161 uint32 num_groups2; /* num groups */
162 DOM_GID *gids; /* group info */
164 UNISTR2 uni_logon_srv; /* logon server unicode string */
165 UNISTR2 uni_logon_dom; /* logon domain unicode string */
167 DOM_SID2 dom_sid; /* domain SID */
169 uint32 num_other_groups; /* other groups */
170 DOM_GID *other_gids; /* group info */
171 DOM_SID2 *other_sids; /* undocumented - domain SIDs */
176 /* NET_USER_INFO_2 */
177 typedef struct net_user_info_2 {
178 uint32 ptr_user_info;
180 NTTIME logon_time; /* logon time */
181 NTTIME logoff_time; /* logoff time */
182 NTTIME kickoff_time; /* kickoff time */
183 NTTIME pass_last_set_time; /* password last set time */
184 NTTIME pass_can_change_time; /* password can change time */
185 NTTIME pass_must_change_time; /* password must change time */
187 UNIHDR hdr_user_name; /* username unicode string header */
188 UNIHDR hdr_full_name; /* user's full name unicode string header */
189 UNIHDR hdr_logon_script; /* logon script unicode string header */
190 UNIHDR hdr_profile_path; /* profile path unicode string header */
191 UNIHDR hdr_home_dir; /* home directory unicode string header */
192 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
194 uint16 logon_count; /* logon count */
195 uint16 bad_pw_count; /* bad password count */
197 uint32 user_rid; /* User RID */
198 uint32 group_rid; /* Group RID */
200 uint32 num_groups; /* num groups */
201 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
202 uint32 user_flgs; /* user flags */
204 uint8 user_sess_key[16]; /* user session key */
206 UNIHDR hdr_logon_srv; /* logon server unicode string header */
207 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
209 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
210 uint8 lm_sess_key[8]; /* lm session key */
211 uint32 acct_flags; /* account flags */
212 uint32 unknown[7]; /* unknown */
214 UNISTR2 uni_user_name; /* username unicode string */
215 UNISTR2 uni_full_name; /* user's full name unicode string */
216 UNISTR2 uni_logon_script; /* logon script unicode string */
217 UNISTR2 uni_profile_path; /* profile path unicode string */
218 UNISTR2 uni_home_dir; /* home directory unicode string */
219 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
221 UNISTR2 uni_logon_srv; /* logon server unicode string */
222 UNISTR2 uni_logon_dom; /* logon domain unicode string */
224 DOM_SID2 dom_sid; /* domain SID */
227 /* NET_USER_INFO_3 */
228 typedef struct net_user_info_3 {
229 uint32 ptr_user_info;
231 NTTIME logon_time; /* logon time */
232 NTTIME logoff_time; /* logoff time */
233 NTTIME kickoff_time; /* kickoff time */
234 NTTIME pass_last_set_time; /* password last set time */
235 NTTIME pass_can_change_time; /* password can change time */
236 NTTIME pass_must_change_time; /* password must change time */
238 UNIHDR hdr_user_name; /* username unicode string header */
239 UNIHDR hdr_full_name; /* user's full name unicode string header */
240 UNIHDR hdr_logon_script; /* logon script unicode string header */
241 UNIHDR hdr_profile_path; /* profile path unicode string header */
242 UNIHDR hdr_home_dir; /* home directory unicode string header */
243 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
245 uint16 logon_count; /* logon count */
246 uint16 bad_pw_count; /* bad password count */
248 uint32 user_rid; /* User RID */
249 uint32 group_rid; /* Group RID */
251 uint32 num_groups; /* num groups */
252 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
253 uint32 user_flgs; /* user flags */
255 uint8 user_sess_key[16]; /* user session key */
257 UNIHDR hdr_logon_srv; /* logon server unicode string header */
258 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
260 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
261 uint8 lm_sess_key[8]; /* lm session key */
262 uint32 acct_flags; /* account flags */
263 uint32 unknown[7]; /* unknown */
265 uint32 num_other_sids; /* number of foreign/trusted domain sids */
266 uint32 buffer_other_sids;
268 /* The next three uint32 are not really part of user_info_3 but here
269 * for parsing convenience. They are only valid in Kerberos PAC
270 * parsing - Guenther */
271 uint32 ptr_res_group_dom_sid;
272 uint32 res_group_count;
273 uint32 ptr_res_groups;
275 UNISTR2 uni_user_name; /* username unicode string */
276 UNISTR2 uni_full_name; /* user's full name unicode string */
277 UNISTR2 uni_logon_script; /* logon script unicode string */
278 UNISTR2 uni_profile_path; /* profile path unicode string */
279 UNISTR2 uni_home_dir; /* home directory unicode string */
280 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
282 uint32 num_groups2; /* num groups */
283 DOM_GID *gids; /* group info */
285 UNISTR2 uni_logon_srv; /* logon server unicode string */
286 UNISTR2 uni_logon_dom; /* logon domain unicode string */
288 DOM_SID2 dom_sid; /* domain SID */
290 DOM_SID2 *other_sids; /* foreign/trusted domain SIDs */
291 uint32 *other_sids_attrib;
295 /* NETLOGON_INFO_1 - pdc status info, i presume */
296 typedef struct netlogon_1_info {
297 uint32 flags; /* 0x0 - undocumented */
298 uint32 pdc_status; /* 0x0 - undocumented */
301 /* NETLOGON_INFO_2 - pdc status info, plus trusted domain info */
302 typedef struct netlogon_2_info {
303 uint32 flags; /* 0x0 - undocumented */
304 uint32 pdc_status; /* 0x0 - undocumented */
305 uint32 ptr_trusted_dc_name; /* pointer to trusted domain controller name */
307 UNISTR2 uni_trusted_dc_name; /* unicode string - trusted dc name */
310 /* NETLOGON_INFO_3 - logon status info, i presume */
311 typedef struct netlogon_3_info {
312 uint32 flags; /* 0x0 - undocumented */
313 uint32 logon_attempts; /* number of logon attempts */
314 uint32 reserved_1; /* 0x0 - undocumented */
315 uint32 reserved_2; /* 0x0 - undocumented */
316 uint32 reserved_3; /* 0x0 - undocumented */
317 uint32 reserved_4; /* 0x0 - undocumented */
318 uint32 reserved_5; /* 0x0 - undocumented */
321 /********************************************************
324 This is generated by a nltest /bdc_query:DOMAIN
326 query_level 0x1, function_code 0x1
328 ********************************************************/
330 /* NET_Q_LOGON_CTRL - LSA Netr Logon Control */
332 typedef struct net_q_logon_ctrl_info {
334 UNISTR2 uni_server_name;
335 uint32 function_code;
339 /* NET_R_LOGON_CTRL - LSA Netr Logon Control */
341 typedef struct net_r_logon_ctrl_info {
346 NETLOGON_INFO_1 info1;
353 typedef struct ctrl_data_info_5 {
354 uint32 function_code;
360 typedef struct ctrl_data_info_6 {
361 uint32 function_code;
368 /********************************************************
371 query_level 0x1 - pdc status
372 query_level 0x3 - number of logon attempts.
374 ********************************************************/
376 /* NET_Q_LOGON_CTRL2 - LSA Netr Logon Control 2 */
377 typedef struct net_q_logon_ctrl2_info {
378 uint32 ptr; /* undocumented buffer pointer */
379 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
381 uint32 function_code;
384 CTRL_DATA_INFO_5 info5;
385 CTRL_DATA_INFO_6 info6;
389 /*******************************************************
390 Logon Control Response
392 switch_value is same as query_level in request
393 *******************************************************/
395 /* NET_R_LOGON_CTRL2 - response to LSA Logon Control2 */
396 typedef struct net_r_logon_ctrl2_info {
397 uint32 switch_value; /* 0x1, 0x3 */
402 NETLOGON_INFO_1 info1;
403 NETLOGON_INFO_2 info2;
404 NETLOGON_INFO_3 info3;
408 NTSTATUS status; /* return code */
411 /* NET_Q_GETDCNAME - Ask a DC for a trusted DC name */
413 typedef struct net_q_getdcname {
414 uint32 ptr_logon_server;
415 UNISTR2 uni_logon_server;
416 uint32 ptr_domainname;
417 UNISTR2 uni_domainname;
420 /* NET_R_GETDCNAME - Ask a DC for a trusted DC name */
422 typedef struct net_r_getdcname {
429 /* NET_Q_GETANYDCNAME - Ask a DC for a trusted DC name */
431 typedef struct net_q_getanydcname {
432 UNISTR2 uni_logon_server;
433 uint32 ptr_domainname;
434 UNISTR2 uni_domainname;
435 } NET_Q_GETANYDCNAME;
437 /* NET_R_GETANYDCNAME - Ask a DC for a trusted DC name */
439 typedef struct net_r_getanydcname {
443 } NET_R_GETANYDCNAME;
445 /* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */
446 typedef struct net_q_trust_dom_info {
447 uint32 ptr; /* undocumented buffer pointer */
448 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
449 } NET_Q_TRUST_DOM_LIST;
451 #define MAX_TRUST_DOMS 1
453 /* NET_R_TRUST_DOM_LIST - response to LSA Trusted Domains */
454 typedef struct net_r_trust_dom_info {
455 UNISTR2 uni_trust_dom_name[MAX_TRUST_DOMS];
457 NTSTATUS status; /* return code */
458 } NET_R_TRUST_DOM_LIST;
462 typedef struct neg_flags_info {
463 uint32 neg_flags; /* negotiated flags */
468 typedef struct net_q_req_chal_info {
469 uint32 undoc_buffer; /* undocumented buffer pointer */
470 UNISTR2 uni_logon_srv; /* logon server unicode string */
471 UNISTR2 uni_logon_clnt; /* logon client unicode string */
472 DOM_CHAL clnt_chal; /* client challenge */
477 typedef struct net_r_req_chal_info {
478 DOM_CHAL srv_chal; /* server challenge */
479 NTSTATUS status; /* return code */
483 typedef struct net_q_auth_info {
484 DOM_LOG_INFO clnt_id; /* client identification info */
485 DOM_CHAL clnt_chal; /* client-calculated credentials */
489 typedef struct net_r_auth_info {
490 DOM_CHAL srv_chal; /* server-calculated credentials */
491 NTSTATUS status; /* return code */
495 typedef struct net_q_auth2_info {
496 DOM_LOG_INFO clnt_id; /* client identification info */
497 DOM_CHAL clnt_chal; /* client-calculated credentials */
499 NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */
504 typedef struct net_r_auth2_info {
505 DOM_CHAL srv_chal; /* server-calculated credentials */
506 NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */
507 NTSTATUS status; /* return code */
511 typedef struct net_q_auth3_info {
512 DOM_LOG_INFO clnt_id; /* client identification info */
513 DOM_CHAL clnt_chal; /* client-calculated credentials */
514 NEG_FLAGS clnt_flgs; /* usually 0x6007 ffff */
518 typedef struct net_r_auth3_info {
519 DOM_CHAL srv_chal; /* server-calculated credentials */
520 NEG_FLAGS srv_flgs; /* usually 0x6007 ffff */
521 uint32 unknown; /* 0x0000045b */
522 NTSTATUS status; /* return code */
526 /* NET_Q_SRV_PWSET */
527 typedef struct net_q_srv_pwset_info {
528 DOM_CLNT_INFO clnt_id; /* client identification/authentication info */
529 uint8 pwd[16]; /* new password - undocumented. */
532 /* NET_R_SRV_PWSET */
533 typedef struct net_r_srv_pwset_info {
534 DOM_CRED srv_cred; /* server-calculated credentials */
536 NTSTATUS status; /* return code */
540 typedef struct net_network_info_2 {
541 uint32 ptr_id_info2; /* pointer to id_info_2 */
542 UNIHDR hdr_domain_name; /* domain name unicode header */
543 uint32 param_ctrl; /* param control (0x2) */
544 DOM_LOGON_ID logon_id; /* logon ID */
545 UNIHDR hdr_user_name; /* user name unicode header */
546 UNIHDR hdr_wksta_name; /* workstation name unicode header */
547 uint8 lm_chal[8]; /* lan manager 8 byte challenge */
548 STRHDR hdr_nt_chal_resp; /* nt challenge response */
549 STRHDR hdr_lm_chal_resp; /* lm challenge response */
551 UNISTR2 uni_domain_name; /* domain name unicode string */
552 UNISTR2 uni_user_name; /* user name unicode string */
553 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
554 STRING2 nt_chal_resp; /* nt challenge response */
555 STRING2 lm_chal_resp; /* lm challenge response */
559 typedef struct id_info_1 {
560 uint32 ptr_id_info1; /* pointer to id_info_1 */
561 UNIHDR hdr_domain_name; /* domain name unicode header */
562 uint32 param_ctrl; /* param control */
563 DOM_LOGON_ID logon_id; /* logon ID */
564 UNIHDR hdr_user_name; /* user name unicode header */
565 UNIHDR hdr_wksta_name; /* workstation name unicode header */
566 OWF_INFO lm_owf; /* LM OWF Password */
567 OWF_INFO nt_owf; /* NT OWF Password */
568 UNISTR2 uni_domain_name; /* domain name unicode string */
569 UNISTR2 uni_user_name; /* user name unicode string */
570 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
573 #define INTERACTIVE_LOGON_TYPE 1
574 #define NET_LOGON_TYPE 2
576 /* NET_ID_INFO_CTR */
577 typedef struct net_id_info_ctr_info {
581 NET_ID_INFO_1 id1; /* auth-level 1 - interactive user login */
582 NET_ID_INFO_2 id2; /* auth-level 2 - workstation referred login */
586 /* SAM_INFO - sam logon/off id structure */
587 typedef struct sam_info {
588 DOM_CLNT_INFO2 client;
589 uint32 ptr_rtn_cred; /* pointer to return credentials */
590 DOM_CRED rtn_cred; /* return credentials */
592 NET_ID_INFO_CTR *ctr;
595 /* SAM_INFO - sam logon/off id structure - no creds */
596 typedef struct sam_info_ex {
599 NET_ID_INFO_CTR *ctr;
602 /* NET_Q_SAM_LOGON */
603 typedef struct net_q_sam_logon_info {
605 uint16 validation_level;
608 /* NET_Q_SAM_LOGON_EX */
609 typedef struct net_q_sam_logon_info_ex {
610 DOM_SAM_INFO_EX sam_id;
611 uint16 validation_level;
613 } NET_Q_SAM_LOGON_EX;
615 /* NET_R_SAM_LOGON */
616 typedef struct net_r_sam_logon_info {
617 uint32 buffer_creds; /* undocumented buffer pointer */
618 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
620 uint16 switch_value; /* 3 - indicates type of USER INFO */
621 NET_USER_INFO_3 *user;
623 uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
625 NTSTATUS status; /* return code */
628 /* NET_R_SAM_LOGON_EX */
629 typedef struct net_r_sam_logon_info_ex {
630 uint16 switch_value; /* 3 - indicates type of USER INFO */
631 NET_USER_INFO_3 *user;
633 uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
636 NTSTATUS status; /* return code */
637 } NET_R_SAM_LOGON_EX;
640 /* NET_Q_SAM_LOGOFF */
641 typedef struct net_q_sam_logoff_info {
645 /* NET_R_SAM_LOGOFF */
646 typedef struct net_r_sam_logoff_info {
647 uint32 buffer_creds; /* undocumented buffer pointer */
648 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
649 NTSTATUS status; /* return code */
653 typedef struct net_q_sam_sync_info {
654 UNISTR2 uni_srv_name; /* \\PDC */
655 UNISTR2 uni_cli_name; /* BDC */
660 uint32 restart_state;
663 uint32 max_size; /* preferred maximum length */
667 typedef struct sam_delta_hdr_info {
668 uint16 type; /* type of structure attached */
677 typedef struct account_lockout_string {
681 /* uint16 *bindata; */
682 uint64 lockout_duration;
684 uint32 bad_attempt_lockout;
688 /* HDR_LOCKOUT_STRING */
689 typedef struct hdr_account_lockout_string {
693 } HDR_LOCKOUT_STRING;
695 /* SAM_DOMAIN_INFO (0x1) */
696 typedef struct sam_domain_info_info {
702 uint16 pwd_history_len;
705 uint64 dom_mod_count;
706 NTTIME creation_time;
707 uint32 security_information;
709 BUFHDR4 hdr_sec_desc; /* security descriptor */
711 HDR_LOCKOUT_STRING hdr_account_lockout;
717 UNISTR2 uni_dom_name;
718 UNISTR2 buf_oem_info;
720 RPC_DATA_BLOB buf_sec_desc;
722 LOCKOUT_STRING account_lockout;
724 UNISTR2 buf_unknown2;
725 UNISTR2 buf_unknown3;
726 UNISTR2 buf_unknown4;
728 uint32 logon_chgpass;
734 /* SAM_GROUP_INFO (0x2) */
735 typedef struct sam_group_info_info {
739 BUFHDR2 hdr_sec_desc; /* security descriptor */
742 UNISTR2 uni_grp_name;
743 UNISTR2 uni_grp_desc;
744 RPC_DATA_BLOB buf_sec_desc;
748 typedef struct sam_passwd_info {
749 /* this structure probably contains password history */
750 /* this is probably a count of lm/nt pairs */
751 uint32 unk_0; /* 0x0000 0002 */
754 uint8 buf_lm_pwd[16];
757 uint8 buf_nt_pwd[16];
763 /* SAM_ACCOUNT_INFO (0x5) */
764 typedef struct sam_account_info_info {
765 UNIHDR hdr_acct_name;
766 UNIHDR hdr_full_name;
772 UNIHDR hdr_dir_drive;
773 UNIHDR hdr_logon_script;
774 UNIHDR hdr_acct_desc;
775 UNIHDR hdr_workstations;
780 uint32 logon_divs; /* 0xA8 */
781 uint32 ptr_logon_hrs;
783 uint16 bad_pwd_count;
785 NTTIME pwd_last_set_time;
786 NTTIME acct_expiry_time;
791 uint8 nt_pwd_present;
792 uint8 lm_pwd_present;
796 UNIHDR hdr_parameters;
800 BUFHDR2 hdr_sec_desc; /* security descriptor */
803 UNIHDR hdr_reserved[3]; /* space for more strings */
804 uint32 dw_reserved[4]; /* space for more data - first two seem to
807 UNISTR2 uni_acct_name;
808 UNISTR2 uni_full_name;
809 UNISTR2 uni_home_dir;
810 UNISTR2 uni_dir_drive;
811 UNISTR2 uni_logon_script;
812 UNISTR2 uni_acct_desc;
813 UNISTR2 uni_workstations;
815 uint32 unknown1; /* 0x4EC */
816 uint32 unknown2; /* 0 */
818 RPC_DATA_BLOB buf_logon_hrs;
820 UNISTR2 uni_parameters;
822 RPC_DATA_BLOB buf_sec_desc;
826 /* SAM_GROUP_MEM_INFO (0x8) */
827 typedef struct sam_group_mem_info_info {
839 } SAM_GROUP_MEM_INFO;
841 /* SAM_ALIAS_INFO (0x9) */
842 typedef struct sam_alias_info_info {
845 BUFHDR2 hdr_sec_desc; /* security descriptor */
849 UNISTR2 uni_als_name;
850 RPC_DATA_BLOB buf_sec_desc;
851 UNISTR2 uni_als_desc;
854 /* SAM_ALIAS_MEM_INFO (0xC) */
855 typedef struct sam_alias_mem_info_info {
863 } SAM_ALIAS_MEM_INFO;
866 /* SAM_DELTA_POLICY (0x0D) */
868 uint32 max_log_size; /* 0x5000 */
869 uint64 audit_retention_period; /* 0 */
870 uint32 auditing_mode; /* 0 */
876 uint32 paged_pool_limit; /* 0x02000000 */
877 uint32 non_paged_pool_limit; /* 0x00100000 */
878 uint32 min_workset_size; /* 0x00010000 */
879 uint32 max_workset_size; /* 0x0f000000 */
880 uint32 page_file_limit; /* 0 */
881 uint64 time_limit; /* 0 */
882 NTTIME modify_time; /* 0x3c*/
883 NTTIME create_time; /* a7080110 */
884 BUFHDR2 hdr_sec_desc;
886 uint32 num_event_audit_options;
887 uint32 event_audit_option;
892 RPC_DATA_BLOB buf_sec_desc;
895 /* SAM_DELTA_TRUST_DOMS */
911 } SAM_DELTA_TRUSTDOMS;
913 /* SAM_DELTA_PRIVS (0x10) */
920 uint32 priv_attr_ptr;
921 uint32 priv_name_ptr;
923 uint32 paged_pool_limit; /* 0x02000000 */
924 uint32 non_paged_pool_limit; /* 0x00100000 */
925 uint32 min_workset_size; /* 0x00010000 */
926 uint32 max_workset_size; /* 0x0f000000 */
927 uint32 page_file_limit; /* 0 */
928 uint64 time_limit; /* 0 */
929 uint32 system_flags; /* 1 */
930 BUFHDR2 hdr_sec_desc;
934 uint32 attribute_count;
937 uint32 privlist_count;
938 UNIHDR *hdr_privslist;
939 UNISTR2 *uni_privslist;
941 RPC_DATA_BLOB buf_sec_desc;
944 /* SAM_DELTA_SECRET */
962 uint32 unknow2; /* 0x0 12 times */
965 uint32 reserved1; /* 0 */
970 uint32 reserved2; /* 0 */
978 /* SAM_DELTA_MOD_COUNT (0x16) */
981 uint32 dom_mod_count_ptr;
982 uint64 dom_mod_count; /* domain mod count at last sync */
983 } SAM_DELTA_MOD_COUNT;
985 typedef union sam_delta_ctr_info {
986 SAM_DOMAIN_INFO domain_info ;
987 SAM_GROUP_INFO group_info ;
988 SAM_ACCOUNT_INFO account_info;
989 SAM_GROUP_MEM_INFO grp_mem_info;
990 SAM_ALIAS_INFO alias_info ;
991 SAM_ALIAS_MEM_INFO als_mem_info;
992 SAM_DELTA_POLICY policy_info;
993 SAM_DELTA_PRIVS privs_info;
994 SAM_DELTA_MOD_COUNT mod_count;
995 SAM_DELTA_TRUSTDOMS trustdoms_info;
996 SAM_DELTA_SECRET secret_info;
1000 typedef struct net_r_sam_sync_info {
1003 uint32 sync_context;
1010 SAM_DELTA_HDR *hdr_deltas;
1011 SAM_DELTA_CTR *deltas;
1016 /* NET_Q_SAM_DELTAS */
1017 typedef struct net_q_sam_deltas_info {
1018 UNISTR2 uni_srv_name;
1019 UNISTR2 uni_cli_name;
1024 uint64 dom_mod_count; /* domain mod count at last sync */
1026 uint32 max_size; /* preferred maximum length */
1029 /* NET_R_SAM_DELTAS */
1030 typedef struct net_r_sam_deltas_info {
1033 uint64 dom_mod_count; /* new domain mod count */
1039 SAM_DELTA_HDR *hdr_deltas;
1040 SAM_DELTA_CTR *deltas;
1045 /* NET_Q_DSR_GETDCNAME - Ask a DC for a trusted DC name and its address */
1046 typedef struct net_q_dsr_getdcname {
1047 uint32 ptr_server_unc;
1048 UNISTR2 uni_server_unc;
1049 uint32 ptr_domain_name;
1050 UNISTR2 uni_domain_name;
1051 uint32 ptr_domain_guid;
1052 struct GUID *domain_guid;
1053 uint32 ptr_site_guid;
1054 struct GUID *site_guid;
1056 } NET_Q_DSR_GETDCNAME;
1058 /* NET_R_DSR_GETDCNAME - Ask a DC for a trusted DC name and its address */
1059 typedef struct net_r_dsr_getdcname {
1062 uint32 ptr_dc_address;
1063 UNISTR2 uni_dc_address;
1064 int32 dc_address_type;
1065 struct GUID domain_guid;
1066 uint32 ptr_domain_name;
1067 UNISTR2 uni_domain_name;
1068 uint32 ptr_forest_name;
1069 UNISTR2 uni_forest_name;
1071 uint32 ptr_dc_site_name;
1072 UNISTR2 uni_dc_site_name;
1073 uint32 ptr_client_site_name;
1074 UNISTR2 uni_client_site_name;
1076 } NET_R_DSR_GETDCNAME;
1078 /* NET_Q_DSR_GESITENAME */
1079 typedef struct net_q_dsr_getsitename {
1080 uint32 ptr_computer_name;
1081 UNISTR2 uni_computer_name;
1082 } NET_Q_DSR_GETSITENAME;
1084 /* NET_R_DSR_GETSITENAME */
1085 typedef struct net_r_dsr_getsitename {
1086 uint32 ptr_site_name;
1087 UNISTR2 uni_site_name;
1089 } NET_R_DSR_GETSITENAME;
1092 #endif /* _RPC_NETLOGON_H */