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