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