2 Unix SMB/CIFS implementation.
3 SMB parameters and setup
4 Copyright (C) Andrew Tridgell 1992-1997
5 Copyright (C) Luke Kenneth Casson Leighton 1996-1997
6 Copyright (C) Paul Ashton 1997
7 Copyright (C) Jean François Micouleau 2002
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef _RPC_NETLOGON_H /* _RPC_NETLOGON_H */
24 #define _RPC_NETLOGON_H
28 #define NET_SAMLOGON 0x02
29 #define NET_SAMLOGOFF 0x03
30 #define NET_REQCHAL 0x04
32 #define NET_SRVPWSET 0x06
33 #define NET_SAM_DELTAS 0x07
34 #define NET_GETDCNAME 0x0b
35 #define NET_LOGON_CTRL 0x0c
36 #define NET_GETANYDCNAME 0x0d
37 #define NET_AUTH2 0x0f
38 #define NET_LOGON_CTRL2 0x0e
39 #define NET_SAM_SYNC 0x10
40 #define NET_TRUST_DOM_LIST 0x13
41 #define NET_DSR_GETDCNAME 0x14
42 #define NET_AUTH3 0x1a
43 #define NET_DSR_GETDCNAMEEX 0x1b
44 #define NET_DSR_GETSITENAME 0x1c
45 #define NET_DSR_GETDCNAMEEX2 0x22
46 #define NET_SAMLOGON_EX 0x27
48 /* Returned delta types */
49 #define SAM_DELTA_DOMAIN_INFO 0x01
50 #define SAM_DELTA_GROUP_INFO 0x02
51 #define SAM_DELTA_RENAME_GROUP 0x04
52 #define SAM_DELTA_ACCOUNT_INFO 0x05
53 #define SAM_DELTA_RENAME_USER 0x07
54 #define SAM_DELTA_GROUP_MEM 0x08
55 #define SAM_DELTA_ALIAS_INFO 0x09
56 #define SAM_DELTA_RENAME_ALIAS 0x0b
57 #define SAM_DELTA_ALIAS_MEM 0x0c
58 #define SAM_DELTA_POLICY_INFO 0x0d
59 #define SAM_DELTA_TRUST_DOMS 0x0e
60 #define SAM_DELTA_PRIVS_INFO 0x10 /* DT_DELTA_ACCOUNTS */
61 #define SAM_DELTA_SECRET_INFO 0x12
62 #define SAM_DELTA_DELETE_GROUP 0x14
63 #define SAM_DELTA_DELETE_USER 0x15
64 #define SAM_DELTA_MODIFIED_COUNT 0x16
66 /* SAM database types */
67 #define SAM_DATABASE_DOMAIN 0x00 /* Domain users and groups */
68 #define SAM_DATABASE_BUILTIN 0x01 /* BUILTIN users and groups */
69 #define SAM_DATABASE_PRIVS 0x02 /* Privileges */
71 /* flags use when sending a NETLOGON_CONTROL request */
73 #define NETLOGON_CONTROL_SYNC 0x2
74 #define NETLOGON_CONTROL_REDISCOVER 0x5
75 #define NETLOGON_CONTROL_TC_QUERY 0x6
76 #define NETLOGON_CONTROL_TRANSPORT_NOTIFY 0x7
77 #define NETLOGON_CONTROL_SET_DBFLAG 0xfffe
79 /* Some flag values reverse engineered from NLTEST.EXE */
80 /* used in the NETLOGON_CONTROL[2] reply */
82 #define NL_CTRL_IN_SYNC 0x0000
83 #define NL_CTRL_REPL_NEEDED 0x0001
84 #define NL_CTRL_REPL_IN_PROGRESS 0x0002
85 #define NL_CTRL_FULL_SYNC 0x0004
87 #define LOGON_KRB5_FAIL_CLOCK_SKEW 0x02000000
89 /* Flags for controlling the behaviour of a particular logon */
91 /* sets NETLOGON_SERVER_TRUST_ACCOUNT user_flag */
93 #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x00000020
94 #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x00000800
96 /* updates the "logon time" on network logon */
97 #define MSV1_0_UPDATE_LOGON_STATISTICS 0x00000004
99 /* returns the user parameters in the driveletter */
100 #define MSV1_0_RETURN_USER_PARAMETERS 0x00000008
102 /* returns the profilepath in the driveletter and
103 * sets LOGON_PROFILE_PATH_RETURNED user_flag */
104 #define MSV1_0_RETURN_PROFILE_PATH 0x00000200
108 /* I think this is correct - it's what gets parsed on the wire. JRA. */
109 /* NET_USER_INFO_2 */
110 typedef struct net_user_info_2
{
111 uint32 ptr_user_info
;
113 NTTIME logon_time
; /* logon time */
114 NTTIME logoff_time
; /* logoff time */
115 NTTIME kickoff_time
; /* kickoff time */
116 NTTIME pass_last_set_time
; /* password last set time */
117 NTTIME pass_can_change_time
; /* password can change time */
118 NTTIME pass_must_change_time
; /* password must change time */
120 UNIHDR hdr_user_name
; /* username unicode string header */
121 UNIHDR hdr_full_name
; /* user's full name unicode string header */
122 UNIHDR hdr_logon_script
; /* logon script unicode string header */
123 UNIHDR hdr_profile_path
; /* profile path unicode string header */
124 UNIHDR hdr_home_dir
; /* home directory unicode string header */
125 UNIHDR hdr_dir_drive
; /* home directory drive unicode string header */
127 uint16 logon_count
; /* logon count */
128 uint16 bad_pw_count
; /* bad password count */
130 uint32 user_id
; /* User ID */
131 uint32 group_id
; /* Group ID */
132 uint32 num_groups
; /* num groups */
133 uint32 buffer_groups
; /* undocumented buffer pointer to groups. */
134 uint32 user_flgs
; /* user flags */
136 uint8 user_sess_key
[16]; /* unused user session key */
138 UNIHDR hdr_logon_srv
; /* logon server unicode string header */
139 UNIHDR hdr_logon_dom
; /* logon domain unicode string header */
141 uint32 buffer_dom_id
; /* undocumented logon domain id pointer */
142 uint8 padding
[40]; /* unused padding bytes. expansion room */
144 UNISTR2 uni_user_name
; /* username unicode string */
145 UNISTR2 uni_full_name
; /* user's full name unicode string */
146 UNISTR2 uni_logon_script
; /* logon script unicode string */
147 UNISTR2 uni_profile_path
; /* profile path unicode string */
148 UNISTR2 uni_home_dir
; /* home directory unicode string */
149 UNISTR2 uni_dir_drive
; /* home directory drive unicode string */
151 uint32 num_groups2
; /* num groups */
152 DOM_GID
*gids
; /* group info */
154 UNISTR2 uni_logon_srv
; /* logon server unicode string */
155 UNISTR2 uni_logon_dom
; /* logon domain unicode string */
157 DOM_SID2 dom_sid
; /* domain SID */
159 uint32 num_other_groups
; /* other groups */
160 DOM_GID
*other_gids
; /* group info */
161 DOM_SID2
*other_sids
; /* undocumented - domain SIDs */
166 /* NET_USER_INFO_2 */
167 typedef struct net_user_info_2
{
168 uint32 ptr_user_info
;
170 NTTIME logon_time
; /* logon time */
171 NTTIME logoff_time
; /* logoff time */
172 NTTIME kickoff_time
; /* kickoff time */
173 NTTIME pass_last_set_time
; /* password last set time */
174 NTTIME pass_can_change_time
; /* password can change time */
175 NTTIME pass_must_change_time
; /* password must change time */
177 UNIHDR hdr_user_name
; /* username unicode string header */
178 UNIHDR hdr_full_name
; /* user's full name unicode string header */
179 UNIHDR hdr_logon_script
; /* logon script unicode string header */
180 UNIHDR hdr_profile_path
; /* profile path unicode string header */
181 UNIHDR hdr_home_dir
; /* home directory unicode string header */
182 UNIHDR hdr_dir_drive
; /* home directory drive unicode string header */
184 uint16 logon_count
; /* logon count */
185 uint16 bad_pw_count
; /* bad password count */
187 uint32 user_rid
; /* User RID */
188 uint32 group_rid
; /* Group RID */
190 uint32 num_groups
; /* num groups */
191 uint32 buffer_groups
; /* undocumented buffer pointer to groups. */
192 uint32 user_flgs
; /* user flags */
194 uint8 user_sess_key
[16]; /* user session key */
196 UNIHDR hdr_logon_srv
; /* logon server unicode string header */
197 UNIHDR hdr_logon_dom
; /* logon domain unicode string header */
199 uint32 buffer_dom_id
; /* undocumented logon domain id pointer */
200 uint8 lm_sess_key
[8]; /* lm session key */
201 uint32 acct_flags
; /* account flags */
202 uint32 unknown
[7]; /* unknown */
204 UNISTR2 uni_user_name
; /* username unicode string */
205 UNISTR2 uni_full_name
; /* user's full name unicode string */
206 UNISTR2 uni_logon_script
; /* logon script unicode string */
207 UNISTR2 uni_profile_path
; /* profile path unicode string */
208 UNISTR2 uni_home_dir
; /* home directory unicode string */
209 UNISTR2 uni_dir_drive
; /* home directory drive unicode string */
211 UNISTR2 uni_logon_srv
; /* logon server unicode string */
212 UNISTR2 uni_logon_dom
; /* logon domain unicode string */
214 DOM_SID2 dom_sid
; /* domain SID */
217 /* NET_USER_INFO_3 */
218 typedef struct net_user_info_3
{
219 uint32 ptr_user_info
;
221 NTTIME logon_time
; /* logon time */
222 NTTIME logoff_time
; /* logoff time */
223 NTTIME kickoff_time
; /* kickoff time */
224 NTTIME pass_last_set_time
; /* password last set time */
225 NTTIME pass_can_change_time
; /* password can change time */
226 NTTIME pass_must_change_time
; /* password must change time */
228 UNIHDR hdr_user_name
; /* username unicode string header */
229 UNIHDR hdr_full_name
; /* user's full name unicode string header */
230 UNIHDR hdr_logon_script
; /* logon script unicode string header */
231 UNIHDR hdr_profile_path
; /* profile path unicode string header */
232 UNIHDR hdr_home_dir
; /* home directory unicode string header */
233 UNIHDR hdr_dir_drive
; /* home directory drive unicode string header */
235 uint16 logon_count
; /* logon count */
236 uint16 bad_pw_count
; /* bad password count */
238 uint32 user_rid
; /* User RID */
239 uint32 group_rid
; /* Group RID */
241 uint32 num_groups
; /* num groups */
242 uint32 buffer_groups
; /* undocumented buffer pointer to groups. */
243 uint32 user_flgs
; /* user flags */
245 uint8 user_sess_key
[16]; /* user session key */
247 UNIHDR hdr_logon_srv
; /* logon server unicode string header */
248 UNIHDR hdr_logon_dom
; /* logon domain unicode string header */
250 uint32 buffer_dom_id
; /* undocumented logon domain id pointer */
251 uint8 lm_sess_key
[8]; /* lm session key */
252 uint32 acct_flags
; /* account flags */
253 uint32 unknown
[7]; /* unknown */
255 uint32 num_other_sids
; /* number of foreign/trusted domain sids */
256 uint32 buffer_other_sids
;
258 /* The next three uint32 are not really part of user_info_3 but here
259 * for parsing convenience. They are only valid in Kerberos PAC
260 * parsing - Guenther */
261 uint32 ptr_res_group_dom_sid
;
262 uint32 res_group_count
;
263 uint32 ptr_res_groups
;
265 UNISTR2 uni_user_name
; /* username unicode string */
266 UNISTR2 uni_full_name
; /* user's full name unicode string */
267 UNISTR2 uni_logon_script
; /* logon script unicode string */
268 UNISTR2 uni_profile_path
; /* profile path unicode string */
269 UNISTR2 uni_home_dir
; /* home directory unicode string */
270 UNISTR2 uni_dir_drive
; /* home directory drive unicode string */
272 uint32 num_groups2
; /* num groups */
273 DOM_GID
*gids
; /* group info */
275 UNISTR2 uni_logon_srv
; /* logon server unicode string */
276 UNISTR2 uni_logon_dom
; /* logon domain unicode string */
278 DOM_SID2 dom_sid
; /* domain SID */
280 DOM_SID2
*other_sids
; /* foreign/trusted domain SIDs */
281 uint32
*other_sids_attrib
;
285 /* NETLOGON_INFO_1 - pdc status info, i presume */
286 typedef struct netlogon_1_info
{
287 uint32 flags
; /* 0x0 - undocumented */
288 uint32 pdc_status
; /* 0x0 - undocumented */
291 /* NETLOGON_INFO_2 - pdc status info, plus trusted domain info */
292 typedef struct netlogon_2_info
{
293 uint32 flags
; /* 0x0 - undocumented */
294 uint32 pdc_status
; /* 0x0 - undocumented */
295 uint32 ptr_trusted_dc_name
; /* pointer to trusted domain controller name */
297 UNISTR2 uni_trusted_dc_name
; /* unicode string - trusted dc name */
300 /* NETLOGON_INFO_3 - logon status info, i presume */
301 typedef struct netlogon_3_info
{
302 uint32 flags
; /* 0x0 - undocumented */
303 uint32 logon_attempts
; /* number of logon attempts */
304 uint32 reserved_1
; /* 0x0 - undocumented */
305 uint32 reserved_2
; /* 0x0 - undocumented */
306 uint32 reserved_3
; /* 0x0 - undocumented */
307 uint32 reserved_4
; /* 0x0 - undocumented */
308 uint32 reserved_5
; /* 0x0 - undocumented */
311 /********************************************************
314 This is generated by a nltest /bdc_query:DOMAIN
316 query_level 0x1, function_code 0x1
318 ********************************************************/
320 /* NET_Q_LOGON_CTRL - LSA Netr Logon Control */
322 typedef struct net_q_logon_ctrl_info
{
324 UNISTR2 uni_server_name
;
325 uint32 function_code
;
329 /* NET_R_LOGON_CTRL - LSA Netr Logon Control */
331 typedef struct net_r_logon_ctrl_info
{
336 NETLOGON_INFO_1 info1
;
343 typedef struct ctrl_data_info_5
{
344 uint32 function_code
;
350 typedef struct ctrl_data_info_6
{
351 uint32 function_code
;
358 /********************************************************
361 query_level 0x1 - pdc status
362 query_level 0x3 - number of logon attempts.
364 ********************************************************/
366 /* NET_Q_LOGON_CTRL2 - LSA Netr Logon Control 2 */
367 typedef struct net_q_logon_ctrl2_info
{
368 uint32 ptr
; /* undocumented buffer pointer */
369 UNISTR2 uni_server_name
; /* server name, starting with two '\'s */
371 uint32 function_code
;
374 CTRL_DATA_INFO_5 info5
;
375 CTRL_DATA_INFO_6 info6
;
379 /*******************************************************
380 Logon Control Response
382 switch_value is same as query_level in request
383 *******************************************************/
385 /* NET_R_LOGON_CTRL2 - response to LSA Logon Control2 */
386 typedef struct net_r_logon_ctrl2_info
{
387 uint32 switch_value
; /* 0x1, 0x3 */
392 NETLOGON_INFO_1 info1
;
393 NETLOGON_INFO_2 info2
;
394 NETLOGON_INFO_3 info3
;
398 NTSTATUS status
; /* return code */
401 /* NET_Q_GETANYDCNAME - Ask a DC for a trusted DC name */
403 typedef struct net_q_getanydcname
{
404 uint32 ptr_logon_server
;
405 UNISTR2 uni_logon_server
;
406 uint32 ptr_domainname
;
407 UNISTR2 uni_domainname
;
408 } NET_Q_GETANYDCNAME
;
410 /* NET_R_GETANYDCNAME - Ask a DC for a trusted DC name */
412 typedef struct net_r_getanydcname
{
416 } NET_R_GETANYDCNAME
;
419 /* NET_Q_GETDCNAME - Ask a DC for a trusted DC name */
421 typedef struct net_q_getdcname
{
422 UNISTR2 uni_logon_server
;
423 uint32 ptr_domainname
;
424 UNISTR2 uni_domainname
;
427 /* NET_R_GETDCNAME - Ask a DC for a trusted DC name */
429 typedef struct net_r_getdcname
{
435 /* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */
436 typedef struct net_q_trust_dom_info
{
437 uint32 ptr
; /* undocumented buffer pointer */
438 UNISTR2 uni_server_name
; /* server name, starting with two '\'s */
439 } NET_Q_TRUST_DOM_LIST
;
441 #define MAX_TRUST_DOMS 1
443 /* NET_R_TRUST_DOM_LIST - response to LSA Trusted Domains */
444 typedef struct net_r_trust_dom_info
{
445 UNISTR2 uni_trust_dom_name
[MAX_TRUST_DOMS
];
447 NTSTATUS status
; /* return code */
448 } NET_R_TRUST_DOM_LIST
;
452 typedef struct neg_flags_info
{
453 uint32 neg_flags
; /* negotiated flags */
458 typedef struct net_q_req_chal_info
{
459 uint32 undoc_buffer
; /* undocumented buffer pointer */
460 UNISTR2 uni_logon_srv
; /* logon server unicode string */
461 UNISTR2 uni_logon_clnt
; /* logon client unicode string */
462 DOM_CHAL clnt_chal
; /* client challenge */
467 typedef struct net_r_req_chal_info
{
468 DOM_CHAL srv_chal
; /* server challenge */
469 NTSTATUS status
; /* return code */
473 typedef struct net_q_auth_info
{
474 DOM_LOG_INFO clnt_id
; /* client identification info */
475 DOM_CHAL clnt_chal
; /* client-calculated credentials */
479 typedef struct net_r_auth_info
{
480 DOM_CHAL srv_chal
; /* server-calculated credentials */
481 NTSTATUS status
; /* return code */
485 typedef struct net_q_auth2_info
{
486 DOM_LOG_INFO clnt_id
; /* client identification info */
487 DOM_CHAL clnt_chal
; /* client-calculated credentials */
489 NEG_FLAGS clnt_flgs
; /* usually 0x0000 01ff */
494 typedef struct net_r_auth2_info
{
495 DOM_CHAL srv_chal
; /* server-calculated credentials */
496 NEG_FLAGS srv_flgs
; /* usually 0x0000 01ff */
497 NTSTATUS status
; /* return code */
501 typedef struct net_q_auth3_info
{
502 DOM_LOG_INFO clnt_id
; /* client identification info */
503 DOM_CHAL clnt_chal
; /* client-calculated credentials */
504 NEG_FLAGS clnt_flgs
; /* usually 0x6007 ffff */
508 typedef struct net_r_auth3_info
{
509 DOM_CHAL srv_chal
; /* server-calculated credentials */
510 NEG_FLAGS srv_flgs
; /* usually 0x6007 ffff */
511 uint32 unknown
; /* 0x0000045b */
512 NTSTATUS status
; /* return code */
516 /* NET_Q_SRV_PWSET */
517 typedef struct net_q_srv_pwset_info
{
518 DOM_CLNT_INFO clnt_id
; /* client identification/authentication info */
519 uint8 pwd
[16]; /* new password - undocumented. */
522 /* NET_R_SRV_PWSET */
523 typedef struct net_r_srv_pwset_info
{
524 DOM_CRED srv_cred
; /* server-calculated credentials */
526 NTSTATUS status
; /* return code */
530 typedef struct net_network_info_2
{
531 uint32 ptr_id_info2
; /* pointer to id_info_2 */
532 UNIHDR hdr_domain_name
; /* domain name unicode header */
533 uint32 param_ctrl
; /* param control (0x2) */
534 DOM_LOGON_ID logon_id
; /* logon ID */
535 UNIHDR hdr_user_name
; /* user name unicode header */
536 UNIHDR hdr_wksta_name
; /* workstation name unicode header */
537 uint8 lm_chal
[8]; /* lan manager 8 byte challenge */
538 STRHDR hdr_nt_chal_resp
; /* nt challenge response */
539 STRHDR hdr_lm_chal_resp
; /* lm challenge response */
541 UNISTR2 uni_domain_name
; /* domain name unicode string */
542 UNISTR2 uni_user_name
; /* user name unicode string */
543 UNISTR2 uni_wksta_name
; /* workgroup name unicode string */
544 STRING2 nt_chal_resp
; /* nt challenge response */
545 STRING2 lm_chal_resp
; /* lm challenge response */
549 typedef struct id_info_1
{
550 uint32 ptr_id_info1
; /* pointer to id_info_1 */
551 UNIHDR hdr_domain_name
; /* domain name unicode header */
552 uint32 param_ctrl
; /* param control */
553 DOM_LOGON_ID logon_id
; /* logon ID */
554 UNIHDR hdr_user_name
; /* user name unicode header */
555 UNIHDR hdr_wksta_name
; /* workstation name unicode header */
556 OWF_INFO lm_owf
; /* LM OWF Password */
557 OWF_INFO nt_owf
; /* NT OWF Password */
558 UNISTR2 uni_domain_name
; /* domain name unicode string */
559 UNISTR2 uni_user_name
; /* user name unicode string */
560 UNISTR2 uni_wksta_name
; /* workgroup name unicode string */
563 #define INTERACTIVE_LOGON_TYPE 1
564 #define NET_LOGON_TYPE 2
566 /* NET_ID_INFO_CTR */
567 typedef struct net_id_info_ctr_info
{
571 NET_ID_INFO_1 id1
; /* auth-level 1 - interactive user login */
572 NET_ID_INFO_2 id2
; /* auth-level 2 - workstation referred login */
576 /* SAM_INFO - sam logon/off id structure */
577 typedef struct sam_info
{
578 DOM_CLNT_INFO2 client
;
579 uint32 ptr_rtn_cred
; /* pointer to return credentials */
580 DOM_CRED rtn_cred
; /* return credentials */
582 NET_ID_INFO_CTR
*ctr
;
585 /* SAM_INFO - sam logon/off id structure - no creds */
586 typedef struct sam_info_ex
{
589 NET_ID_INFO_CTR
*ctr
;
592 /* NET_Q_SAM_LOGON */
593 typedef struct net_q_sam_logon_info
{
595 uint16 validation_level
;
598 /* NET_Q_SAM_LOGON_EX */
599 typedef struct net_q_sam_logon_info_ex
{
600 DOM_SAM_INFO_EX sam_id
;
601 uint16 validation_level
;
603 } NET_Q_SAM_LOGON_EX
;
605 /* NET_R_SAM_LOGON */
606 typedef struct net_r_sam_logon_info
{
607 uint32 buffer_creds
; /* undocumented buffer pointer */
608 DOM_CRED srv_creds
; /* server credentials. server time stamp appears to be ignored. */
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? */
615 NTSTATUS status
; /* return code */
618 /* NET_R_SAM_LOGON_EX */
619 typedef struct net_r_sam_logon_info_ex
{
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? */
626 NTSTATUS status
; /* return code */
627 } NET_R_SAM_LOGON_EX
;
630 /* NET_Q_SAM_LOGOFF */
631 typedef struct net_q_sam_logoff_info
{
635 /* NET_R_SAM_LOGOFF */
636 typedef struct net_r_sam_logoff_info
{
637 uint32 buffer_creds
; /* undocumented buffer pointer */
638 DOM_CRED srv_creds
; /* server credentials. server time stamp appears to be ignored. */
639 NTSTATUS status
; /* return code */
643 typedef struct net_q_sam_sync_info
{
644 UNISTR2 uni_srv_name
; /* \\PDC */
645 UNISTR2 uni_cli_name
; /* BDC */
650 uint32 restart_state
;
653 uint32 max_size
; /* preferred maximum length */
657 typedef struct sam_delta_hdr_info
{
658 uint16 type
; /* type of structure attached */
667 typedef struct account_lockout_string
{
671 /* uint16 *bindata; */
672 uint64 lockout_duration
;
674 uint32 bad_attempt_lockout
;
678 /* HDR_LOCKOUT_STRING */
679 typedef struct hdr_account_lockout_string
{
683 } HDR_LOCKOUT_STRING
;
685 /* SAM_DOMAIN_INFO (0x1) */
686 typedef struct sam_domain_info_info
{
692 uint16 pwd_history_len
;
695 uint64 dom_mod_count
;
696 NTTIME creation_time
;
697 uint32 security_information
;
699 BUFHDR4 hdr_sec_desc
; /* security descriptor */
701 HDR_LOCKOUT_STRING hdr_account_lockout
;
707 UNISTR2 uni_dom_name
;
708 UNISTR2 buf_oem_info
;
710 RPC_DATA_BLOB buf_sec_desc
;
712 LOCKOUT_STRING account_lockout
;
714 UNISTR2 buf_unknown2
;
715 UNISTR2 buf_unknown3
;
716 UNISTR2 buf_unknown4
;
718 uint32 logon_chgpass
;
724 /* SAM_GROUP_INFO (0x2) */
725 typedef struct sam_group_info_info
{
729 BUFHDR2 hdr_sec_desc
; /* security descriptor */
732 UNISTR2 uni_grp_name
;
733 UNISTR2 uni_grp_desc
;
734 RPC_DATA_BLOB buf_sec_desc
;
738 typedef struct sam_passwd_info
{
739 /* this structure probably contains password history */
740 /* this is probably a count of lm/nt pairs */
741 uint32 unk_0
; /* 0x0000 0002 */
744 uint8 buf_lm_pwd
[16];
747 uint8 buf_nt_pwd
[16];
753 /* SAM_ACCOUNT_INFO (0x5) */
754 typedef struct sam_account_info_info
{
755 UNIHDR hdr_acct_name
;
756 UNIHDR hdr_full_name
;
762 UNIHDR hdr_dir_drive
;
763 UNIHDR hdr_logon_script
;
764 UNIHDR hdr_acct_desc
;
765 UNIHDR hdr_workstations
;
770 uint32 logon_divs
; /* 0xA8 */
771 uint32 ptr_logon_hrs
;
773 uint16 bad_pwd_count
;
775 NTTIME pwd_last_set_time
;
776 NTTIME acct_expiry_time
;
781 uint8 nt_pwd_present
;
782 uint8 lm_pwd_present
;
786 UNIHDR hdr_parameters
;
790 BUFHDR2 hdr_sec_desc
; /* security descriptor */
793 UNIHDR hdr_reserved
[3]; /* space for more strings */
794 uint32 dw_reserved
[4]; /* space for more data - first two seem to
797 UNISTR2 uni_acct_name
;
798 UNISTR2 uni_full_name
;
799 UNISTR2 uni_home_dir
;
800 UNISTR2 uni_dir_drive
;
801 UNISTR2 uni_logon_script
;
802 UNISTR2 uni_acct_desc
;
803 UNISTR2 uni_workstations
;
805 uint32 unknown1
; /* 0x4EC */
806 uint32 unknown2
; /* 0 */
808 RPC_DATA_BLOB buf_logon_hrs
;
810 UNISTR2 uni_parameters
;
812 RPC_DATA_BLOB buf_sec_desc
;
816 /* SAM_GROUP_MEM_INFO (0x8) */
817 typedef struct sam_group_mem_info_info
{
829 } SAM_GROUP_MEM_INFO
;
831 /* SAM_ALIAS_INFO (0x9) */
832 typedef struct sam_alias_info_info
{
835 BUFHDR2 hdr_sec_desc
; /* security descriptor */
839 UNISTR2 uni_als_name
;
840 RPC_DATA_BLOB buf_sec_desc
;
841 UNISTR2 uni_als_desc
;
844 /* SAM_ALIAS_MEM_INFO (0xC) */
845 typedef struct sam_alias_mem_info_info
{
853 } SAM_ALIAS_MEM_INFO
;
856 /* SAM_DELTA_POLICY (0x0D) */
858 uint32 max_log_size
; /* 0x5000 */
859 uint64 audit_retention_period
; /* 0 */
860 uint32 auditing_mode
; /* 0 */
866 uint32 paged_pool_limit
; /* 0x02000000 */
867 uint32 non_paged_pool_limit
; /* 0x00100000 */
868 uint32 min_workset_size
; /* 0x00010000 */
869 uint32 max_workset_size
; /* 0x0f000000 */
870 uint32 page_file_limit
; /* 0 */
871 uint64 time_limit
; /* 0 */
872 NTTIME modify_time
; /* 0x3c*/
873 NTTIME create_time
; /* a7080110 */
874 BUFHDR2 hdr_sec_desc
;
876 uint32 num_event_audit_options
;
877 uint32 event_audit_option
;
882 RPC_DATA_BLOB buf_sec_desc
;
885 /* SAM_DELTA_TRUST_DOMS */
901 } SAM_DELTA_TRUSTDOMS
;
903 /* SAM_DELTA_PRIVS (0x10) */
910 uint32 priv_attr_ptr
;
911 uint32 priv_name_ptr
;
913 uint32 paged_pool_limit
; /* 0x02000000 */
914 uint32 non_paged_pool_limit
; /* 0x00100000 */
915 uint32 min_workset_size
; /* 0x00010000 */
916 uint32 max_workset_size
; /* 0x0f000000 */
917 uint32 page_file_limit
; /* 0 */
918 uint64 time_limit
; /* 0 */
919 uint32 system_flags
; /* 1 */
920 BUFHDR2 hdr_sec_desc
;
924 uint32 attribute_count
;
927 uint32 privlist_count
;
928 UNIHDR
*hdr_privslist
;
929 UNISTR2
*uni_privslist
;
931 RPC_DATA_BLOB buf_sec_desc
;
934 /* SAM_DELTA_SECRET */
952 uint32 unknow2
; /* 0x0 12 times */
955 uint32 reserved1
; /* 0 */
960 uint32 reserved2
; /* 0 */
968 /* SAM_DELTA_MOD_COUNT (0x16) */
971 uint32 dom_mod_count_ptr
;
972 uint64 dom_mod_count
; /* domain mod count at last sync */
973 } SAM_DELTA_MOD_COUNT
;
975 typedef union sam_delta_ctr_info
{
976 SAM_DOMAIN_INFO domain_info
;
977 SAM_GROUP_INFO group_info
;
978 SAM_ACCOUNT_INFO account_info
;
979 SAM_GROUP_MEM_INFO grp_mem_info
;
980 SAM_ALIAS_INFO alias_info
;
981 SAM_ALIAS_MEM_INFO als_mem_info
;
982 SAM_DELTA_POLICY policy_info
;
983 SAM_DELTA_PRIVS privs_info
;
984 SAM_DELTA_MOD_COUNT mod_count
;
985 SAM_DELTA_TRUSTDOMS trustdoms_info
;
986 SAM_DELTA_SECRET secret_info
;
990 typedef struct net_r_sam_sync_info
{
1000 SAM_DELTA_HDR
*hdr_deltas
;
1001 SAM_DELTA_CTR
*deltas
;
1006 /* NET_Q_SAM_DELTAS */
1007 typedef struct net_q_sam_deltas_info
{
1008 UNISTR2 uni_srv_name
;
1009 UNISTR2 uni_cli_name
;
1014 uint64 dom_mod_count
; /* domain mod count at last sync */
1016 uint32 max_size
; /* preferred maximum length */
1019 /* NET_R_SAM_DELTAS */
1020 typedef struct net_r_sam_deltas_info
{
1023 uint64 dom_mod_count
; /* new domain mod count */
1029 SAM_DELTA_HDR
*hdr_deltas
;
1030 SAM_DELTA_CTR
*deltas
;
1035 #define DSGETDC_VALID_FLAGS ( \
1036 DS_FORCE_REDISCOVERY | \
1037 DS_DIRECTORY_SERVICE_REQUIRED | \
1038 DS_DIRECTORY_SERVICE_PREFERRED | \
1039 DS_GC_SERVER_REQUIRED | \
1041 DS_BACKGROUND_ONLY | \
1044 DS_TIMESERV_REQUIRED | \
1045 DS_WRITABLE_REQUIRED | \
1046 DS_GOOD_TIMESERV_PREFERRED | \
1048 DS_ONLY_LDAP_NEEDED | \
1051 DS_RETURN_FLAT_NAME | \
1052 DS_RETURN_DNS_NAME )
1054 struct DS_DOMAIN_CONTROLLER_INFO
{
1055 const char *domain_controller_name
;
1056 const char *domain_controller_address
;
1057 int32 domain_controller_address_type
;
1058 struct GUID
*domain_guid
;
1059 const char *domain_name
;
1060 const char *dns_forest_name
;
1062 const char *dc_site_name
;
1063 const char *client_site_name
;
1066 /* NET_Q_DSR_GETDCNAME */
1067 typedef struct net_q_dsr_getdcname
{
1068 uint32 ptr_server_unc
;
1069 UNISTR2 uni_server_unc
;
1070 uint32 ptr_domain_name
;
1071 UNISTR2 uni_domain_name
;
1072 uint32 ptr_domain_guid
;
1073 struct GUID
*domain_guid
;
1074 uint32 ptr_site_guid
;
1075 struct GUID
*site_guid
;
1077 } NET_Q_DSR_GETDCNAME
;
1079 /* NET_R_DSR_GETDCNAME */
1080 typedef struct net_r_dsr_getdcname
{
1083 uint32 ptr_dc_address
;
1084 UNISTR2 uni_dc_address
;
1085 int32 dc_address_type
;
1086 struct GUID domain_guid
;
1087 uint32 ptr_domain_name
;
1088 UNISTR2 uni_domain_name
;
1089 uint32 ptr_forest_name
;
1090 UNISTR2 uni_forest_name
;
1092 uint32 ptr_dc_site_name
;
1093 UNISTR2 uni_dc_site_name
;
1094 uint32 ptr_client_site_name
;
1095 UNISTR2 uni_client_site_name
;
1097 } NET_R_DSR_GETDCNAME
;
1099 /* NET_Q_DSR_GESITENAME */
1100 typedef struct net_q_dsr_getsitename
{
1101 uint32 ptr_computer_name
;
1102 UNISTR2 uni_computer_name
;
1103 } NET_Q_DSR_GETSITENAME
;
1105 /* NET_R_DSR_GETSITENAME */
1106 typedef struct net_r_dsr_getsitename
{
1107 uint32 ptr_site_name
;
1108 UNISTR2 uni_site_name
;
1110 } NET_R_DSR_GETSITENAME
;
1113 #endif /* _RPC_NETLOGON_H */