Make header comment clearer, these are RIDs, not UIDs.
[ira/wip.git] / source3 / include / rpc_netlogon.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell 1992-1997
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1997
7    Copyright (C) Paul Ashton 1997
8    
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.
13    
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.
18    
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.
22 */
23
24 #ifndef _RPC_NETLOGON_H /* _RPC_NETLOGON_H */
25 #define _RPC_NETLOGON_H 
26
27
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
41 /* Secure Channel types.  used in NetrServerAuthenticate negotiation */
42 #define SEC_CHAN_WKSTA   2
43 #define SEC_CHAN_DOMAIN  4
44 #define SEC_CHAN_BDC     6
45
46 /* Returned delta types */
47 #define SAM_DELTA_DOMAIN_INFO  0x01 /* Domain */
48 #define SAM_DELTA_GROUP_INFO   0x02 /* Domain groups */
49 #define SAM_DELTA_ACCOUNT_INFO 0x05 /* Users */
50 #define SAM_DELTA_GROUP_MEM    0x08 /* Group membership */
51 #define SAM_DELTA_ALIAS_INFO   0x09 /* Local groups */
52 #define SAM_DELTA_ALIAS_MEM    0x0C /* Local group membership */
53 #define SAM_DELTA_UNKNOWN      0x0D /* Privilige stuff */
54 #define SAM_DELTA_UNKNOWN2     0x10 /* Privilige stuff */
55 #define SAM_DELTA_SAM_STAMP    0x16 /* Some kind of journal record? */
56
57 /* SAM database types */
58 #define SAM_DATABASE_DOMAIN    0x00 /* Domain users and groups */
59 #define SAM_DATABASE_BUILTIN   0x01 /* BUILTIN users and groups */
60 #define SAM_DATABASE_PRIVS     0x02 /* Priviliges? */
61
62 #if 0
63 /* I think this is correct - it's what gets parsed on the wire. JRA. */
64 /* NET_USER_INFO_2 */
65 typedef struct net_user_info_2
66 {
67         uint32 ptr_user_info;
68
69         NTTIME logon_time;            /* logon time */
70         NTTIME logoff_time;           /* logoff time */
71         NTTIME kickoff_time;          /* kickoff time */
72         NTTIME pass_last_set_time;    /* password last set time */
73         NTTIME pass_can_change_time;  /* password can change time */
74         NTTIME pass_must_change_time; /* password must change time */
75
76         UNIHDR hdr_user_name;    /* username unicode string header */
77         UNIHDR hdr_full_name;    /* user's full name unicode string header */
78         UNIHDR hdr_logon_script; /* logon script unicode string header */
79         UNIHDR hdr_profile_path; /* profile path unicode string header */
80         UNIHDR hdr_home_dir;     /* home directory unicode string header */
81         UNIHDR hdr_dir_drive;    /* home directory drive unicode string header */
82
83         uint16 logon_count;  /* logon count */
84         uint16 bad_pw_count; /* bad password count */
85
86         uint32 user_id;       /* User ID */
87         uint32 group_id;      /* Group ID */
88         uint32 num_groups;    /* num groups */
89         uint32 buffer_groups; /* undocumented buffer pointer to groups. */
90         uint32 user_flgs;     /* user flags */
91
92         uint8 user_sess_key[16]; /* unused user session key */
93
94         UNIHDR hdr_logon_srv; /* logon server unicode string header */
95         UNIHDR hdr_logon_dom; /* logon domain unicode string header */
96
97         uint32 buffer_dom_id; /* undocumented logon domain id pointer */
98         uint8 padding[40];    /* unused padding bytes.  expansion room */
99
100         UNISTR2 uni_user_name;    /* username unicode string */
101         UNISTR2 uni_full_name;    /* user's full name unicode string */
102         UNISTR2 uni_logon_script; /* logon script unicode string */
103         UNISTR2 uni_profile_path; /* profile path unicode string */
104         UNISTR2 uni_home_dir;     /* home directory unicode string */
105         UNISTR2 uni_dir_drive;    /* home directory drive unicode string */
106
107         uint32 num_groups2;        /* num groups */
108         DOM_GID *gids; /* group info */
109
110         UNISTR2 uni_logon_srv; /* logon server unicode string */
111         UNISTR2 uni_logon_dom; /* logon domain unicode string */
112
113         DOM_SID2 dom_sid;           /* domain SID */
114
115         uint32 num_other_groups;        /* other groups */
116         DOM_GID *other_gids; /* group info */
117         DOM_SID2 *other_sids; /* undocumented - domain SIDs */
118
119 } NET_USER_INFO_2;
120 #endif
121
122 /* NET_USER_INFO_3 */
123 typedef struct net_user_info_3
124 {
125         uint32 ptr_user_info;
126
127         NTTIME logon_time;            /* logon time */
128         NTTIME logoff_time;           /* logoff time */
129         NTTIME kickoff_time;          /* kickoff time */
130         NTTIME pass_last_set_time;    /* password last set time */
131         NTTIME pass_can_change_time;  /* password can change time */
132         NTTIME pass_must_change_time; /* password must change time */
133
134         UNIHDR hdr_user_name;    /* username unicode string header */
135         UNIHDR hdr_full_name;    /* user's full name unicode string header */
136         UNIHDR hdr_logon_script; /* logon script unicode string header */
137         UNIHDR hdr_profile_path; /* profile path unicode string header */
138         UNIHDR hdr_home_dir;     /* home directory unicode string header */
139         UNIHDR hdr_dir_drive;    /* home directory drive unicode string header */
140
141         uint16 logon_count;  /* logon count */
142         uint16 bad_pw_count; /* bad password count */
143
144         uint32 user_rid;       /* User RID */
145         uint32 group_rid;      /* Group RID */
146
147         uint32 num_groups;    /* num groups */
148         uint32 buffer_groups; /* undocumented buffer pointer to groups. */
149         uint32 user_flgs;     /* user flags */
150
151         uint8 user_sess_key[16]; /* unused user session key */
152
153         UNIHDR hdr_logon_srv; /* logon server unicode string header */
154         UNIHDR hdr_logon_dom; /* logon domain unicode string header */
155
156         uint32 buffer_dom_id; /* undocumented logon domain id pointer */
157         uint8 padding[40];    /* unused padding bytes.  expansion room */
158
159         uint32 num_other_sids; /* 0 - num_sids */
160         uint32 buffer_other_sids; /* NULL - undocumented pointer to SIDs. */
161         
162         UNISTR2 uni_user_name;    /* username unicode string */
163         UNISTR2 uni_full_name;    /* user's full name unicode string */
164         UNISTR2 uni_logon_script; /* logon script unicode string */
165         UNISTR2 uni_profile_path; /* profile path unicode string */
166         UNISTR2 uni_home_dir;     /* home directory unicode string */
167         UNISTR2 uni_dir_drive;    /* home directory drive unicode string */
168
169         uint32 num_groups2;        /* num groups */
170         DOM_GID *gids; /* group info */
171
172         UNISTR2 uni_logon_srv; /* logon server unicode string */
173         UNISTR2 uni_logon_dom; /* logon domain unicode string */
174
175         DOM_SID2 dom_sid;           /* domain SID */
176
177         uint32 num_other_groups;        /* other groups */
178         DOM_GID *other_gids; /* group info */
179         DOM_SID2 *other_sids; /* undocumented - domain SIDs */
180
181 } NET_USER_INFO_3;
182
183
184 /* NETLOGON_INFO_1 - pdc status info, i presume */
185 typedef struct netlogon_1_info
186 {
187         uint32 flags;            /* 0x0 - undocumented */
188         uint32 pdc_status;       /* 0x0 - undocumented */
189
190 } NETLOGON_INFO_1;
191
192 /* NETLOGON_INFO_2 - pdc status info, plus trusted domain info */
193 typedef struct netlogon_2_info
194 {
195         uint32  flags;            /* 0x0 - undocumented */
196         uint32  pdc_status;       /* 0x0 - undocumented */
197         uint32  ptr_trusted_dc_name; /* pointer to trusted domain controller name */
198         uint32  tc_status;           /* 0x051f - ERROR_NO_LOGON_SERVERS */
199         UNISTR2 uni_trusted_dc_name; /* unicode string - trusted dc name */
200
201 } NETLOGON_INFO_2;
202
203 /* NETLOGON_INFO_3 - logon status info, i presume */
204 typedef struct netlogon_3_info
205 {
206         uint32 flags;            /* 0x0 - undocumented */
207         uint32 logon_attempts;   /* number of logon attempts */
208         uint32 reserved_1;       /* 0x0 - undocumented */
209         uint32 reserved_2;       /* 0x0 - undocumented */
210         uint32 reserved_3;       /* 0x0 - undocumented */
211         uint32 reserved_4;       /* 0x0 - undocumented */
212         uint32 reserved_5;       /* 0x0 - undocumented */
213
214 } NETLOGON_INFO_3;
215
216 /********************************************************
217  Logon Control Query
218
219  This is generated by a nltest /bdc_query:DOMAIN
220
221  query_level 0x1, function_code 0x1
222
223  ********************************************************/
224
225 /* NET_Q_LOGON_CTRL - LSA Netr Logon Control */
226
227 typedef struct net_q_logon_ctrl_info
228 {
229         uint32 ptr;
230         UNISTR2 uni_server_name;
231         uint32 function_code;
232         uint32 query_level;
233 } NET_Q_LOGON_CTRL;
234
235 /* NET_R_LOGON_CTRL - LSA Netr Logon Control */
236
237 typedef struct net_r_logon_ctrl_info
238 {
239         uint32 switch_value;
240         uint32 ptr;
241
242         union {
243                 NETLOGON_INFO_1 info1;
244         } logon;
245
246         NTSTATUS status;
247 } NET_R_LOGON_CTRL;
248
249 /********************************************************
250  Logon Control2 Query
251
252  query_level 0x1 - pdc status
253  query_level 0x3 - number of logon attempts.
254
255  ********************************************************/
256
257 /* NET_Q_LOGON_CTRL2 - LSA Netr Logon Control 2 */
258 typedef struct net_q_logon_ctrl2_info
259 {
260         uint32       ptr;             /* undocumented buffer pointer */
261         UNISTR2      uni_server_name; /* server name, starting with two '\'s */
262         
263         uint32       function_code; /* 0x1 */
264         uint32       query_level;   /* 0x1, 0x3 */
265         uint32       switch_value;  /* 0x1 */
266
267 } NET_Q_LOGON_CTRL2;
268
269 /*******************************************************
270  Logon Control Response
271
272  switch_value is same as query_level in request 
273  *******************************************************/
274
275 /* NET_R_LOGON_CTRL2 - response to LSA Logon Control2 */
276 typedef struct net_r_logon_ctrl2_info
277 {
278         uint32       switch_value;  /* 0x1, 0x3 */
279         uint32       ptr;
280
281         union
282         {
283                 NETLOGON_INFO_1 info1;
284                 NETLOGON_INFO_2 info2;
285                 NETLOGON_INFO_3 info3;
286
287         } logon;
288
289         NTSTATUS status; /* return code */
290
291 } NET_R_LOGON_CTRL2;
292
293 /* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */
294 typedef struct net_q_trust_dom_info
295 {
296         uint32       ptr;             /* undocumented buffer pointer */
297         UNISTR2      uni_server_name; /* server name, starting with two '\'s */
298
299 } NET_Q_TRUST_DOM_LIST;
300
301 #define MAX_TRUST_DOMS 1
302
303 /* NET_R_TRUST_DOM_LIST - response to LSA Trusted Domains */
304 typedef struct net_r_trust_dom_info
305 {
306         UNISTR2 uni_trust_dom_name[MAX_TRUST_DOMS];
307
308         NTSTATUS status; /* return code */
309
310 } NET_R_TRUST_DOM_LIST;
311
312
313 /* NEG_FLAGS */
314 typedef struct neg_flags_info
315 {
316     uint32 neg_flags; /* negotiated flags */
317
318 } NEG_FLAGS;
319
320
321 /* NET_Q_REQ_CHAL */
322 typedef struct net_q_req_chal_info
323 {
324     uint32  undoc_buffer; /* undocumented buffer pointer */
325     UNISTR2 uni_logon_srv; /* logon server unicode string */
326     UNISTR2 uni_logon_clnt; /* logon client unicode string */
327     DOM_CHAL clnt_chal; /* client challenge */
328
329 } NET_Q_REQ_CHAL;
330
331
332 /* NET_R_REQ_CHAL */
333 typedef struct net_r_req_chal_info
334 {
335         DOM_CHAL srv_chal; /* server challenge */
336         NTSTATUS status; /* return code */
337 } NET_R_REQ_CHAL;
338
339 /* NET_Q_AUTH */
340 typedef struct net_q_auth_info
341 {
342         DOM_LOG_INFO clnt_id; /* client identification info */
343         DOM_CHAL clnt_chal;     /* client-calculated credentials */
344 } NET_Q_AUTH;
345
346 /* NET_R_AUTH */
347 typedef struct net_r_auth_info
348 {
349         DOM_CHAL srv_chal;     /* server-calculated credentials */
350         NTSTATUS status; /* return code */
351 } NET_R_AUTH;
352
353 /* NET_Q_AUTH_2 */
354 typedef struct net_q_auth2_info
355 {
356     DOM_LOG_INFO clnt_id; /* client identification info */
357     DOM_CHAL clnt_chal;     /* client-calculated credentials */
358
359     NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */
360
361 } NET_Q_AUTH_2;
362
363
364 /* NET_R_AUTH_2 */
365 typedef struct net_r_auth2_info
366 {
367         DOM_CHAL srv_chal;     /* server-calculated credentials */
368         NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */
369         NTSTATUS status; /* return code */
370 } NET_R_AUTH_2;
371
372
373 /* NET_Q_SRV_PWSET */
374 typedef struct net_q_srv_pwset_info
375 {
376     DOM_CLNT_INFO clnt_id; /* client identification/authentication info */
377     uint8 pwd[16]; /* new password - undocumented. */
378
379 } NET_Q_SRV_PWSET;
380     
381 /* NET_R_SRV_PWSET */
382 typedef struct net_r_srv_pwset_info
383 {
384     DOM_CRED srv_cred;     /* server-calculated credentials */
385
386   NTSTATUS status; /* return code */
387
388 } NET_R_SRV_PWSET;
389
390 /* NET_ID_INFO_2 */
391 typedef struct net_network_info_2
392 {
393         uint32            ptr_id_info2;        /* pointer to id_info_2 */
394         UNIHDR            hdr_domain_name;     /* domain name unicode header */
395         uint32            param_ctrl;          /* param control (0x2) */
396         DOM_LOGON_ID      logon_id;            /* logon ID */
397         UNIHDR            hdr_user_name;       /* user name unicode header */
398         UNIHDR            hdr_wksta_name;      /* workstation name unicode header */
399         uint8             lm_chal[8];          /* lan manager 8 byte challenge */
400         STRHDR            hdr_nt_chal_resp;    /* nt challenge response */
401         STRHDR            hdr_lm_chal_resp;    /* lm challenge response */
402
403         UNISTR2           uni_domain_name;     /* domain name unicode string */
404         UNISTR2           uni_user_name;       /* user name unicode string */
405         UNISTR2           uni_wksta_name;      /* workgroup name unicode string */
406         STRING2           nt_chal_resp;        /* nt challenge response */
407         STRING2           lm_chal_resp;        /* lm challenge response */
408
409 } NET_ID_INFO_2;
410
411 /* NET_ID_INFO_1 */
412 typedef struct id_info_1
413 {
414         uint32            ptr_id_info1;        /* pointer to id_info_1 */
415         UNIHDR            hdr_domain_name;     /* domain name unicode header */
416         uint32            param_ctrl;          /* param control */
417         DOM_LOGON_ID      logon_id;            /* logon ID */
418         UNIHDR            hdr_user_name;       /* user name unicode header */
419         UNIHDR            hdr_wksta_name;      /* workstation name unicode header */
420         OWF_INFO          lm_owf;              /* LM OWF Password */
421         OWF_INFO          nt_owf;              /* NT OWF Password */
422         UNISTR2           uni_domain_name;     /* domain name unicode string */
423         UNISTR2           uni_user_name;       /* user name unicode string */
424         UNISTR2           uni_wksta_name;      /* workgroup name unicode string */
425
426 } NET_ID_INFO_1;
427
428 #define INTERACTIVE_LOGON_TYPE 1
429 #define NET_LOGON_TYPE 2
430
431 /* NET_ID_INFO_CTR */
432 typedef struct net_id_info_ctr_info
433 {
434   uint16         switch_value;
435   
436   union
437   {
438     NET_ID_INFO_1 id1; /* auth-level 1 - interactive user login */
439     NET_ID_INFO_2 id2; /* auth-level 2 - workstation referred login */
440
441   } auth;
442   
443 } NET_ID_INFO_CTR;
444
445 /* SAM_INFO - sam logon/off id structure */
446 typedef struct sam_info
447 {
448   DOM_CLNT_INFO2  client;
449   uint32          ptr_rtn_cred; /* pointer to return credentials */
450   DOM_CRED        rtn_cred; /* return credentials */
451   uint16          logon_level;
452   NET_ID_INFO_CTR *ctr;
453
454 } DOM_SAM_INFO;
455
456 /* NET_Q_SAM_LOGON */
457 typedef struct net_q_sam_logon_info
458 {
459     DOM_SAM_INFO sam_id;
460         uint16          validation_level;
461
462 } NET_Q_SAM_LOGON;
463
464 /* NET_R_SAM_LOGON */
465 typedef struct net_r_sam_logon_info
466 {
467     uint32 buffer_creds; /* undocumented buffer pointer */
468     DOM_CRED srv_creds; /* server credentials.  server time stamp appears to be ignored. */
469     
470         uint16 switch_value; /* 3 - indicates type of USER INFO */
471     NET_USER_INFO_3 *user;
472
473     uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
474
475   NTSTATUS status; /* return code */
476
477 } NET_R_SAM_LOGON;
478
479
480 /* NET_Q_SAM_LOGOFF */
481 typedef struct net_q_sam_logoff_info
482 {
483     DOM_SAM_INFO sam_id;
484
485 } NET_Q_SAM_LOGOFF;
486
487 /* NET_R_SAM_LOGOFF */
488 typedef struct net_r_sam_logoff_info
489 {
490     uint32 buffer_creds; /* undocumented buffer pointer */
491     DOM_CRED srv_creds; /* server credentials.  server time stamp appears to be ignored. */
492     
493   NTSTATUS status; /* return code */
494
495 } NET_R_SAM_LOGOFF;
496
497 /* NET_Q_SAM_SYNC */
498 typedef struct net_q_sam_sync_info
499 {
500         UNISTR2 uni_srv_name; /* \\PDC */
501         UNISTR2 uni_cli_name; /* BDC */
502         DOM_CRED cli_creds;
503         DOM_CRED ret_creds;
504
505         uint32 database_id;
506         uint32 restart_state;
507         uint32 sync_context;
508
509         uint32 max_size;       /* preferred maximum length */
510
511 } NET_Q_SAM_SYNC;
512
513 /* SAM_DELTA_HDR */
514 typedef struct sam_delta_hdr_info
515 {
516         uint16 type;  /* type of structure attached */
517         uint16 type2;
518         uint32 target_rid;
519
520         uint32 type3;
521         uint32 ptr_delta;
522
523 } SAM_DELTA_HDR;
524
525 /* SAM_DOMAIN_INFO (0x1) */
526 typedef struct sam_domain_info_info
527 {
528         UNIHDR hdr_dom_name;
529         UNIHDR hdr_oem_info;
530
531         UINT64_S force_logoff;
532         uint16   min_pwd_len;
533         uint16   pwd_history_len;
534         UINT64_S max_pwd_age;
535         UINT64_S min_pwd_age;
536         UINT64_S dom_mod_count;
537         NTTIME   creation_time;
538
539         BUFHDR2 hdr_sec_desc; /* security descriptor */
540         UNIHDR hdr_unknown;
541         uint8 reserved[40];
542
543         UNISTR2 uni_dom_name;
544         UNISTR2 buf_oem_info; /* never seen */
545
546         BUFFER4 buf_sec_desc;
547         UNISTR2 buf_unknown;
548
549 } SAM_DOMAIN_INFO;
550
551 /* SAM_GROUP_INFO (0x2) */
552 typedef struct sam_group_info_info
553 {
554         UNIHDR hdr_grp_name;
555         DOM_GID gid;
556         UNIHDR hdr_grp_desc;
557         BUFHDR2 hdr_sec_desc;  /* security descriptor */
558         uint8 reserved[48];
559
560         UNISTR2 uni_grp_name;
561         UNISTR2 uni_grp_desc;
562         BUFFER4 buf_sec_desc;
563
564 } SAM_GROUP_INFO;
565
566 /* SAM_PWD */
567 typedef struct sam_passwd_info
568 {
569         /* this structure probably contains password history */
570         /* this is probably a count of lm/nt pairs */
571         uint32 unk_0; /* 0x0000 0002 */
572
573         UNIHDR hdr_lm_pwd;
574         uint8  buf_lm_pwd[16];
575
576         UNIHDR hdr_nt_pwd;
577         uint8  buf_nt_pwd[16];
578
579         UNIHDR hdr_empty_lm;
580         UNIHDR hdr_empty_nt;
581
582 } SAM_PWD;
583
584 /* SAM_ACCOUNT_INFO (0x5) */
585 typedef struct sam_account_info_info
586 {
587         UNIHDR hdr_acct_name;
588         UNIHDR hdr_full_name;
589
590         uint32 user_rid;
591         uint32 group_rid;
592
593         UNIHDR hdr_home_dir;
594         UNIHDR hdr_dir_drive;
595         UNIHDR hdr_logon_script;
596         UNIHDR hdr_acct_desc;
597         UNIHDR hdr_workstations;
598
599         NTTIME logon_time;
600         NTTIME logoff_time;
601
602         uint32 logon_divs; /* 0xA8 */
603         uint32 ptr_logon_hrs;
604
605         uint16 bad_pwd_count;
606         uint16 logon_count;
607         NTTIME pwd_last_set_time;
608         NTTIME acct_expiry_time;
609
610         uint32 acb_info;
611         uint8 nt_pwd[16];
612         uint8 lm_pwd[16];
613         uint8 nt_pwd_present;
614         uint8 lm_pwd_present;
615         uint8 pwd_expired;
616
617         UNIHDR hdr_comment;
618         UNIHDR hdr_parameters;
619         uint16 country;
620         uint16 codepage;
621
622         BUFHDR2 hdr_sec_desc;  /* security descriptor */
623
624         UNIHDR  hdr_profile;
625         UNIHDR  hdr_reserved[3];  /* space for more strings */
626         uint32  dw_reserved[4];   /* space for more data - first two seem to
627                                      be an NTTIME */
628
629         UNISTR2 uni_acct_name;
630         UNISTR2 uni_full_name;
631         UNISTR2 uni_home_dir;
632         UNISTR2 uni_dir_drive;
633         UNISTR2 uni_logon_script;
634         UNISTR2 uni_acct_desc;
635         UNISTR2 uni_workstations;
636
637         uint32 unknown1; /* 0x4EC */
638         uint32 unknown2; /* 0 */
639
640         BUFFER4 buf_logon_hrs;
641         UNISTR2 uni_comment;
642         UNISTR2 uni_parameters;
643         SAM_PWD pass;
644         BUFFER4 buf_sec_desc;
645         UNISTR2 uni_profile;
646
647 } SAM_ACCOUNT_INFO;
648
649 /* SAM_GROUP_MEM_INFO (0x8) */
650 typedef struct sam_group_mem_info_info
651 {
652         uint32 ptr_rids;
653         uint32 ptr_attribs;
654         uint32 num_members;
655         uint8 unknown[16];
656
657         uint32 num_members2;
658         uint32 *rids;
659
660         uint32 num_members3;
661         uint32 *attribs;
662
663 } SAM_GROUP_MEM_INFO;
664
665 /* SAM_ALIAS_INFO (0x9) */
666 typedef struct sam_alias_info_info
667 {
668         UNIHDR hdr_als_name;
669         uint32 als_rid;
670         BUFHDR2 hdr_sec_desc;  /* security descriptor */
671         UNIHDR hdr_als_desc;
672         uint8 reserved[40];
673
674         UNISTR2 uni_als_name;
675         BUFFER4 buf_sec_desc;
676         UNISTR2 uni_als_desc;
677
678 } SAM_ALIAS_INFO;
679
680 /* SAM_ALIAS_MEM_INFO (0xC) */
681 typedef struct sam_alias_mem_info_info
682 {
683         uint32 num_members;
684         uint32 ptr_members;
685         uint8 unknown[16];
686
687         uint32 num_sids;
688         uint32 *ptr_sids;
689         DOM_SID2 *sids;
690
691 } SAM_ALIAS_MEM_INFO;
692
693 /* SAM_DELTA_STAMP (0x16) */
694 typedef struct
695 {
696         uint32 seqnum;
697         uint32 dom_mod_count_ptr;
698         UINT64_S dom_mod_count;  /* domain mod count at last sync */
699 } SAM_DELTA_STAMP;
700
701 typedef union sam_delta_ctr_info
702 {
703         SAM_DOMAIN_INFO    domain_info ;
704         SAM_GROUP_INFO     group_info  ;
705         SAM_ACCOUNT_INFO   account_info;
706         SAM_GROUP_MEM_INFO grp_mem_info;
707         SAM_ALIAS_INFO     alias_info  ;
708         SAM_ALIAS_MEM_INFO als_mem_info;
709         SAM_DELTA_STAMP    stamp;
710 } SAM_DELTA_CTR;
711
712 /* NET_R_SAM_SYNC */
713 typedef struct net_r_sam_sync_info
714 {
715         DOM_CRED srv_creds;
716
717         uint32 sync_context;
718
719         uint32 ptr_deltas;
720         uint32 num_deltas;
721         uint32 ptr_deltas2;
722         uint32 num_deltas2;
723
724         SAM_DELTA_HDR *hdr_deltas;
725         SAM_DELTA_CTR *deltas;
726
727         NTSTATUS status;
728 } NET_R_SAM_SYNC;
729
730 /* NET_Q_SAM_DELTAS */
731 typedef struct net_q_sam_deltas_info
732 {
733         UNISTR2 uni_srv_name;
734         UNISTR2 uni_cli_name;
735         DOM_CRED cli_creds;
736         DOM_CRED ret_creds;
737
738         uint32 database_id;
739         UINT64_S dom_mod_count;  /* domain mod count at last sync */
740
741         uint32 max_size;       /* preferred maximum length */
742
743 } NET_Q_SAM_DELTAS;
744
745 /* NET_R_SAM_DELTAS */
746 typedef struct net_r_sam_deltas_info
747 {
748         DOM_CRED srv_creds;
749
750         UINT64_S dom_mod_count;   /* new domain mod count */
751
752         uint32 ptr_deltas;
753         uint32 num_deltas;
754         uint32 num_deltas2;
755
756         SAM_DELTA_HDR *hdr_deltas;
757         SAM_DELTA_CTR *deltas;
758
759         NTSTATUS status;
760 } NET_R_SAM_DELTAS;
761
762 #endif /* _RPC_NETLOGON_H */