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 /* Returned delta types */
47 #define SAM_DELTA_DOMAIN_INFO 0x01
48 #define SAM_DELTA_GROUP_INFO 0x02
49 #define SAM_DELTA_RENAME_GROUP 0x04
50 #define SAM_DELTA_ACCOUNT_INFO 0x05
51 #define SAM_DELTA_RENAME_USER 0x07
52 #define SAM_DELTA_GROUP_MEM 0x08
53 #define SAM_DELTA_ALIAS_INFO 0x09
54 #define SAM_DELTA_RENAME_ALIAS 0x0b
55 #define SAM_DELTA_ALIAS_MEM 0x0c
56 #define SAM_DELTA_POLICY_INFO 0x0d
57 #define SAM_DELTA_TRUST_DOMS 0x0e
58 #define SAM_DELTA_PRIVS_INFO 0x10 /* DT_DELTA_ACCOUNTS */
59 #define SAM_DELTA_SECRET_INFO 0x12
60 #define SAM_DELTA_DELETE_GROUP 0x14
61 #define SAM_DELTA_DELETE_USER 0x15
62 #define SAM_DELTA_MODIFIED_COUNT 0x16
64 /* flags use when sending a NETLOGON_CONTROL request */
66 #define NETLOGON_CONTROL_SYNC 0x2
67 #define NETLOGON_CONTROL_REDISCOVER 0x5
68 #define NETLOGON_CONTROL_TC_QUERY 0x6
69 #define NETLOGON_CONTROL_TRANSPORT_NOTIFY 0x7
70 #define NETLOGON_CONTROL_SET_DBFLAG 0xfffe
72 /* Some flag values reverse engineered from NLTEST.EXE */
73 /* used in the NETLOGON_CONTROL[2] reply */
75 #define NL_CTRL_IN_SYNC 0x0000
76 #define NL_CTRL_REPL_NEEDED 0x0001
77 #define NL_CTRL_REPL_IN_PROGRESS 0x0002
78 #define NL_CTRL_FULL_SYNC 0x0004
80 #define LOGON_GUEST 0x00000001
81 #define LOGON_NOENCRYPTION 0x00000002
82 #define LOGON_CACHED_ACCOUNT 0x00000004
83 #define LOGON_USED_LM_PASSWORD 0x00000008
84 #define LOGON_EXTRA_SIDS 0x00000020
85 #define LOGON_SUBAUTH_SESSION_KEY 0x00000040
86 #define LOGON_SERVER_TRUST_ACCOUNT 0x00000080
87 #define LOGON_NTLMV2_ENABLED 0x00000100
88 #define LOGON_RESOURCE_GROUPS 0x00000200
89 #define LOGON_PROFILE_PATH_RETURNED 0x00000400
90 #define LOGON_GRACE_LOGON 0x01000000
92 #define SE_GROUP_MANDATORY 0x00000001
93 #define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
94 #define SE_GROUP_ENABLED 0x00000004
95 #define SE_GROUP_OWNER 0x00000008
96 #define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
97 #define SE_GROUP_LOGON_ID 0xC0000000
98 #define SE_GROUP_RESOURCE 0x20000000
100 /* Flags for controlling the behaviour of a particular logon */
102 /* sets LOGON_SERVER_TRUST_ACCOUNT user_flag */
103 #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x00000020
104 #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x00000800
106 /* updates the "logon time" on network logon */
107 #define MSV1_0_UPDATE_LOGON_STATISTICS 0x00000004
109 /* returns the user parameters in the driveletter */
110 #define MSV1_0_RETURN_USER_PARAMETERS 0x00000008
112 /* returns the profilepath in the driveletter and
113 * sets LOGON_PROFILE_PATH_RETURNED user_flag */
114 #define MSV1_0_RETURN_PROFILE_PATH 0x00000200
117 /* I think this is correct - it's what gets parsed on the wire. JRA. */
118 /* NET_USER_INFO_2 */
119 typedef struct net_user_info_2 {
120 uint32 ptr_user_info;
122 NTTIME logon_time; /* logon time */
123 NTTIME logoff_time; /* logoff time */
124 NTTIME kickoff_time; /* kickoff time */
125 NTTIME pass_last_set_time; /* password last set time */
126 NTTIME pass_can_change_time; /* password can change time */
127 NTTIME pass_must_change_time; /* password must change time */
129 UNIHDR hdr_user_name; /* username unicode string header */
130 UNIHDR hdr_full_name; /* user's full name unicode string header */
131 UNIHDR hdr_logon_script; /* logon script unicode string header */
132 UNIHDR hdr_profile_path; /* profile path unicode string header */
133 UNIHDR hdr_home_dir; /* home directory unicode string header */
134 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
136 uint16 logon_count; /* logon count */
137 uint16 bad_pw_count; /* bad password count */
139 uint32 user_id; /* User ID */
140 uint32 group_id; /* Group ID */
141 uint32 num_groups; /* num groups */
142 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
143 uint32 user_flgs; /* user flags */
145 uint8 user_sess_key[16]; /* unused user session key */
147 UNIHDR hdr_logon_srv; /* logon server unicode string header */
148 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
150 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
151 uint8 padding[40]; /* unused padding bytes. expansion room */
153 UNISTR2 uni_user_name; /* username unicode string */
154 UNISTR2 uni_full_name; /* user's full name unicode string */
155 UNISTR2 uni_logon_script; /* logon script unicode string */
156 UNISTR2 uni_profile_path; /* profile path unicode string */
157 UNISTR2 uni_home_dir; /* home directory unicode string */
158 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
160 uint32 num_groups2; /* num groups */
161 DOM_GID *gids; /* group info */
163 UNISTR2 uni_logon_srv; /* logon server unicode string */
164 UNISTR2 uni_logon_dom; /* logon domain unicode string */
166 DOM_SID2 dom_sid; /* domain SID */
168 uint32 num_other_groups; /* other groups */
169 DOM_GID *other_gids; /* group info */
170 DOM_SID2 *other_sids; /* undocumented - domain SIDs */
175 /* NET_USER_INFO_2 */
176 typedef struct net_user_info_2 {
177 uint32 ptr_user_info;
179 NTTIME logon_time; /* logon time */
180 NTTIME logoff_time; /* logoff time */
181 NTTIME kickoff_time; /* kickoff time */
182 NTTIME pass_last_set_time; /* password last set time */
183 NTTIME pass_can_change_time; /* password can change time */
184 NTTIME pass_must_change_time; /* password must change time */
186 UNIHDR hdr_user_name; /* username unicode string header */
187 UNIHDR hdr_full_name; /* user's full name unicode string header */
188 UNIHDR hdr_logon_script; /* logon script unicode string header */
189 UNIHDR hdr_profile_path; /* profile path unicode string header */
190 UNIHDR hdr_home_dir; /* home directory unicode string header */
191 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
193 uint16 logon_count; /* logon count */
194 uint16 bad_pw_count; /* bad password count */
196 uint32 user_rid; /* User RID */
197 uint32 group_rid; /* Group RID */
199 uint32 num_groups; /* num groups */
200 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
201 uint32 user_flgs; /* user flags */
203 uint8 user_sess_key[16]; /* user session key */
205 UNIHDR hdr_logon_srv; /* logon server unicode string header */
206 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
208 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
209 uint8 lm_sess_key[8]; /* lm session key */
210 uint32 acct_flags; /* account flags */
211 uint32 unknown[7]; /* unknown */
213 UNISTR2 uni_user_name; /* username unicode string */
214 UNISTR2 uni_full_name; /* user's full name unicode string */
215 UNISTR2 uni_logon_script; /* logon script unicode string */
216 UNISTR2 uni_profile_path; /* profile path unicode string */
217 UNISTR2 uni_home_dir; /* home directory unicode string */
218 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
220 UNISTR2 uni_logon_srv; /* logon server unicode string */
221 UNISTR2 uni_logon_dom; /* logon domain unicode string */
223 DOM_SID2 dom_sid; /* domain SID */
226 /* NET_USER_INFO_3 */
227 typedef struct net_user_info_3 {
228 uint32 ptr_user_info;
230 NTTIME logon_time; /* logon time */
231 NTTIME logoff_time; /* logoff time */
232 NTTIME kickoff_time; /* kickoff time */
233 NTTIME pass_last_set_time; /* password last set time */
234 NTTIME pass_can_change_time; /* password can change time */
235 NTTIME pass_must_change_time; /* password must change time */
237 UNIHDR hdr_user_name; /* username unicode string header */
238 UNIHDR hdr_full_name; /* user's full name unicode string header */
239 UNIHDR hdr_logon_script; /* logon script unicode string header */
240 UNIHDR hdr_profile_path; /* profile path unicode string header */
241 UNIHDR hdr_home_dir; /* home directory unicode string header */
242 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
244 uint16 logon_count; /* logon count */
245 uint16 bad_pw_count; /* bad password count */
247 uint32 user_rid; /* User RID */
248 uint32 group_rid; /* Group RID */
250 uint32 num_groups; /* num groups */
251 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
252 uint32 user_flgs; /* user flags */
254 uint8 user_sess_key[16]; /* user session key */
256 UNIHDR hdr_logon_srv; /* logon server unicode string header */
257 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
259 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
260 uint8 lm_sess_key[8]; /* lm session key */
261 uint32 acct_flags; /* account flags */
262 uint32 unknown[7]; /* unknown */
264 uint32 num_other_sids; /* number of foreign/trusted domain sids */
265 uint32 buffer_other_sids;
267 /* The next three uint32 are not really part of user_info_3 but here
268 * for parsing convenience. They are only valid in Kerberos PAC
269 * parsing - Guenther */
270 uint32 ptr_res_group_dom_sid;
271 uint32 res_group_count;
272 uint32 ptr_res_groups;
274 UNISTR2 uni_user_name; /* username unicode string */
275 UNISTR2 uni_full_name; /* user's full name unicode string */
276 UNISTR2 uni_logon_script; /* logon script unicode string */
277 UNISTR2 uni_profile_path; /* profile path unicode string */
278 UNISTR2 uni_home_dir; /* home directory unicode string */
279 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
281 uint32 num_groups2; /* num groups */
282 DOM_GID *gids; /* group info */
284 UNISTR2 uni_logon_srv; /* logon server unicode string */
285 UNISTR2 uni_logon_dom; /* logon domain unicode string */
287 DOM_SID2 dom_sid; /* domain SID */
289 DOM_SID2 *other_sids; /* foreign/trusted domain SIDs */
290 uint32 *other_sids_attrib;
294 /* NETLOGON_INFO_1 - pdc status info, i presume */
295 typedef struct netlogon_1_info {
296 uint32 flags; /* 0x0 - undocumented */
297 uint32 pdc_status; /* 0x0 - undocumented */
300 /* NETLOGON_INFO_2 - pdc status info, plus trusted domain info */
301 typedef struct netlogon_2_info {
302 uint32 flags; /* 0x0 - undocumented */
303 uint32 pdc_status; /* 0x0 - undocumented */
304 uint32 ptr_trusted_dc_name; /* pointer to trusted domain controller name */
306 UNISTR2 uni_trusted_dc_name; /* unicode string - trusted dc name */
309 /* NETLOGON_INFO_3 - logon status info, i presume */
310 typedef struct netlogon_3_info {
311 uint32 flags; /* 0x0 - undocumented */
312 uint32 logon_attempts; /* number of logon attempts */
313 uint32 reserved_1; /* 0x0 - undocumented */
314 uint32 reserved_2; /* 0x0 - undocumented */
315 uint32 reserved_3; /* 0x0 - undocumented */
316 uint32 reserved_4; /* 0x0 - undocumented */
317 uint32 reserved_5; /* 0x0 - undocumented */
320 /********************************************************
323 This is generated by a nltest /bdc_query:DOMAIN
325 query_level 0x1, function_code 0x1
327 ********************************************************/
329 /* NET_Q_LOGON_CTRL - LSA Netr Logon Control */
331 typedef struct net_q_logon_ctrl_info {
333 UNISTR2 uni_server_name;
334 uint32 function_code;
338 /* NET_R_LOGON_CTRL - LSA Netr Logon Control */
340 typedef struct net_r_logon_ctrl_info {
345 NETLOGON_INFO_1 info1;
352 typedef struct ctrl_data_info_5 {
353 uint32 function_code;
359 typedef struct ctrl_data_info_6 {
360 uint32 function_code;
367 /********************************************************
370 query_level 0x1 - pdc status
371 query_level 0x3 - number of logon attempts.
373 ********************************************************/
375 /* NET_Q_LOGON_CTRL2 - LSA Netr Logon Control 2 */
376 typedef struct net_q_logon_ctrl2_info {
377 uint32 ptr; /* undocumented buffer pointer */
378 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
380 uint32 function_code;
383 CTRL_DATA_INFO_5 info5;
384 CTRL_DATA_INFO_6 info6;
388 /*******************************************************
389 Logon Control Response
391 switch_value is same as query_level in request
392 *******************************************************/
394 /* NET_R_LOGON_CTRL2 - response to LSA Logon Control2 */
395 typedef struct net_r_logon_ctrl2_info {
396 uint32 switch_value; /* 0x1, 0x3 */
401 NETLOGON_INFO_1 info1;
402 NETLOGON_INFO_2 info2;
403 NETLOGON_INFO_3 info3;
407 NTSTATUS status; /* return code */
410 /* NET_Q_GETDCNAME - Ask a DC for a trusted DC name */
412 typedef struct net_q_getdcname {
413 uint32 ptr_logon_server;
414 UNISTR2 uni_logon_server;
415 uint32 ptr_domainname;
416 UNISTR2 uni_domainname;
419 /* NET_R_GETDCNAME - Ask a DC for a trusted DC name */
421 typedef struct net_r_getdcname {
427 /* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */
428 typedef struct net_q_trust_dom_info {
429 uint32 ptr; /* undocumented buffer pointer */
430 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
431 } NET_Q_TRUST_DOM_LIST;
433 #define MAX_TRUST_DOMS 1
435 /* NET_R_TRUST_DOM_LIST - response to LSA Trusted Domains */
436 typedef struct net_r_trust_dom_info {
437 UNISTR2 uni_trust_dom_name[MAX_TRUST_DOMS];
439 NTSTATUS status; /* return code */
440 } NET_R_TRUST_DOM_LIST;
444 typedef struct neg_flags_info {
445 uint32 neg_flags; /* negotiated flags */
450 typedef struct net_q_req_chal_info {
451 uint32 undoc_buffer; /* undocumented buffer pointer */
452 UNISTR2 uni_logon_srv; /* logon server unicode string */
453 UNISTR2 uni_logon_clnt; /* logon client unicode string */
454 DOM_CHAL clnt_chal; /* client challenge */
459 typedef struct net_r_req_chal_info {
460 DOM_CHAL srv_chal; /* server challenge */
461 NTSTATUS status; /* return code */
465 typedef struct net_q_auth_info {
466 DOM_LOG_INFO clnt_id; /* client identification info */
467 DOM_CHAL clnt_chal; /* client-calculated credentials */
471 typedef struct net_r_auth_info {
472 DOM_CHAL srv_chal; /* server-calculated credentials */
473 NTSTATUS status; /* return code */
477 typedef struct net_q_auth2_info {
478 DOM_LOG_INFO clnt_id; /* client identification info */
479 DOM_CHAL clnt_chal; /* client-calculated credentials */
481 NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */
486 typedef struct net_r_auth2_info {
487 DOM_CHAL srv_chal; /* server-calculated credentials */
488 NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */
489 NTSTATUS status; /* return code */
493 typedef struct net_q_auth3_info {
494 DOM_LOG_INFO clnt_id; /* client identification info */
495 DOM_CHAL clnt_chal; /* client-calculated credentials */
496 NEG_FLAGS clnt_flgs; /* usually 0x6007 ffff */
500 typedef struct net_r_auth3_info {
501 DOM_CHAL srv_chal; /* server-calculated credentials */
502 NEG_FLAGS srv_flgs; /* usually 0x6007 ffff */
503 uint32 unknown; /* 0x0000045b */
504 NTSTATUS status; /* return code */
508 /* NET_Q_SRV_PWSET */
509 typedef struct net_q_srv_pwset_info {
510 DOM_CLNT_INFO clnt_id; /* client identification/authentication info */
511 uint8 pwd[16]; /* new password - undocumented. */
514 /* NET_R_SRV_PWSET */
515 typedef struct net_r_srv_pwset_info {
516 DOM_CRED srv_cred; /* server-calculated credentials */
518 NTSTATUS status; /* return code */
522 typedef struct net_network_info_2 {
523 uint32 ptr_id_info2; /* pointer to id_info_2 */
524 UNIHDR hdr_domain_name; /* domain name unicode header */
525 uint32 param_ctrl; /* param control (0x2) */
526 DOM_LOGON_ID logon_id; /* logon ID */
527 UNIHDR hdr_user_name; /* user name unicode header */
528 UNIHDR hdr_wksta_name; /* workstation name unicode header */
529 uint8 lm_chal[8]; /* lan manager 8 byte challenge */
530 STRHDR hdr_nt_chal_resp; /* nt challenge response */
531 STRHDR hdr_lm_chal_resp; /* lm challenge response */
533 UNISTR2 uni_domain_name; /* domain name unicode string */
534 UNISTR2 uni_user_name; /* user name unicode string */
535 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
536 STRING2 nt_chal_resp; /* nt challenge response */
537 STRING2 lm_chal_resp; /* lm challenge response */
541 typedef struct id_info_1 {
542 uint32 ptr_id_info1; /* pointer to id_info_1 */
543 UNIHDR hdr_domain_name; /* domain name unicode header */
544 uint32 param_ctrl; /* param control */
545 DOM_LOGON_ID logon_id; /* logon ID */
546 UNIHDR hdr_user_name; /* user name unicode header */
547 UNIHDR hdr_wksta_name; /* workstation name unicode header */
548 OWF_INFO lm_owf; /* LM OWF Password */
549 OWF_INFO nt_owf; /* NT OWF Password */
550 UNISTR2 uni_domain_name; /* domain name unicode string */
551 UNISTR2 uni_user_name; /* user name unicode string */
552 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
555 #define INTERACTIVE_LOGON_TYPE 1
556 #define NET_LOGON_TYPE 2
558 /* NET_ID_INFO_CTR */
559 typedef struct net_id_info_ctr_info {
563 NET_ID_INFO_1 id1; /* auth-level 1 - interactive user login */
564 NET_ID_INFO_2 id2; /* auth-level 2 - workstation referred login */
568 /* SAM_INFO - sam logon/off id structure */
569 typedef struct sam_info {
570 DOM_CLNT_INFO2 client;
571 uint32 ptr_rtn_cred; /* pointer to return credentials */
572 DOM_CRED rtn_cred; /* return credentials */
574 NET_ID_INFO_CTR *ctr;
577 /* SAM_INFO - sam logon/off id structure - no creds */
578 typedef struct sam_info_ex {
581 NET_ID_INFO_CTR *ctr;
584 /* NET_Q_SAM_LOGON */
585 typedef struct net_q_sam_logon_info {
587 uint16 validation_level;
590 /* NET_Q_SAM_LOGON_EX */
591 typedef struct net_q_sam_logon_info_ex {
592 DOM_SAM_INFO_EX sam_id;
593 uint16 validation_level;
595 } NET_Q_SAM_LOGON_EX;
597 /* NET_R_SAM_LOGON */
598 typedef struct net_r_sam_logon_info {
599 uint32 buffer_creds; /* undocumented buffer pointer */
600 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
602 uint16 switch_value; /* 3 - indicates type of USER INFO */
603 NET_USER_INFO_3 *user;
605 uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
607 NTSTATUS status; /* return code */
610 /* NET_R_SAM_LOGON_EX */
611 typedef struct net_r_sam_logon_info_ex {
612 uint16 switch_value; /* 3 - indicates type of USER INFO */
613 NET_USER_INFO_3 *user;
615 uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
618 NTSTATUS status; /* return code */
619 } NET_R_SAM_LOGON_EX;
622 /* NET_Q_SAM_LOGOFF */
623 typedef struct net_q_sam_logoff_info {
627 /* NET_R_SAM_LOGOFF */
628 typedef struct net_r_sam_logoff_info {
629 uint32 buffer_creds; /* undocumented buffer pointer */
630 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
631 NTSTATUS status; /* return code */
635 typedef struct net_q_sam_sync_info {
636 UNISTR2 uni_srv_name; /* \\PDC */
637 UNISTR2 uni_cli_name; /* BDC */
642 uint32 restart_state;
645 uint32 max_size; /* preferred maximum length */
649 typedef struct sam_delta_hdr_info {
650 uint16 type; /* type of structure attached */
659 typedef struct account_lockout_string {
663 /* uint16 *bindata; */
664 uint64 lockout_duration;
666 uint32 bad_attempt_lockout;
670 /* HDR_LOCKOUT_STRING */
671 typedef struct hdr_account_lockout_string {
675 } HDR_LOCKOUT_STRING;
677 /* SAM_DOMAIN_INFO (0x1) */
678 typedef struct sam_domain_info_info {
684 uint16 pwd_history_len;
687 uint64 dom_mod_count;
688 NTTIME creation_time;
689 uint32 security_information;
691 BUFHDR4 hdr_sec_desc; /* security descriptor */
693 HDR_LOCKOUT_STRING hdr_account_lockout;
699 UNISTR2 uni_dom_name;
700 UNISTR2 buf_oem_info;
702 RPC_DATA_BLOB buf_sec_desc;
704 LOCKOUT_STRING account_lockout;
706 UNISTR2 buf_unknown2;
707 UNISTR2 buf_unknown3;
708 UNISTR2 buf_unknown4;
710 uint32 logon_chgpass;
716 /* SAM_GROUP_INFO (0x2) */
717 typedef struct sam_group_info_info {
721 BUFHDR2 hdr_sec_desc; /* security descriptor */
724 UNISTR2 uni_grp_name;
725 UNISTR2 uni_grp_desc;
726 RPC_DATA_BLOB buf_sec_desc;
730 typedef struct sam_passwd_info {
731 /* this structure probably contains password history */
732 /* this is probably a count of lm/nt pairs */
733 uint32 unk_0; /* 0x0000 0002 */
736 uint8 buf_lm_pwd[16];
739 uint8 buf_nt_pwd[16];
745 /* SAM_ACCOUNT_INFO (0x5) */
746 typedef struct sam_account_info_info {
747 UNIHDR hdr_acct_name;
748 UNIHDR hdr_full_name;
754 UNIHDR hdr_dir_drive;
755 UNIHDR hdr_logon_script;
756 UNIHDR hdr_acct_desc;
757 UNIHDR hdr_workstations;
762 uint32 logon_divs; /* 0xA8 */
763 uint32 ptr_logon_hrs;
765 uint16 bad_pwd_count;
767 NTTIME pwd_last_set_time;
768 NTTIME acct_expiry_time;
773 uint8 nt_pwd_present;
774 uint8 lm_pwd_present;
778 UNIHDR hdr_parameters;
782 BUFHDR2 hdr_sec_desc; /* security descriptor */
785 UNIHDR hdr_reserved[3]; /* space for more strings */
786 uint32 dw_reserved[4]; /* space for more data - first two seem to
789 UNISTR2 uni_acct_name;
790 UNISTR2 uni_full_name;
791 UNISTR2 uni_home_dir;
792 UNISTR2 uni_dir_drive;
793 UNISTR2 uni_logon_script;
794 UNISTR2 uni_acct_desc;
795 UNISTR2 uni_workstations;
797 uint32 unknown1; /* 0x4EC */
798 uint32 unknown2; /* 0 */
800 RPC_DATA_BLOB buf_logon_hrs;
802 UNISTR2 uni_parameters;
804 RPC_DATA_BLOB buf_sec_desc;
808 /* SAM_GROUP_MEM_INFO (0x8) */
809 typedef struct sam_group_mem_info_info {
821 } SAM_GROUP_MEM_INFO;
823 /* SAM_ALIAS_INFO (0x9) */
824 typedef struct sam_alias_info_info {
827 BUFHDR2 hdr_sec_desc; /* security descriptor */
831 UNISTR2 uni_als_name;
832 RPC_DATA_BLOB buf_sec_desc;
833 UNISTR2 uni_als_desc;
836 /* SAM_ALIAS_MEM_INFO (0xC) */
837 typedef struct sam_alias_mem_info_info {
845 } SAM_ALIAS_MEM_INFO;
848 /* SAM_DELTA_POLICY (0x0D) */
850 uint32 max_log_size; /* 0x5000 */
851 uint64 audit_retention_period; /* 0 */
852 uint32 auditing_mode; /* 0 */
858 uint32 paged_pool_limit; /* 0x02000000 */
859 uint32 non_paged_pool_limit; /* 0x00100000 */
860 uint32 min_workset_size; /* 0x00010000 */
861 uint32 max_workset_size; /* 0x0f000000 */
862 uint32 page_file_limit; /* 0 */
863 uint64 time_limit; /* 0 */
864 NTTIME modify_time; /* 0x3c*/
865 NTTIME create_time; /* a7080110 */
866 BUFHDR2 hdr_sec_desc;
868 uint32 num_event_audit_options;
869 uint32 event_audit_option;
874 RPC_DATA_BLOB buf_sec_desc;
877 /* SAM_DELTA_TRUST_DOMS */
893 } SAM_DELTA_TRUSTDOMS;
895 /* SAM_DELTA_PRIVS (0x10) */
902 uint32 priv_attr_ptr;
903 uint32 priv_name_ptr;
905 uint32 paged_pool_limit; /* 0x02000000 */
906 uint32 non_paged_pool_limit; /* 0x00100000 */
907 uint32 min_workset_size; /* 0x00010000 */
908 uint32 max_workset_size; /* 0x0f000000 */
909 uint32 page_file_limit; /* 0 */
910 uint64 time_limit; /* 0 */
911 uint32 system_flags; /* 1 */
912 BUFHDR2 hdr_sec_desc;
916 uint32 attribute_count;
919 uint32 privlist_count;
920 UNIHDR *hdr_privslist;
921 UNISTR2 *uni_privslist;
923 RPC_DATA_BLOB buf_sec_desc;
926 /* SAM_DELTA_SECRET */
944 uint32 unknow2; /* 0x0 12 times */
947 uint32 reserved1; /* 0 */
952 uint32 reserved2; /* 0 */
960 /* SAM_DELTA_MOD_COUNT (0x16) */
963 uint32 dom_mod_count_ptr;
964 uint64 dom_mod_count; /* domain mod count at last sync */
965 } SAM_DELTA_MOD_COUNT;
967 typedef union sam_delta_ctr_info {
968 SAM_DOMAIN_INFO domain_info ;
969 SAM_GROUP_INFO group_info ;
970 SAM_ACCOUNT_INFO account_info;
971 SAM_GROUP_MEM_INFO grp_mem_info;
972 SAM_ALIAS_INFO alias_info ;
973 SAM_ALIAS_MEM_INFO als_mem_info;
974 SAM_DELTA_POLICY policy_info;
975 SAM_DELTA_PRIVS privs_info;
976 SAM_DELTA_MOD_COUNT mod_count;
977 SAM_DELTA_TRUSTDOMS trustdoms_info;
978 SAM_DELTA_SECRET secret_info;
982 typedef struct net_r_sam_sync_info {
992 SAM_DELTA_HDR *hdr_deltas;
993 SAM_DELTA_CTR *deltas;
998 /* NET_Q_SAM_DELTAS */
999 typedef struct net_q_sam_deltas_info {
1000 UNISTR2 uni_srv_name;
1001 UNISTR2 uni_cli_name;
1006 uint64 dom_mod_count; /* domain mod count at last sync */
1008 uint32 max_size; /* preferred maximum length */
1011 /* NET_R_SAM_DELTAS */
1012 typedef struct net_r_sam_deltas_info {
1015 uint64 dom_mod_count; /* new domain mod count */
1021 SAM_DELTA_HDR *hdr_deltas;
1022 SAM_DELTA_CTR *deltas;
1027 /* NET_Q_DSR_GETDCNAME - Ask a DC for a trusted DC name and its address */
1028 typedef struct net_q_dsr_getdcname {
1029 uint32 ptr_server_unc;
1030 UNISTR2 uni_server_unc;
1031 uint32 ptr_domain_name;
1032 UNISTR2 uni_domain_name;
1033 uint32 ptr_domain_guid;
1034 struct GUID *domain_guid;
1035 uint32 ptr_site_guid;
1036 struct GUID *site_guid;
1038 } NET_Q_DSR_GETDCNAME;
1040 /* NET_R_DSR_GETDCNAME - Ask a DC for a trusted DC name and its address */
1041 typedef struct net_r_dsr_getdcname {
1044 uint32 ptr_dc_address;
1045 UNISTR2 uni_dc_address;
1046 int32 dc_address_type;
1047 struct GUID domain_guid;
1048 uint32 ptr_domain_name;
1049 UNISTR2 uni_domain_name;
1050 uint32 ptr_forest_name;
1051 UNISTR2 uni_forest_name;
1053 uint32 ptr_dc_site_name;
1054 UNISTR2 uni_dc_site_name;
1055 uint32 ptr_client_site_name;
1056 UNISTR2 uni_client_site_name;
1058 } NET_R_DSR_GETDCNAME;
1060 /* NET_Q_DSR_GESITENAME */
1061 typedef struct net_q_dsr_getsitename {
1062 uint32 ptr_computer_name;
1063 UNISTR2 uni_computer_name;
1064 } NET_Q_DSR_GETSITENAME;
1066 /* NET_R_DSR_GETSITENAME */
1067 typedef struct net_r_dsr_getsitename {
1068 uint32 ptr_site_name;
1069 UNISTR2 uni_site_name;
1071 } NET_R_DSR_GETSITENAME;
1074 #endif /* _RPC_NETLOGON_H */