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 /* Secure Channel types. used in NetrServerAuthenticate negotiation */
49 #define SEC_CHAN_WKSTA 2
50 #define SEC_CHAN_DOMAIN 4
51 #define SEC_CHAN_BDC 6
53 /* Returned delta types */
54 #define SAM_DELTA_DOMAIN_INFO 0x01
55 #define SAM_DELTA_GROUP_INFO 0x02
56 #define SAM_DELTA_RENAME_GROUP 0x04
57 #define SAM_DELTA_ACCOUNT_INFO 0x05
58 #define SAM_DELTA_RENAME_USER 0x07
59 #define SAM_DELTA_GROUP_MEM 0x08
60 #define SAM_DELTA_ALIAS_INFO 0x09
61 #define SAM_DELTA_RENAME_ALIAS 0x0b
62 #define SAM_DELTA_ALIAS_MEM 0x0c
63 #define SAM_DELTA_POLICY_INFO 0x0d
64 #define SAM_DELTA_TRUST_DOMS 0x0e
65 #define SAM_DELTA_PRIVS_INFO 0x10 /* DT_DELTA_ACCOUNTS */
66 #define SAM_DELTA_SECRET_INFO 0x12
67 #define SAM_DELTA_DELETE_GROUP 0x14
68 #define SAM_DELTA_DELETE_USER 0x15
69 #define SAM_DELTA_MODIFIED_COUNT 0x16
71 /* SAM database types */
72 #define SAM_DATABASE_DOMAIN 0x00 /* Domain users and groups */
73 #define SAM_DATABASE_BUILTIN 0x01 /* BUILTIN users and groups */
74 #define SAM_DATABASE_PRIVS 0x02 /* Privileges */
76 /* flags use when sending a NETLOGON_CONTROL request */
78 #define NETLOGON_CONTROL_SYNC 0x2
79 #define NETLOGON_CONTROL_REDISCOVER 0x5
80 #define NETLOGON_CONTROL_TC_QUERY 0x6
81 #define NETLOGON_CONTROL_TRANSPORT_NOTIFY 0x7
82 #define NETLOGON_CONTROL_SET_DBFLAG 0xfffe
84 /* Some flag values reverse engineered from NLTEST.EXE */
85 /* used in the NETLOGON_CONTROL[2] reply */
87 #define NL_CTRL_IN_SYNC 0x0000
88 #define NL_CTRL_REPL_NEEDED 0x0001
89 #define NL_CTRL_REPL_IN_PROGRESS 0x0002
90 #define NL_CTRL_FULL_SYNC 0x0004
92 #define LOGON_GUEST 0x00000001
93 #define LOGON_NOENCRYPTION 0x00000002
94 #define LOGON_CACHED_ACCOUNT 0x00000004
95 #define LOGON_USED_LM_PASSWORD 0x00000008
96 #define LOGON_EXTRA_SIDS 0x00000020
97 #define LOGON_SUBAUTH_SESSION_KEY 0x00000040
98 #define LOGON_SERVER_TRUST_ACCOUNT 0x00000080
99 #define LOGON_NTLMV2_ENABLED 0x00000100
100 #define LOGON_RESOURCE_GROUPS 0x00000200
101 #define LOGON_PROFILE_PATH_RETURNED 0x00000400
102 #define LOGON_GRACE_LOGON 0x01000000
103 #define LOGON_KRB5_FAIL_CLOCK_SKEW 0x02000000
105 #define SE_GROUP_MANDATORY 0x00000001
106 #define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
107 #define SE_GROUP_ENABLED 0x00000004
108 #define SE_GROUP_OWNER 0x00000008
109 #define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
110 #define SE_GROUP_LOGON_ID 0xC0000000
111 #define SE_GROUP_RESOURCE 0x20000000 /* Domain Local Group */
113 /* Flags for controlling the behaviour of a particular logon */
115 /* sets LOGON_SERVER_TRUST_ACCOUNT user_flag */
116 #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x00000020
117 #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x00000800
119 /* updates the "logon time" on network logon */
120 #define MSV1_0_UPDATE_LOGON_STATISTICS 0x00000004
122 /* returns the user parameters in the driveletter */
123 #define MSV1_0_RETURN_USER_PARAMETERS 0x00000008
125 /* returns the profilepath in the driveletter and
126 * sets LOGON_PROFILE_PATH_RETURNED user_flag */
127 #define MSV1_0_RETURN_PROFILE_PATH 0x00000200
130 /* I think this is correct - it's what gets parsed on the wire. JRA. */
131 /* NET_USER_INFO_2 */
132 typedef struct net_user_info_2 {
133 uint32 ptr_user_info;
135 NTTIME logon_time; /* logon time */
136 NTTIME logoff_time; /* logoff time */
137 NTTIME kickoff_time; /* kickoff time */
138 NTTIME pass_last_set_time; /* password last set time */
139 NTTIME pass_can_change_time; /* password can change time */
140 NTTIME pass_must_change_time; /* password must change time */
142 UNIHDR hdr_user_name; /* username unicode string header */
143 UNIHDR hdr_full_name; /* user's full name unicode string header */
144 UNIHDR hdr_logon_script; /* logon script unicode string header */
145 UNIHDR hdr_profile_path; /* profile path unicode string header */
146 UNIHDR hdr_home_dir; /* home directory unicode string header */
147 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
149 uint16 logon_count; /* logon count */
150 uint16 bad_pw_count; /* bad password count */
152 uint32 user_id; /* User ID */
153 uint32 group_id; /* Group ID */
154 uint32 num_groups; /* num groups */
155 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
156 uint32 user_flgs; /* user flags */
158 uint8 user_sess_key[16]; /* unused user session key */
160 UNIHDR hdr_logon_srv; /* logon server unicode string header */
161 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
163 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
164 uint8 padding[40]; /* unused padding bytes. expansion room */
166 UNISTR2 uni_user_name; /* username unicode string */
167 UNISTR2 uni_full_name; /* user's full name unicode string */
168 UNISTR2 uni_logon_script; /* logon script unicode string */
169 UNISTR2 uni_profile_path; /* profile path unicode string */
170 UNISTR2 uni_home_dir; /* home directory unicode string */
171 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
173 uint32 num_groups2; /* num groups */
174 DOM_GID *gids; /* group info */
176 UNISTR2 uni_logon_srv; /* logon server unicode string */
177 UNISTR2 uni_logon_dom; /* logon domain unicode string */
179 DOM_SID2 dom_sid; /* domain SID */
181 uint32 num_other_groups; /* other groups */
182 DOM_GID *other_gids; /* group info */
183 DOM_SID2 *other_sids; /* undocumented - domain SIDs */
188 /* NET_USER_INFO_2 */
189 typedef struct net_user_info_2 {
190 uint32 ptr_user_info;
192 NTTIME logon_time; /* logon time */
193 NTTIME logoff_time; /* logoff time */
194 NTTIME kickoff_time; /* kickoff time */
195 NTTIME pass_last_set_time; /* password last set time */
196 NTTIME pass_can_change_time; /* password can change time */
197 NTTIME pass_must_change_time; /* password must change time */
199 UNIHDR hdr_user_name; /* username unicode string header */
200 UNIHDR hdr_full_name; /* user's full name unicode string header */
201 UNIHDR hdr_logon_script; /* logon script unicode string header */
202 UNIHDR hdr_profile_path; /* profile path unicode string header */
203 UNIHDR hdr_home_dir; /* home directory unicode string header */
204 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
206 uint16 logon_count; /* logon count */
207 uint16 bad_pw_count; /* bad password count */
209 uint32 user_rid; /* User RID */
210 uint32 group_rid; /* Group RID */
212 uint32 num_groups; /* num groups */
213 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
214 uint32 user_flgs; /* user flags */
216 uint8 user_sess_key[16]; /* user session key */
218 UNIHDR hdr_logon_srv; /* logon server unicode string header */
219 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
221 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
222 uint8 lm_sess_key[8]; /* lm session key */
223 uint32 acct_flags; /* account flags */
224 uint32 unknown[7]; /* unknown */
226 UNISTR2 uni_user_name; /* username unicode string */
227 UNISTR2 uni_full_name; /* user's full name unicode string */
228 UNISTR2 uni_logon_script; /* logon script unicode string */
229 UNISTR2 uni_profile_path; /* profile path unicode string */
230 UNISTR2 uni_home_dir; /* home directory unicode string */
231 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
233 UNISTR2 uni_logon_srv; /* logon server unicode string */
234 UNISTR2 uni_logon_dom; /* logon domain unicode string */
236 DOM_SID2 dom_sid; /* domain SID */
239 /* NET_USER_INFO_3 */
240 typedef struct net_user_info_3 {
241 uint32 ptr_user_info;
243 NTTIME logon_time; /* logon time */
244 NTTIME logoff_time; /* logoff time */
245 NTTIME kickoff_time; /* kickoff time */
246 NTTIME pass_last_set_time; /* password last set time */
247 NTTIME pass_can_change_time; /* password can change time */
248 NTTIME pass_must_change_time; /* password must change time */
250 UNIHDR hdr_user_name; /* username unicode string header */
251 UNIHDR hdr_full_name; /* user's full name unicode string header */
252 UNIHDR hdr_logon_script; /* logon script unicode string header */
253 UNIHDR hdr_profile_path; /* profile path unicode string header */
254 UNIHDR hdr_home_dir; /* home directory unicode string header */
255 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
257 uint16 logon_count; /* logon count */
258 uint16 bad_pw_count; /* bad password count */
260 uint32 user_rid; /* User RID */
261 uint32 group_rid; /* Group RID */
263 uint32 num_groups; /* num groups */
264 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
265 uint32 user_flgs; /* user flags */
267 uint8 user_sess_key[16]; /* user session key */
269 UNIHDR hdr_logon_srv; /* logon server unicode string header */
270 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
272 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
273 uint8 lm_sess_key[8]; /* lm session key */
274 uint32 acct_flags; /* account flags */
275 uint32 unknown[7]; /* unknown */
277 uint32 num_other_sids; /* number of foreign/trusted domain sids */
278 uint32 buffer_other_sids;
280 /* The next three uint32 are not really part of user_info_3 but here
281 * for parsing convenience. They are only valid in Kerberos PAC
282 * parsing - Guenther */
283 uint32 ptr_res_group_dom_sid;
284 uint32 res_group_count;
285 uint32 ptr_res_groups;
287 UNISTR2 uni_user_name; /* username unicode string */
288 UNISTR2 uni_full_name; /* user's full name unicode string */
289 UNISTR2 uni_logon_script; /* logon script unicode string */
290 UNISTR2 uni_profile_path; /* profile path unicode string */
291 UNISTR2 uni_home_dir; /* home directory unicode string */
292 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
294 uint32 num_groups2; /* num groups */
295 DOM_GID *gids; /* group info */
297 UNISTR2 uni_logon_srv; /* logon server unicode string */
298 UNISTR2 uni_logon_dom; /* logon domain unicode string */
300 DOM_SID2 dom_sid; /* domain SID */
302 DOM_SID2 *other_sids; /* foreign/trusted domain SIDs */
303 uint32 *other_sids_attrib;
307 /* NETLOGON_INFO_1 - pdc status info, i presume */
308 typedef struct netlogon_1_info {
309 uint32 flags; /* 0x0 - undocumented */
310 uint32 pdc_status; /* 0x0 - undocumented */
313 /* NETLOGON_INFO_2 - pdc status info, plus trusted domain info */
314 typedef struct netlogon_2_info {
315 uint32 flags; /* 0x0 - undocumented */
316 uint32 pdc_status; /* 0x0 - undocumented */
317 uint32 ptr_trusted_dc_name; /* pointer to trusted domain controller name */
319 UNISTR2 uni_trusted_dc_name; /* unicode string - trusted dc name */
322 /* NETLOGON_INFO_3 - logon status info, i presume */
323 typedef struct netlogon_3_info {
324 uint32 flags; /* 0x0 - undocumented */
325 uint32 logon_attempts; /* number of logon attempts */
326 uint32 reserved_1; /* 0x0 - undocumented */
327 uint32 reserved_2; /* 0x0 - undocumented */
328 uint32 reserved_3; /* 0x0 - undocumented */
329 uint32 reserved_4; /* 0x0 - undocumented */
330 uint32 reserved_5; /* 0x0 - undocumented */
333 /********************************************************
336 This is generated by a nltest /bdc_query:DOMAIN
338 query_level 0x1, function_code 0x1
340 ********************************************************/
342 /* NET_Q_LOGON_CTRL - LSA Netr Logon Control */
344 typedef struct net_q_logon_ctrl_info {
346 UNISTR2 uni_server_name;
347 uint32 function_code;
351 /* NET_R_LOGON_CTRL - LSA Netr Logon Control */
353 typedef struct net_r_logon_ctrl_info {
358 NETLOGON_INFO_1 info1;
365 typedef struct ctrl_data_info_5 {
366 uint32 function_code;
372 typedef struct ctrl_data_info_6 {
373 uint32 function_code;
380 /********************************************************
383 query_level 0x1 - pdc status
384 query_level 0x3 - number of logon attempts.
386 ********************************************************/
388 /* NET_Q_LOGON_CTRL2 - LSA Netr Logon Control 2 */
389 typedef struct net_q_logon_ctrl2_info {
390 uint32 ptr; /* undocumented buffer pointer */
391 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
393 uint32 function_code;
396 CTRL_DATA_INFO_5 info5;
397 CTRL_DATA_INFO_6 info6;
401 /*******************************************************
402 Logon Control Response
404 switch_value is same as query_level in request
405 *******************************************************/
407 /* NET_R_LOGON_CTRL2 - response to LSA Logon Control2 */
408 typedef struct net_r_logon_ctrl2_info {
409 uint32 switch_value; /* 0x1, 0x3 */
414 NETLOGON_INFO_1 info1;
415 NETLOGON_INFO_2 info2;
416 NETLOGON_INFO_3 info3;
420 NTSTATUS status; /* return code */
423 /* NET_Q_GETANYDCNAME - Ask a DC for a trusted DC name */
425 typedef struct net_q_getanydcname {
426 uint32 ptr_logon_server;
427 UNISTR2 uni_logon_server;
428 uint32 ptr_domainname;
429 UNISTR2 uni_domainname;
430 } NET_Q_GETANYDCNAME;
432 /* NET_R_GETANYDCNAME - Ask a DC for a trusted DC name */
434 typedef struct net_r_getanydcname {
438 } NET_R_GETANYDCNAME;
441 /* NET_Q_GETDCNAME - Ask a DC for a trusted DC name */
443 typedef struct net_q_getdcname {
444 UNISTR2 uni_logon_server;
445 uint32 ptr_domainname;
446 UNISTR2 uni_domainname;
449 /* NET_R_GETDCNAME - Ask a DC for a trusted DC name */
451 typedef struct net_r_getdcname {
457 /* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */
458 typedef struct net_q_trust_dom_info {
459 uint32 ptr; /* undocumented buffer pointer */
460 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
461 } NET_Q_TRUST_DOM_LIST;
463 #define MAX_TRUST_DOMS 1
465 /* NET_R_TRUST_DOM_LIST - response to LSA Trusted Domains */
466 typedef struct net_r_trust_dom_info {
467 UNISTR2 uni_trust_dom_name[MAX_TRUST_DOMS];
469 NTSTATUS status; /* return code */
470 } NET_R_TRUST_DOM_LIST;
474 typedef struct neg_flags_info {
475 uint32 neg_flags; /* negotiated flags */
480 typedef struct net_q_req_chal_info {
481 uint32 undoc_buffer; /* undocumented buffer pointer */
482 UNISTR2 uni_logon_srv; /* logon server unicode string */
483 UNISTR2 uni_logon_clnt; /* logon client unicode string */
484 DOM_CHAL clnt_chal; /* client challenge */
489 typedef struct net_r_req_chal_info {
490 DOM_CHAL srv_chal; /* server challenge */
491 NTSTATUS status; /* return code */
495 typedef struct net_q_auth_info {
496 DOM_LOG_INFO clnt_id; /* client identification info */
497 DOM_CHAL clnt_chal; /* client-calculated credentials */
501 typedef struct net_r_auth_info {
502 DOM_CHAL srv_chal; /* server-calculated credentials */
503 NTSTATUS status; /* return code */
507 typedef struct net_q_auth2_info {
508 DOM_LOG_INFO clnt_id; /* client identification info */
509 DOM_CHAL clnt_chal; /* client-calculated credentials */
511 NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */
516 typedef struct net_r_auth2_info {
517 DOM_CHAL srv_chal; /* server-calculated credentials */
518 NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */
519 NTSTATUS status; /* return code */
523 typedef struct net_q_auth3_info {
524 DOM_LOG_INFO clnt_id; /* client identification info */
525 DOM_CHAL clnt_chal; /* client-calculated credentials */
526 NEG_FLAGS clnt_flgs; /* usually 0x6007 ffff */
530 typedef struct net_r_auth3_info {
531 DOM_CHAL srv_chal; /* server-calculated credentials */
532 NEG_FLAGS srv_flgs; /* usually 0x6007 ffff */
533 uint32 unknown; /* 0x0000045b */
534 NTSTATUS status; /* return code */
538 /* NET_Q_SRV_PWSET */
539 typedef struct net_q_srv_pwset_info {
540 DOM_CLNT_INFO clnt_id; /* client identification/authentication info */
541 uint8 pwd[16]; /* new password - undocumented. */
544 /* NET_R_SRV_PWSET */
545 typedef struct net_r_srv_pwset_info {
546 DOM_CRED srv_cred; /* server-calculated credentials */
548 NTSTATUS status; /* return code */
552 typedef struct net_network_info_2 {
553 uint32 ptr_id_info2; /* pointer to id_info_2 */
554 UNIHDR hdr_domain_name; /* domain name unicode header */
555 uint32 param_ctrl; /* param control (0x2) */
556 DOM_LOGON_ID logon_id; /* logon ID */
557 UNIHDR hdr_user_name; /* user name unicode header */
558 UNIHDR hdr_wksta_name; /* workstation name unicode header */
559 uint8 lm_chal[8]; /* lan manager 8 byte challenge */
560 STRHDR hdr_nt_chal_resp; /* nt challenge response */
561 STRHDR hdr_lm_chal_resp; /* lm challenge response */
563 UNISTR2 uni_domain_name; /* domain name unicode string */
564 UNISTR2 uni_user_name; /* user name unicode string */
565 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
566 STRING2 nt_chal_resp; /* nt challenge response */
567 STRING2 lm_chal_resp; /* lm challenge response */
571 typedef struct id_info_1 {
572 uint32 ptr_id_info1; /* pointer to id_info_1 */
573 UNIHDR hdr_domain_name; /* domain name unicode header */
574 uint32 param_ctrl; /* param control */
575 DOM_LOGON_ID logon_id; /* logon ID */
576 UNIHDR hdr_user_name; /* user name unicode header */
577 UNIHDR hdr_wksta_name; /* workstation name unicode header */
578 OWF_INFO lm_owf; /* LM OWF Password */
579 OWF_INFO nt_owf; /* NT OWF Password */
580 UNISTR2 uni_domain_name; /* domain name unicode string */
581 UNISTR2 uni_user_name; /* user name unicode string */
582 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
585 #define INTERACTIVE_LOGON_TYPE 1
586 #define NET_LOGON_TYPE 2
588 /* NET_ID_INFO_CTR */
589 typedef struct net_id_info_ctr_info {
593 NET_ID_INFO_1 id1; /* auth-level 1 - interactive user login */
594 NET_ID_INFO_2 id2; /* auth-level 2 - workstation referred login */
598 /* SAM_INFO - sam logon/off id structure */
599 typedef struct sam_info {
600 DOM_CLNT_INFO2 client;
601 uint32 ptr_rtn_cred; /* pointer to return credentials */
602 DOM_CRED rtn_cred; /* return credentials */
604 NET_ID_INFO_CTR *ctr;
607 /* SAM_INFO - sam logon/off id structure - no creds */
608 typedef struct sam_info_ex {
611 NET_ID_INFO_CTR *ctr;
614 /* NET_Q_SAM_LOGON */
615 typedef struct net_q_sam_logon_info {
617 uint16 validation_level;
620 /* NET_Q_SAM_LOGON_EX */
621 typedef struct net_q_sam_logon_info_ex {
622 DOM_SAM_INFO_EX sam_id;
623 uint16 validation_level;
625 } NET_Q_SAM_LOGON_EX;
627 /* NET_R_SAM_LOGON */
628 typedef struct net_r_sam_logon_info {
629 uint32 buffer_creds; /* undocumented buffer pointer */
630 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
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? */
637 NTSTATUS status; /* return code */
640 /* NET_R_SAM_LOGON_EX */
641 typedef struct net_r_sam_logon_info_ex {
642 uint16 switch_value; /* 3 - indicates type of USER INFO */
643 NET_USER_INFO_3 *user;
645 uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
648 NTSTATUS status; /* return code */
649 } NET_R_SAM_LOGON_EX;
652 /* NET_Q_SAM_LOGOFF */
653 typedef struct net_q_sam_logoff_info {
657 /* NET_R_SAM_LOGOFF */
658 typedef struct net_r_sam_logoff_info {
659 uint32 buffer_creds; /* undocumented buffer pointer */
660 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
661 NTSTATUS status; /* return code */
665 typedef struct net_q_sam_sync_info {
666 UNISTR2 uni_srv_name; /* \\PDC */
667 UNISTR2 uni_cli_name; /* BDC */
672 uint32 restart_state;
675 uint32 max_size; /* preferred maximum length */
679 typedef struct sam_delta_hdr_info {
680 uint16 type; /* type of structure attached */
689 typedef struct account_lockout_string {
693 /* uint16 *bindata; */
694 uint64 lockout_duration;
696 uint32 bad_attempt_lockout;
700 /* HDR_LOCKOUT_STRING */
701 typedef struct hdr_account_lockout_string {
705 } HDR_LOCKOUT_STRING;
707 /* SAM_DOMAIN_INFO (0x1) */
708 typedef struct sam_domain_info_info {
714 uint16 pwd_history_len;
717 uint64 dom_mod_count;
718 NTTIME creation_time;
719 uint32 security_information;
721 BUFHDR4 hdr_sec_desc; /* security descriptor */
723 HDR_LOCKOUT_STRING hdr_account_lockout;
729 UNISTR2 uni_dom_name;
730 UNISTR2 buf_oem_info;
732 RPC_DATA_BLOB buf_sec_desc;
734 LOCKOUT_STRING account_lockout;
736 UNISTR2 buf_unknown2;
737 UNISTR2 buf_unknown3;
738 UNISTR2 buf_unknown4;
740 uint32 logon_chgpass;
746 /* SAM_GROUP_INFO (0x2) */
747 typedef struct sam_group_info_info {
751 BUFHDR2 hdr_sec_desc; /* security descriptor */
754 UNISTR2 uni_grp_name;
755 UNISTR2 uni_grp_desc;
756 RPC_DATA_BLOB buf_sec_desc;
760 typedef struct sam_passwd_info {
761 /* this structure probably contains password history */
762 /* this is probably a count of lm/nt pairs */
763 uint32 unk_0; /* 0x0000 0002 */
766 uint8 buf_lm_pwd[16];
769 uint8 buf_nt_pwd[16];
775 /* SAM_ACCOUNT_INFO (0x5) */
776 typedef struct sam_account_info_info {
777 UNIHDR hdr_acct_name;
778 UNIHDR hdr_full_name;
784 UNIHDR hdr_dir_drive;
785 UNIHDR hdr_logon_script;
786 UNIHDR hdr_acct_desc;
787 UNIHDR hdr_workstations;
792 uint32 logon_divs; /* 0xA8 */
793 uint32 ptr_logon_hrs;
795 uint16 bad_pwd_count;
797 NTTIME pwd_last_set_time;
798 NTTIME acct_expiry_time;
803 uint8 nt_pwd_present;
804 uint8 lm_pwd_present;
808 UNIHDR hdr_parameters;
812 BUFHDR2 hdr_sec_desc; /* security descriptor */
815 UNIHDR hdr_reserved[3]; /* space for more strings */
816 uint32 dw_reserved[4]; /* space for more data - first two seem to
819 UNISTR2 uni_acct_name;
820 UNISTR2 uni_full_name;
821 UNISTR2 uni_home_dir;
822 UNISTR2 uni_dir_drive;
823 UNISTR2 uni_logon_script;
824 UNISTR2 uni_acct_desc;
825 UNISTR2 uni_workstations;
827 uint32 unknown1; /* 0x4EC */
828 uint32 unknown2; /* 0 */
830 RPC_DATA_BLOB buf_logon_hrs;
832 UNISTR2 uni_parameters;
834 RPC_DATA_BLOB buf_sec_desc;
838 /* SAM_GROUP_MEM_INFO (0x8) */
839 typedef struct sam_group_mem_info_info {
851 } SAM_GROUP_MEM_INFO;
853 /* SAM_ALIAS_INFO (0x9) */
854 typedef struct sam_alias_info_info {
857 BUFHDR2 hdr_sec_desc; /* security descriptor */
861 UNISTR2 uni_als_name;
862 RPC_DATA_BLOB buf_sec_desc;
863 UNISTR2 uni_als_desc;
866 /* SAM_ALIAS_MEM_INFO (0xC) */
867 typedef struct sam_alias_mem_info_info {
875 } SAM_ALIAS_MEM_INFO;
878 /* SAM_DELTA_POLICY (0x0D) */
880 uint32 max_log_size; /* 0x5000 */
881 uint64 audit_retention_period; /* 0 */
882 uint32 auditing_mode; /* 0 */
888 uint32 paged_pool_limit; /* 0x02000000 */
889 uint32 non_paged_pool_limit; /* 0x00100000 */
890 uint32 min_workset_size; /* 0x00010000 */
891 uint32 max_workset_size; /* 0x0f000000 */
892 uint32 page_file_limit; /* 0 */
893 uint64 time_limit; /* 0 */
894 NTTIME modify_time; /* 0x3c*/
895 NTTIME create_time; /* a7080110 */
896 BUFHDR2 hdr_sec_desc;
898 uint32 num_event_audit_options;
899 uint32 event_audit_option;
904 RPC_DATA_BLOB buf_sec_desc;
907 /* SAM_DELTA_TRUST_DOMS */
923 } SAM_DELTA_TRUSTDOMS;
925 /* SAM_DELTA_PRIVS (0x10) */
932 uint32 priv_attr_ptr;
933 uint32 priv_name_ptr;
935 uint32 paged_pool_limit; /* 0x02000000 */
936 uint32 non_paged_pool_limit; /* 0x00100000 */
937 uint32 min_workset_size; /* 0x00010000 */
938 uint32 max_workset_size; /* 0x0f000000 */
939 uint32 page_file_limit; /* 0 */
940 uint64 time_limit; /* 0 */
941 uint32 system_flags; /* 1 */
942 BUFHDR2 hdr_sec_desc;
946 uint32 attribute_count;
949 uint32 privlist_count;
950 UNIHDR *hdr_privslist;
951 UNISTR2 *uni_privslist;
953 RPC_DATA_BLOB buf_sec_desc;
956 /* SAM_DELTA_SECRET */
974 uint32 unknow2; /* 0x0 12 times */
977 uint32 reserved1; /* 0 */
982 uint32 reserved2; /* 0 */
990 /* SAM_DELTA_MOD_COUNT (0x16) */
993 uint32 dom_mod_count_ptr;
994 uint64 dom_mod_count; /* domain mod count at last sync */
995 } SAM_DELTA_MOD_COUNT;
997 typedef union sam_delta_ctr_info {
998 SAM_DOMAIN_INFO domain_info ;
999 SAM_GROUP_INFO group_info ;
1000 SAM_ACCOUNT_INFO account_info;
1001 SAM_GROUP_MEM_INFO grp_mem_info;
1002 SAM_ALIAS_INFO alias_info ;
1003 SAM_ALIAS_MEM_INFO als_mem_info;
1004 SAM_DELTA_POLICY policy_info;
1005 SAM_DELTA_PRIVS privs_info;
1006 SAM_DELTA_MOD_COUNT mod_count;
1007 SAM_DELTA_TRUSTDOMS trustdoms_info;
1008 SAM_DELTA_SECRET secret_info;
1011 /* NET_R_SAM_SYNC */
1012 typedef struct net_r_sam_sync_info {
1015 uint32 sync_context;
1022 SAM_DELTA_HDR *hdr_deltas;
1023 SAM_DELTA_CTR *deltas;
1028 /* NET_Q_SAM_DELTAS */
1029 typedef struct net_q_sam_deltas_info {
1030 UNISTR2 uni_srv_name;
1031 UNISTR2 uni_cli_name;
1036 uint64 dom_mod_count; /* domain mod count at last sync */
1038 uint32 max_size; /* preferred maximum length */
1041 /* NET_R_SAM_DELTAS */
1042 typedef struct net_r_sam_deltas_info {
1045 uint64 dom_mod_count; /* new domain mod count */
1051 SAM_DELTA_HDR *hdr_deltas;
1052 SAM_DELTA_CTR *deltas;
1057 #define DS_FORCE_REDISCOVERY 0x00000001
1058 #define DS_DIRECTORY_SERVICE_REQUIRED 0x00000010
1059 #define DS_DIRECTORY_SERVICE_PREFERRED 0x00000020
1060 #define DS_GC_SERVER_REQUIRED 0x00000040
1061 #define DS_PDC_REQUIRED 0x00000080
1062 #define DS_BACKGROUND_ONLY 0x00000100
1063 #define DS_IP_REQUIRED 0x00000200
1064 #define DS_KDC_REQUIRED 0x00000400
1065 #define DS_TIMESERV_REQUIRED 0x00000800
1066 #define DS_WRITABLE_REQUIRED 0x00001000
1067 #define DS_GOOD_TIMESERV_PREFERRED 0x00002000
1068 #define DS_AVOID_SELF 0x00004000
1069 #define DS_ONLY_LDAP_NEEDED 0x00008000
1071 #define DS_IS_FLAT_NAME 0x00010000
1072 #define DS_IS_DNS_NAME 0x00020000
1074 #define DS_RETURN_DNS_NAME 0x40000000
1075 #define DS_RETURN_FLAT_NAME 0x80000000
1077 #if 0 /* unknown yet */
1078 #define DS_IP_VERSION_AGNOSTIC
1079 #define DS_TRY_NEXTCLOSEST_SITE
1082 #define DSGETDC_VALID_FLAGS ( \
1083 DS_FORCE_REDISCOVERY | \
1084 DS_DIRECTORY_SERVICE_REQUIRED | \
1085 DS_DIRECTORY_SERVICE_PREFERRED | \
1086 DS_GC_SERVER_REQUIRED | \
1088 DS_BACKGROUND_ONLY | \
1091 DS_TIMESERV_REQUIRED | \
1092 DS_WRITABLE_REQUIRED | \
1093 DS_GOOD_TIMESERV_PREFERRED | \
1095 DS_ONLY_LDAP_NEEDED | \
1098 DS_RETURN_FLAT_NAME | \
1099 DS_RETURN_DNS_NAME )
1101 struct DS_DOMAIN_CONTROLLER_INFO {
1102 const char *domain_controller_name;
1103 const char *domain_controller_address;
1104 int32 domain_controller_address_type;
1105 struct GUID *domain_guid;
1106 const char *domain_name;
1107 const char *dns_forest_name;
1109 const char *dc_site_name;
1110 const char *client_site_name;
1113 /* NET_Q_DSR_GETDCNAME */
1114 typedef struct net_q_dsr_getdcname {
1115 uint32 ptr_server_unc;
1116 UNISTR2 uni_server_unc;
1117 uint32 ptr_domain_name;
1118 UNISTR2 uni_domain_name;
1119 uint32 ptr_domain_guid;
1120 struct GUID *domain_guid;
1121 uint32 ptr_site_guid;
1122 struct GUID *site_guid;
1124 } NET_Q_DSR_GETDCNAME;
1126 /* NET_R_DSR_GETDCNAME */
1127 typedef struct net_r_dsr_getdcname {
1130 uint32 ptr_dc_address;
1131 UNISTR2 uni_dc_address;
1132 int32 dc_address_type;
1133 struct GUID domain_guid;
1134 uint32 ptr_domain_name;
1135 UNISTR2 uni_domain_name;
1136 uint32 ptr_forest_name;
1137 UNISTR2 uni_forest_name;
1139 uint32 ptr_dc_site_name;
1140 UNISTR2 uni_dc_site_name;
1141 uint32 ptr_client_site_name;
1142 UNISTR2 uni_client_site_name;
1144 } NET_R_DSR_GETDCNAME;
1146 /* NET_Q_DSR_GETDCNAMEEX */
1147 typedef struct net_q_dsr_getdcnameex {
1148 uint32 ptr_server_unc;
1149 UNISTR2 uni_server_unc;
1150 uint32 ptr_domain_name;
1151 UNISTR2 uni_domain_name;
1152 uint32 ptr_domain_guid;
1153 struct GUID *domain_guid;
1154 uint32 ptr_site_name;
1155 UNISTR2 uni_site_name;
1157 } NET_Q_DSR_GETDCNAMEEX;
1159 /* NET_R_DSR_GETDCNAMEEX */
1160 typedef struct net_r_dsr_getdcnameex NET_R_DSR_GETDCNAMEEX;
1162 /* NET_Q_DSR_GETDCNAMEEX2 */
1163 typedef struct net_q_dsr_getdcnameex2 {
1164 uint32 ptr_server_unc;
1165 UNISTR2 uni_server_unc;
1166 uint32 ptr_client_account;
1167 UNISTR2 uni_client_account;
1169 uint32 ptr_domain_name;
1170 UNISTR2 uni_domain_name;
1171 uint32 ptr_domain_guid;
1172 struct GUID *domain_guid;
1173 uint32 ptr_site_name;
1174 UNISTR2 uni_site_name;
1176 } NET_Q_DSR_GETDCNAMEEX2;
1178 /* NET_R_DSR_GETDCNAMEEX2 */
1179 typedef struct net_r_dsr_getdcnameex2 NET_R_DSR_GETDCNAMEEX2;
1181 /* NET_Q_DSR_GESITENAME */
1182 typedef struct net_q_dsr_getsitename {
1183 uint32 ptr_computer_name;
1184 UNISTR2 uni_computer_name;
1185 } NET_Q_DSR_GETSITENAME;
1187 /* NET_R_DSR_GETSITENAME */
1188 typedef struct net_r_dsr_getsitename {
1189 uint32 ptr_site_name;
1190 UNISTR2 uni_site_name;
1192 } NET_R_DSR_GETSITENAME;
1195 #endif /* _RPC_NETLOGON_H */