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