Fix string overflow due to wrong size calculation
[Samba/gebeck_regimport.git] / source3 / include / rpc_netlogon.h
blob74e3a50ee4a64c345cbde9eca192d0d0df9d61a6
1 /*
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
28 /* NETLOGON pipe */
29 #define NET_SAMLOGON 0x02
30 #define NET_SAMLOGOFF 0x03
31 #define NET_REQCHAL 0x04
32 #define NET_AUTH 0x05
33 #define NET_SRVPWSET 0x06
34 #define NET_SAM_DELTAS 0x07
35 #define NET_LOGON_CTRL 0x0c
36 #define NET_AUTH2 0x0f
37 #define NET_LOGON_CTRL2 0x0e
38 #define NET_SAM_SYNC 0x10
39 #define NET_TRUST_DOM_LIST 0x13
40 #define NET_AUTH3 0x1a
42 /* Secure Channel types. used in NetrServerAuthenticate negotiation */
43 #define SEC_CHAN_WKSTA 2
44 #define SEC_CHAN_DOMAIN 4
45 #define SEC_CHAN_BDC 6
47 /* Returned delta types */
48 #define SAM_DELTA_DOMAIN_INFO 0x01
49 #define SAM_DELTA_GROUP_INFO 0x02
50 #define SAM_DELTA_RENAME_GROUP 0x04
51 #define SAM_DELTA_ACCOUNT_INFO 0x05
52 #define SAM_DELTA_RENAME_USER 0x07
53 #define SAM_DELTA_GROUP_MEM 0x08
54 #define SAM_DELTA_ALIAS_INFO 0x09
55 #define SAM_DELTA_RENAME_ALIAS 0x0b
56 #define SAM_DELTA_ALIAS_MEM 0x0c
57 #define SAM_DELTA_POLICY_INFO 0x0d
58 #define SAM_DELTA_TRUST_DOMS 0x0e
59 #define SAM_DELTA_PRIVS_INFO 0x10 /* DT_DELTA_ACCOUNTS */
60 #define SAM_DELTA_SECRET_INFO 0x12
61 #define SAM_DELTA_DELETE_GROUP 0x14
62 #define SAM_DELTA_DELETE_USER 0x15
63 #define SAM_DELTA_MODIFIED_COUNT 0x16
65 /* SAM database types */
66 #define SAM_DATABASE_DOMAIN 0x00 /* Domain users and groups */
67 #define SAM_DATABASE_BUILTIN 0x01 /* BUILTIN users and groups */
68 #define SAM_DATABASE_PRIVS 0x02 /* Privileges */
70 #if 0
71 /* I think this is correct - it's what gets parsed on the wire. JRA. */
72 /* NET_USER_INFO_2 */
73 typedef struct net_user_info_2
75 uint32 ptr_user_info;
77 NTTIME logon_time; /* logon time */
78 NTTIME logoff_time; /* logoff time */
79 NTTIME kickoff_time; /* kickoff time */
80 NTTIME pass_last_set_time; /* password last set time */
81 NTTIME pass_can_change_time; /* password can change time */
82 NTTIME pass_must_change_time; /* password must change time */
84 UNIHDR hdr_user_name; /* username unicode string header */
85 UNIHDR hdr_full_name; /* user's full name unicode string header */
86 UNIHDR hdr_logon_script; /* logon script unicode string header */
87 UNIHDR hdr_profile_path; /* profile path unicode string header */
88 UNIHDR hdr_home_dir; /* home directory unicode string header */
89 UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
91 uint16 logon_count; /* logon count */
92 uint16 bad_pw_count; /* bad password count */
94 uint32 user_id; /* User ID */
95 uint32 group_id; /* Group ID */
96 uint32 num_groups; /* num groups */
97 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
98 uint32 user_flgs; /* user flags */
100 uint8 user_sess_key[16]; /* unused user session key */
102 UNIHDR hdr_logon_srv; /* logon server unicode string header */
103 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
105 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
106 uint8 padding[40]; /* unused padding bytes. expansion room */
108 UNISTR2 uni_user_name; /* username unicode string */
109 UNISTR2 uni_full_name; /* user's full name unicode string */
110 UNISTR2 uni_logon_script; /* logon script unicode string */
111 UNISTR2 uni_profile_path; /* profile path unicode string */
112 UNISTR2 uni_home_dir; /* home directory unicode string */
113 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
115 uint32 num_groups2; /* num groups */
116 DOM_GID *gids; /* group info */
118 UNISTR2 uni_logon_srv; /* logon server unicode string */
119 UNISTR2 uni_logon_dom; /* logon domain unicode string */
121 DOM_SID2 dom_sid; /* domain SID */
123 uint32 num_other_groups; /* other groups */
124 DOM_GID *other_gids; /* group info */
125 DOM_SID2 *other_sids; /* undocumented - domain SIDs */
127 } NET_USER_INFO_2;
128 #endif
130 /* NET_USER_INFO_3 */
131 typedef struct net_user_info_3
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_rid; /* User RID */
153 uint32 group_rid; /* Group RID */
155 uint32 num_groups; /* num groups */
156 uint32 buffer_groups; /* undocumented buffer pointer to groups. */
157 uint32 user_flgs; /* user flags */
159 uint8 user_sess_key[16]; /* user session key */
161 UNIHDR hdr_logon_srv; /* logon server unicode string header */
162 UNIHDR hdr_logon_dom; /* logon domain unicode string header */
164 uint32 buffer_dom_id; /* undocumented logon domain id pointer */
165 uint8 padding[40]; /* unused padding bytes. expansion room */
167 uint32 num_other_sids; /* number of foreign/trusted domain sids */
168 uint32 buffer_other_sids;
170 UNISTR2 uni_user_name; /* username unicode string */
171 UNISTR2 uni_full_name; /* user's full name unicode string */
172 UNISTR2 uni_logon_script; /* logon script unicode string */
173 UNISTR2 uni_profile_path; /* profile path unicode string */
174 UNISTR2 uni_home_dir; /* home directory unicode string */
175 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
177 uint32 num_groups2; /* num groups */
178 DOM_GID *gids; /* group info */
180 UNISTR2 uni_logon_srv; /* logon server unicode string */
181 UNISTR2 uni_logon_dom; /* logon domain unicode string */
183 DOM_SID2 dom_sid; /* domain SID */
185 uint32 num_other_groups; /* other groups */
186 DOM_GID *other_gids; /* group info */
187 DOM_SID2 *other_sids; /* foreign/trusted domain SIDs */
189 } NET_USER_INFO_3;
192 /* NETLOGON_INFO_1 - pdc status info, i presume */
193 typedef struct netlogon_1_info
195 uint32 flags; /* 0x0 - undocumented */
196 uint32 pdc_status; /* 0x0 - undocumented */
198 } NETLOGON_INFO_1;
200 /* NETLOGON_INFO_2 - pdc status info, plus trusted domain info */
201 typedef struct netlogon_2_info
203 uint32 flags; /* 0x0 - undocumented */
204 uint32 pdc_status; /* 0x0 - undocumented */
205 uint32 ptr_trusted_dc_name; /* pointer to trusted domain controller name */
206 uint32 tc_status; /* 0x051f - ERROR_NO_LOGON_SERVERS */
207 UNISTR2 uni_trusted_dc_name; /* unicode string - trusted dc name */
209 } NETLOGON_INFO_2;
211 /* NETLOGON_INFO_3 - logon status info, i presume */
212 typedef struct netlogon_3_info
214 uint32 flags; /* 0x0 - undocumented */
215 uint32 logon_attempts; /* number of logon attempts */
216 uint32 reserved_1; /* 0x0 - undocumented */
217 uint32 reserved_2; /* 0x0 - undocumented */
218 uint32 reserved_3; /* 0x0 - undocumented */
219 uint32 reserved_4; /* 0x0 - undocumented */
220 uint32 reserved_5; /* 0x0 - undocumented */
222 } NETLOGON_INFO_3;
224 /********************************************************
225 Logon Control Query
227 This is generated by a nltest /bdc_query:DOMAIN
229 query_level 0x1, function_code 0x1
231 ********************************************************/
233 /* NET_Q_LOGON_CTRL - LSA Netr Logon Control */
235 typedef struct net_q_logon_ctrl_info
237 uint32 ptr;
238 UNISTR2 uni_server_name;
239 uint32 function_code;
240 uint32 query_level;
241 } NET_Q_LOGON_CTRL;
243 /* NET_R_LOGON_CTRL - LSA Netr Logon Control */
245 typedef struct net_r_logon_ctrl_info
247 uint32 switch_value;
248 uint32 ptr;
250 union {
251 NETLOGON_INFO_1 info1;
252 } logon;
254 NTSTATUS status;
255 } NET_R_LOGON_CTRL;
257 /********************************************************
258 Logon Control2 Query
260 query_level 0x1 - pdc status
261 query_level 0x3 - number of logon attempts.
263 ********************************************************/
265 /* NET_Q_LOGON_CTRL2 - LSA Netr Logon Control 2 */
266 typedef struct net_q_logon_ctrl2_info
268 uint32 ptr; /* undocumented buffer pointer */
269 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
271 uint32 function_code; /* 0x1 */
272 uint32 query_level; /* 0x1, 0x3 */
273 uint32 switch_value; /* 0x1 */
275 } NET_Q_LOGON_CTRL2;
277 /*******************************************************
278 Logon Control Response
280 switch_value is same as query_level in request
281 *******************************************************/
283 /* NET_R_LOGON_CTRL2 - response to LSA Logon Control2 */
284 typedef struct net_r_logon_ctrl2_info
286 uint32 switch_value; /* 0x1, 0x3 */
287 uint32 ptr;
289 union
291 NETLOGON_INFO_1 info1;
292 NETLOGON_INFO_2 info2;
293 NETLOGON_INFO_3 info3;
295 } logon;
297 NTSTATUS status; /* return code */
299 } NET_R_LOGON_CTRL2;
301 /* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */
302 typedef struct net_q_trust_dom_info
304 uint32 ptr; /* undocumented buffer pointer */
305 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
307 } NET_Q_TRUST_DOM_LIST;
309 #define MAX_TRUST_DOMS 1
311 /* NET_R_TRUST_DOM_LIST - response to LSA Trusted Domains */
312 typedef struct net_r_trust_dom_info
314 UNISTR2 uni_trust_dom_name[MAX_TRUST_DOMS];
316 NTSTATUS status; /* return code */
318 } NET_R_TRUST_DOM_LIST;
321 /* NEG_FLAGS */
322 typedef struct neg_flags_info
324 uint32 neg_flags; /* negotiated flags */
326 } NEG_FLAGS;
329 /* NET_Q_REQ_CHAL */
330 typedef struct net_q_req_chal_info
332 uint32 undoc_buffer; /* undocumented buffer pointer */
333 UNISTR2 uni_logon_srv; /* logon server unicode string */
334 UNISTR2 uni_logon_clnt; /* logon client unicode string */
335 DOM_CHAL clnt_chal; /* client challenge */
337 } NET_Q_REQ_CHAL;
340 /* NET_R_REQ_CHAL */
341 typedef struct net_r_req_chal_info
343 DOM_CHAL srv_chal; /* server challenge */
344 NTSTATUS status; /* return code */
345 } NET_R_REQ_CHAL;
347 /* NET_Q_AUTH */
348 typedef struct net_q_auth_info
350 DOM_LOG_INFO clnt_id; /* client identification info */
351 DOM_CHAL clnt_chal; /* client-calculated credentials */
352 } NET_Q_AUTH;
354 /* NET_R_AUTH */
355 typedef struct net_r_auth_info
357 DOM_CHAL srv_chal; /* server-calculated credentials */
358 NTSTATUS status; /* return code */
359 } NET_R_AUTH;
361 /* NET_Q_AUTH_2 */
362 typedef struct net_q_auth2_info
364 DOM_LOG_INFO clnt_id; /* client identification info */
365 DOM_CHAL clnt_chal; /* client-calculated credentials */
367 NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */
369 } NET_Q_AUTH_2;
372 /* NET_R_AUTH_2 */
373 typedef struct net_r_auth2_info
375 DOM_CHAL srv_chal; /* server-calculated credentials */
376 NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */
377 NTSTATUS status; /* return code */
378 } NET_R_AUTH_2;
380 /* NET_Q_AUTH_3 */
381 typedef struct net_q_auth3_info
383 DOM_LOG_INFO clnt_id; /* client identification info */
384 DOM_CHAL clnt_chal; /* client-calculated credentials */
385 NEG_FLAGS clnt_flgs; /* usually 0x6007 ffff */
386 } NET_Q_AUTH_3;
388 /* NET_R_AUTH_3 */
389 typedef struct net_r_auth3_info
391 DOM_CHAL srv_chal; /* server-calculated credentials */
392 NEG_FLAGS srv_flgs; /* usually 0x6007 ffff */
393 uint32 unknown; /* 0x0000045b */
394 NTSTATUS status; /* return code */
395 } NET_R_AUTH_3;
398 /* NET_Q_SRV_PWSET */
399 typedef struct net_q_srv_pwset_info
401 DOM_CLNT_INFO clnt_id; /* client identification/authentication info */
402 uint8 pwd[16]; /* new password - undocumented. */
404 } NET_Q_SRV_PWSET;
406 /* NET_R_SRV_PWSET */
407 typedef struct net_r_srv_pwset_info
409 DOM_CRED srv_cred; /* server-calculated credentials */
411 NTSTATUS status; /* return code */
413 } NET_R_SRV_PWSET;
415 /* NET_ID_INFO_2 */
416 typedef struct net_network_info_2
418 uint32 ptr_id_info2; /* pointer to id_info_2 */
419 UNIHDR hdr_domain_name; /* domain name unicode header */
420 uint32 param_ctrl; /* param control (0x2) */
421 DOM_LOGON_ID logon_id; /* logon ID */
422 UNIHDR hdr_user_name; /* user name unicode header */
423 UNIHDR hdr_wksta_name; /* workstation name unicode header */
424 uint8 lm_chal[8]; /* lan manager 8 byte challenge */
425 STRHDR hdr_nt_chal_resp; /* nt challenge response */
426 STRHDR hdr_lm_chal_resp; /* lm challenge response */
428 UNISTR2 uni_domain_name; /* domain name unicode string */
429 UNISTR2 uni_user_name; /* user name unicode string */
430 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
431 STRING2 nt_chal_resp; /* nt challenge response */
432 STRING2 lm_chal_resp; /* lm challenge response */
434 } NET_ID_INFO_2;
436 /* NET_ID_INFO_1 */
437 typedef struct id_info_1
439 uint32 ptr_id_info1; /* pointer to id_info_1 */
440 UNIHDR hdr_domain_name; /* domain name unicode header */
441 uint32 param_ctrl; /* param control */
442 DOM_LOGON_ID logon_id; /* logon ID */
443 UNIHDR hdr_user_name; /* user name unicode header */
444 UNIHDR hdr_wksta_name; /* workstation name unicode header */
445 OWF_INFO lm_owf; /* LM OWF Password */
446 OWF_INFO nt_owf; /* NT OWF Password */
447 UNISTR2 uni_domain_name; /* domain name unicode string */
448 UNISTR2 uni_user_name; /* user name unicode string */
449 UNISTR2 uni_wksta_name; /* workgroup name unicode string */
451 } NET_ID_INFO_1;
453 #define INTERACTIVE_LOGON_TYPE 1
454 #define NET_LOGON_TYPE 2
456 /* NET_ID_INFO_CTR */
457 typedef struct net_id_info_ctr_info
459 uint16 switch_value;
461 union
463 NET_ID_INFO_1 id1; /* auth-level 1 - interactive user login */
464 NET_ID_INFO_2 id2; /* auth-level 2 - workstation referred login */
466 } auth;
468 } NET_ID_INFO_CTR;
470 /* SAM_INFO - sam logon/off id structure */
471 typedef struct sam_info
473 DOM_CLNT_INFO2 client;
474 uint32 ptr_rtn_cred; /* pointer to return credentials */
475 DOM_CRED rtn_cred; /* return credentials */
476 uint16 logon_level;
477 NET_ID_INFO_CTR *ctr;
479 } DOM_SAM_INFO;
481 /* NET_Q_SAM_LOGON */
482 typedef struct net_q_sam_logon_info
484 DOM_SAM_INFO sam_id;
485 uint16 validation_level;
487 } NET_Q_SAM_LOGON;
489 /* NET_R_SAM_LOGON */
490 typedef struct net_r_sam_logon_info
492 uint32 buffer_creds; /* undocumented buffer pointer */
493 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
495 uint16 switch_value; /* 3 - indicates type of USER INFO */
496 NET_USER_INFO_3 *user;
498 uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
500 NTSTATUS status; /* return code */
502 } NET_R_SAM_LOGON;
505 /* NET_Q_SAM_LOGOFF */
506 typedef struct net_q_sam_logoff_info
508 DOM_SAM_INFO sam_id;
510 } NET_Q_SAM_LOGOFF;
512 /* NET_R_SAM_LOGOFF */
513 typedef struct net_r_sam_logoff_info
515 uint32 buffer_creds; /* undocumented buffer pointer */
516 DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
518 NTSTATUS status; /* return code */
520 } NET_R_SAM_LOGOFF;
522 /* NET_Q_SAM_SYNC */
523 typedef struct net_q_sam_sync_info
525 UNISTR2 uni_srv_name; /* \\PDC */
526 UNISTR2 uni_cli_name; /* BDC */
527 DOM_CRED cli_creds;
528 DOM_CRED ret_creds;
530 uint32 database_id;
531 uint32 restart_state;
532 uint32 sync_context;
534 uint32 max_size; /* preferred maximum length */
536 } NET_Q_SAM_SYNC;
538 /* SAM_DELTA_HDR */
539 typedef struct sam_delta_hdr_info
541 uint16 type; /* type of structure attached */
542 uint16 type2;
543 uint32 target_rid;
545 uint32 type3;
546 uint32 ptr_delta;
548 } SAM_DELTA_HDR;
550 /* SAM_DOMAIN_INFO (0x1) */
551 typedef struct sam_domain_info_info
553 UNIHDR hdr_dom_name;
554 UNIHDR hdr_oem_info;
556 UINT64_S force_logoff;
557 uint16 min_pwd_len;
558 uint16 pwd_history_len;
559 UINT64_S max_pwd_age;
560 UINT64_S min_pwd_age;
561 UINT64_S dom_mod_count;
562 NTTIME creation_time;
564 BUFHDR2 hdr_sec_desc; /* security descriptor */
565 UNIHDR hdr_unknown;
566 uint8 reserved[40];
568 UNISTR2 uni_dom_name;
569 UNISTR2 buf_oem_info; /* never seen */
571 BUFFER4 buf_sec_desc;
572 UNISTR2 buf_unknown;
574 } SAM_DOMAIN_INFO;
576 /* SAM_GROUP_INFO (0x2) */
577 typedef struct sam_group_info_info
579 UNIHDR hdr_grp_name;
580 DOM_GID gid;
581 UNIHDR hdr_grp_desc;
582 BUFHDR2 hdr_sec_desc; /* security descriptor */
583 uint8 reserved[48];
585 UNISTR2 uni_grp_name;
586 UNISTR2 uni_grp_desc;
587 BUFFER4 buf_sec_desc;
589 } SAM_GROUP_INFO;
591 /* SAM_PWD */
592 typedef struct sam_passwd_info
594 /* this structure probably contains password history */
595 /* this is probably a count of lm/nt pairs */
596 uint32 unk_0; /* 0x0000 0002 */
598 UNIHDR hdr_lm_pwd;
599 uint8 buf_lm_pwd[16];
601 UNIHDR hdr_nt_pwd;
602 uint8 buf_nt_pwd[16];
604 UNIHDR hdr_empty_lm;
605 UNIHDR hdr_empty_nt;
607 } SAM_PWD;
609 /* SAM_ACCOUNT_INFO (0x5) */
610 typedef struct sam_account_info_info
612 UNIHDR hdr_acct_name;
613 UNIHDR hdr_full_name;
615 uint32 user_rid;
616 uint32 group_rid;
618 UNIHDR hdr_home_dir;
619 UNIHDR hdr_dir_drive;
620 UNIHDR hdr_logon_script;
621 UNIHDR hdr_acct_desc;
622 UNIHDR hdr_workstations;
624 NTTIME logon_time;
625 NTTIME logoff_time;
627 uint32 logon_divs; /* 0xA8 */
628 uint32 ptr_logon_hrs;
630 uint16 bad_pwd_count;
631 uint16 logon_count;
632 NTTIME pwd_last_set_time;
633 NTTIME acct_expiry_time;
635 uint32 acb_info;
636 uint8 nt_pwd[16];
637 uint8 lm_pwd[16];
638 uint8 nt_pwd_present;
639 uint8 lm_pwd_present;
640 uint8 pwd_expired;
642 UNIHDR hdr_comment;
643 UNIHDR hdr_parameters;
644 uint16 country;
645 uint16 codepage;
647 BUFHDR2 hdr_sec_desc; /* security descriptor */
649 UNIHDR hdr_profile;
650 UNIHDR hdr_reserved[3]; /* space for more strings */
651 uint32 dw_reserved[4]; /* space for more data - first two seem to
652 be an NTTIME */
654 UNISTR2 uni_acct_name;
655 UNISTR2 uni_full_name;
656 UNISTR2 uni_home_dir;
657 UNISTR2 uni_dir_drive;
658 UNISTR2 uni_logon_script;
659 UNISTR2 uni_acct_desc;
660 UNISTR2 uni_workstations;
662 uint32 unknown1; /* 0x4EC */
663 uint32 unknown2; /* 0 */
665 BUFFER4 buf_logon_hrs;
666 UNISTR2 uni_comment;
667 UNISTR2 uni_parameters;
668 SAM_PWD pass;
669 BUFFER4 buf_sec_desc;
670 UNISTR2 uni_profile;
672 } SAM_ACCOUNT_INFO;
674 /* SAM_GROUP_MEM_INFO (0x8) */
675 typedef struct sam_group_mem_info_info
677 uint32 ptr_rids;
678 uint32 ptr_attribs;
679 uint32 num_members;
680 uint8 unknown[16];
682 uint32 num_members2;
683 uint32 *rids;
685 uint32 num_members3;
686 uint32 *attribs;
688 } SAM_GROUP_MEM_INFO;
690 /* SAM_ALIAS_INFO (0x9) */
691 typedef struct sam_alias_info_info
693 UNIHDR hdr_als_name;
694 uint32 als_rid;
695 BUFHDR2 hdr_sec_desc; /* security descriptor */
696 UNIHDR hdr_als_desc;
697 uint8 reserved[40];
699 UNISTR2 uni_als_name;
700 BUFFER4 buf_sec_desc;
701 UNISTR2 uni_als_desc;
703 } SAM_ALIAS_INFO;
705 /* SAM_ALIAS_MEM_INFO (0xC) */
706 typedef struct sam_alias_mem_info_info
708 uint32 num_members;
709 uint32 ptr_members;
710 uint8 unknown[16];
712 uint32 num_sids;
713 uint32 *ptr_sids;
714 DOM_SID2 *sids;
716 } SAM_ALIAS_MEM_INFO;
719 /* SAM_DELTA_POLICY (0x0D) */
720 typedef struct
722 uint32 max_log_size; /* 0x5000 */
723 UINT64_S audit_retention_period; /* 0 */
724 uint32 auditing_mode; /* 0 */
725 uint32 num_events;
726 uint32 ptr_events;
727 UNIHDR hdr_dom_name;
728 uint32 sid_ptr;
730 uint32 paged_pool_limit; /* 0x02000000 */
731 uint32 non_paged_pool_limit; /* 0x00100000 */
732 uint32 min_workset_size; /* 0x00010000 */
733 uint32 max_workset_size; /* 0x0f000000 */
734 uint32 page_file_limit; /* 0 */
735 UINT64_S time_limit; /* 0 */
736 NTTIME modify_time; /* 0x3c*/
737 NTTIME create_time; /* a7080110 */
738 BUFHDR2 hdr_sec_desc;
740 uint32 num_event_audit_options;
741 uint32 event_audit_option;
743 UNISTR2 domain_name;
744 DOM_SID2 domain_sid;
746 BUFFER4 buf_sec_desc;
747 } SAM_DELTA_POLICY;
749 /* SAM_DELTA_TRUST_DOMS */
750 typedef struct
752 uint32 buf_size;
753 SEC_DESC *sec_desc;
754 DOM_SID2 sid;
755 UNIHDR hdr_domain;
757 uint32 unknown0;
758 uint32 unknown1;
759 uint32 unknown2;
761 uint32 buf_size2;
762 uint32 ptr;
764 uint32 unknown3;
765 UNISTR2 domain;
767 } SAM_DELTA_TRUSTDOMS;
769 /* SAM_DELTA_PRIVS (0x10) */
770 typedef struct
772 DOM_SID2 sid;
774 uint32 priv_count;
775 uint32 priv_control;
777 uint32 priv_attr_ptr;
778 uint32 priv_name_ptr;
780 uint32 paged_pool_limit; /* 0x02000000 */
781 uint32 non_paged_pool_limit; /* 0x00100000 */
782 uint32 min_workset_size; /* 0x00010000 */
783 uint32 max_workset_size; /* 0x0f000000 */
784 uint32 page_file_limit; /* 0 */
785 UINT64_S time_limit; /* 0 */
786 uint32 system_flags; /* 1 */
787 BUFHDR2 hdr_sec_desc;
789 uint32 buf_size2;
791 uint32 attribute_count;
792 uint32 *attributes;
794 uint32 privlist_count;
795 UNIHDR *hdr_privslist;
796 UNISTR2 *uni_privslist;
798 BUFFER4 buf_sec_desc;
799 } SAM_DELTA_PRIVS;
801 /* SAM_DELTA_SECRET */
802 typedef struct
804 uint32 buf_size;
805 SEC_DESC *sec_desc;
806 UNISTR2 secret;
808 uint32 count1;
809 uint32 count2;
810 uint32 ptr;
811 NTTIME time1;
812 uint32 count3;
813 uint32 count4;
814 uint32 ptr2;
815 NTTIME time2;
816 uint32 unknow1;
818 uint32 buf_size2;
819 uint32 ptr3;
820 uint32 unknow2; /* 0x0 12 times */
822 uint32 chal_len;
823 uint32 reserved1; /* 0 */
824 uint32 chal_len2;
825 uint8 chal[16];
827 uint32 key_len;
828 uint32 reserved2; /* 0 */
829 uint32 key_len2;
830 uint8 key[8];
832 uint32 buf_size3;
833 SEC_DESC *sec_desc2;
835 } SAM_DELTA_SECRET;
837 /* SAM_DELTA_MOD_COUNT (0x16) */
838 typedef struct
840 uint32 seqnum;
841 uint32 dom_mod_count_ptr;
842 UINT64_S dom_mod_count; /* domain mod count at last sync */
843 } SAM_DELTA_MOD_COUNT;
845 typedef union sam_delta_ctr_info
847 SAM_DOMAIN_INFO domain_info ;
848 SAM_GROUP_INFO group_info ;
849 SAM_ACCOUNT_INFO account_info;
850 SAM_GROUP_MEM_INFO grp_mem_info;
851 SAM_ALIAS_INFO alias_info ;
852 SAM_ALIAS_MEM_INFO als_mem_info;
853 SAM_DELTA_POLICY policy_info;
854 SAM_DELTA_PRIVS privs_info;
855 SAM_DELTA_MOD_COUNT mod_count;
856 SAM_DELTA_TRUSTDOMS trustdoms_info;
857 SAM_DELTA_SECRET secret_info;
858 } SAM_DELTA_CTR;
860 /* NET_R_SAM_SYNC */
861 typedef struct net_r_sam_sync_info
863 DOM_CRED srv_creds;
865 uint32 sync_context;
867 uint32 ptr_deltas;
868 uint32 num_deltas;
869 uint32 ptr_deltas2;
870 uint32 num_deltas2;
872 SAM_DELTA_HDR *hdr_deltas;
873 SAM_DELTA_CTR *deltas;
875 NTSTATUS status;
876 } NET_R_SAM_SYNC;
878 /* NET_Q_SAM_DELTAS */
879 typedef struct net_q_sam_deltas_info
881 UNISTR2 uni_srv_name;
882 UNISTR2 uni_cli_name;
883 DOM_CRED cli_creds;
884 DOM_CRED ret_creds;
886 uint32 database_id;
887 UINT64_S dom_mod_count; /* domain mod count at last sync */
889 uint32 max_size; /* preferred maximum length */
891 } NET_Q_SAM_DELTAS;
893 /* NET_R_SAM_DELTAS */
894 typedef struct net_r_sam_deltas_info
896 DOM_CRED srv_creds;
898 UINT64_S dom_mod_count; /* new domain mod count */
900 uint32 ptr_deltas;
901 uint32 num_deltas;
902 uint32 num_deltas2;
904 SAM_DELTA_HDR *hdr_deltas;
905 SAM_DELTA_CTR *deltas;
907 NTSTATUS status;
908 } NET_R_SAM_DELTAS;
910 #endif /* _RPC_NETLOGON_H */