9a62bd4b97efcd6de6736412bcb16b85ea282199
[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_6_info
451 {
452         uint32 unknown_0; /* 0x0000 0000 */
453
454         uint32 ptr_0;     /* pointer to unknown structure */
455         uint8  padding[12]; /* 12 bytes zeros */
456
457 } SAM_UNK_INFO_6;
458
459 typedef struct sam_unknown_info_7_info
460 {
461         uint16 unknown_0; /* 0x0003 */
462
463 } SAM_UNK_INFO_7;
464
465 typedef struct sam_unknown_info_2_inf
466 {
467         uint32 unknown_0; /* 0x0000 0000 */
468         uint32 unknown_1; /* 0x8000 0000 */
469         uint32 unknown_2; /* 0x0000 0000 */
470
471         uint32 ptr_0;     /* pointer to unknown structure */
472         UNIHDR hdr_domain; /* domain name unicode header */
473         UNIHDR hdr_server; /* server name unicode header */
474
475         /* put all the data in here, at the moment, including what the above
476            pointer is referring to
477          */
478
479         uint32 seq_num; /* some sort of incrementing sequence number? */
480         uint32 unknown_3; /* 0x0000 0000 */
481         
482         uint32 unknown_4; /* 0x0000 0001 */
483         uint32 unknown_5; /* 0x0000 0003 */
484         uint32 unknown_6; /* 0x0000 0001 */
485         uint32 num_domain_usrs; /* number of users in domain */
486         uint32 num_domain_grps; /* number of domain groups in domain */
487         uint32 num_local_grps; /* number of local groups in domain */
488
489         uint8 padding[12]; /* 12 bytes zeros */
490
491         UNISTR2 uni_domain; /* domain name unicode string */
492         UNISTR2 uni_server; /* server name unicode string */
493
494 } SAM_UNK_INFO_2;
495
496 typedef struct sam_unknown_info_1_inf
497 {
498         uint8 padding[12]; /* 12 bytes zeros */
499         uint32 unknown_1; /* 0x8000 0000 */
500         uint32 unknown_2; /* 0x0000 0000 */
501         uint32 unknown_3; /* 0x0000 0000 */
502
503 } SAM_UNK_INFO_1;
504
505
506 typedef struct sam_unknown_ctr_info
507 {
508         union
509         {
510                 SAM_UNK_INFO_1 inf1;
511                 SAM_UNK_INFO_2 inf2;
512                 SAM_UNK_INFO_6 inf6;
513                 SAM_UNK_INFO_7 inf7;
514
515         } info;
516
517 } SAM_UNK_CTR;
518
519
520 /* SAMR_R_QUERY_DOMAIN_INFO - */
521 typedef struct r_samr_query_domain_info
522 {
523         uint32 ptr_0;
524         uint16 switch_value; /* same as in query */
525
526         SAM_UNK_CTR *ctr;
527
528         uint32 status;         /* return status */
529
530 } SAMR_R_QUERY_DOMAIN_INFO;
531
532
533 /* SAMR_Q_LOOKUP_DOMAIN - obtain SID for a local domain */
534 typedef struct q_samr_lookup_domain_info
535 {
536         POLICY_HND connect_pol;
537
538         UNIHDR  hdr_domain;
539         UNISTR2 uni_domain;
540
541 } SAMR_Q_LOOKUP_DOMAIN;
542
543
544 /* SAMR_R_LOOKUP_DOMAIN */
545 typedef struct r_samr_lookup_domain_info
546 {
547         uint32   ptr_sid;
548         DOM_SID2 dom_sid;
549
550         uint32 status;
551
552 } SAMR_R_LOOKUP_DOMAIN;
553
554
555 /****************************************************************************
556 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
557
558 0x0000 03f1 and a specific   domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
559 0x0000 0200 and a specific   domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
560 *****************************************************************************/
561
562 /* SAMR_Q_OPEN_DOMAIN */
563 typedef struct q_samr_open_domain_info
564 {
565         POLICY_HND connect_pol;   /* policy handle */
566         uint32 flags;               /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */
567         DOM_SID2 dom_sid;         /* domain SID */
568
569 } SAMR_Q_OPEN_DOMAIN;
570
571
572 /* SAMR_R_OPEN_DOMAIN - probably an open */
573 typedef struct r_samr_open_domain_info
574 {
575         POLICY_HND domain_pol; /* policy handle associated with the SID */
576         uint32 status;         /* return status */
577
578 } SAMR_R_OPEN_DOMAIN;
579
580
581 #define MAX_SAM_ENTRIES 250
582
583 typedef struct samr_entry_info
584 {
585         uint32 rid;
586         UNIHDR hdr_name;
587
588 } SAM_ENTRY;
589
590
591 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
592 typedef struct q_samr_enum_dom_users_info
593 {
594         POLICY_HND pol;          /* policy handle */
595
596         uint32 start_idx;   /* number of values (0 indicates unlimited?) */
597         uint16 acb_mask;          /* 0x0000 indicates all */
598         uint16 unknown_1;         /* 0x0000 */
599
600         uint32 max_size;              /* 0x0000 ffff */
601
602 } SAMR_Q_ENUM_DOM_USERS;
603
604
605 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
606 typedef struct r_samr_enum_dom_users_info
607 {
608         uint32 next_idx;     /* next starting index required for enum */
609         uint32 ptr_entries1;  
610
611         uint32 num_entries2;
612         uint32 ptr_entries2;
613
614         uint32 num_entries3;
615
616         SAM_ENTRY *sam;
617         UNISTR2 *uni_acct_name;
618
619         uint32 num_entries4;
620
621         uint32 status;
622
623 } SAMR_R_ENUM_DOM_USERS;
624
625
626 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
627 typedef struct q_samr_enum_dom_groups_info
628 {
629         POLICY_HND pol;          /* policy handle */
630
631         /* this is possibly an enumeration context handle... */
632         uint32 unknown_0;         /* 0x0000 0000 */
633
634         uint32 max_size;              /* 0x0000 ffff */
635
636 } SAMR_Q_ENUM_DOM_GROUPS;
637
638
639 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
640 typedef struct r_samr_enum_dom_groups_info
641 {
642         uint32 num_entries;
643         uint32 ptr_entries;
644
645         uint32 num_entries2;
646         uint32 ptr_entries2;
647
648         uint32 num_entries3;
649
650         SAM_ENTRY sam[MAX_SAM_ENTRIES];
651         UNISTR2 uni_grp_name[MAX_SAM_ENTRIES];
652
653         uint32 num_entries4;
654
655         uint32 status;
656
657 } SAMR_R_ENUM_DOM_GROUPS;
658
659
660 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
661 typedef struct q_samr_enum_dom_aliases_info
662 {
663         POLICY_HND pol;          /* policy handle */
664
665         /* this is possibly an enumeration context handle... */
666         uint32 unknown_0;         /* 0x0000 0000 */
667
668         uint32 max_size;              /* 0x0000 ffff */
669
670 } SAMR_Q_ENUM_DOM_ALIASES;
671
672
673 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
674 typedef struct r_samr_enum_dom_aliases_info
675 {
676         uint32 num_entries;
677         uint32 ptr_entries;
678
679         uint32 num_entries2;
680         uint32 ptr_entries2;
681
682         uint32 num_entries3;
683
684         SAM_ENTRY sam[MAX_SAM_ENTRIES];
685         UNISTR2 uni_grp_name[MAX_SAM_ENTRIES];
686
687         uint32 num_entries4;
688
689         uint32 status;
690
691 } SAMR_R_ENUM_DOM_ALIASES;
692
693
694 /* -- Level 1 Display Info - User Information -- */
695
696 typedef struct samr_entry_info1
697 {
698         uint32 user_idx;
699
700         uint32 rid_user;
701         uint16 acb_info;
702         uint16 pad;
703
704         UNIHDR hdr_acct_name;
705         UNIHDR hdr_user_name;
706         UNIHDR hdr_user_desc;
707
708 } SAM_ENTRY1;
709
710 typedef struct samr_str_entry_info1
711 {
712         UNISTR2 uni_acct_name;
713         UNISTR2 uni_full_name;
714         UNISTR2 uni_acct_desc;
715
716 } SAM_STR1;
717
718 typedef struct sam_entry_info_1
719 {
720         SAM_ENTRY1 sam[MAX_SAM_ENTRIES];
721         SAM_STR1   str[MAX_SAM_ENTRIES];
722
723 } SAM_DISPINFO_1;
724
725
726 /* -- Level 2 Display Info - Trust Account Information -- */
727
728 typedef struct samr_entry_info2
729 {
730         uint32 user_idx;
731
732         uint32 rid_user;
733         uint16 acb_info;
734         uint16 pad;
735
736         UNIHDR hdr_srv_name;
737         UNIHDR hdr_srv_desc;
738
739 } SAM_ENTRY2;
740
741 typedef struct samr_str_entry_info2
742 {
743         UNISTR2 uni_srv_name;
744         UNISTR2 uni_srv_desc;
745
746 } SAM_STR2;
747
748 typedef struct sam_entry_info_2
749 {
750         SAM_ENTRY2 sam[MAX_SAM_ENTRIES];
751         SAM_STR2   str[MAX_SAM_ENTRIES];
752
753 } SAM_DISPINFO_2;
754
755
756 /* -- Level 3 Display Info - Domain Group Information -- */
757
758 typedef struct samr_entry_info3
759 {
760         uint32 grp_idx;
761
762         uint32 rid_grp;
763         uint32 attr;     /* SE_GROUP_xxx, usually 7 */
764
765         UNIHDR hdr_grp_name;
766         UNIHDR hdr_grp_desc;
767
768 } SAM_ENTRY3;
769
770 typedef struct samr_str_entry_info3
771 {
772         UNISTR2 uni_grp_name;
773         UNISTR2 uni_grp_desc;
774
775 } SAM_STR3;
776
777 typedef struct sam_entry_info_3
778 {
779         SAM_ENTRY3 sam[MAX_SAM_ENTRIES];
780         SAM_STR3   str[MAX_SAM_ENTRIES];
781
782 } SAM_DISPINFO_3;
783
784
785 /* -- Level 4 Display Info - User List (ASCII) -- */
786
787 typedef struct samr_entry_info4
788 {
789         uint32 user_idx;
790         STRHDR hdr_acct_name;
791
792 } SAM_ENTRY4;
793
794 typedef struct samr_str_entry_info4
795 {
796         STRING2 acct_name;
797
798 } SAM_STR4;
799
800 typedef struct sam_entry_info_4
801 {
802         SAM_ENTRY4 sam[MAX_SAM_ENTRIES];
803         SAM_STR4   str[MAX_SAM_ENTRIES];
804
805 } SAM_DISPINFO_4;
806
807
808 /* -- Level 5 Display Info - Group List (ASCII) -- */
809
810 typedef struct samr_entry_info5
811 {
812         uint32 grp_idx;
813         STRHDR hdr_grp_name;
814
815 } SAM_ENTRY5;
816
817 typedef struct samr_str_entry_info5
818 {
819         STRING2 grp_name;
820
821 } SAM_STR5;
822
823 typedef struct sam_entry_info_5
824 {
825         SAM_ENTRY5 sam[MAX_SAM_ENTRIES];
826         SAM_STR5   str[MAX_SAM_ENTRIES];
827
828 } SAM_DISPINFO_5;
829
830
831 typedef struct sam_dispinfo_ctr_info
832 {
833         union
834         {
835                 SAM_DISPINFO_1 *info1; /* users/names/descriptions */
836                 SAM_DISPINFO_2 *info2; /* trust accounts */
837                 SAM_DISPINFO_3 *info3; /* domain groups/descriptions */
838                 SAM_DISPINFO_4 *info4; /* user list (ASCII) - used by Win95 */
839                 SAM_DISPINFO_5 *info5; /* group list (ASCII) */
840                 void       *info; /* allows assignment without typecasting, */
841
842         } sam;
843
844 } SAM_DISPINFO_CTR;
845
846
847 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
848 typedef struct q_samr_query_disp_info
849 {
850         POLICY_HND domain_pol;
851
852         uint16 switch_level;    /* see SAM_DISPINFO_CTR above */
853         /* align */
854
855         uint32 start_idx;       /* start enumeration index */
856         uint32 max_entries;     /* maximum number of entries to return */
857         uint32 max_size;        /* recommended data size; if exceeded server
858                                    should return STATUS_MORE_ENTRIES */
859
860 } SAMR_Q_QUERY_DISPINFO;
861
862
863 /* SAMR_R_QUERY_DISPINFO  */
864 typedef struct r_samr_query_dispinfo_info
865 {
866         uint32 total_size;     /* total data size for all matching entries
867                                   (0 = uncalculated) */
868         uint32 data_size;      /* actual data size returned = size of SAM_ENTRY
869                                   structures + total length of strings */
870
871         uint16 switch_level;   /* see SAM_DISPINFO_CTR above */
872         /* align */
873
874         uint32 num_entries;    /* number of entries returned */
875         uint32 ptr_entries;
876         uint32 num_entries2;
877
878         SAM_DISPINFO_CTR *ctr;
879
880         uint32 status;
881
882 } SAMR_R_QUERY_DISPINFO;
883
884
885 /* SAMR_Q_DELETE_DOM_GROUP - delete domain group */
886 typedef struct q_samr_delete_dom_group_info
887 {
888     POLICY_HND group_pol;          /* policy handle */
889
890 } SAMR_Q_DELETE_DOM_GROUP;
891
892
893 /* SAMR_R_DELETE_DOM_GROUP - delete domain group */
894 typedef struct r_samr_delete_dom_group_info
895 {
896         POLICY_HND pol;       /* policy handle */
897         uint32 status;        /* return status */
898
899 } SAMR_R_DELETE_DOM_GROUP;
900
901
902 /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */
903 typedef struct q_samr_create_dom_group_info
904 {
905         POLICY_HND pol;        /* policy handle */
906
907         UNIHDR hdr_acct_desc;
908         UNISTR2 uni_acct_desc;
909
910         uint16 unknown_1;    /* 0x0002 */
911         uint16 unknown_2;    /* 0x0001 */
912
913 } SAMR_Q_CREATE_DOM_GROUP;
914
915 /* SAMR_R_CREATE_DOM_GROUP - SAM create group */
916 typedef struct r_samr_create_dom_group_info
917 {
918         POLICY_HND pol;        /* policy handle */
919
920         uint32 rid;    
921         uint32 status;    
922
923 } SAMR_R_CREATE_DOM_GROUP;
924
925 /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */
926 typedef struct q_samr_query_group_info
927 {
928         POLICY_HND pol;        /* policy handle */
929
930         uint16 switch_level;    /* 0x0001 seen */
931
932 } SAMR_Q_QUERY_GROUPINFO;
933
934 typedef struct samr_group_info1
935 {
936         UNIHDR hdr_acct_name;
937
938         uint32 unknown_1; /* 0x0000 0003 - number of group members? */
939         uint32 unknown_2; /* 0x0000 0001 - number of group members? */
940
941         UNIHDR hdr_acct_desc;
942
943         UNISTR2 uni_acct_name;
944         UNISTR2 uni_acct_desc;
945
946 } GROUP_INFO1;
947
948 typedef struct samr_group_info4
949 {
950         UNIHDR hdr_acct_desc;
951         UNISTR2 uni_acct_desc;
952
953 } GROUP_INFO4;
954
955 /* GROUP_INFO_CTR */
956 typedef struct group_info_ctr
957 {
958         uint16 switch_value1;
959         uint16 switch_value2;
960
961         union
962         {
963                 GROUP_INFO4 info4;
964                 GROUP_INFO1 info1;
965
966         } group;
967
968 } GROUP_INFO_CTR;
969
970 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
971 typedef struct r_samr_query_groupinfo_info
972 {
973         uint32 ptr;        
974         GROUP_INFO_CTR *ctr;
975
976         uint32 status;
977
978 } SAMR_R_QUERY_GROUPINFO;
979
980
981 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
982 typedef struct q_samr_set_group_info
983 {
984         POLICY_HND pol;        /* policy handle */
985         GROUP_INFO_CTR *ctr;
986
987 } SAMR_Q_SET_GROUPINFO;
988
989 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
990 typedef struct r_samr_set_group_info
991 {
992         uint32 status;
993
994 } SAMR_R_SET_GROUPINFO;
995
996
997 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
998 typedef struct q_samr_delete_dom_alias_info
999 {
1000     POLICY_HND alias_pol;          /* policy handle */
1001
1002 } SAMR_Q_DELETE_DOM_ALIAS;
1003
1004
1005 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
1006 typedef struct r_samr_delete_dom_alias_info
1007 {
1008         POLICY_HND pol;       /* policy handle */
1009         uint32 status;        /* return status */
1010
1011 } SAMR_R_DELETE_DOM_ALIAS;
1012
1013
1014 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
1015 typedef struct q_samr_create_dom_alias_info
1016 {
1017         POLICY_HND dom_pol;        /* policy handle */
1018
1019         UNIHDR hdr_acct_desc;
1020         UNISTR2 uni_acct_desc;
1021
1022         uint16 unknown_1;    /* 0x001f */
1023         uint16 unknown_2;    /* 0x000f */
1024
1025 } SAMR_Q_CREATE_DOM_ALIAS;
1026
1027 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
1028 typedef struct r_samr_create_dom_alias_info
1029 {
1030         POLICY_HND alias_pol;        /* policy handle */
1031
1032         uint32 rid;    
1033         uint32 status;    
1034
1035 } SAMR_R_CREATE_DOM_ALIAS;
1036
1037 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
1038 typedef struct q_samr_query_alias_info
1039 {
1040         POLICY_HND pol;        /* policy handle */
1041
1042         uint16 switch_level;    /* 0x0003 seen */
1043
1044 } SAMR_Q_QUERY_ALIASINFO;
1045
1046 typedef struct samr_alias_info3
1047 {
1048         UNIHDR hdr_acct_desc;
1049         UNISTR2 uni_acct_desc;
1050
1051 } ALIAS_INFO3;
1052
1053 /* ALIAS_INFO_CTR */
1054 typedef struct alias_info_ctr
1055 {
1056         uint16 switch_value1;
1057         uint16 switch_value2;
1058
1059         union
1060         {
1061                 ALIAS_INFO3 info3;
1062
1063         } alias;
1064
1065 } ALIAS_INFO_CTR;
1066
1067 /* SAMR_R_QUERY_ALIASINFO - SAM alias info */
1068 typedef struct r_samr_query_aliasinfo_info
1069 {
1070         uint32 ptr;        
1071         ALIAS_INFO_CTR *ctr;
1072
1073         uint32 status;
1074
1075 } SAMR_R_QUERY_ALIASINFO;
1076
1077
1078 /* SAMR_Q_SET_ALIASINFO - SAM Alias Info */
1079 typedef struct q_samr_set_alias_info
1080 {
1081         POLICY_HND alias_pol;        /* policy handle */
1082         ALIAS_INFO_CTR *ctr;
1083
1084 } SAMR_Q_SET_ALIASINFO;
1085
1086 /* SAMR_R_SET_ALIASINFO - SAM alias info */
1087 typedef struct r_samr_set_aliasinfo_info
1088 {
1089         uint32 status;
1090
1091 } SAMR_R_SET_ALIASINFO;
1092
1093
1094 /* SAMR_Q_QUERY_USERGROUPS - */
1095 typedef struct q_samr_query_usergroup_info
1096 {
1097         POLICY_HND pol;          /* policy handle associated with unknown id */
1098
1099 } SAMR_Q_QUERY_USERGROUPS;
1100
1101 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
1102 typedef struct r_samr_query_usergroup_info
1103 {
1104         uint32 ptr_0;            /* pointer */
1105         uint32 num_entries;      /* number of RID groups */
1106         uint32 ptr_1;            /* pointer */
1107         uint32 num_entries2;     /* number of RID groups */
1108
1109         DOM_GID *gid; /* group info */
1110
1111         uint32 status;         /* return status */
1112
1113 } SAMR_R_QUERY_USERGROUPS;
1114
1115
1116 /* SAMR_Q_SET_USERINFO - set sam info */
1117 typedef struct q_samr_set_user_info
1118 {
1119         POLICY_HND pol;          /* policy handle associated with user */
1120         uint16 switch_value;      /* 0x0017 */
1121         uint16 switch_value2;      /* 0x0017 */
1122
1123         union
1124         {
1125                 SAM_USER_INFO_23 *id23; /* auth-level 0x17 */
1126                 SAM_USER_INFO_24 *id24; /* auth-level 0x18 */
1127                 void* id; /* to make typecasting easy */
1128
1129         } info;
1130
1131 } SAMR_Q_SET_USERINFO;
1132
1133 /* SAMR_R_SET_USERINFO - set sam info */
1134 typedef struct r_samr_set_user_info
1135 {
1136         uint32 status;         /* return status */
1137
1138 } SAMR_R_SET_USERINFO;
1139
1140
1141 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
1142 typedef struct q_samr_query_user_info
1143 {
1144         POLICY_HND pol;          /* policy handle associated with unknown id */
1145         uint16 switch_value;         /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
1146
1147 } SAMR_Q_QUERY_USERINFO;
1148
1149 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
1150 typedef struct r_samr_query_user_info
1151 {
1152         uint32 ptr;            /* pointer */
1153         uint16 switch_value;      /* 0x0015, 0x0011 or 0x0010 - same as in query */
1154         /* uint8[2] padding. */
1155
1156         union
1157         {
1158                 SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
1159                 SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
1160                 SAM_USER_INFO_21 *id21; /* auth-level 21 */
1161                 void* id; /* to make typecasting easy */
1162
1163         } info;
1164
1165         uint32 status;         /* return status */
1166
1167 } SAMR_R_QUERY_USERINFO;
1168
1169
1170 /****************************************************************************
1171 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
1172
1173 the policy handle allocated by an "samr open secret" call is associated
1174 with a SID.  this policy handle is what is queried here, *not* the SID
1175 itself.  the response to the lookup rids is relative to this SID.
1176 *****************************************************************************/
1177 /* SAMR_Q_QUERY_USERALIASES */
1178 typedef struct q_samr_query_useraliases_info
1179 {
1180         POLICY_HND pol;       /* policy handle */
1181
1182         uint32 num_sids1;      /* number of rids being looked up */
1183         uint32 ptr;            /* buffer pointer */
1184         uint32 num_sids2;      /* number of rids being looked up */
1185
1186         uint32   ptr_sid[MAX_LOOKUP_SIDS]; /* pointers to sids to be looked up */
1187         DOM_SID2 sid    [MAX_LOOKUP_SIDS]; /* sids to be looked up. */
1188
1189 } SAMR_Q_QUERY_USERALIASES;
1190
1191
1192 /* SAMR_R_QUERY_USERALIASES */
1193 typedef struct r_samr_query_useraliases_info
1194 {
1195         uint32 num_entries;
1196         uint32 ptr; /* undocumented buffer pointer */
1197
1198         uint32 num_entries2; 
1199         uint32 *rid; /* domain RIDs being looked up */
1200
1201         uint32 status; /* return code */
1202
1203 } SAMR_R_QUERY_USERALIASES;
1204
1205
1206 /****************************************************************************
1207 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
1208 *****************************************************************************/
1209 /* SAMR_Q_LOOKUP_NAMES */
1210 typedef struct q_samr_lookup_names_info
1211 {
1212     POLICY_HND pol;       /* policy handle */
1213
1214         uint32 num_names1;      /* number of names being looked up */
1215         uint32 flags;           /* 0x0000 03e8 - unknown */
1216         uint32 ptr;            /* 0x0000 0000 - 32 bit unknown */
1217         uint32 num_names2;      /* number of names being looked up */
1218
1219         UNIHDR  hdr_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
1220         UNISTR2 uni_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
1221
1222 } SAMR_Q_LOOKUP_NAMES;
1223
1224
1225 /* SAMR_R_LOOKUP_NAMES */
1226 typedef struct r_samr_lookup_names_info
1227 {
1228         uint32 num_rids1;      /* number of aliases being looked up */
1229         uint32 ptr_rids;       /* pointer to aliases */
1230         uint32 num_rids2;      /* number of aliases being looked up */
1231
1232         uint32 rid[MAX_LOOKUP_SIDS]; /* rids */
1233
1234         uint32 num_types1;      /* number of users in aliases being looked up */
1235         uint32 ptr_types;       /* pointer to users in aliases */
1236         uint32 num_types2;      /* number of users in aliases being looked up */
1237
1238         uint32 type[MAX_LOOKUP_SIDS]; /* SID_ENUM type */
1239
1240         uint32 status; /* return code */
1241
1242 } SAMR_R_LOOKUP_NAMES;
1243
1244
1245 /****************************************************************************
1246 SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something.
1247
1248 called to resolve domain RID groups.
1249 *****************************************************************************/
1250 /* SAMR_Q_LOOKUP_RIDS */
1251 typedef struct q_samr_lookup_rids_info
1252 {
1253         POLICY_HND pol;       /* policy handle */
1254
1255         uint32 num_rids1;      /* number of rids being looked up */
1256         uint32 flags;          /* 0x0000 03e8 - unknown */
1257         uint32 ptr;            /* 0x0000 0000 - 32 bit unknown */
1258         uint32 num_rids2;      /* number of rids being looked up */
1259
1260         uint32 rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
1261
1262 } SAMR_Q_LOOKUP_RIDS;
1263
1264
1265 /****************************************************************************
1266 SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names
1267
1268 *****************************************************************************/
1269 /* SAMR_R_LOOKUP_RIDS */
1270 typedef struct r_samr_lookup_rids_info
1271 {
1272         uint32 num_names1;      /* number of aliases being looked up */
1273         uint32 ptr_names;       /* pointer to aliases */
1274         uint32 num_names2;      /* number of aliases being looked up */
1275
1276         UNIHDR  hdr_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
1277         UNISTR2 uni_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
1278
1279         uint32 num_types1;      /* number of users in aliases being looked up */
1280         uint32 ptr_types;       /* pointer to users in aliases */
1281         uint32 num_types2;      /* number of users in aliases being looked up */
1282
1283         uint32 type[MAX_LOOKUP_SIDS]; /* SID_ENUM type */
1284
1285         uint32 status;
1286
1287 } SAMR_R_LOOKUP_RIDS;
1288
1289
1290 /* SAMR_Q_OPEN_USER - probably an open */
1291 typedef struct q_samr_open_user_info
1292 {
1293         POLICY_HND domain_pol;       /* policy handle */
1294         uint32 unknown_0;     /* 32 bit unknown - 0x02011b */
1295         uint32 user_rid;      /* user RID */
1296
1297 } SAMR_Q_OPEN_USER;
1298
1299
1300 /* SAMR_R_OPEN_USER - probably an open */
1301 typedef struct r_samr_open_user_info
1302 {
1303         POLICY_HND user_pol;       /* policy handle associated with unknown id */
1304         uint32 status;         /* return status */
1305
1306 } SAMR_R_OPEN_USER;
1307
1308
1309 /* SAMR_Q_CREATE_USER - probably a create */
1310 typedef struct q_samr_create_user_info
1311 {
1312         POLICY_HND domain_pol;       /* policy handle */
1313
1314         UNIHDR  hdr_name;       /* unicode account name header */
1315         UNISTR2 uni_name;       /* unicode account name */
1316
1317         uint16 acb_info;      /* account control info */
1318         uint32 unknown_1;     /* 0xe005 00b0 */
1319
1320 } SAMR_Q_CREATE_USER;
1321
1322
1323 /* SAMR_R_CREATE_USER - probably a create */
1324 typedef struct r_samr_create_user_info
1325 {
1326         POLICY_HND user_pol;       /* policy handle associated with user */
1327
1328         uint32 unknown_0;     /* 0x0007 03ff */
1329         uint32 user_rid;      /* user RID */
1330         uint32 status;         /* return status */
1331
1332 } SAMR_R_CREATE_USER;
1333
1334
1335
1336 /* SAMR_Q_QUERY_GROUPMEM - query group members */
1337 typedef struct q_samr_query_groupmem_info
1338 {
1339         POLICY_HND group_pol;        /* policy handle */
1340
1341 } SAMR_Q_QUERY_GROUPMEM;
1342
1343
1344 /* SAMR_R_QUERY_GROUPMEM - query group members */
1345 typedef struct r_samr_query_groupmem_info
1346 {
1347         uint32 ptr;
1348         uint32 num_entries;
1349
1350         uint32 ptr_rids;
1351         uint32 ptr_attrs;
1352
1353         uint32 num_rids;
1354         uint32 *rid;
1355
1356         uint32 num_attrs;
1357         uint32 *attr;
1358
1359         uint32 status;
1360
1361 } SAMR_R_QUERY_GROUPMEM;
1362
1363
1364 /* SAMR_Q_DEL_GROUPMEM - probably an del group member */
1365 typedef struct q_samr_del_group_mem_info
1366 {
1367         POLICY_HND pol;       /* policy handle */
1368
1369         uint32 rid;         /* rid */
1370
1371 } SAMR_Q_DEL_GROUPMEM;
1372
1373
1374 /* SAMR_R_DEL_GROUPMEM - probably an del group member */
1375 typedef struct r_samr_del_group_mem_info
1376 {
1377         uint32 status;         /* return status */
1378
1379 } SAMR_R_DEL_GROUPMEM;
1380
1381
1382 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
1383 typedef struct q_samr_add_group_mem_info
1384 {
1385         POLICY_HND pol;       /* policy handle */
1386
1387         uint32 rid;         /* rid */
1388         uint32 unknown;     /* 0x0000 0005 */
1389
1390 } SAMR_Q_ADD_GROUPMEM;
1391
1392
1393 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
1394 typedef struct r_samr_add_group_mem_info
1395 {
1396         uint32 status;         /* return status */
1397
1398 } SAMR_R_ADD_GROUPMEM;
1399
1400
1401 /* SAMR_Q_OPEN_GROUP - probably an open */
1402 typedef struct q_samr_open_group_info
1403 {
1404         POLICY_HND domain_pol;       /* policy handle */
1405         uint32 unknown;         /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
1406         uint32 rid_group;        /* rid */
1407
1408 } SAMR_Q_OPEN_GROUP;
1409
1410
1411 /* SAMR_R_OPEN_GROUP - probably an open */
1412 typedef struct r_samr_open_group_info
1413 {
1414         POLICY_HND pol;       /* policy handle */
1415         uint32 status;         /* return status */
1416
1417 } SAMR_R_OPEN_GROUP;
1418
1419
1420 /* SAMR_Q_QUERY_ALIASMEM - query alias members */
1421 typedef struct q_samr_query_aliasmem_info
1422 {
1423         POLICY_HND alias_pol;        /* policy handle */
1424
1425 } SAMR_Q_QUERY_ALIASMEM;
1426
1427
1428 /* SAMR_R_QUERY_ALIASMEM - query alias members */
1429 typedef struct r_samr_query_aliasmem_info
1430 {
1431         uint32 num_sids;
1432         uint32 ptr;
1433         uint32 num_sids1;
1434
1435         DOM_SID2 *sid;
1436
1437         uint32 status;
1438
1439 } SAMR_R_QUERY_ALIASMEM;
1440
1441
1442 /* SAMR_Q_ADD_ALIASMEM - add alias member */
1443 typedef struct q_samr_add_alias_mem_info
1444 {
1445         POLICY_HND alias_pol;       /* policy handle */
1446
1447         DOM_SID2 sid; /* member sid to be added to the alias */
1448
1449 } SAMR_Q_ADD_ALIASMEM;
1450
1451
1452 /* SAMR_R_ADD_ALIASMEM - add alias member */
1453 typedef struct r_samr_add_alias_mem_info
1454 {
1455         uint32 status;         /* return status */
1456
1457 } SAMR_R_ADD_ALIASMEM;
1458
1459
1460 /* SAMR_Q_DEL_ALIASMEM - add an add alias member */
1461 typedef struct q_samr_del_alias_mem_info
1462 {
1463         POLICY_HND alias_pol;       /* policy handle */
1464
1465         DOM_SID2 sid; /* member sid to be added to alias */
1466
1467 } SAMR_Q_DEL_ALIASMEM;
1468
1469
1470 /* SAMR_R_DEL_ALIASMEM - delete alias member */
1471 typedef struct r_samr_del_alias_mem_info
1472 {
1473         uint32 status;         /* return status */
1474
1475 } SAMR_R_DEL_ALIASMEM;
1476
1477
1478
1479 /* SAMR_Q_OPEN_ALIAS - probably an open */
1480 typedef struct q_samr_open_alias_info
1481 {
1482         POLICY_HND dom_pol;
1483
1484         uint32 unknown_0;         /* 0x0000 0008 */
1485         uint32 rid_alias;        /* rid */
1486
1487 } SAMR_Q_OPEN_ALIAS;
1488
1489
1490 /* SAMR_R_OPEN_ALIAS - probably an open */
1491 typedef struct r_samr_open_alias_info
1492 {
1493         POLICY_HND pol;       /* policy handle */
1494         uint32 status;         /* return status */
1495
1496 } SAMR_R_OPEN_ALIAS;
1497
1498
1499 /* SAMR_Q_CONNECT_ANON - probably an open */
1500 typedef struct q_samr_connect_anon_info
1501 {
1502         uint32 ptr;                  /* ptr? */
1503         uint16 unknown_0;            /* 0x005c */
1504         uint16 unknown_1;            /* 0x0001 */
1505         uint32 unknown_2;            /* 0x0000 0020 */
1506
1507 } SAMR_Q_CONNECT_ANON;
1508
1509 /* SAMR_R_CONNECT_ANON - probably an open */
1510 typedef struct r_samr_connect_anon_info
1511 {
1512         POLICY_HND connect_pol;       /* policy handle */
1513         uint32 status;         /* return status */
1514
1515 } SAMR_R_CONNECT_ANON;
1516
1517 /* SAMR_Q_CONNECT - probably an open */
1518 typedef struct q_samr_connect_info
1519 {
1520         uint32 ptr_srv_name;         /* pointer (to server name?) */
1521         UNISTR2 uni_srv_name;        /* unicode server name starting with '\\' */
1522
1523         uint32 unknown_0;            /* 32 bit unknown */
1524
1525 } SAMR_Q_CONNECT;
1526
1527
1528 /* SAMR_R_CONNECT - probably an open */
1529 typedef struct r_samr_connect_info
1530 {
1531     POLICY_HND connect_pol;       /* policy handle */
1532         uint32 status;         /* return status */
1533
1534 } SAMR_R_CONNECT;
1535
1536 /* SAMR_Q_UNKNOWN_38 */
1537 typedef struct q_samr_unknown_38
1538 {
1539         uint32 ptr; 
1540         UNIHDR  hdr_srv_name;
1541         UNISTR2 uni_srv_name;
1542
1543 } SAMR_Q_UNKNOWN_38;
1544
1545 /* SAMR_R_UNKNOWN_38 */
1546 typedef struct r_samr_unknown_38
1547 {
1548         uint16 unk_0;
1549         uint16 unk_1;
1550         uint16 unk_2;
1551         uint16 unk_3;
1552
1553 } SAMR_R_UNKNOWN_38;
1554
1555 /* SAMR_ENC_PASSWD */
1556 typedef struct enc_passwd_info
1557 {
1558         uint32 ptr;
1559         uint8 pass[516];
1560
1561 } SAMR_ENC_PASSWD;
1562
1563 /* SAMR_ENC_HASH */
1564 typedef struct enc_hash_info
1565 {
1566         uint32 ptr;
1567         uint8 hash[16];
1568
1569 } SAMR_ENC_HASH;
1570
1571 /* SAMR_Q_CHGPASSWD_USER */
1572 typedef struct q_samr_chgpasswd_user_info
1573 {
1574         uint32 ptr_0;
1575
1576         UNIHDR hdr_dest_host; /* server name unicode header */
1577         UNISTR2 uni_dest_host; /* server name unicode string */
1578
1579         UNIHDR hdr_user_name;    /* username unicode string header */
1580         UNISTR2 uni_user_name;    /* username unicode string */
1581
1582         SAMR_ENC_PASSWD nt_newpass;
1583         SAMR_ENC_HASH nt_oldhash;
1584
1585         uint32 unknown; /* 0x0000 0001 */
1586
1587         SAMR_ENC_PASSWD lm_newpass;
1588         SAMR_ENC_HASH lm_oldhash;
1589
1590 } SAMR_Q_CHGPASSWD_USER;
1591
1592 /* SAMR_R_CHGPASSWD_USER */
1593 typedef struct r_samr_chgpasswd_user_info
1594 {
1595         uint32 status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1596
1597 } SAMR_R_CHGPASSWD_USER;
1598
1599 #endif /* _RPC_SAMR_H */
1600