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_LOGON_CTRL 0x0c
36 #define NET_GETDCNAME 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_GETSITENAME 0x1c
44 #define NET_SAMLOGON_EX 0x27
46 /* Secure Channel types. used in NetrServerAuthenticate negotiation */
47 #define SEC_CHAN_WKSTA 2
48 #define SEC_CHAN_DOMAIN 4
49 #define SEC_CHAN_BDC 6
51 /* Returned delta types */
52 #define SAM_DELTA_DOMAIN_INFO 0x01
53 #define SAM_DELTA_GROUP_INFO 0x02
54 #define SAM_DELTA_RENAME_GROUP 0x04
55 #define SAM_DELTA_ACCOUNT_INFO 0x05
56 #define SAM_DELTA_RENAME_USER 0x07
57 #define SAM_DELTA_GROUP_MEM 0x08
58 #define SAM_DELTA_ALIAS_INFO 0x09
59 #define SAM_DELTA_RENAME_ALIAS 0x0b
60 #define SAM_DELTA_ALIAS_MEM 0x0c
61 #define SAM_DELTA_POLICY_INFO 0x0d
62 #define SAM_DELTA_TRUST_DOMS 0x0e
63 #define SAM_DELTA_PRIVS_INFO 0x10 /* DT_DELTA_ACCOUNTS */
64 #define SAM_DELTA_SECRET_INFO 0x12
65 #define SAM_DELTA_DELETE_GROUP 0x14
66 #define SAM_DELTA_DELETE_USER 0x15
67 #define SAM_DELTA_MODIFIED_COUNT 0x16
69 /* SAM database types */
70 #define SAM_DATABASE_DOMAIN 0x00 /* Domain users and groups */
71 #define SAM_DATABASE_BUILTIN 0x01 /* BUILTIN users and groups */
72 #define SAM_DATABASE_PRIVS 0x02 /* Privileges */
74 /* flags use when sending a NETLOGON_CONTROL request */
76 #define NETLOGON_CONTROL_SYNC 0x2
77 #define NETLOGON_CONTROL_REDISCOVER 0x5
78 #define NETLOGON_CONTROL_TC_QUERY 0x6
79 #define NETLOGON_CONTROL_TRANSPORT_NOTIFY 0x7
80 #define NETLOGON_CONTROL_SET_DBFLAG 0xfffe
82 /* Some flag values reverse engineered from NLTEST.EXE */
83 /* used in the NETLOGON_CONTROL[2] reply */
85 #define NL_CTRL_IN_SYNC 0x0000
86 #define NL_CTRL_REPL_NEEDED 0x0001
87 #define NL_CTRL_REPL_IN_PROGRESS 0x0002
88 #define NL_CTRL_FULL_SYNC 0x0004
90 #define LOGON_GUEST 0x00000001
91 #define LOGON_NOENCRYPTION 0x00000002
92 #define LOGON_CACHED_ACCOUNT 0x00000004
93 #define LOGON_USED_LM_PASSWORD 0x00000008
94 #define LOGON_EXTRA_SIDS 0x00000020
95 #define LOGON_SUBAUTH_SESSION_KEY 0x00000040
96 #define LOGON_SERVER_TRUST_ACCOUNT 0x00000080
97 #define LOGON_NTLMV2_ENABLED 0x00000100
98 #define LOGON_RESOURCE_GROUPS 0x00000200
99 #define LOGON_PROFILE_PATH_RETURNED 0x00000400
100 #define LOGON_GRACE_LOGON 0x01000000
102 #define SE_GROUP_MANDATORY 0x00000001
103 #define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
104 #define SE_GROUP_ENABLED 0x00000004
105 #define SE_GROUP_OWNER 0x00000008
106 #define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
107 #define SE_GROUP_LOGON_ID 0xC0000000
108 #define SE_GROUP_RESOURCE 0x20000000
110 /* Flags for controlling the behaviour of a particular logon */
111 #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT ( 0x020 )
112 #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT ( 0x800 )
115 /* I think this is correct - it's what gets parsed on the wire. JRA. */
116 /* NET_USER_INFO_2 */
117 typedef struct net_user_info_2 {
118 uint32 ptr_user_info;
120 NTTIME logon_time; /* logon time */
121 NTTIME logoff_time; /* logoff time */
122 NTTIME kickoff_time; /* kickoff time */
123 NTTIME pass_last_set_time; /* password last set time */
124 NTTIME pass_can_change_time; /* password can change time */
125 NTTIME pass_must_change_time; /* password must change time */
127 UNIHDR hdr_user_name; /* username unicode string header */
128 UNIHDR hdr_full_name; /* user's full name unicode string header */
129 UNIHDR hdr_logon_script; /* logon script unicode string header */
130 UNIHDR hdr_profile_path; /* profile path unicode string header */
131 UNIHDR hdr_home_dir; /* home directory unicode string header */
132 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
134 uint16 logon_count; /* logon count */
135 uint16 bad_pw_count; /* bad password count */
137 uint32 user_id; /* User ID */
138 uint32 group_id; /* Group ID */
139 uint32 num_groups; /* num groups */
140 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
141 uint32 user_flgs; /* user flags */
143 uint8 user_sess_key[16]; /* unused user session key */
145 UNIHDR hdr_logon_srv; /* logon server unicode string header */
146 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
148 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
149 uint8 padding[40]; /* unused padding bytes. expansion room */
151 UNISTR2 uni_user_name; /* username unicode string */
152 UNISTR2 uni_full_name; /* user's full name unicode string */
153 UNISTR2 uni_logon_script; /* logon script unicode string */
154 UNISTR2 uni_profile_path; /* profile path unicode string */
155 UNISTR2 uni_home_dir; /* home directory unicode string */
156 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
158 uint32 num_groups2; /* num groups */
159 DOM_GID *gids; /* group info */
161 UNISTR2 uni_logon_srv; /* logon server unicode string */
162 UNISTR2 uni_logon_dom; /* logon domain unicode string */
164 DOM_SID2 dom_sid; /* domain SID */
166 uint32 num_other_groups; /* other groups */
167 DOM_GID *other_gids; /* group info */
168 DOM_SID2 *other_sids; /* undocumented - domain SIDs */
173 /* NET_USER_INFO_2 */
174 typedef struct net_user_info_2 {
175 uint32 ptr_user_info;
177 NTTIME logon_time; /* logon time */
178 NTTIME logoff_time; /* logoff time */
179 NTTIME kickoff_time; /* kickoff time */
180 NTTIME pass_last_set_time; /* password last set time */
181 NTTIME pass_can_change_time; /* password can change time */
182 NTTIME pass_must_change_time; /* password must change time */
184 UNIHDR hdr_user_name; /* username unicode string header */
185 UNIHDR hdr_full_name; /* user's full name unicode string header */
186 UNIHDR hdr_logon_script; /* logon script unicode string header */
187 UNIHDR hdr_profile_path; /* profile path unicode string header */
188 UNIHDR hdr_home_dir; /* home directory unicode string header */
189 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
191 uint16 logon_count; /* logon count */
192 uint16 bad_pw_count; /* bad password count */
194 uint32 user_rid; /* User RID */
195 uint32 group_rid; /* Group RID */
197 uint32 num_groups; /* num groups */
198 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
199 uint32 user_flgs; /* user flags */
201 uint8 user_sess_key[16]; /* user session key */
203 UNIHDR hdr_logon_srv; /* logon server unicode string header */
204 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
206 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
207 uint8 lm_sess_key[8]; /* lm session key */
208 uint32 acct_flags; /* account flags */
209 uint32 unknown[7]; /* unknown */
211 UNISTR2 uni_user_name; /* username unicode string */
212 UNISTR2 uni_full_name; /* user's full name unicode string */
213 UNISTR2 uni_logon_script; /* logon script unicode string */
214 UNISTR2 uni_profile_path; /* profile path unicode string */
215 UNISTR2 uni_home_dir; /* home directory unicode string */
216 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
218 UNISTR2 uni_logon_srv; /* logon server unicode string */
219 UNISTR2 uni_logon_dom; /* logon domain unicode string */
221 DOM_SID2 dom_sid; /* domain SID */
224 /* NET_USER_INFO_3 */
225 typedef struct net_user_info_3 {
226 uint32 ptr_user_info;
228 NTTIME logon_time; /* logon time */
229 NTTIME logoff_time; /* logoff time */
230 NTTIME kickoff_time; /* kickoff time */
231 NTTIME pass_last_set_time; /* password last set time */
232 NTTIME pass_can_change_time; /* password can change time */
233 NTTIME pass_must_change_time; /* password must change time */
235 UNIHDR hdr_user_name; /* username unicode string header */
236 UNIHDR hdr_full_name; /* user's full name unicode string header */
237 UNIHDR hdr_logon_script; /* logon script unicode string header */
238 UNIHDR hdr_profile_path; /* profile path unicode string header */
239 UNIHDR hdr_home_dir; /* home directory unicode string header */
240 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
242 uint16 logon_count; /* logon count */
243 uint16 bad_pw_count; /* bad password count */
245 uint32 user_rid; /* User RID */
246 uint32 group_rid; /* Group RID */
248 uint32 num_groups; /* num groups */
249 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
250 uint32 user_flgs; /* user flags */
252 uint8 user_sess_key[16]; /* user session key */
254 UNIHDR hdr_logon_srv; /* logon server unicode string header */
255 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
257 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
258 uint8 lm_sess_key[8]; /* lm session key */
259 uint32 acct_flags; /* account flags */
260 uint32 unknown[7]; /* unknown */
262 uint32 num_other_sids; /* number of foreign/trusted domain sids */
263 uint32 buffer_other_sids;
265 /* The next three uint32 are not really part of user_info_3 but here
266 * for parsing convenience. They are only valid in Kerberos PAC
267 * parsing - Guenther */
268 uint32 ptr_res_group_dom_sid;
269 uint32 res_group_count;
270 uint32 ptr_res_groups;
272 UNISTR2 uni_user_name; /* username unicode string */
273 UNISTR2 uni_full_name; /* user's full name unicode string */
274 UNISTR2 uni_logon_script; /* logon script unicode string */
275 UNISTR2 uni_profile_path; /* profile path unicode string */
276 UNISTR2 uni_home_dir; /* home directory unicode string */
277 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
279 uint32 num_groups2; /* num groups */
280 DOM_GID *gids; /* group info */
282 UNISTR2 uni_logon_srv; /* logon server unicode string */
283 UNISTR2 uni_logon_dom; /* logon domain unicode string */
285 DOM_SID2 dom_sid; /* domain SID */
287 DOM_SID2 *other_sids; /* foreign/trusted domain SIDs */
288 uint32 *other_sids_attrib;
292 /* NETLOGON_INFO_1 - pdc status info, i presume */
293 typedef struct netlogon_1_info {
294 uint32 flags; /* 0x0 - undocumented */
295 uint32 pdc_status; /* 0x0 - undocumented */
298 /* NETLOGON_INFO_2 - pdc status info, plus trusted domain info */
299 typedef struct netlogon_2_info {
300 uint32 flags; /* 0x0 - undocumented */
301 uint32 pdc_status; /* 0x0 - undocumented */
302 uint32 ptr_trusted_dc_name; /* pointer to trusted domain controller name */
304 UNISTR2 uni_trusted_dc_name; /* unicode string - trusted dc name */
307 /* NETLOGON_INFO_3 - logon status info, i presume */
308 typedef struct netlogon_3_info {
309 uint32 flags; /* 0x0 - undocumented */
310 uint32 logon_attempts; /* number of logon attempts */
311 uint32 reserved_1; /* 0x0 - undocumented */
312 uint32 reserved_2; /* 0x0 - undocumented */
313 uint32 reserved_3; /* 0x0 - undocumented */
314 uint32 reserved_4; /* 0x0 - undocumented */
315 uint32 reserved_5; /* 0x0 - undocumented */
318 /********************************************************
321 This is generated by a nltest /bdc_query:DOMAIN
323 query_level 0x1, function_code 0x1
325 ********************************************************/
327 /* NET_Q_LOGON_CTRL - LSA Netr Logon Control */
329 typedef struct net_q_logon_ctrl_info {
331 UNISTR2 uni_server_name;
332 uint32 function_code;
336 /* NET_R_LOGON_CTRL - LSA Netr Logon Control */
338 typedef struct net_r_logon_ctrl_info {
343 NETLOGON_INFO_1 info1;
350 typedef struct ctrl_data_info_5 {
351 uint32 function_code;
357 typedef struct ctrl_data_info_6 {
358 uint32 function_code;
365 /********************************************************
368 query_level 0x1 - pdc status
369 query_level 0x3 - number of logon attempts.
371 ********************************************************/
373 /* NET_Q_LOGON_CTRL2 - LSA Netr Logon Control 2 */
374 typedef struct net_q_logon_ctrl2_info {
375 uint32 ptr; /* undocumented buffer pointer */
376 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
378 uint32 function_code;
381 CTRL_DATA_INFO_5 info5;
382 CTRL_DATA_INFO_6 info6;
386 /*******************************************************
387 Logon Control Response
389 switch_value is same as query_level in request
390 *******************************************************/
392 /* NET_R_LOGON_CTRL2 - response to LSA Logon Control2 */
393 typedef struct net_r_logon_ctrl2_info {
394 uint32 switch_value; /* 0x1, 0x3 */
399 NETLOGON_INFO_1 info1;
400 NETLOGON_INFO_2 info2;
401 NETLOGON_INFO_3 info3;
405 NTSTATUS status; /* return code */
408 /* NET_Q_GETDCNAME - Ask a DC for a trusted DC name */
410 typedef struct net_q_getdcname {
411 uint32 ptr_logon_server;
412 UNISTR2 uni_logon_server;
413 uint32 ptr_domainname;
414 UNISTR2 uni_domainname;
417 /* NET_R_GETDCNAME - Ask a DC for a trusted DC name */
419 typedef struct net_r_getdcname {
425 /* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */
426 typedef struct net_q_trust_dom_info {
427 uint32 ptr; /* undocumented buffer pointer */
428 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
429 } NET_Q_TRUST_DOM_LIST;
431 #define MAX_TRUST_DOMS 1
433 /* NET_R_TRUST_DOM_LIST - response to LSA Trusted Domains */
434 typedef struct net_r_trust_dom_info {
435 UNISTR2 uni_trust_dom_name[MAX_TRUST_DOMS];
437 NTSTATUS status; /* return code */
438 } NET_R_TRUST_DOM_LIST;
442 typedef struct neg_flags_info {
443 uint32 neg_flags; /* negotiated flags */
448 typedef struct net_q_req_chal_info {
449 uint32 undoc_buffer; /* undocumented buffer pointer */
450 UNISTR2 uni_logon_srv; /* logon server unicode string */
451 UNISTR2 uni_logon_clnt; /* logon client unicode string */
452 DOM_CHAL clnt_chal; /* client challenge */
457 typedef struct net_r_req_chal_info {
458 DOM_CHAL srv_chal; /* server challenge */
459 NTSTATUS status; /* return code */
463 typedef struct net_q_auth_info {
464 DOM_LOG_INFO clnt_id; /* client identification info */
465 DOM_CHAL clnt_chal; /* client-calculated credentials */
469 typedef struct net_r_auth_info {
470 DOM_CHAL srv_chal; /* server-calculated credentials */
471 NTSTATUS status; /* return code */
475 typedef struct net_q_auth2_info {
476 DOM_LOG_INFO clnt_id; /* client identification info */
477 DOM_CHAL clnt_chal; /* client-calculated credentials */
479 NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */
484 typedef struct net_r_auth2_info {
485 DOM_CHAL srv_chal; /* server-calculated credentials */
486 NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */
487 NTSTATUS status; /* return code */
491 typedef struct net_q_auth3_info {
492 DOM_LOG_INFO clnt_id; /* client identification info */
493 DOM_CHAL clnt_chal; /* client-calculated credentials */
494 NEG_FLAGS clnt_flgs; /* usually 0x6007 ffff */
498 typedef struct net_r_auth3_info {
499 DOM_CHAL srv_chal; /* server-calculated credentials */
500 NEG_FLAGS srv_flgs; /* usually 0x6007 ffff */
501 uint32 unknown; /* 0x0000045b */
502 NTSTATUS status; /* return code */
506 /* NET_Q_SRV_PWSET */
507 typedef struct net_q_srv_pwset_info {
508 DOM_CLNT_INFO clnt_id; /* client identification/authentication info */
509 uint8 pwd[16]; /* new password - undocumented. */
512 /* NET_R_SRV_PWSET */
513 typedef struct net_r_srv_pwset_info {
514 DOM_CRED srv_cred; /* server-calculated credentials */
516 NTSTATUS status; /* return code */
520 typedef struct net_network_info_2 {
521 uint32 ptr_id_info2; /* pointer to id_info_2 */
522 UNIHDR hdr_domain_name; /* domain name unicode header */
523 uint32 param_ctrl; /* param control (0x2) */
524 DOM_LOGON_ID logon_id; /* logon ID */
525 UNIHDR hdr_user_name; /* user name unicode header */
526 UNIHDR hdr_wksta_name; /* workstation name unicode header */
527 uint8 lm_chal[8]; /* lan manager 8 byte challenge */
528 STRHDR hdr_nt_chal_resp; /* nt challenge response */
529 STRHDR hdr_lm_chal_resp; /* lm challenge response */
531 UNISTR2 uni_domain_name; /* domain name unicode string */
532 UNISTR2 uni_user_name; /* user name unicode string */
533 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
534 STRING2 nt_chal_resp; /* nt challenge response */
535 STRING2 lm_chal_resp; /* lm challenge response */
539 typedef struct id_info_1 {
540 uint32 ptr_id_info1; /* pointer to id_info_1 */
541 UNIHDR hdr_domain_name; /* domain name unicode header */
542 uint32 param_ctrl; /* param control */
543 DOM_LOGON_ID logon_id; /* logon ID */
544 UNIHDR hdr_user_name; /* user name unicode header */
545 UNIHDR hdr_wksta_name; /* workstation name unicode header */
546 OWF_INFO lm_owf; /* LM OWF Password */
547 OWF_INFO nt_owf; /* NT OWF Password */
548 UNISTR2 uni_domain_name; /* domain name unicode string */
549 UNISTR2 uni_user_name; /* user name unicode string */
550 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
553 #define INTERACTIVE_LOGON_TYPE 1
554 #define NET_LOGON_TYPE 2
556 /* NET_ID_INFO_CTR */
557 typedef struct net_id_info_ctr_info {
561 NET_ID_INFO_1 id1; /* auth-level 1 - interactive user login */
562 NET_ID_INFO_2 id2; /* auth-level 2 - workstation referred login */
566 /* SAM_INFO - sam logon/off id structure */
567 typedef struct sam_info {
568 DOM_CLNT_INFO2 client;
569 uint32 ptr_rtn_cred; /* pointer to return credentials */
570 DOM_CRED rtn_cred; /* return credentials */
572 NET_ID_INFO_CTR *ctr;
575 /* SAM_INFO - sam logon/off id structure - no creds */
576 typedef struct sam_info_ex {
579 NET_ID_INFO_CTR *ctr;
582 /* NET_Q_SAM_LOGON */
583 typedef struct net_q_sam_logon_info {
585 uint16 validation_level;
588 /* NET_Q_SAM_LOGON_EX */
589 typedef struct net_q_sam_logon_info_ex {
590 DOM_SAM_INFO_EX sam_id;
591 uint16 validation_level;
593 } NET_Q_SAM_LOGON_EX;
595 /* NET_R_SAM_LOGON */
596 typedef struct net_r_sam_logon_info {
597 uint32 buffer_creds; /* undocumented buffer pointer */
598 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
600 uint16 switch_value; /* 3 - indicates type of USER INFO */
601 NET_USER_INFO_3 *user;
603 uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
605 NTSTATUS status; /* return code */
608 /* NET_R_SAM_LOGON_EX */
609 typedef struct net_r_sam_logon_info_ex {
610 uint16 switch_value; /* 3 - indicates type of USER INFO */
611 NET_USER_INFO_3 *user;
613 uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
616 NTSTATUS status; /* return code */
617 } NET_R_SAM_LOGON_EX;
620 /* NET_Q_SAM_LOGOFF */
621 typedef struct net_q_sam_logoff_info {
625 /* NET_R_SAM_LOGOFF */
626 typedef struct net_r_sam_logoff_info {
627 uint32 buffer_creds; /* undocumented buffer pointer */
628 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
629 NTSTATUS status; /* return code */
633 typedef struct net_q_sam_sync_info {
634 UNISTR2 uni_srv_name; /* \\PDC */
635 UNISTR2 uni_cli_name; /* BDC */
640 uint32 restart_state;
643 uint32 max_size; /* preferred maximum length */
647 typedef struct sam_delta_hdr_info {
648 uint16 type; /* type of structure attached */
657 typedef struct account_lockout_string {
661 /* uint16 *bindata; */
662 UINT64_S lockout_duration;
663 UINT64_S reset_count;
664 uint32 bad_attempt_lockout;
668 /* HDR_LOCKOUT_STRING */
669 typedef struct hdr_account_lockout_string {
673 } HDR_LOCKOUT_STRING;
675 /* SAM_DOMAIN_INFO (0x1) */
676 typedef struct sam_domain_info_info {
680 UINT64_S force_logoff;
682 uint16 pwd_history_len;
683 UINT64_S max_pwd_age;
684 UINT64_S min_pwd_age;
685 UINT64_S dom_mod_count;
686 NTTIME creation_time;
687 uint32 security_information;
689 BUFHDR4 hdr_sec_desc; /* security descriptor */
691 HDR_LOCKOUT_STRING hdr_account_lockout;
697 UNISTR2 uni_dom_name;
698 UNISTR2 buf_oem_info;
700 RPC_DATA_BLOB buf_sec_desc;
702 LOCKOUT_STRING account_lockout;
704 UNISTR2 buf_unknown2;
705 UNISTR2 buf_unknown3;
706 UNISTR2 buf_unknown4;
708 uint32 logon_chgpass;
714 /* SAM_GROUP_INFO (0x2) */
715 typedef struct sam_group_info_info {
719 BUFHDR2 hdr_sec_desc; /* security descriptor */
722 UNISTR2 uni_grp_name;
723 UNISTR2 uni_grp_desc;
724 RPC_DATA_BLOB buf_sec_desc;
728 typedef struct sam_passwd_info {
729 /* this structure probably contains password history */
730 /* this is probably a count of lm/nt pairs */
731 uint32 unk_0; /* 0x0000 0002 */
734 uint8 buf_lm_pwd[16];
737 uint8 buf_nt_pwd[16];
743 /* SAM_ACCOUNT_INFO (0x5) */
744 typedef struct sam_account_info_info {
745 UNIHDR hdr_acct_name;
746 UNIHDR hdr_full_name;
752 UNIHDR hdr_dir_drive;
753 UNIHDR hdr_logon_script;
754 UNIHDR hdr_acct_desc;
755 UNIHDR hdr_workstations;
760 uint32 logon_divs; /* 0xA8 */
761 uint32 ptr_logon_hrs;
763 uint16 bad_pwd_count;
765 NTTIME pwd_last_set_time;
766 NTTIME acct_expiry_time;
771 uint8 nt_pwd_present;
772 uint8 lm_pwd_present;
776 UNIHDR hdr_parameters;
780 BUFHDR2 hdr_sec_desc; /* security descriptor */
783 UNIHDR hdr_reserved[3]; /* space for more strings */
784 uint32 dw_reserved[4]; /* space for more data - first two seem to
787 UNISTR2 uni_acct_name;
788 UNISTR2 uni_full_name;
789 UNISTR2 uni_home_dir;
790 UNISTR2 uni_dir_drive;
791 UNISTR2 uni_logon_script;
792 UNISTR2 uni_acct_desc;
793 UNISTR2 uni_workstations;
795 uint32 unknown1; /* 0x4EC */
796 uint32 unknown2; /* 0 */
798 RPC_DATA_BLOB buf_logon_hrs;
800 UNISTR2 uni_parameters;
802 RPC_DATA_BLOB buf_sec_desc;
806 /* SAM_GROUP_MEM_INFO (0x8) */
807 typedef struct sam_group_mem_info_info {
819 } SAM_GROUP_MEM_INFO;
821 /* SAM_ALIAS_INFO (0x9) */
822 typedef struct sam_alias_info_info {
825 BUFHDR2 hdr_sec_desc; /* security descriptor */
829 UNISTR2 uni_als_name;
830 RPC_DATA_BLOB buf_sec_desc;
831 UNISTR2 uni_als_desc;
834 /* SAM_ALIAS_MEM_INFO (0xC) */
835 typedef struct sam_alias_mem_info_info {
843 } SAM_ALIAS_MEM_INFO;
846 /* SAM_DELTA_POLICY (0x0D) */
848 uint32 max_log_size; /* 0x5000 */
849 UINT64_S audit_retention_period; /* 0 */
850 uint32 auditing_mode; /* 0 */
856 uint32 paged_pool_limit; /* 0x02000000 */
857 uint32 non_paged_pool_limit; /* 0x00100000 */
858 uint32 min_workset_size; /* 0x00010000 */
859 uint32 max_workset_size; /* 0x0f000000 */
860 uint32 page_file_limit; /* 0 */
861 UINT64_S time_limit; /* 0 */
862 NTTIME modify_time; /* 0x3c*/
863 NTTIME create_time; /* a7080110 */
864 BUFHDR2 hdr_sec_desc;
866 uint32 num_event_audit_options;
867 uint32 event_audit_option;
872 RPC_DATA_BLOB buf_sec_desc;
875 /* SAM_DELTA_TRUST_DOMS */
891 } SAM_DELTA_TRUSTDOMS;
893 /* SAM_DELTA_PRIVS (0x10) */
900 uint32 priv_attr_ptr;
901 uint32 priv_name_ptr;
903 uint32 paged_pool_limit; /* 0x02000000 */
904 uint32 non_paged_pool_limit; /* 0x00100000 */
905 uint32 min_workset_size; /* 0x00010000 */
906 uint32 max_workset_size; /* 0x0f000000 */
907 uint32 page_file_limit; /* 0 */
908 UINT64_S time_limit; /* 0 */
909 uint32 system_flags; /* 1 */
910 BUFHDR2 hdr_sec_desc;
914 uint32 attribute_count;
917 uint32 privlist_count;
918 UNIHDR *hdr_privslist;
919 UNISTR2 *uni_privslist;
921 RPC_DATA_BLOB buf_sec_desc;
924 /* SAM_DELTA_SECRET */
942 uint32 unknow2; /* 0x0 12 times */
945 uint32 reserved1; /* 0 */
950 uint32 reserved2; /* 0 */
958 /* SAM_DELTA_MOD_COUNT (0x16) */
961 uint32 dom_mod_count_ptr;
962 UINT64_S dom_mod_count; /* domain mod count at last sync */
963 } SAM_DELTA_MOD_COUNT;
965 typedef union sam_delta_ctr_info {
966 SAM_DOMAIN_INFO domain_info ;
967 SAM_GROUP_INFO group_info ;
968 SAM_ACCOUNT_INFO account_info;
969 SAM_GROUP_MEM_INFO grp_mem_info;
970 SAM_ALIAS_INFO alias_info ;
971 SAM_ALIAS_MEM_INFO als_mem_info;
972 SAM_DELTA_POLICY policy_info;
973 SAM_DELTA_PRIVS privs_info;
974 SAM_DELTA_MOD_COUNT mod_count;
975 SAM_DELTA_TRUSTDOMS trustdoms_info;
976 SAM_DELTA_SECRET secret_info;
980 typedef struct net_r_sam_sync_info {
990 SAM_DELTA_HDR *hdr_deltas;
991 SAM_DELTA_CTR *deltas;
996 /* NET_Q_SAM_DELTAS */
997 typedef struct net_q_sam_deltas_info {
998 UNISTR2 uni_srv_name;
999 UNISTR2 uni_cli_name;
1004 UINT64_S dom_mod_count; /* domain mod count at last sync */
1006 uint32 max_size; /* preferred maximum length */
1009 /* NET_R_SAM_DELTAS */
1010 typedef struct net_r_sam_deltas_info {
1013 UINT64_S dom_mod_count; /* new domain mod count */
1019 SAM_DELTA_HDR *hdr_deltas;
1020 SAM_DELTA_CTR *deltas;
1025 /* NET_Q_DSR_GETDCNAME - Ask a DC for a trusted DC name and its address */
1026 typedef struct net_q_dsr_getdcname {
1027 uint32 ptr_server_unc;
1028 UNISTR2 uni_server_unc;
1029 uint32 ptr_domain_name;
1030 UNISTR2 uni_domain_name;
1031 uint32 ptr_domain_guid;
1032 struct uuid *domain_guid;
1033 uint32 ptr_site_guid;
1034 struct uuid *site_guid;
1036 } NET_Q_DSR_GETDCNAME;
1038 /* NET_R_DSR_GETDCNAME - Ask a DC for a trusted DC name and its address */
1039 typedef struct net_r_dsr_getdcname {
1042 uint32 ptr_dc_address;
1043 UNISTR2 uni_dc_address;
1044 int32 dc_address_type;
1045 struct uuid domain_guid;
1046 uint32 ptr_domain_name;
1047 UNISTR2 uni_domain_name;
1048 uint32 ptr_forest_name;
1049 UNISTR2 uni_forest_name;
1051 uint32 ptr_dc_site_name;
1052 UNISTR2 uni_dc_site_name;
1053 uint32 ptr_client_site_name;
1054 UNISTR2 uni_client_site_name;
1056 } NET_R_DSR_GETDCNAME;
1058 /* NET_Q_DSR_GESITENAME */
1059 typedef struct net_q_dsr_getsitename {
1060 uint32 ptr_computer_name;
1061 UNISTR2 uni_computer_name;
1062 } NET_Q_DSR_GETSITENAME;
1064 /* NET_R_DSR_GETSITENAME */
1065 typedef struct net_r_dsr_getsitename {
1066 uint32 ptr_site_name;
1067 UNISTR2 uni_site_name;
1069 } NET_R_DSR_GETSITENAME;
1072 #endif /* _RPC_NETLOGON_H */