07ae0301d431d72a377aa3421396abe733b12d83
[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         uint16 req_num_entries;   /* number of values (0 indicates unlimited?) */
490         uint16 unknown_0;         /* enumeration context? */
491         uint16 acb_mask;          /* 0x0000 indicates all */
492         uint16 unknown_1;         /* 0x0000 */
493
494         uint32 max_size;              /* 0x0000 ffff */
495
496 } SAMR_Q_ENUM_DOM_USERS;
497
498
499 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
500 typedef struct r_samr_enum_dom_users_info
501 {
502         uint32 unknown_0;          /* unknown. */
503         uint32 ptr_entries1;       /* actual number of entries to follow, having masked some out */
504
505         uint32 num_entries2;
506         uint32 ptr_entries2;
507
508         uint32 num_entries3;
509
510         SAM_ENTRY sam[MAX_SAM_ENTRIES];
511         UNISTR2 uni_acct_name[MAX_SAM_ENTRIES];
512
513         uint32 num_entries4;
514
515         uint32 status;
516
517 } SAMR_R_ENUM_DOM_USERS;
518
519
520 typedef struct samr_entry_info3
521 {
522         uint32 grp_idx;
523
524         uint32 rid_grp;
525         uint32 attr;
526
527         UNIHDR hdr_grp_name;
528         UNIHDR hdr_grp_desc;
529
530 } SAM_ENTRY3;
531
532 typedef struct samr_str_entry_info3
533 {
534         UNISTR2 uni_grp_name;
535         UNISTR2 uni_grp_desc;
536
537 } SAM_STR3;
538
539 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
540 typedef struct q_samr_enum_dom_groups_info
541 {
542         POLICY_HND pol;          /* policy handle */
543
544         /* these are possibly an enumeration context handle... */
545         uint16 switch_level;      /* 0x0003 */
546         uint16 unknown_0;         /* 0x0000 */
547         uint32 start_idx;       /* presumably the start enumeration index */
548         uint32 unknown_1;       /* 0x0000 07d0 */
549
550         uint32 max_size;        /* 0x0000 7fff */
551
552 } SAMR_Q_ENUM_DOM_GROUPS;
553
554
555 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
556 typedef struct r_samr_enum_dom_groups_info
557 {
558         uint32 unknown_0;        /* 0x0000 0492 or 0x0000 00be */
559         uint32 unknown_1;        /* 0x0000 049a or 0x0000 00be */
560         uint32 switch_level;     /* 0x0000 0003 */
561
562         uint32 num_entries;
563         uint32 ptr_entries;
564
565         uint32 num_entries2;
566
567         SAM_ENTRY3 sam[MAX_SAM_ENTRIES];
568         SAM_STR3   str[MAX_SAM_ENTRIES];
569
570         uint32 status;
571
572 } SAMR_R_ENUM_DOM_GROUPS;
573
574
575
576 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
577 typedef struct q_samr_enum_dom_aliases_info
578 {
579         POLICY_HND pol;          /* policy handle */
580
581         /* this is possibly an enumeration context handle... */
582         uint32 unknown_0;         /* 0x0000 0000 */
583
584         uint32 max_size;              /* 0x0000 ffff */
585
586 } SAMR_Q_ENUM_DOM_ALIASES;
587
588 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
589 typedef struct r_samr_enum_dom_aliases_info
590 {
591         uint32 num_entries;
592         uint32 ptr_entries;
593
594         uint32 num_entries2;
595         uint32 ptr_entries2;
596
597         uint32 num_entries3;
598
599         SAM_ENTRY sam[MAX_SAM_ENTRIES];
600         UNISTR2 uni_grp_name[MAX_SAM_ENTRIES];
601
602         uint32 num_entries4;
603
604         uint32 status;
605
606 } SAMR_R_ENUM_DOM_ALIASES;
607
608
609
610 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
611 typedef struct q_samr_query_disp_info
612 {
613         POLICY_HND pol;        /* policy handle */
614
615         uint16 switch_level;    /* 0x0001 and 0x0002 seen */
616         uint16 unknown_0;       /* 0x0000 and 0x2000 seen */
617         uint32 start_idx;       /* presumably the start enumeration index */
618         uint32 unknown_1;       /* 0x0000 07d0, 0x0000 0400 and 0x0000 0200 seen */
619
620         uint32 max_size;        /* 0x0000 7fff, 0x0000 7ffe and 0x0000 3fff seen*/
621
622 } SAMR_Q_QUERY_DISPINFO;
623
624 typedef struct samr_entry_info1
625 {
626         uint32 user_idx;
627
628         uint32 rid_user;
629         uint16 acb_info;
630         uint16 pad;
631
632         UNIHDR hdr_acct_name;
633         UNIHDR hdr_user_name;
634         UNIHDR hdr_user_desc;
635
636 } SAM_ENTRY1;
637
638 typedef struct samr_str_entry_info1
639 {
640         UNISTR2 uni_acct_name;
641         UNISTR2 uni_full_name;
642         UNISTR2 uni_acct_desc;
643
644 } SAM_STR1;
645
646 typedef struct sam_entry_info_1
647 {
648         uint32 num_entries;
649         uint32 ptr_entries;
650         uint32 num_entries2;
651
652         SAM_ENTRY1 sam[MAX_SAM_ENTRIES];
653         SAM_STR1   str[MAX_SAM_ENTRIES];
654
655
656 } SAM_INFO_1;
657
658 typedef struct samr_entry_info2
659 {
660         uint32 user_idx;
661
662         uint32 rid_user;
663         uint16 acb_info;
664         uint16 pad;
665
666         UNIHDR hdr_srv_name;
667         UNIHDR hdr_srv_desc;
668
669 } SAM_ENTRY2;
670
671 typedef struct samr_str_entry_info2
672 {
673         UNISTR2 uni_srv_name;
674         UNISTR2 uni_srv_desc;
675
676 } SAM_STR2;
677
678 typedef struct sam_entry_info_2
679 {
680         uint32 num_entries;
681         uint32 ptr_entries;
682         uint32 num_entries2;
683
684         SAM_ENTRY2 sam[MAX_SAM_ENTRIES];
685         SAM_STR2   str[MAX_SAM_ENTRIES];
686
687 } SAM_INFO_2;
688
689 typedef struct sam_info_ctr_info
690 {
691         union
692         {
693                 SAM_INFO_1 *info1; /* server info */
694                 SAM_INFO_2 *info2; /* user info */
695                 void       *info; /* allows assignment without typecasting, */
696
697         } sam;
698
699 } SAM_INFO_CTR;
700
701 /* SAMR_R_QUERY_DISPINFO - SAM rids, names and descriptions */
702 typedef struct r_samr_query_dispinfo_info
703 {
704         uint32 unknown_0;        /* container length? 0x0000 0492 or 0x0000 00be */
705         uint32 unknown_1;        /* container length? 0x0000 049a or 0x0000 00be */
706         uint16 switch_level;     /* 0x0001 or 0x0002 */
707         /*uint8 pad[2] */
708
709         SAM_INFO_CTR *ctr;
710
711         uint32 status;
712
713 } SAMR_R_QUERY_DISPINFO;
714
715
716 /* SAMR_Q_DELETE_DOM_GROUP - delete domain group */
717 typedef struct q_samr_delete_dom_group_info
718 {
719     POLICY_HND group_pol;          /* policy handle */
720
721 } SAMR_Q_DELETE_DOM_GROUP;
722
723
724 /* SAMR_R_DELETE_DOM_GROUP - delete domain group */
725 typedef struct r_samr_delete_dom_group_info
726 {
727         POLICY_HND pol;       /* policy handle */
728         uint32 status;        /* return status */
729
730 } SAMR_R_DELETE_DOM_GROUP;
731
732
733 /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */
734 typedef struct q_samr_create_dom_group_info
735 {
736         POLICY_HND pol;        /* policy handle */
737
738         UNIHDR hdr_acct_desc;
739         UNISTR2 uni_acct_desc;
740
741         uint16 unknown_1;    /* 0x0002 */
742         uint16 unknown_2;    /* 0x0001 */
743
744 } SAMR_Q_CREATE_DOM_GROUP;
745
746 /* SAMR_R_CREATE_DOM_GROUP - SAM create group */
747 typedef struct r_samr_create_dom_group_info
748 {
749         POLICY_HND pol;        /* policy handle */
750
751         uint32 rid;    
752         uint32 status;    
753
754 } SAMR_R_CREATE_DOM_GROUP;
755
756 /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */
757 typedef struct q_samr_query_group_info
758 {
759         POLICY_HND pol;        /* policy handle */
760
761         uint16 switch_level;    /* 0x0001 seen */
762
763 } SAMR_Q_QUERY_GROUPINFO;
764
765 typedef struct samr_group_info1
766 {
767         UNIHDR hdr_acct_name;
768
769         uint32 unknown_1; /* 0x0000 0003 - number of group members? */
770         uint32 unknown_2; /* 0x0000 0001 - number of group members? */
771
772         UNIHDR hdr_acct_desc;
773
774         UNISTR2 uni_acct_name;
775         UNISTR2 uni_acct_desc;
776
777 } GROUP_INFO1;
778
779 typedef struct samr_group_info4
780 {
781         UNIHDR hdr_acct_desc;
782         UNISTR2 uni_acct_desc;
783
784 } GROUP_INFO4;
785
786 /* GROUP_INFO_CTR */
787 typedef struct group_info_ctr
788 {
789         uint16 switch_value1;
790         uint16 switch_value2;
791
792         union
793         {
794                 GROUP_INFO4 info4;
795                 GROUP_INFO1 info1;
796
797         } group;
798
799 } GROUP_INFO_CTR;
800
801 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
802 typedef struct r_samr_query_groupinfo_info
803 {
804         uint32 ptr;        
805         GROUP_INFO_CTR *ctr;
806
807         uint32 status;
808
809 } SAMR_R_QUERY_GROUPINFO;
810
811
812 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
813 typedef struct q_samr_set_group_info
814 {
815         POLICY_HND pol;        /* policy handle */
816         GROUP_INFO_CTR *ctr;
817
818 } SAMR_Q_SET_GROUPINFO;
819
820 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
821 typedef struct r_samr_set_group_info
822 {
823         uint32 status;
824
825 } SAMR_R_SET_GROUPINFO;
826
827
828 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
829 typedef struct q_samr_delete_dom_alias_info
830 {
831     POLICY_HND alias_pol;          /* policy handle */
832
833 } SAMR_Q_DELETE_DOM_ALIAS;
834
835
836 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
837 typedef struct r_samr_delete_dom_alias_info
838 {
839         POLICY_HND pol;       /* policy handle */
840         uint32 status;        /* return status */
841
842 } SAMR_R_DELETE_DOM_ALIAS;
843
844
845 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
846 typedef struct q_samr_create_dom_alias_info
847 {
848         POLICY_HND dom_pol;        /* policy handle */
849
850         UNIHDR hdr_acct_desc;
851         UNISTR2 uni_acct_desc;
852
853         uint16 unknown_1;    /* 0x001f */
854         uint16 unknown_2;    /* 0x000f */
855
856 } SAMR_Q_CREATE_DOM_ALIAS;
857
858 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
859 typedef struct r_samr_create_dom_alias_info
860 {
861         POLICY_HND alias_pol;        /* policy handle */
862
863         uint32 rid;    
864         uint32 status;    
865
866 } SAMR_R_CREATE_DOM_ALIAS;
867
868 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
869 typedef struct q_samr_query_alias_info
870 {
871         POLICY_HND pol;        /* policy handle */
872
873         uint16 switch_level;    /* 0x0003 seen */
874
875 } SAMR_Q_QUERY_ALIASINFO;
876
877 typedef struct samr_alias_info3
878 {
879         UNIHDR hdr_acct_desc;
880         UNISTR2 uni_acct_desc;
881
882 } ALIAS_INFO3;
883
884 /* ALIAS_INFO_CTR */
885 typedef struct alias_info_ctr
886 {
887         uint16 switch_value1;
888         uint16 switch_value2;
889
890         union
891         {
892                 ALIAS_INFO3 info3;
893
894         } alias;
895
896 } ALIAS_INFO_CTR;
897
898 /* SAMR_R_QUERY_ALIASINFO - SAM alias info */
899 typedef struct r_samr_query_aliasinfo_info
900 {
901         uint32 ptr;        
902         ALIAS_INFO_CTR *ctr;
903
904         uint32 status;
905
906 } SAMR_R_QUERY_ALIASINFO;
907
908
909 /* SAMR_Q_SET_ALIASINFO - SAM Alias Info */
910 typedef struct q_samr_set_alias_info
911 {
912         POLICY_HND alias_pol;        /* policy handle */
913         ALIAS_INFO_CTR *ctr;
914
915 } SAMR_Q_SET_ALIASINFO;
916
917 /* SAMR_R_SET_ALIASINFO - SAM alias info */
918 typedef struct r_samr_set_aliasinfo_info
919 {
920         uint32 status;
921
922 } SAMR_R_SET_ALIASINFO;
923
924
925 /* SAMR_Q_QUERY_USERGROUPS - */
926 typedef struct q_samr_query_usergroup_info
927 {
928         POLICY_HND pol;          /* policy handle associated with unknown id */
929
930 } SAMR_Q_QUERY_USERGROUPS;
931
932 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
933 typedef struct r_samr_query_usergroup_info
934 {
935         uint32 ptr_0;            /* pointer */
936         uint32 num_entries;      /* number of RID groups */
937         uint32 ptr_1;            /* pointer */
938         uint32 num_entries2;     /* number of RID groups */
939
940         DOM_GID *gid; /* group info */
941
942         uint32 status;         /* return status */
943
944 } SAMR_R_QUERY_USERGROUPS;
945
946
947 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
948 typedef struct q_samr_query_user_info
949 {
950         POLICY_HND pol;          /* policy handle associated with unknown id */
951         uint16 switch_value;         /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
952
953 } SAMR_Q_QUERY_USERINFO;
954
955 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
956 typedef struct r_samr_query_user_info
957 {
958         uint32 ptr;            /* pointer */
959         uint16 switch_value;      /* 0x0015, 0x0011 or 0x0010 - same as in query */
960         /* uint8[2] padding. */
961
962         union
963         {
964                 SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
965                 SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
966                 SAM_USER_INFO_21 *id21; /* auth-level 21 */
967                 void* id; /* to make typecasting easy */
968
969         } info;
970
971         uint32 status;         /* return status */
972
973 } SAMR_R_QUERY_USERINFO;
974
975
976 /****************************************************************************
977 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
978
979 the policy handle allocated by an "samr open secret" call is associated
980 with a SID.  this policy handle is what is queried here, *not* the SID
981 itself.  the response to the lookup rids is relative to this SID.
982 *****************************************************************************/
983 /* SAMR_Q_QUERY_USERALIASES */
984 typedef struct q_samr_query_useraliases_info
985 {
986         POLICY_HND pol;       /* policy handle */
987
988         uint32 num_sids1;      /* number of rids being looked up */
989         uint32 ptr;            /* buffer pointer */
990         uint32 num_sids2;      /* number of rids being looked up */
991
992         uint32   ptr_sid[MAX_LOOKUP_SIDS]; /* pointers to sids to be looked up */
993         DOM_SID2 sid    [MAX_LOOKUP_SIDS]; /* sids to be looked up. */
994
995 } SAMR_Q_QUERY_USERALIASES;
996
997
998 /* SAMR_R_QUERY_USERALIASES */
999 typedef struct r_samr_query_useraliases_info
1000 {
1001         uint32 num_entries;
1002         uint32 ptr; /* undocumented buffer pointer */
1003
1004         uint32 num_entries2; 
1005         uint32 *rid; /* domain RIDs being looked up */
1006
1007         uint32 status; /* return code */
1008
1009 } SAMR_R_QUERY_USERALIASES;
1010
1011
1012 /****************************************************************************
1013 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
1014 *****************************************************************************/
1015 /* SAMR_Q_LOOKUP_NAMES */
1016 typedef struct q_samr_lookup_names_info
1017 {
1018     POLICY_HND pol;       /* policy handle */
1019
1020         uint32 num_names1;      /* number of names being looked up */
1021         uint32 flags;           /* 0x0000 03e8 - unknown */
1022         uint32 ptr;            /* 0x0000 0000 - 32 bit unknown */
1023         uint32 num_names2;      /* number of names being looked up */
1024
1025         UNIHDR  hdr_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
1026         UNISTR2 uni_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
1027
1028 } SAMR_Q_LOOKUP_NAMES;
1029
1030
1031 /* SAMR_R_LOOKUP_NAMES */
1032 typedef struct r_samr_lookup_names_info
1033 {
1034         uint32 num_rids1;      /* number of aliases being looked up */
1035         uint32 ptr_rids;       /* pointer to aliases */
1036         uint32 num_rids2;      /* number of aliases being looked up */
1037
1038         uint32 rid[MAX_LOOKUP_SIDS]; /* rids */
1039
1040         uint32 num_types1;      /* number of users in aliases being looked up */
1041         uint32 ptr_types;       /* pointer to users in aliases */
1042         uint32 num_types2;      /* number of users in aliases being looked up */
1043
1044         uint32 type[MAX_LOOKUP_SIDS]; /* SID_ENUM type */
1045
1046         uint32 status; /* return code */
1047
1048 } SAMR_R_LOOKUP_NAMES;
1049
1050
1051 /****************************************************************************
1052 SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something.
1053
1054 called to resolve domain RID groups.
1055 *****************************************************************************/
1056 /* SAMR_Q_LOOKUP_RIDS */
1057 typedef struct q_samr_lookup_rids_info
1058 {
1059         POLICY_HND pol;       /* policy handle */
1060
1061         uint32 num_rids1;      /* number of rids being looked up */
1062         uint32 flags;          /* 0x0000 03e8 - unknown */
1063         uint32 ptr;            /* 0x0000 0000 - 32 bit unknown */
1064         uint32 num_rids2;      /* number of rids being looked up */
1065
1066         uint32 rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
1067
1068 } SAMR_Q_LOOKUP_RIDS;
1069
1070
1071 /****************************************************************************
1072 SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names
1073
1074 *****************************************************************************/
1075 /* SAMR_R_LOOKUP_RIDS */
1076 typedef struct r_samr_lookup_rids_info
1077 {
1078         uint32 num_names1;      /* number of aliases being looked up */
1079         uint32 ptr_names;       /* pointer to aliases */
1080         uint32 num_names2;      /* number of aliases being looked up */
1081
1082         UNIHDR  hdr_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
1083         UNISTR2 uni_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
1084
1085         uint32 num_types1;      /* number of users in aliases being looked up */
1086         uint32 ptr_types;       /* pointer to users in aliases */
1087         uint32 num_types2;      /* number of users in aliases being looked up */
1088
1089         uint32 type[MAX_LOOKUP_SIDS]; /* SID_ENUM type */
1090
1091         uint32 status;
1092
1093 } SAMR_R_LOOKUP_RIDS;
1094
1095
1096 /* SAMR_Q_OPEN_USER - probably an open */
1097 typedef struct q_samr_open_user_info
1098 {
1099         POLICY_HND domain_pol;       /* policy handle */
1100         uint32 unknown_0;     /* 32 bit unknown - 0x02011b */
1101         uint32 user_rid;      /* user RID */
1102
1103 } SAMR_Q_OPEN_USER;
1104
1105
1106 /* SAMR_R_OPEN_USER - probably an open */
1107 typedef struct r_samr_open_user_info
1108 {
1109         POLICY_HND user_pol;       /* policy handle associated with unknown id */
1110         uint32 status;         /* return status */
1111
1112 } SAMR_R_OPEN_USER;
1113
1114
1115
1116 /* SAMR_Q_UNKNOWN_32 - probably a "create SAM entry" */
1117 typedef struct q_samr_unknown_32_info
1118 {
1119     POLICY_HND pol;             /* policy handle */
1120
1121         UNIHDR  hdr_mach_acct;       /* unicode machine account name header */
1122         UNISTR2 uni_mach_acct;       /* unicode machine account name */
1123
1124         uint32 acct_ctrl;            /* 32 bit ACB_XXXX */
1125         uint16 unknown_1;            /* 16 bit unknown - 0x00B0 */
1126         uint16 unknown_2;            /* 16 bit unknown - 0xe005 */
1127
1128 } SAMR_Q_UNKNOWN_32;
1129
1130
1131 /* SAMR_R_UNKNOWN_32 - probably a "create SAM entry" */
1132 typedef struct r_samr_unknown_32_info
1133 {
1134     POLICY_HND pol;       /* policy handle */
1135
1136         /* rid4.unknown - fail: 0030 success: 0x03ff */
1137         DOM_RID4 rid4;         /* rid and attributes */
1138
1139         uint32 status;         /* return status - fail: 0xC000 0099: user exists */
1140
1141 } SAMR_R_UNKNOWN_32;
1142
1143 /* SAMR_Q_QUERY_GROUPMEM - query group members */
1144 typedef struct q_samr_query_groupmem_info
1145 {
1146         POLICY_HND group_pol;        /* policy handle */
1147
1148 } SAMR_Q_QUERY_GROUPMEM;
1149
1150
1151 /* SAMR_R_QUERY_GROUPMEM - query group members */
1152 typedef struct r_samr_query_groupmem_info
1153 {
1154         uint32 ptr;
1155         uint32 num_entries;
1156
1157         uint32 ptr_rids;
1158         uint32 ptr_attrs;
1159
1160         uint32 num_rids;
1161         uint32 *rid;
1162
1163         uint32 num_attrs;
1164         uint32 *attr;
1165
1166         uint32 status;
1167
1168 } SAMR_R_QUERY_GROUPMEM;
1169
1170
1171 /* SAMR_Q_DEL_GROUPMEM - probably an del group member */
1172 typedef struct q_samr_del_group_mem_info
1173 {
1174         POLICY_HND pol;       /* policy handle */
1175
1176         uint32 rid;         /* rid */
1177
1178 } SAMR_Q_DEL_GROUPMEM;
1179
1180
1181 /* SAMR_R_DEL_GROUPMEM - probably an del group member */
1182 typedef struct r_samr_del_group_mem_info
1183 {
1184         uint32 status;         /* return status */
1185
1186 } SAMR_R_DEL_GROUPMEM;
1187
1188
1189 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
1190 typedef struct q_samr_add_group_mem_info
1191 {
1192         POLICY_HND pol;       /* policy handle */
1193
1194         uint32 rid;         /* rid */
1195         uint32 unknown;     /* 0x0000 0005 */
1196
1197 } SAMR_Q_ADD_GROUPMEM;
1198
1199
1200 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
1201 typedef struct r_samr_add_group_mem_info
1202 {
1203         uint32 status;         /* return status */
1204
1205 } SAMR_R_ADD_GROUPMEM;
1206
1207
1208 /* SAMR_Q_OPEN_GROUP - probably an open */
1209 typedef struct q_samr_open_group_info
1210 {
1211         POLICY_HND domain_pol;       /* policy handle */
1212         uint32 unknown;         /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
1213         uint32 rid_group;        /* rid */
1214
1215 } SAMR_Q_OPEN_GROUP;
1216
1217
1218 /* SAMR_R_OPEN_GROUP - probably an open */
1219 typedef struct r_samr_open_group_info
1220 {
1221         POLICY_HND pol;       /* policy handle */
1222         uint32 status;         /* return status */
1223
1224 } SAMR_R_OPEN_GROUP;
1225
1226
1227 /* SAMR_Q_QUERY_ALIASMEM - query alias members */
1228 typedef struct q_samr_query_aliasmem_info
1229 {
1230         POLICY_HND alias_pol;        /* policy handle */
1231
1232 } SAMR_Q_QUERY_ALIASMEM;
1233
1234
1235 /* SAMR_R_QUERY_ALIASMEM - query alias members */
1236 typedef struct r_samr_query_aliasmem_info
1237 {
1238         uint32 num_sids;
1239         uint32 ptr;
1240         uint32 num_sids1;
1241
1242         DOM_SID2 *sid;
1243
1244         uint32 status;
1245
1246 } SAMR_R_QUERY_ALIASMEM;
1247
1248
1249 /* SAMR_Q_ADD_ALIASMEM - add alias member */
1250 typedef struct q_samr_add_alias_mem_info
1251 {
1252         POLICY_HND alias_pol;       /* policy handle */
1253
1254         DOM_SID2 sid; /* member sid to be added to the alias */
1255
1256 } SAMR_Q_ADD_ALIASMEM;
1257
1258
1259 /* SAMR_R_ADD_ALIASMEM - add alias member */
1260 typedef struct r_samr_add_alias_mem_info
1261 {
1262         uint32 status;         /* return status */
1263
1264 } SAMR_R_ADD_ALIASMEM;
1265
1266
1267 /* SAMR_Q_DEL_ALIASMEM - add an add alias member */
1268 typedef struct q_samr_del_alias_mem_info
1269 {
1270         POLICY_HND alias_pol;       /* policy handle */
1271
1272         DOM_SID2 sid; /* member sid to be added to alias */
1273
1274 } SAMR_Q_DEL_ALIASMEM;
1275
1276
1277 /* SAMR_R_DEL_ALIASMEM - delete alias member */
1278 typedef struct r_samr_del_alias_mem_info
1279 {
1280         uint32 status;         /* return status */
1281
1282 } SAMR_R_DEL_ALIASMEM;
1283
1284
1285
1286 /* SAMR_Q_OPEN_ALIAS - probably an open */
1287 typedef struct q_samr_open_alias_info
1288 {
1289         POLICY_HND dom_pol;
1290
1291         uint32 unknown_0;         /* 0x0000 0008 */
1292         uint32 rid_alias;        /* rid */
1293
1294 } SAMR_Q_OPEN_ALIAS;
1295
1296
1297 /* SAMR_R_OPEN_ALIAS - probably an open */
1298 typedef struct r_samr_open_alias_info
1299 {
1300         POLICY_HND pol;       /* policy handle */
1301         uint32 status;         /* return status */
1302
1303 } SAMR_R_OPEN_ALIAS;
1304
1305
1306 /* SAMR_Q_CONNECT_ANON - probably an open */
1307 typedef struct q_samr_connect_anon_info
1308 {
1309         uint32 ptr;                  /* ptr? */
1310         uint16 unknown_0;            /* 0x005c */
1311         uint16 unknown_1;            /* 0x0001 */
1312         uint32 unknown_2;            /* 0x0000 0020 */
1313
1314 } SAMR_Q_CONNECT_ANON;
1315
1316 /* SAMR_R_CONNECT_ANON - probably an open */
1317 typedef struct r_samr_connect_anon_info
1318 {
1319         POLICY_HND connect_pol;       /* policy handle */
1320         uint32 status;         /* return status */
1321
1322 } SAMR_R_CONNECT_ANON;
1323
1324 /* SAMR_Q_CONNECT - probably an open */
1325 typedef struct q_samr_connect_info
1326 {
1327         uint32 ptr_srv_name;         /* pointer (to server name?) */
1328         UNISTR2 uni_srv_name;        /* unicode server name starting with '\\' */
1329
1330         uint32 unknown_0;            /* 32 bit unknown */
1331
1332 } SAMR_Q_CONNECT;
1333
1334
1335 /* SAMR_R_CONNECT - probably an open */
1336 typedef struct r_samr_connect_info
1337 {
1338     POLICY_HND connect_pol;       /* policy handle */
1339         uint32 status;         /* return status */
1340
1341 } SAMR_R_CONNECT;
1342
1343 /* SAMR_Q_UNKNOWN_38 */
1344 typedef struct q_samr_unknown_38
1345 {
1346         uint32 ptr; 
1347         UNIHDR  hdr_srv_name;
1348         UNISTR2 uni_srv_name;
1349
1350 } SAMR_Q_UNKNOWN_38;
1351
1352 /* SAMR_R_UNKNOWN_38 */
1353 typedef struct r_samr_unknown_38
1354 {
1355         uint16 unk_0;
1356         uint16 unk_1;
1357         uint16 unk_2;
1358         uint16 unk_3;
1359
1360 } SAMR_R_UNKNOWN_38;
1361
1362 /* SAMR_ENC_PASSWD */
1363 typedef struct enc_passwd_info
1364 {
1365         uint32 ptr;
1366         uint8 pass[516];
1367
1368 } SAMR_ENC_PASSWD;
1369
1370 /* SAMR_ENC_HASH */
1371 typedef struct enc_hash_info
1372 {
1373         uint32 ptr;
1374         uint8 hash[16];
1375
1376 } SAMR_ENC_HASH;
1377
1378 /* SAMR_Q_CHGPASSWD_USER */
1379 typedef struct q_samr_chgpasswd_user_info
1380 {
1381         uint32 ptr_0;
1382
1383         UNIHDR hdr_dest_host; /* server name unicode header */
1384         UNISTR2 uni_dest_host; /* server name unicode string */
1385
1386         UNIHDR hdr_user_name;    /* username unicode string header */
1387         UNISTR2 uni_user_name;    /* username unicode string */
1388
1389         SAMR_ENC_PASSWD nt_newpass;
1390         SAMR_ENC_HASH nt_oldhash;
1391
1392         uint32 unknown; /* 0x0000 0001 */
1393
1394         SAMR_ENC_PASSWD lm_newpass;
1395         SAMR_ENC_HASH lm_oldhash;
1396
1397 } SAMR_Q_CHGPASSWD_USER;
1398
1399 /* SAMR_R_CHGPASSWD_USER */
1400 typedef struct r_samr_chgpasswd_user_info
1401 {
1402         uint32 status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1403
1404 } SAMR_R_CHGPASSWD_USER;
1405
1406 #endif /* _RPC_SAMR_H */
1407