added SamrQueryDomainInfo call info level 0x3 for kix32.exe support
[samba.git] / source3 / include / rpc_samr.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell 1992-1998
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1998
7    Copyright (C) Paul Ashton 1997-1998
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_SAMR_H /* _RPC_SAMR_H */
25 #define _RPC_SAMR_H 
26
27
28 #include "rpc_misc.h"
29
30
31 /*******************************************************************
32  the following information comes from a QuickView on samsrv.dll,
33  and gives an idea of exactly what is needed:
34  
35 x SamrAddMemberToAlias
36 x SamrAddMemberToGroup
37 SamrAddMultipleMembersToAlias
38 x SamrChangePasswordUser
39 x SamrCloseHandle
40 x SamrConnect
41 x SamrCreateAliasInDomain
42 x SamrCreateGroupInDomain
43 x SamrCreateUserInDomain
44 ? SamrDeleteAlias
45 SamrDeleteGroup
46 SamrDeleteUser
47 x SamrEnumerateAliasesInDomain
48 SamrEnumerateDomainsInSamServer
49 x SamrEnumerateGroupsInDomain
50 x SamrEnumerateUsersInDomain
51 SamrGetUserDomainPasswordInformation
52 SamrLookupDomainInSamServer
53 ? SamrLookupIdsInDomain
54 x SamrLookupNamesInDomain
55 x SamrOpenAlias
56 x SamrOpenDomain
57 x SamrOpenGroup
58 x SamrOpenUser
59 x SamrQueryDisplayInformation
60 x SamrQueryInformationAlias
61 SamrQueryInformationDomain
62 ? SamrQueryInformationUser
63 SamrQuerySecurityObject
64 SamrRemoveMemberFromAlias
65 SamrRemoveMemberFromForiegnDomain
66 SamrRemoveMemberFromGroup
67 SamrRemoveMultipleMembersFromAlias
68 x SamrSetInformationAlias
69 SamrSetInformationDomain
70 x SamrSetInformationGroup
71 x SamrSetInformationUser
72 SamrSetMemberAttributesOfGroup
73 SamrSetSecurityObject
74 SamrShutdownSamServer
75 SamrTestPrivateFunctionsDomain
76 SamrTestPrivateFunctionsUser
77
78 ********************************************************************/
79
80 #define SAMR_CONNECT_ANON      0x00
81 #define SAMR_CLOSE_HND         0x01
82
83 #define SAMR_UNKNOWN_3         0x03
84 #define SAMR_LOOKUP_DOMAIN     0x05
85 #define SAMR_OPEN_DOMAIN       0x07
86
87 #define SAMR_QUERY_DOMAIN_INFO 0x08
88
89 #define SAMR_CREATE_DOM_GROUP  0x0a
90 #define SAMR_ENUM_DOM_GROUPS   0x0b
91 #define SAMR_ENUM_DOM_USERS    0x0d
92 #define SAMR_CREATE_DOM_ALIAS  0x0e
93 #define SAMR_ENUM_DOM_ALIASES  0x0f
94 #define SAMR_QUERY_USERALIASES 0x10
95
96 #define SAMR_LOOKUP_NAMES      0x11
97 #define SAMR_LOOKUP_RIDS       0x12
98
99 #define SAMR_OPEN_GROUP        0x13
100 #define SAMR_QUERY_GROUPINFO   0x14
101 #define SAMR_SET_GROUPINFO     0x15
102 #define SAMR_ADD_GROUPMEM      0x16
103 #define SAMR_DELETE_DOM_GROUP  0x17
104 #define SAMR_DEL_GROUPMEM      0x18
105 #define SAMR_QUERY_GROUPMEM    0x19
106
107 #define SAMR_OPEN_ALIAS        0x1b
108 #define SAMR_QUERY_ALIASINFO   0x1c
109 #define SAMR_SET_ALIASINFO     0x1d
110 #define SAMR_DELETE_DOM_ALIAS  0x1e
111 #define SAMR_ADD_ALIASMEM      0x1f
112 #define SAMR_DEL_ALIASMEM      0x20
113 #define SAMR_QUERY_ALIASMEM    0x21
114
115 #define SAMR_OPEN_USER         0x22
116 #define SAMR_CREATE_USER       0x32
117 #define SAMR_SET_USERINFO      0x3A
118
119 #define SAMR_QUERY_USERINFO    0x24
120 #define SAMR_QUERY_USERGROUPS  0x27
121 #define SAMR_QUERY_DISPINFO    0x28
122
123 #define SAMR_UNKNOWN_2C        0x2c
124 #define SAMR_QUERY_DISPINFO3   0x30 /* Alias for SAMR_QUERY_DISPINFO
125                                        with info level 3 */
126 #define SAMR_QUERY_DISPINFO4   0x33 /* Alias for SAMR_QUERY_DISPINFO
127                                        with info level 4 */
128 #define SAMR_UNKNOWN_34        0x34
129
130 #define SAMR_CHGPASSWD_USER    0x37
131 #define SAMR_UNKNOWN_38        0x38
132
133 #define SAMR_CONNECT           0x39
134
135
136 typedef struct logon_hours_info
137 {
138         uint32 len; /* normally 21 bytes */
139         uint8 hours[32];
140
141 } LOGON_HRS;
142
143 /* SAM_USER_INFO_23 */
144 typedef struct sam_user_info_23
145 {
146         NTTIME logon_time;            /* logon time */
147         NTTIME logoff_time;           /* logoff time */
148         NTTIME kickoff_time;          /* kickoff time */
149         NTTIME pass_last_set_time;    /* password last set time */
150         NTTIME pass_can_change_time;  /* password can change time */
151         NTTIME pass_must_change_time; /* password must change time */
152
153         UNIHDR hdr_user_name;    /* NULL - user name unicode string header */
154         UNIHDR hdr_full_name;    /* user's full name unicode string header */
155         UNIHDR hdr_home_dir;     /* home directory unicode string header */
156         UNIHDR hdr_dir_drive;    /* home drive unicode string header */
157         UNIHDR hdr_logon_script; /* logon script unicode string header */
158         UNIHDR hdr_profile_path; /* profile path unicode string header */
159         UNIHDR hdr_acct_desc  ;  /* user description */
160         UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
161         UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
162         UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
163
164         uint8 lm_pwd[16];    /* lm user passwords */
165         uint8 nt_pwd[16];    /* nt user passwords */
166
167         uint32 user_rid;      /* Primary User ID */
168         uint32 group_rid;     /* Primary Group ID */
169
170         uint16 acb_info; /* account info (ACB_xxxx bit-mask) */
171         /* uint8 pad[2] */
172
173         uint32 unknown_3; /* 0x09f8 27fa */
174
175         uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
176         /* uint8 pad[2] */
177         uint32 ptr_logon_hrs; /* pointer to logon hours */
178
179         uint8 padding1[8];
180
181         uint32 unknown_5;     /* 0x0001 0000 */
182
183         uint8 pass[516];
184
185         UNISTR2 uni_user_name;    /* NULL - username unicode string */
186         UNISTR2 uni_full_name;    /* user's full name unicode string */
187         UNISTR2 uni_home_dir;     /* home directory unicode string */
188         UNISTR2 uni_dir_drive;    /* home directory drive unicode string */
189         UNISTR2 uni_logon_script; /* logon script unicode string */
190         UNISTR2 uni_profile_path; /* profile path unicode string */
191         UNISTR2 uni_acct_desc  ;  /* user description unicode string */
192         UNISTR2 uni_workstations; /* login from workstations unicode string */
193         UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
194         UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
195
196         uint32 unknown_6; /* 0x0000 04ec */
197         uint32 padding4;
198
199         LOGON_HRS logon_hrs;
200
201 } SAM_USER_INFO_23;
202
203 /* SAM_USER_INFO_24 */
204 typedef struct sam_user_info_24
205 {
206         uint8 pass[516];
207
208 } SAM_USER_INFO_24;
209
210
211 /* SAM_USER_INFO_21 */
212 typedef struct sam_user_info_21
213 {
214         NTTIME logon_time;            /* logon time */
215         NTTIME logoff_time;           /* logoff time */
216         NTTIME kickoff_time;          /* kickoff time */
217         NTTIME pass_last_set_time;    /* password last set time */
218         NTTIME pass_can_change_time;  /* password can change time */
219         NTTIME pass_must_change_time; /* password must change time */
220
221         UNIHDR hdr_user_name;    /* username unicode string header */
222         UNIHDR hdr_full_name;    /* user's full name unicode string header */
223         UNIHDR hdr_home_dir;     /* home directory unicode string header */
224         UNIHDR hdr_dir_drive;    /* home drive unicode string header */
225         UNIHDR hdr_logon_script; /* logon script unicode string header */
226         UNIHDR hdr_profile_path; /* profile path unicode string header */
227         UNIHDR hdr_acct_desc  ;  /* user description */
228         UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
229         UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
230         UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
231
232         uint8 lm_pwd[16];    /* lm user passwords */
233         uint8 nt_pwd[16];    /* nt user passwords */
234
235         uint32 user_rid;      /* Primary User ID */
236         uint32 group_rid;     /* Primary Group ID */
237
238         uint16 acb_info; /* account info (ACB_xxxx bit-mask) */
239         /* uint8 pad[2] */
240
241         uint32 unknown_3; /* 0x00ff ffff */
242
243         uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
244         /* uint8 pad[2] */
245         uint32 ptr_logon_hrs; /* unknown pointer */
246
247         uint32 unknown_5;     /* 0x0002 0000 */
248
249         uint8 padding1[8];
250
251         UNISTR2 uni_user_name;    /* username unicode string */
252         UNISTR2 uni_full_name;    /* user's full name unicode string */
253         UNISTR2 uni_home_dir;     /* home directory unicode string */
254         UNISTR2 uni_dir_drive;    /* home directory drive unicode string */
255         UNISTR2 uni_logon_script; /* logon script unicode string */
256         UNISTR2 uni_profile_path; /* profile path unicode string */
257         UNISTR2 uni_acct_desc  ;  /* user description unicode string */
258         UNISTR2 uni_workstations; /* login from workstations unicode string */
259         UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
260         UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
261
262         uint32 unknown_6; /* 0x0000 04ec */
263         uint32 padding4;
264
265         LOGON_HRS logon_hrs;
266
267 } SAM_USER_INFO_21;
268
269
270 /* SAM_USER_INFO_11 */
271 typedef struct sam_user_info_11
272 {
273         uint8  padding_0[16];  /* 0 - padding 16 bytes */
274         NTTIME expiry;         /* expiry time or something? */
275         uint8  padding_1[24];  /* 0 - padding 24 bytes */
276
277         UNIHDR hdr_mach_acct;  /* unicode header for machine account */
278         uint32 padding_2;      /* 0 - padding 4 bytes */
279
280         uint32 ptr_1;          /* pointer */
281         uint8  padding_3[32];  /* 0 - padding 32 bytes */
282         uint32 padding_4;      /* 0 - padding 4 bytes */
283
284         uint32 ptr_2;          /* pointer */
285         uint32 padding_5;      /* 0 - padding 4 bytes */
286
287         uint32 ptr_3;          /* pointer */
288         uint8  padding_6[32];  /* 0 - padding 32 bytes */
289
290         uint32 rid_user;       /* user RID */
291         uint32 rid_group;      /* group RID */
292
293         uint16 acct_ctrl;      /* 0080 - ACB_XXXX */
294         uint16 unknown_3;      /* 16 bit padding */
295
296         uint16 unknown_4;      /* 0x003f      - 16 bit unknown */
297         uint16 unknown_5;      /* 0x003c      - 16 bit unknown */
298
299         uint8  padding_7[16];  /* 0 - padding 16 bytes */
300         uint32 padding_8;      /* 0 - padding 4 bytes */
301         
302         UNISTR2 uni_mach_acct; /* unicode string for machine account */
303
304         uint8  padding_9[48];  /* 0 - padding 48 bytes */
305
306 } SAM_USER_INFO_11;
307
308
309 /* SAM_USER_INFO_10 */
310 typedef struct sam_user_info_10
311 {
312         uint32 acb_info;
313
314 } SAM_USER_INFO_10;
315
316
317
318 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
319 typedef struct q_samr_close_hnd_info
320 {
321     POLICY_HND pol;          /* policy handle */
322
323 } SAMR_Q_CLOSE_HND;
324
325
326 /* SAMR_R_CLOSE_HND - probably a policy handle close */
327 typedef struct r_samr_close_hnd_info
328 {
329         POLICY_HND pol;       /* policy handle */
330         uint32 status;         /* return status */
331
332 } SAMR_R_CLOSE_HND;
333
334
335 /****************************************************************************
336 SAMR_Q_UNKNOWN_2C - a "set user info" occurs just after this
337 *****************************************************************************/
338
339 /* SAMR_Q_UNKNOWN_2C */
340 typedef struct q_samr_unknown_2c_info
341 {
342         POLICY_HND user_pol;          /* policy handle */
343
344 } SAMR_Q_UNKNOWN_2C;
345
346
347 /****************************************************************************
348 SAMR_R_UNKNOWN_2C - a "set user info" occurs just after this
349 *****************************************************************************/
350
351 /* SAMR_R_UNKNOWN_2C */
352 typedef struct r_samr_unknown_2c_info
353 {
354         uint32 unknown_0; /* 0x0016 0000 */
355         uint32 unknown_1; /* 0x0000 0000 */
356         uint32 status; 
357
358 } SAMR_R_UNKNOWN_2C;
359
360
361 /****************************************************************************
362 SAMR_Q_UNKNOWN_3 - info level 4.  returns SIDs.
363 *****************************************************************************/
364
365 /* SAMR_Q_UNKNOWN_3 - probably get domain info... */
366 typedef struct q_samr_unknown_3_info
367 {
368         POLICY_HND user_pol;          /* policy handle */
369         uint16 switch_value;     /* 0x0000 0004 */
370         /* uint8 pad[2] */
371
372 } SAMR_Q_UNKNOWN_3;
373
374 /* DOM_SID3 example:
375    0x14 0x035b 0x0002 S-1-1
376    0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
377    0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ACCOUNT_OPS
378    0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03f1
379  */
380
381 /* DOM_SID3 example:
382    0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03ee
383    0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
384    0x14 0x035b 0x0002 S-1-1
385  */
386
387 /* DOM_SID3 - security id */
388 typedef struct sid_info_3
389 {
390         uint16 len; /* length, bytes, including length of len :-) */
391         /* uint8  pad[2]; */
392         
393         DOM_SID sid;
394
395 } DOM_SID3;
396
397
398 #define MAX_SAM_SIDS 15
399
400 /* SAM_SID_STUFF */
401 typedef struct sid_stuff_info
402 {
403         uint16 unknown_2; /* 0x0001 */
404         uint16 unknown_3; /* 0x8004 */
405
406         uint8 padding1[8];
407
408         uint32 unknown_4; /* 0x0000 0014 */
409         uint32 unknown_5; /* 0x0000 0014 */
410
411         uint16 unknown_6; /* 0x0002 */
412         uint16 unknown_7; /* 0x5800 */
413
414         uint32 num_sids;
415
416         uint16 padding2;
417
418         DOM_SID3 sid[MAX_SAM_SIDS];
419
420 } SAM_SID_STUFF;
421
422 /* SAMR_R_UNKNOWN_3 - probably an open */
423 typedef struct r_samr_unknown_3_info
424 {
425         uint32 ptr_0;
426         uint32 sid_stuff_len0;
427
428         uint32 ptr_1;
429         uint32 sid_stuff_len1;
430
431         SAM_SID_STUFF sid_stuff;
432
433         uint32 status;         /* return status */
434
435 } SAMR_R_UNKNOWN_3;
436
437
438 /****************************************************************************
439 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
440 *****************************************************************************/
441
442 /* SAMR_Q_QUERY_DOMAIN_INFO - */
443 typedef struct q_samr_query_domain_info
444 {
445         POLICY_HND domain_pol;   /* policy handle */
446         uint16 switch_value;     /* 0x0002, 0x0001 */
447
448 } SAMR_Q_QUERY_DOMAIN_INFO;
449
450 typedef struct sam_unknown_info_3_info
451 {
452         uint32 unknown_0; /* 0x0000 0000 */
453         uint32 unknown_1; /* 0x8000 0000 */
454
455 } SAM_UNK_INFO_3;
456
457 typedef struct sam_unknown_info_6_info
458 {
459         uint32 unknown_0; /* 0x0000 0000 */
460
461         uint32 ptr_0;     /* pointer to unknown structure */
462         uint8  padding[12]; /* 12 bytes zeros */
463
464 } SAM_UNK_INFO_6;
465
466 typedef struct sam_unknown_info_7_info
467 {
468         uint16 unknown_0; /* 0x0003 */
469
470 } SAM_UNK_INFO_7;
471
472 typedef struct sam_unknown_info_2_inf
473 {
474         uint32 unknown_0; /* 0x0000 0000 */
475         uint32 unknown_1; /* 0x8000 0000 */
476         uint32 unknown_2; /* 0x0000 0000 */
477
478         uint32 ptr_0;     /* pointer to unknown structure */
479         UNIHDR hdr_domain; /* domain name unicode header */
480         UNIHDR hdr_server; /* server name unicode header */
481
482         /* put all the data in here, at the moment, including what the above
483            pointer is referring to
484          */
485
486         uint32 seq_num; /* some sort of incrementing sequence number? */
487         uint32 unknown_3; /* 0x0000 0000 */
488         
489         uint32 unknown_4; /* 0x0000 0001 */
490         uint32 unknown_5; /* 0x0000 0003 */
491         uint32 unknown_6; /* 0x0000 0001 */
492         uint32 num_domain_usrs; /* number of users in domain */
493         uint32 num_domain_grps; /* number of domain groups in domain */
494         uint32 num_local_grps; /* number of local groups in domain */
495
496         uint8 padding[12]; /* 12 bytes zeros */
497
498         UNISTR2 uni_domain; /* domain name unicode string */
499         UNISTR2 uni_server; /* server name unicode string */
500
501 } SAM_UNK_INFO_2;
502
503 typedef struct sam_unknown_info_1_inf
504 {
505         uint8 padding[12]; /* 12 bytes zeros */
506         uint32 unknown_1; /* 0x8000 0000 */
507         uint32 unknown_2; /* 0x0000 0000 */
508
509 } SAM_UNK_INFO_1;
510
511
512 typedef struct sam_unknown_ctr_info
513 {
514         union
515         {
516                 SAM_UNK_INFO_1 inf1;
517                 SAM_UNK_INFO_2 inf2;
518                 SAM_UNK_INFO_3 inf3;
519                 SAM_UNK_INFO_6 inf6;
520                 SAM_UNK_INFO_7 inf7;
521
522         } info;
523
524 } SAM_UNK_CTR;
525
526
527 /* SAMR_R_QUERY_DOMAIN_INFO - */
528 typedef struct r_samr_query_domain_info
529 {
530         uint32 ptr_0;
531         uint16 switch_value; /* same as in query */
532
533         SAM_UNK_CTR *ctr;
534
535         uint32 status;         /* return status */
536
537 } SAMR_R_QUERY_DOMAIN_INFO;
538
539
540 /* SAMR_Q_LOOKUP_DOMAIN - obtain SID for a local domain */
541 typedef struct q_samr_lookup_domain_info
542 {
543         POLICY_HND connect_pol;
544
545         UNIHDR  hdr_domain;
546         UNISTR2 uni_domain;
547
548 } SAMR_Q_LOOKUP_DOMAIN;
549
550
551 /* SAMR_R_LOOKUP_DOMAIN */
552 typedef struct r_samr_lookup_domain_info
553 {
554         uint32   ptr_sid;
555         DOM_SID2 dom_sid;
556
557         uint32 status;
558
559 } SAMR_R_LOOKUP_DOMAIN;
560
561
562 /****************************************************************************
563 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
564
565 0x0000 03f1 and a specific   domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
566 0x0000 0200 and a specific   domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
567 *****************************************************************************/
568
569 /* SAMR_Q_OPEN_DOMAIN */
570 typedef struct q_samr_open_domain_info
571 {
572         POLICY_HND connect_pol;   /* policy handle */
573         uint32 flags;               /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */
574         DOM_SID2 dom_sid;         /* domain SID */
575
576 } SAMR_Q_OPEN_DOMAIN;
577
578
579 /* SAMR_R_OPEN_DOMAIN - probably an open */
580 typedef struct r_samr_open_domain_info
581 {
582         POLICY_HND domain_pol; /* policy handle associated with the SID */
583         uint32 status;         /* return status */
584
585 } SAMR_R_OPEN_DOMAIN;
586
587
588 #define MAX_SAM_ENTRIES 250
589
590 typedef struct samr_entry_info
591 {
592         uint32 rid;
593         UNIHDR hdr_name;
594
595 } SAM_ENTRY;
596
597
598 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
599 typedef struct q_samr_enum_dom_users_info
600 {
601         POLICY_HND pol;          /* policy handle */
602
603         uint32 start_idx;   /* number of values (0 indicates unlimited?) */
604         uint16 acb_mask;          /* 0x0000 indicates all */
605         uint16 unknown_1;         /* 0x0000 */
606
607         uint32 max_size;              /* 0x0000 ffff */
608
609 } SAMR_Q_ENUM_DOM_USERS;
610
611
612 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
613 typedef struct r_samr_enum_dom_users_info
614 {
615         uint32 next_idx;     /* next starting index required for enum */
616         uint32 ptr_entries1;  
617
618         uint32 num_entries2;
619         uint32 ptr_entries2;
620
621         uint32 num_entries3;
622
623         SAM_ENTRY *sam;
624         UNISTR2 *uni_acct_name;
625
626         uint32 num_entries4;
627
628         uint32 status;
629
630 } SAMR_R_ENUM_DOM_USERS;
631
632
633 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
634 typedef struct q_samr_enum_dom_groups_info
635 {
636         POLICY_HND pol;          /* policy handle */
637
638         /* this is possibly an enumeration context handle... */
639         uint32 unknown_0;         /* 0x0000 0000 */
640
641         uint32 max_size;              /* 0x0000 ffff */
642
643 } SAMR_Q_ENUM_DOM_GROUPS;
644
645
646 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
647 typedef struct r_samr_enum_dom_groups_info
648 {
649         uint32 num_entries;
650         uint32 ptr_entries;
651
652         uint32 num_entries2;
653         uint32 ptr_entries2;
654
655         uint32 num_entries3;
656
657         SAM_ENTRY sam[MAX_SAM_ENTRIES];
658         UNISTR2 uni_grp_name[MAX_SAM_ENTRIES];
659
660         uint32 num_entries4;
661
662         uint32 status;
663
664 } SAMR_R_ENUM_DOM_GROUPS;
665
666
667 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
668 typedef struct q_samr_enum_dom_aliases_info
669 {
670         POLICY_HND pol;          /* policy handle */
671
672         /* this is possibly an enumeration context handle... */
673         uint32 unknown_0;         /* 0x0000 0000 */
674
675         uint32 max_size;              /* 0x0000 ffff */
676
677 } SAMR_Q_ENUM_DOM_ALIASES;
678
679
680 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
681 typedef struct r_samr_enum_dom_aliases_info
682 {
683         uint32 num_entries;
684         uint32 ptr_entries;
685
686         uint32 num_entries2;
687         uint32 ptr_entries2;
688
689         uint32 num_entries3;
690
691         SAM_ENTRY sam[MAX_SAM_ENTRIES];
692         UNISTR2 uni_grp_name[MAX_SAM_ENTRIES];
693
694         uint32 num_entries4;
695
696         uint32 status;
697
698 } SAMR_R_ENUM_DOM_ALIASES;
699
700
701 /* -- Level 1 Display Info - User Information -- */
702
703 typedef struct samr_entry_info1
704 {
705         uint32 user_idx;
706
707         uint32 rid_user;
708         uint16 acb_info;
709         uint16 pad;
710
711         UNIHDR hdr_acct_name;
712         UNIHDR hdr_user_name;
713         UNIHDR hdr_user_desc;
714
715 } SAM_ENTRY1;
716
717 typedef struct samr_str_entry_info1
718 {
719         UNISTR2 uni_acct_name;
720         UNISTR2 uni_full_name;
721         UNISTR2 uni_acct_desc;
722
723 } SAM_STR1;
724
725 typedef struct sam_entry_info_1
726 {
727         SAM_ENTRY1 sam[MAX_SAM_ENTRIES];
728         SAM_STR1   str[MAX_SAM_ENTRIES];
729
730 } SAM_DISPINFO_1;
731
732
733 /* -- Level 2 Display Info - Trust Account Information -- */
734
735 typedef struct samr_entry_info2
736 {
737         uint32 user_idx;
738
739         uint32 rid_user;
740         uint16 acb_info;
741         uint16 pad;
742
743         UNIHDR hdr_srv_name;
744         UNIHDR hdr_srv_desc;
745
746 } SAM_ENTRY2;
747
748 typedef struct samr_str_entry_info2
749 {
750         UNISTR2 uni_srv_name;
751         UNISTR2 uni_srv_desc;
752
753 } SAM_STR2;
754
755 typedef struct sam_entry_info_2
756 {
757         SAM_ENTRY2 sam[MAX_SAM_ENTRIES];
758         SAM_STR2   str[MAX_SAM_ENTRIES];
759
760 } SAM_DISPINFO_2;
761
762
763 /* -- Level 3 Display Info - Domain Group Information -- */
764
765 typedef struct samr_entry_info3
766 {
767         uint32 grp_idx;
768
769         uint32 rid_grp;
770         uint32 attr;     /* SE_GROUP_xxx, usually 7 */
771
772         UNIHDR hdr_grp_name;
773         UNIHDR hdr_grp_desc;
774
775 } SAM_ENTRY3;
776
777 typedef struct samr_str_entry_info3
778 {
779         UNISTR2 uni_grp_name;
780         UNISTR2 uni_grp_desc;
781
782 } SAM_STR3;
783
784 typedef struct sam_entry_info_3
785 {
786         SAM_ENTRY3 sam[MAX_SAM_ENTRIES];
787         SAM_STR3   str[MAX_SAM_ENTRIES];
788
789 } SAM_DISPINFO_3;
790
791
792 /* -- Level 4 Display Info - User List (ASCII) -- */
793
794 typedef struct samr_entry_info4
795 {
796         uint32 user_idx;
797         STRHDR hdr_acct_name;
798
799 } SAM_ENTRY4;
800
801 typedef struct samr_str_entry_info4
802 {
803         STRING2 acct_name;
804
805 } SAM_STR4;
806
807 typedef struct sam_entry_info_4
808 {
809         SAM_ENTRY4 sam[MAX_SAM_ENTRIES];
810         SAM_STR4   str[MAX_SAM_ENTRIES];
811
812 } SAM_DISPINFO_4;
813
814
815 /* -- Level 5 Display Info - Group List (ASCII) -- */
816
817 typedef struct samr_entry_info5
818 {
819         uint32 grp_idx;
820         STRHDR hdr_grp_name;
821
822 } SAM_ENTRY5;
823
824 typedef struct samr_str_entry_info5
825 {
826         STRING2 grp_name;
827
828 } SAM_STR5;
829
830 typedef struct sam_entry_info_5
831 {
832         SAM_ENTRY5 sam[MAX_SAM_ENTRIES];
833         SAM_STR5   str[MAX_SAM_ENTRIES];
834
835 } SAM_DISPINFO_5;
836
837
838 typedef struct sam_dispinfo_ctr_info
839 {
840         union
841         {
842                 SAM_DISPINFO_1 *info1; /* users/names/descriptions */
843                 SAM_DISPINFO_2 *info2; /* trust accounts */
844                 SAM_DISPINFO_3 *info3; /* domain groups/descriptions */
845                 SAM_DISPINFO_4 *info4; /* user list (ASCII) - used by Win95 */
846                 SAM_DISPINFO_5 *info5; /* group list (ASCII) */
847                 void       *info; /* allows assignment without typecasting, */
848
849         } sam;
850
851 } SAM_DISPINFO_CTR;
852
853
854 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
855 typedef struct q_samr_query_disp_info
856 {
857         POLICY_HND domain_pol;
858
859         uint16 switch_level;    /* see SAM_DISPINFO_CTR above */
860         /* align */
861
862         uint32 start_idx;       /* start enumeration index */
863         uint32 max_entries;     /* maximum number of entries to return */
864         uint32 max_size;        /* recommended data size; if exceeded server
865                                    should return STATUS_MORE_ENTRIES */
866
867 } SAMR_Q_QUERY_DISPINFO;
868
869
870 /* SAMR_R_QUERY_DISPINFO  */
871 typedef struct r_samr_query_dispinfo_info
872 {
873         uint32 total_size;     /* total data size for all matching entries
874                                   (0 = uncalculated) */
875         uint32 data_size;      /* actual data size returned = size of SAM_ENTRY
876                                   structures + total length of strings */
877
878         uint16 switch_level;   /* see SAM_DISPINFO_CTR above */
879         /* align */
880
881         uint32 num_entries;    /* number of entries returned */
882         uint32 ptr_entries;
883         uint32 num_entries2;
884
885         SAM_DISPINFO_CTR *ctr;
886
887         uint32 status;
888
889 } SAMR_R_QUERY_DISPINFO;
890
891
892 /* SAMR_Q_DELETE_DOM_GROUP - delete domain group */
893 typedef struct q_samr_delete_dom_group_info
894 {
895     POLICY_HND group_pol;          /* policy handle */
896
897 } SAMR_Q_DELETE_DOM_GROUP;
898
899
900 /* SAMR_R_DELETE_DOM_GROUP - delete domain group */
901 typedef struct r_samr_delete_dom_group_info
902 {
903         POLICY_HND pol;       /* policy handle */
904         uint32 status;        /* return status */
905
906 } SAMR_R_DELETE_DOM_GROUP;
907
908
909 /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */
910 typedef struct q_samr_create_dom_group_info
911 {
912         POLICY_HND pol;        /* policy handle */
913
914         UNIHDR hdr_acct_desc;
915         UNISTR2 uni_acct_desc;
916
917         uint16 unknown_1;    /* 0x0002 */
918         uint16 unknown_2;    /* 0x0001 */
919
920 } SAMR_Q_CREATE_DOM_GROUP;
921
922 /* SAMR_R_CREATE_DOM_GROUP - SAM create group */
923 typedef struct r_samr_create_dom_group_info
924 {
925         POLICY_HND pol;        /* policy handle */
926
927         uint32 rid;    
928         uint32 status;    
929
930 } SAMR_R_CREATE_DOM_GROUP;
931
932 /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */
933 typedef struct q_samr_query_group_info
934 {
935         POLICY_HND pol;        /* policy handle */
936
937         uint16 switch_level;    /* 0x0001 seen */
938
939 } SAMR_Q_QUERY_GROUPINFO;
940
941 typedef struct samr_group_info1
942 {
943         UNIHDR hdr_acct_name;
944
945         uint32 unknown_1; /* 0x0000 0003 - number of group members? */
946         uint32 unknown_2; /* 0x0000 0001 - number of group members? */
947
948         UNIHDR hdr_acct_desc;
949
950         UNISTR2 uni_acct_name;
951         UNISTR2 uni_acct_desc;
952
953 } GROUP_INFO1;
954
955 typedef struct samr_group_info4
956 {
957         UNIHDR hdr_acct_desc;
958         UNISTR2 uni_acct_desc;
959
960 } GROUP_INFO4;
961
962 /* GROUP_INFO_CTR */
963 typedef struct group_info_ctr
964 {
965         uint16 switch_value1;
966         uint16 switch_value2;
967
968         union
969         {
970                 GROUP_INFO4 info4;
971                 GROUP_INFO1 info1;
972
973         } group;
974
975 } GROUP_INFO_CTR;
976
977 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
978 typedef struct r_samr_query_groupinfo_info
979 {
980         uint32 ptr;        
981         GROUP_INFO_CTR *ctr;
982
983         uint32 status;
984
985 } SAMR_R_QUERY_GROUPINFO;
986
987
988 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
989 typedef struct q_samr_set_group_info
990 {
991         POLICY_HND pol;        /* policy handle */
992         GROUP_INFO_CTR *ctr;
993
994 } SAMR_Q_SET_GROUPINFO;
995
996 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
997 typedef struct r_samr_set_group_info
998 {
999         uint32 status;
1000
1001 } SAMR_R_SET_GROUPINFO;
1002
1003
1004 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
1005 typedef struct q_samr_delete_dom_alias_info
1006 {
1007     POLICY_HND alias_pol;          /* policy handle */
1008
1009 } SAMR_Q_DELETE_DOM_ALIAS;
1010
1011
1012 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
1013 typedef struct r_samr_delete_dom_alias_info
1014 {
1015         POLICY_HND pol;       /* policy handle */
1016         uint32 status;        /* return status */
1017
1018 } SAMR_R_DELETE_DOM_ALIAS;
1019
1020
1021 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
1022 typedef struct q_samr_create_dom_alias_info
1023 {
1024         POLICY_HND dom_pol;        /* policy handle */
1025
1026         UNIHDR hdr_acct_desc;
1027         UNISTR2 uni_acct_desc;
1028
1029         uint16 unknown_1;    /* 0x001f */
1030         uint16 unknown_2;    /* 0x000f */
1031
1032 } SAMR_Q_CREATE_DOM_ALIAS;
1033
1034 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
1035 typedef struct r_samr_create_dom_alias_info
1036 {
1037         POLICY_HND alias_pol;        /* policy handle */
1038
1039         uint32 rid;    
1040         uint32 status;    
1041
1042 } SAMR_R_CREATE_DOM_ALIAS;
1043
1044 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
1045 typedef struct q_samr_query_alias_info
1046 {
1047         POLICY_HND pol;        /* policy handle */
1048
1049         uint16 switch_level;    /* 0x0003 seen */
1050
1051 } SAMR_Q_QUERY_ALIASINFO;
1052
1053 typedef struct samr_alias_info3
1054 {
1055         UNIHDR hdr_acct_desc;
1056         UNISTR2 uni_acct_desc;
1057
1058 } ALIAS_INFO3;
1059
1060 /* ALIAS_INFO_CTR */
1061 typedef struct alias_info_ctr
1062 {
1063         uint16 switch_value1;
1064         uint16 switch_value2;
1065
1066         union
1067         {
1068                 ALIAS_INFO3 info3;
1069
1070         } alias;
1071
1072 } ALIAS_INFO_CTR;
1073
1074 /* SAMR_R_QUERY_ALIASINFO - SAM alias info */
1075 typedef struct r_samr_query_aliasinfo_info
1076 {
1077         uint32 ptr;        
1078         ALIAS_INFO_CTR *ctr;
1079
1080         uint32 status;
1081
1082 } SAMR_R_QUERY_ALIASINFO;
1083
1084
1085 /* SAMR_Q_SET_ALIASINFO - SAM Alias Info */
1086 typedef struct q_samr_set_alias_info
1087 {
1088         POLICY_HND alias_pol;        /* policy handle */
1089         ALIAS_INFO_CTR *ctr;
1090
1091 } SAMR_Q_SET_ALIASINFO;
1092
1093 /* SAMR_R_SET_ALIASINFO - SAM alias info */
1094 typedef struct r_samr_set_aliasinfo_info
1095 {
1096         uint32 status;
1097
1098 } SAMR_R_SET_ALIASINFO;
1099
1100
1101 /* SAMR_Q_QUERY_USERGROUPS - */
1102 typedef struct q_samr_query_usergroup_info
1103 {
1104         POLICY_HND pol;          /* policy handle associated with unknown id */
1105
1106 } SAMR_Q_QUERY_USERGROUPS;
1107
1108 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
1109 typedef struct r_samr_query_usergroup_info
1110 {
1111         uint32 ptr_0;            /* pointer */
1112         uint32 num_entries;      /* number of RID groups */
1113         uint32 ptr_1;            /* pointer */
1114         uint32 num_entries2;     /* number of RID groups */
1115
1116         DOM_GID *gid; /* group info */
1117
1118         uint32 status;         /* return status */
1119
1120 } SAMR_R_QUERY_USERGROUPS;
1121
1122
1123 /* SAMR_Q_SET_USERINFO - set sam info */
1124 typedef struct q_samr_set_user_info
1125 {
1126         POLICY_HND pol;          /* policy handle associated with user */
1127         uint16 switch_value;      /* 0x0017 */
1128         uint16 switch_value2;      /* 0x0017 */
1129
1130         union
1131         {
1132                 SAM_USER_INFO_23 *id23; /* auth-level 0x17 */
1133                 SAM_USER_INFO_24 *id24; /* auth-level 0x18 */
1134                 void* id; /* to make typecasting easy */
1135
1136         } info;
1137
1138 } SAMR_Q_SET_USERINFO;
1139
1140 /* SAMR_R_SET_USERINFO - set sam info */
1141 typedef struct r_samr_set_user_info
1142 {
1143         uint32 status;         /* return status */
1144
1145 } SAMR_R_SET_USERINFO;
1146
1147
1148 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
1149 typedef struct q_samr_query_user_info
1150 {
1151         POLICY_HND pol;          /* policy handle associated with unknown id */
1152         uint16 switch_value;         /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
1153
1154 } SAMR_Q_QUERY_USERINFO;
1155
1156 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
1157 typedef struct r_samr_query_user_info
1158 {
1159         uint32 ptr;            /* pointer */
1160         uint16 switch_value;      /* 0x0015, 0x0011 or 0x0010 - same as in query */
1161         /* uint8[2] padding. */
1162
1163         union
1164         {
1165                 SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
1166                 SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
1167                 SAM_USER_INFO_21 *id21; /* auth-level 21 */
1168                 void* id; /* to make typecasting easy */
1169
1170         } info;
1171
1172         uint32 status;         /* return status */
1173
1174 } SAMR_R_QUERY_USERINFO;
1175
1176
1177 /****************************************************************************
1178 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
1179
1180 the policy handle allocated by an "samr open secret" call is associated
1181 with a SID.  this policy handle is what is queried here, *not* the SID
1182 itself.  the response to the lookup rids is relative to this SID.
1183 *****************************************************************************/
1184 /* SAMR_Q_QUERY_USERALIASES */
1185 typedef struct q_samr_query_useraliases_info
1186 {
1187         POLICY_HND pol;       /* policy handle */
1188
1189         uint32 num_sids1;      /* number of rids being looked up */
1190         uint32 ptr;            /* buffer pointer */
1191         uint32 num_sids2;      /* number of rids being looked up */
1192
1193         uint32   ptr_sid[MAX_LOOKUP_SIDS]; /* pointers to sids to be looked up */
1194         DOM_SID2 sid    [MAX_LOOKUP_SIDS]; /* sids to be looked up. */
1195
1196 } SAMR_Q_QUERY_USERALIASES;
1197
1198
1199 /* SAMR_R_QUERY_USERALIASES */
1200 typedef struct r_samr_query_useraliases_info
1201 {
1202         uint32 num_entries;
1203         uint32 ptr; /* undocumented buffer pointer */
1204
1205         uint32 num_entries2; 
1206         uint32 *rid; /* domain RIDs being looked up */
1207
1208         uint32 status; /* return code */
1209
1210 } SAMR_R_QUERY_USERALIASES;
1211
1212
1213 /****************************************************************************
1214 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
1215 *****************************************************************************/
1216 /* SAMR_Q_LOOKUP_NAMES */
1217 typedef struct q_samr_lookup_names_info
1218 {
1219     POLICY_HND pol;       /* policy handle */
1220
1221         uint32 num_names1;      /* number of names being looked up */
1222         uint32 flags;           /* 0x0000 03e8 - unknown */
1223         uint32 ptr;            /* 0x0000 0000 - 32 bit unknown */
1224         uint32 num_names2;      /* number of names being looked up */
1225
1226         UNIHDR  hdr_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
1227         UNISTR2 uni_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
1228
1229 } SAMR_Q_LOOKUP_NAMES;
1230
1231
1232 /* SAMR_R_LOOKUP_NAMES */
1233 typedef struct r_samr_lookup_names_info
1234 {
1235         uint32 num_rids1;      /* number of aliases being looked up */
1236         uint32 ptr_rids;       /* pointer to aliases */
1237         uint32 num_rids2;      /* number of aliases being looked up */
1238
1239         uint32 rid[MAX_LOOKUP_SIDS]; /* rids */
1240
1241         uint32 num_types1;      /* number of users in aliases being looked up */
1242         uint32 ptr_types;       /* pointer to users in aliases */
1243         uint32 num_types2;      /* number of users in aliases being looked up */
1244
1245         uint32 type[MAX_LOOKUP_SIDS]; /* SID_ENUM type */
1246
1247         uint32 status; /* return code */
1248
1249 } SAMR_R_LOOKUP_NAMES;
1250
1251
1252 /****************************************************************************
1253 SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something.
1254
1255 called to resolve domain RID groups.
1256 *****************************************************************************/
1257 /* SAMR_Q_LOOKUP_RIDS */
1258 typedef struct q_samr_lookup_rids_info
1259 {
1260         POLICY_HND pol;       /* policy handle */
1261
1262         uint32 num_rids1;      /* number of rids being looked up */
1263         uint32 flags;          /* 0x0000 03e8 - unknown */
1264         uint32 ptr;            /* 0x0000 0000 - 32 bit unknown */
1265         uint32 num_rids2;      /* number of rids being looked up */
1266
1267         uint32 rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
1268
1269 } SAMR_Q_LOOKUP_RIDS;
1270
1271
1272 /****************************************************************************
1273 SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names
1274
1275 *****************************************************************************/
1276 /* SAMR_R_LOOKUP_RIDS */
1277 typedef struct r_samr_lookup_rids_info
1278 {
1279         uint32 num_names1;      /* number of aliases being looked up */
1280         uint32 ptr_names;       /* pointer to aliases */
1281         uint32 num_names2;      /* number of aliases being looked up */
1282
1283         UNIHDR  hdr_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
1284         UNISTR2 uni_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
1285
1286         uint32 num_types1;      /* number of users in aliases being looked up */
1287         uint32 ptr_types;       /* pointer to users in aliases */
1288         uint32 num_types2;      /* number of users in aliases being looked up */
1289
1290         uint32 type[MAX_LOOKUP_SIDS]; /* SID_ENUM type */
1291
1292         uint32 status;
1293
1294 } SAMR_R_LOOKUP_RIDS;
1295
1296
1297 /* SAMR_Q_OPEN_USER - probably an open */
1298 typedef struct q_samr_open_user_info
1299 {
1300         POLICY_HND domain_pol;       /* policy handle */
1301         uint32 unknown_0;     /* 32 bit unknown - 0x02011b */
1302         uint32 user_rid;      /* user RID */
1303
1304 } SAMR_Q_OPEN_USER;
1305
1306
1307 /* SAMR_R_OPEN_USER - probably an open */
1308 typedef struct r_samr_open_user_info
1309 {
1310         POLICY_HND user_pol;       /* policy handle associated with unknown id */
1311         uint32 status;         /* return status */
1312
1313 } SAMR_R_OPEN_USER;
1314
1315
1316 /* SAMR_Q_CREATE_USER - probably a create */
1317 typedef struct q_samr_create_user_info
1318 {
1319         POLICY_HND domain_pol;       /* policy handle */
1320
1321         UNIHDR  hdr_name;       /* unicode account name header */
1322         UNISTR2 uni_name;       /* unicode account name */
1323
1324         uint16 acb_info;      /* account control info */
1325         uint32 unknown_1;     /* 0xe005 00b0 */
1326
1327 } SAMR_Q_CREATE_USER;
1328
1329
1330 /* SAMR_R_CREATE_USER - probably a create */
1331 typedef struct r_samr_create_user_info
1332 {
1333         POLICY_HND user_pol;       /* policy handle associated with user */
1334
1335         uint32 unknown_0;     /* 0x0007 03ff */
1336         uint32 user_rid;      /* user RID */
1337         uint32 status;         /* return status */
1338
1339 } SAMR_R_CREATE_USER;
1340
1341
1342
1343 /* SAMR_Q_QUERY_GROUPMEM - query group members */
1344 typedef struct q_samr_query_groupmem_info
1345 {
1346         POLICY_HND group_pol;        /* policy handle */
1347
1348 } SAMR_Q_QUERY_GROUPMEM;
1349
1350
1351 /* SAMR_R_QUERY_GROUPMEM - query group members */
1352 typedef struct r_samr_query_groupmem_info
1353 {
1354         uint32 ptr;
1355         uint32 num_entries;
1356
1357         uint32 ptr_rids;
1358         uint32 ptr_attrs;
1359
1360         uint32 num_rids;
1361         uint32 *rid;
1362
1363         uint32 num_attrs;
1364         uint32 *attr;
1365
1366         uint32 status;
1367
1368 } SAMR_R_QUERY_GROUPMEM;
1369
1370
1371 /* SAMR_Q_DEL_GROUPMEM - probably an del group member */
1372 typedef struct q_samr_del_group_mem_info
1373 {
1374         POLICY_HND pol;       /* policy handle */
1375
1376         uint32 rid;         /* rid */
1377
1378 } SAMR_Q_DEL_GROUPMEM;
1379
1380
1381 /* SAMR_R_DEL_GROUPMEM - probably an del group member */
1382 typedef struct r_samr_del_group_mem_info
1383 {
1384         uint32 status;         /* return status */
1385
1386 } SAMR_R_DEL_GROUPMEM;
1387
1388
1389 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
1390 typedef struct q_samr_add_group_mem_info
1391 {
1392         POLICY_HND pol;       /* policy handle */
1393
1394         uint32 rid;         /* rid */
1395         uint32 unknown;     /* 0x0000 0005 */
1396
1397 } SAMR_Q_ADD_GROUPMEM;
1398
1399
1400 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
1401 typedef struct r_samr_add_group_mem_info
1402 {
1403         uint32 status;         /* return status */
1404
1405 } SAMR_R_ADD_GROUPMEM;
1406
1407
1408 /* SAMR_Q_OPEN_GROUP - probably an open */
1409 typedef struct q_samr_open_group_info
1410 {
1411         POLICY_HND domain_pol;       /* policy handle */
1412         uint32 unknown;         /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
1413         uint32 rid_group;        /* rid */
1414
1415 } SAMR_Q_OPEN_GROUP;
1416
1417
1418 /* SAMR_R_OPEN_GROUP - probably an open */
1419 typedef struct r_samr_open_group_info
1420 {
1421         POLICY_HND pol;       /* policy handle */
1422         uint32 status;         /* return status */
1423
1424 } SAMR_R_OPEN_GROUP;
1425
1426
1427 /* SAMR_Q_QUERY_ALIASMEM - query alias members */
1428 typedef struct q_samr_query_aliasmem_info
1429 {
1430         POLICY_HND alias_pol;        /* policy handle */
1431
1432 } SAMR_Q_QUERY_ALIASMEM;
1433
1434
1435 /* SAMR_R_QUERY_ALIASMEM - query alias members */
1436 typedef struct r_samr_query_aliasmem_info
1437 {
1438         uint32 num_sids;
1439         uint32 ptr;
1440         uint32 num_sids1;
1441
1442         DOM_SID2 *sid;
1443
1444         uint32 status;
1445
1446 } SAMR_R_QUERY_ALIASMEM;
1447
1448
1449 /* SAMR_Q_ADD_ALIASMEM - add alias member */
1450 typedef struct q_samr_add_alias_mem_info
1451 {
1452         POLICY_HND alias_pol;       /* policy handle */
1453
1454         DOM_SID2 sid; /* member sid to be added to the alias */
1455
1456 } SAMR_Q_ADD_ALIASMEM;
1457
1458
1459 /* SAMR_R_ADD_ALIASMEM - add alias member */
1460 typedef struct r_samr_add_alias_mem_info
1461 {
1462         uint32 status;         /* return status */
1463
1464 } SAMR_R_ADD_ALIASMEM;
1465
1466
1467 /* SAMR_Q_DEL_ALIASMEM - add an add alias member */
1468 typedef struct q_samr_del_alias_mem_info
1469 {
1470         POLICY_HND alias_pol;       /* policy handle */
1471
1472         DOM_SID2 sid; /* member sid to be added to alias */
1473
1474 } SAMR_Q_DEL_ALIASMEM;
1475
1476
1477 /* SAMR_R_DEL_ALIASMEM - delete alias member */
1478 typedef struct r_samr_del_alias_mem_info
1479 {
1480         uint32 status;         /* return status */
1481
1482 } SAMR_R_DEL_ALIASMEM;
1483
1484
1485
1486 /* SAMR_Q_OPEN_ALIAS - probably an open */
1487 typedef struct q_samr_open_alias_info
1488 {
1489         POLICY_HND dom_pol;
1490
1491         uint32 unknown_0;         /* 0x0000 0008 */
1492         uint32 rid_alias;        /* rid */
1493
1494 } SAMR_Q_OPEN_ALIAS;
1495
1496
1497 /* SAMR_R_OPEN_ALIAS - probably an open */
1498 typedef struct r_samr_open_alias_info
1499 {
1500         POLICY_HND pol;       /* policy handle */
1501         uint32 status;         /* return status */
1502
1503 } SAMR_R_OPEN_ALIAS;
1504
1505
1506 /* SAMR_Q_CONNECT_ANON - probably an open */
1507 typedef struct q_samr_connect_anon_info
1508 {
1509         uint32 ptr;                  /* ptr? */
1510         uint16 unknown_0;            /* 0x005c */
1511         uint16 unknown_1;            /* 0x0001 */
1512         uint32 unknown_2;            /* 0x0000 0020 */
1513
1514 } SAMR_Q_CONNECT_ANON;
1515
1516 /* SAMR_R_CONNECT_ANON - probably an open */
1517 typedef struct r_samr_connect_anon_info
1518 {
1519         POLICY_HND connect_pol;       /* policy handle */
1520         uint32 status;         /* return status */
1521
1522 } SAMR_R_CONNECT_ANON;
1523
1524 /* SAMR_Q_CONNECT - probably an open */
1525 typedef struct q_samr_connect_info
1526 {
1527         uint32 ptr_srv_name;         /* pointer (to server name?) */
1528         UNISTR2 uni_srv_name;        /* unicode server name starting with '\\' */
1529
1530         uint32 unknown_0;            /* 32 bit unknown */
1531
1532 } SAMR_Q_CONNECT;
1533
1534
1535 /* SAMR_R_CONNECT - probably an open */
1536 typedef struct r_samr_connect_info
1537 {
1538     POLICY_HND connect_pol;       /* policy handle */
1539         uint32 status;         /* return status */
1540
1541 } SAMR_R_CONNECT;
1542
1543 /* SAMR_Q_UNKNOWN_38 */
1544 typedef struct q_samr_unknown_38
1545 {
1546         uint32 ptr; 
1547         UNIHDR  hdr_srv_name;
1548         UNISTR2 uni_srv_name;
1549
1550 } SAMR_Q_UNKNOWN_38;
1551
1552 /* SAMR_R_UNKNOWN_38 */
1553 typedef struct r_samr_unknown_38
1554 {
1555         uint16 unk_0;
1556         uint16 unk_1;
1557         uint16 unk_2;
1558         uint16 unk_3;
1559
1560 } SAMR_R_UNKNOWN_38;
1561
1562 /* SAMR_ENC_PASSWD */
1563 typedef struct enc_passwd_info
1564 {
1565         uint32 ptr;
1566         uint8 pass[516];
1567
1568 } SAMR_ENC_PASSWD;
1569
1570 /* SAMR_ENC_HASH */
1571 typedef struct enc_hash_info
1572 {
1573         uint32 ptr;
1574         uint8 hash[16];
1575
1576 } SAMR_ENC_HASH;
1577
1578 /* SAMR_Q_CHGPASSWD_USER */
1579 typedef struct q_samr_chgpasswd_user_info
1580 {
1581         uint32 ptr_0;
1582
1583         UNIHDR hdr_dest_host; /* server name unicode header */
1584         UNISTR2 uni_dest_host; /* server name unicode string */
1585
1586         UNIHDR hdr_user_name;    /* username unicode string header */
1587         UNISTR2 uni_user_name;    /* username unicode string */
1588
1589         SAMR_ENC_PASSWD nt_newpass;
1590         SAMR_ENC_HASH nt_oldhash;
1591
1592         uint32 unknown; /* 0x0000 0001 */
1593
1594         SAMR_ENC_PASSWD lm_newpass;
1595         SAMR_ENC_HASH lm_oldhash;
1596
1597 } SAMR_Q_CHGPASSWD_USER;
1598
1599 /* SAMR_R_CHGPASSWD_USER */
1600 typedef struct r_samr_chgpasswd_user_info
1601 {
1602         uint32 status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1603
1604 } SAMR_R_CHGPASSWD_USER;
1605
1606 #endif /* _RPC_SAMR_H */
1607