Fixed interface code so that a UUID is transmitted as the following fields :
[Samba/ekacnet.git] / source / include / rpc_samr.h
blobd45cb23388f91da8e548d3d2314dbe594d44d14f
1 /*
2 Unix SMB/Netbios implementation.
3 Version 1.9.
4 SMB parameters and setup
5 Copyright (C) Andrew Tridgell 1992-1997
6 Copyright (C) Luke Kenneth Casson Leighton 1996-1997
7 Copyright (C) Paul Ashton 1997
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.
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.
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.
24 #ifndef _RPC_SAMR_H /* _RPC_SAMR_H */
25 #define _RPC_SAMR_H
28 #include "rpc_misc.h"
31 /*******************************************************************
32 the following information comes from a QuickView on samsrv.dll,
33 and gives an idea of exactly what is needed:
35 SamrAddMemberToAlias
36 SamrAddMemberToGroup
37 SamrAddMultipleMembersToAlias
38 SamrChangePasswordUser
39 x SamrCloseHandle
40 x SamrConnect
41 SamrCreateAliasInDomain
42 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 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 SamrSetInformationAlias
69 SamrSetInformationDomain
70 SamrSetInformationGroup
71 SamrSetInformationUser
72 SamrSetMemberAttributesOfGroup
73 SamrSetSecurityObject
74 SamrShutdownSamServer
75 SamrTestPrivateFunctionsDomain
76 SamrTestPrivateFunctionsUser
78 ********************************************************************/
80 #define SAMR_CLOSE_HND 0x01
81 #define SAMR_OPEN_DOMAIN 0x07
82 #define SAMR_QUERY_DOMAIN_INFO 0x08
83 #define SAMR_LOOKUP_IDS 0x10
84 #define SAMR_LOOKUP_NAMES 0x11
85 #define SAMR_UNKNOWN_3 0x03
86 #define SAMR_QUERY_DISPINFO 0x28
87 #define SAMR_OPEN_USER 0x22
88 #define SAMR_QUERY_USERINFO 0x24
89 #define SAMR_QUERY_USERGROUPS 0x27
90 #define SAMR_UNKNOWN_12 0x12
91 #define SAMR_UNKNOWN_21 0x21
92 #define SAMR_UNKNOWN_2C 0x2c
93 #define SAMR_UNKNOWN_32 0x32
94 #define SAMR_UNKNOWN_34 0x34
95 #define SAMR_CHGPASSWD_USER 0x37
96 #define SAMR_UNKNOWN_38 0x38
97 #define SAMR_CONNECT 0x39
98 #define SAMR_CONNECT_ANON 0x00
99 #define SAMR_OPEN_ALIAS 0x1b
100 #define SAMR_QUERY_ALIASINFO 0x1c
101 #define SAMR_ENUM_DOM_USERS 0x0d
102 #define SAMR_ENUM_DOM_ALIASES 0x0f
103 #define SAMR_ENUM_DOM_GROUPS 0x30
106 typedef struct logon_hours_info
108 uint32 len; /* normally 21 bytes */
109 uint8 hours[32];
111 } LOGON_HRS;
113 /* SAM_USER_INFO_21 */
114 typedef struct sam_user_info_21
116 NTTIME logon_time; /* logon time */
117 NTTIME logoff_time; /* logoff time */
118 NTTIME kickoff_time; /* kickoff time */
119 NTTIME pass_last_set_time; /* password last set time */
120 NTTIME pass_can_change_time; /* password can change time */
121 NTTIME pass_must_change_time; /* password must change time */
123 UNIHDR hdr_user_name; /* username unicode string header */
124 UNIHDR hdr_full_name; /* user's full name unicode string header */
125 UNIHDR hdr_home_dir; /* home directory unicode string header */
126 UNIHDR hdr_dir_drive; /* home drive unicode string header */
127 UNIHDR hdr_logon_script; /* logon script unicode string header */
128 UNIHDR hdr_profile_path; /* profile path unicode string header */
129 UNIHDR hdr_acct_desc ; /* user description */
130 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
131 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
132 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
134 uint8 lm_pwd[16]; /* lm user passwords */
135 uint8 nt_pwd[16]; /* nt user passwords */
137 uint32 user_rid; /* Primary User ID */
138 uint32 group_rid; /* Primary Group ID */
140 uint16 acb_info; /* account info (ACB_xxxx bit-mask) */
141 /* uint8 pad[2] */
143 uint32 unknown_3; /* 0x00ff ffff */
145 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
146 /* uint8 pad[2] */
147 uint32 ptr_logon_hrs; /* unknown pointer */
149 uint32 unknown_5; /* 0x0002 0000 */
151 uint8 padding1[8];
153 UNISTR2 uni_user_name; /* username unicode string */
154 UNISTR2 uni_full_name; /* user's full name unicode string */
155 UNISTR2 uni_home_dir; /* home directory unicode string */
156 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
157 UNISTR2 uni_logon_script; /* logon script unicode string */
158 UNISTR2 uni_profile_path; /* profile path unicode string */
159 UNISTR2 uni_acct_desc ; /* user description unicode string */
160 UNISTR2 uni_workstations; /* login from workstations unicode string */
161 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
162 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
164 uint32 unknown_6; /* 0x0000 04ec */
165 uint32 padding4;
167 LOGON_HRS logon_hrs;
169 } SAM_USER_INFO_21;
172 /* SAM_USER_INFO_11 */
173 typedef struct sam_user_info_11
175 uint8 padding_0[16]; /* 0 - padding 16 bytes */
176 NTTIME expiry; /* expiry time or something? */
177 uint8 padding_1[24]; /* 0 - padding 24 bytes */
179 UNIHDR hdr_mach_acct; /* unicode header for machine account */
180 uint32 padding_2; /* 0 - padding 4 bytes */
182 uint32 ptr_1; /* pointer */
183 uint8 padding_3[32]; /* 0 - padding 32 bytes */
184 uint32 padding_4; /* 0 - padding 4 bytes */
186 uint32 ptr_2; /* pointer */
187 uint32 padding_5; /* 0 - padding 4 bytes */
189 uint32 ptr_3; /* pointer */
190 uint8 padding_6[32]; /* 0 - padding 32 bytes */
192 uint32 rid_user; /* user RID */
193 uint32 rid_group; /* group RID */
195 uint16 acct_ctrl; /* 0080 - ACB_XXXX */
196 uint16 unknown_3; /* 16 bit padding */
198 uint16 unknown_4; /* 0x003f - 16 bit unknown */
199 uint16 unknown_5; /* 0x003c - 16 bit unknown */
201 uint8 padding_7[16]; /* 0 - padding 16 bytes */
202 uint32 padding_8; /* 0 - padding 4 bytes */
204 UNISTR2 uni_mach_acct; /* unicode string for machine account */
206 uint8 padding_9[48]; /* 0 - padding 48 bytes */
208 } SAM_USER_INFO_11;
211 /* SAM_USER_INFO_10 */
212 typedef struct sam_user_info_10
214 uint32 acb_info;
216 } SAM_USER_INFO_10;
220 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
221 typedef struct q_samr_close_hnd_info
223 POLICY_HND pol; /* policy handle */
225 } SAMR_Q_CLOSE_HND;
228 /* SAMR_R_CLOSE_HND - probably a policy handle close */
229 typedef struct r_samr_close_hnd_info
231 POLICY_HND pol; /* policy handle */
232 uint32 status; /* return status */
234 } SAMR_R_CLOSE_HND;
237 /****************************************************************************
238 SAMR_Q_UNKNOWN_2C - a "set user info" occurs just after this
239 *****************************************************************************/
241 /* SAMR_Q_UNKNOWN_2C */
242 typedef struct q_samr_unknown_2c_info
244 POLICY_HND user_pol; /* policy handle */
246 } SAMR_Q_UNKNOWN_2C;
249 /****************************************************************************
250 SAMR_R_UNKNOWN_2C - a "set user info" occurs just after this
251 *****************************************************************************/
253 /* SAMR_R_UNKNOWN_2C */
254 typedef struct r_samr_unknown_2c_info
256 uint32 unknown_0; /* 0x0016 0000 */
257 uint32 unknown_1; /* 0x0000 0000 */
258 uint32 status;
260 } SAMR_R_UNKNOWN_2C;
263 /****************************************************************************
264 SAMR_Q_UNKNOWN_3 - info level 4. returns SIDs.
265 *****************************************************************************/
267 /* SAMR_Q_UNKNOWN_3 - probably get domain info... */
268 typedef struct q_samr_unknown_3_info
270 POLICY_HND user_pol; /* policy handle */
271 uint16 switch_value; /* 0x0000 0004 */
272 /* uint8 pad[2] */
274 } SAMR_Q_UNKNOWN_3;
276 /* DOM_SID3 example:
277 0x14 0x035b 0x0002 S-1-1
278 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
279 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ACCOUNT_OPS
280 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03f1
283 /* DOM_SID3 example:
284 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03ee
285 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
286 0x14 0x035b 0x0002 S-1-1
289 /* DOM_SID3 - security id */
290 typedef struct sid_info_3
292 uint16 len; /* length, bytes, including length of len :-) */
293 /* uint8 pad[2]; */
295 DOM_SID sid;
297 } DOM_SID3;
300 #define MAX_SAM_SIDS 15
302 /* SAM_SID_STUFF */
303 typedef struct sid_stuff_info
305 uint16 unknown_2; /* 0x0001 */
306 uint16 unknown_3; /* 0x8004 */
308 uint8 padding1[8];
310 uint32 unknown_4; /* 0x0000 0014 */
311 uint32 unknown_5; /* 0x0000 0014 */
313 uint16 unknown_6; /* 0x0002 */
314 uint16 unknown_7; /* 0x5800 */
316 uint32 num_sids;
318 uint16 padding2;
320 DOM_SID3 sid[MAX_SAM_SIDS];
322 } SAM_SID_STUFF;
324 /* SAMR_R_UNKNOWN_3 - probably an open */
325 typedef struct r_samr_unknown_3_info
327 uint32 ptr_0;
328 uint32 sid_stuff_len0;
330 uint32 ptr_1;
331 uint32 sid_stuff_len1;
333 SAM_SID_STUFF sid_stuff;
335 uint32 status; /* return status */
337 } SAMR_R_UNKNOWN_3;
340 /****************************************************************************
341 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
342 *****************************************************************************/
344 /* SAMR_Q_QUERY_DOMAIN_INFO - */
345 typedef struct q_samr_query_domain_info
347 POLICY_HND domain_pol; /* policy handle */
348 uint16 switch_value; /* 0x0002 */
350 } SAMR_Q_QUERY_DOMAIN_INFO;
352 typedef struct sam_unkown_info_2_info
354 uint32 unknown_0; /* 0x0000 0000 */
355 uint32 unknown_1; /* 0x8000 0000 */
356 uint32 unknown_2; /* 0x0000 0000 */
358 uint32 ptr_0; /* pointer to unknown structure */
359 UNIHDR hdr_domain; /* domain name unicode header */
360 UNIHDR hdr_server; /* server name unicode header */
362 /* put all the data in here, at the moment, including what the above
363 pointer is referring to
366 uint32 seq_num; /* some sort of incrementing sequence number? */
367 uint32 unknown_3; /* 0x0000 0000 */
369 uint32 unknown_4; /* 0x0000 0001 */
370 uint32 unknown_5; /* 0x0000 0003 */
371 uint32 unknown_6; /* 0x0000 0001 */
372 uint32 num_domain_usrs; /* number of users in domain */
373 uint32 num_domain_grps; /* number of domain groups in domain */
374 uint32 num_local_grps; /* number of local groups in domain */
376 uint8 padding[12]; /* 12 bytes zeros */
378 UNISTR2 uni_domain; /* domain name unicode string */
379 UNISTR2 uni_server; /* server name unicode string */
381 } SAM_UNK_INFO_2;
384 typedef struct sam_unknown_ctr_info
386 union
388 SAM_UNK_INFO_2 inf2;
390 } info;
392 } SAM_UNK_CTR;
395 /* SAMR_R_QUERY_DOMAIN_INFO - */
396 typedef struct r_samr_query_domain_info
398 uint32 ptr_0;
399 uint16 switch_value; /* same as in query */
401 SAM_UNK_CTR *ctr;
403 uint32 status; /* return status */
405 } SAMR_R_QUERY_DOMAIN_INFO;
408 /****************************************************************************
409 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
411 0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
412 0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
413 *****************************************************************************/
415 /* SAMR_Q_OPEN_DOMAIN */
416 typedef struct q_samr_open_domain_info
418 POLICY_HND connect_pol; /* policy handle */
419 uint32 rid; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - a RID? */
420 DOM_SID2 dom_sid; /* domain SID */
422 } SAMR_Q_OPEN_DOMAIN;
425 /* SAMR_R_OPEN_DOMAIN - probably an open */
426 typedef struct r_samr_open_domain_info
428 POLICY_HND domain_pol; /* policy handle associated with the SID */
429 uint32 status; /* return status */
431 } SAMR_R_OPEN_DOMAIN;
434 #define MAX_SAM_ENTRIES 250
436 typedef struct samr_entry_info
438 uint32 rid;
439 UNIHDR hdr_name;
441 } SAM_ENTRY;
443 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
444 typedef struct q_samr_enum_dom_users_info
446 POLICY_HND pol; /* policy handle */
448 uint16 req_num_entries; /* number of values (0 indicates unlimited?) */
449 uint16 unknown_0; /* enumeration context? */
450 uint16 acb_mask; /* 0x0000 indicates all */
451 uint16 unknown_1; /* 0x0000 */
453 uint32 max_size; /* 0x0000 ffff */
455 } SAMR_Q_ENUM_DOM_USERS;
458 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
459 typedef struct r_samr_enum_dom_users_info
461 uint16 total_num_entries; /* number of entries that match without the acb mask */
462 uint16 unknown_0; /* same as unknown_0 (enum context?) in request */
463 uint32 ptr_entries1; /* actual number of entries to follow, having masked some out */
465 uint32 num_entries2;
466 uint32 ptr_entries2;
468 uint32 num_entries3;
470 SAM_ENTRY sam[MAX_SAM_ENTRIES];
471 UNISTR2 uni_acct_name[MAX_SAM_ENTRIES];
473 uint32 num_entries4;
475 uint32 status;
477 } SAMR_R_ENUM_DOM_USERS;
480 typedef struct samr_entry_info3
482 uint32 grp_idx;
484 uint32 rid_grp;
485 uint32 attr;
487 UNIHDR hdr_grp_name;
488 UNIHDR hdr_grp_desc;
490 } SAM_ENTRY3;
492 typedef struct samr_str_entry_info3
494 UNISTR2 uni_grp_name;
495 UNISTR2 uni_grp_desc;
497 } SAM_STR3;
499 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
500 typedef struct q_samr_enum_dom_groups_info
502 POLICY_HND pol; /* policy handle */
504 /* these are possibly an enumeration context handle... */
505 uint16 switch_level; /* 0x0003 */
506 uint16 unknown_0; /* 0x0000 */
507 uint32 start_idx; /* presumably the start enumeration index */
508 uint32 unknown_1; /* 0x0000 07d0 */
510 uint32 max_size; /* 0x0000 7fff */
512 } SAMR_Q_ENUM_DOM_GROUPS;
515 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
516 typedef struct r_samr_enum_dom_groups_info
518 uint32 unknown_0; /* 0x0000 0492 or 0x0000 00be */
519 uint32 unknown_1; /* 0x0000 049a or 0x0000 00be */
520 uint32 switch_level; /* 0x0000 0003 */
522 uint32 num_entries;
523 uint32 ptr_entries;
525 uint32 num_entries2;
527 SAM_ENTRY3 sam[MAX_SAM_ENTRIES];
528 SAM_STR3 str[MAX_SAM_ENTRIES];
530 uint32 status;
532 } SAMR_R_ENUM_DOM_GROUPS;
536 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
537 typedef struct q_samr_enum_dom_aliases_info
539 POLICY_HND pol; /* policy handle */
541 /* this is possibly an enumeration context handle... */
542 uint32 unknown_0; /* 0x0000 0000 */
544 uint32 max_size; /* 0x0000 ffff */
546 } SAMR_Q_ENUM_DOM_ALIASES;
548 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
549 typedef struct r_samr_enum_dom_aliases_info
551 uint32 num_entries;
552 uint32 ptr_entries;
554 uint32 num_entries2;
555 uint32 ptr_entries2;
557 uint32 num_entries3;
559 SAM_ENTRY sam[MAX_SAM_ENTRIES];
560 UNISTR2 uni_grp_name[MAX_SAM_ENTRIES];
562 uint32 num_entries4;
564 uint32 status;
566 } SAMR_R_ENUM_DOM_ALIASES;
570 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
571 typedef struct q_samr_query_disp_info
573 POLICY_HND pol; /* policy handle */
575 uint16 switch_level; /* 0x0001 and 0x0002 seen */
576 uint16 unknown_0; /* 0x0000 and 0x2000 seen */
577 uint32 start_idx; /* presumably the start enumeration index */
578 uint32 unknown_1; /* 0x0000 07d0, 0x0000 0400 and 0x0000 0200 seen */
580 uint32 max_size; /* 0x0000 7fff, 0x0000 7ffe and 0x0000 3fff seen*/
582 } SAMR_Q_QUERY_DISPINFO;
584 typedef struct samr_entry_info1
586 uint32 user_idx;
588 uint32 rid_user;
589 uint16 acb_info;
590 uint16 pad;
592 UNIHDR hdr_acct_name;
593 UNIHDR hdr_user_name;
594 UNIHDR hdr_user_desc;
596 } SAM_ENTRY1;
598 typedef struct samr_str_entry_info1
600 UNISTR2 uni_acct_name;
601 UNISTR2 uni_full_name;
602 UNISTR2 uni_acct_desc;
604 } SAM_STR1;
606 typedef struct sam_entry_info_1
608 uint32 num_entries;
609 uint32 ptr_entries;
610 uint32 num_entries2;
612 SAM_ENTRY1 sam[MAX_SAM_ENTRIES];
613 SAM_STR1 str[MAX_SAM_ENTRIES];
616 } SAM_INFO_1;
618 typedef struct samr_entry_info2
620 uint32 user_idx;
622 uint32 rid_user;
623 uint16 acb_info;
624 uint16 pad;
626 UNIHDR hdr_srv_name;
627 UNIHDR hdr_srv_desc;
629 } SAM_ENTRY2;
631 typedef struct samr_str_entry_info2
633 UNISTR2 uni_srv_name;
634 UNISTR2 uni_srv_desc;
636 } SAM_STR2;
638 typedef struct sam_entry_info_2
640 uint32 num_entries;
641 uint32 ptr_entries;
642 uint32 num_entries2;
644 SAM_ENTRY2 sam[MAX_SAM_ENTRIES];
645 SAM_STR2 str[MAX_SAM_ENTRIES];
647 } SAM_INFO_2;
649 typedef struct sam_info_ctr_info
651 union
653 SAM_INFO_1 *info1; /* server info */
654 SAM_INFO_2 *info2; /* user info */
655 void *info; /* allows assignment without typecasting, */
657 } sam;
659 } SAM_INFO_CTR;
661 /* SAMR_R_QUERY_DISPINFO - SAM rids, names and descriptions */
662 typedef struct r_samr_query_dispinfo_info
664 uint32 unknown_0; /* container length? 0x0000 0492 or 0x0000 00be */
665 uint32 unknown_1; /* container length? 0x0000 049a or 0x0000 00be */
666 uint16 switch_level; /* 0x0001 or 0x0002 */
667 /*uint8 pad[2] */
669 SAM_INFO_CTR *ctr;
671 uint32 status;
673 } SAMR_R_QUERY_DISPINFO;
677 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
678 typedef struct q_samr_enum_alias_info
680 POLICY_HND pol; /* policy handle */
682 uint16 switch_level; /* 0x0003 seen */
684 } SAMR_Q_QUERY_ALIASINFO;
686 typedef struct samr_alias_info3
688 UNIHDR hdr_acct_desc;
689 UNISTR2 uni_acct_desc;
691 } ALIAS_INFO3;
693 /* SAMR_R_QUERY_ALIASINFO - SAM rids, names and descriptions */
694 typedef struct r_samr_query_aliasinfo_info
696 uint32 ptr;
697 uint16 switch_value; /* 0x0003 */
698 /* uint8[2] padding */
700 union
702 ALIAS_INFO3 info3;
704 } alias;
706 uint32 status;
708 } SAMR_R_QUERY_ALIASINFO;
711 /* SAMR_Q_QUERY_USERGROUPS - */
712 typedef struct q_samr_query_usergroup_info
714 POLICY_HND pol; /* policy handle associated with unknown id */
716 } SAMR_Q_QUERY_USERGROUPS;
718 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
719 typedef struct r_samr_query_usergroup_info
721 uint32 ptr_0; /* pointer */
722 uint32 num_entries; /* number of RID groups */
723 uint32 ptr_1; /* pointer */
724 uint32 num_entries2; /* number of RID groups */
726 DOM_GID *gid; /* group info */
728 uint32 status; /* return status */
730 } SAMR_R_QUERY_USERGROUPS;
733 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
734 typedef struct q_samr_query_user_info
736 POLICY_HND pol; /* policy handle associated with unknown id */
737 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
739 } SAMR_Q_QUERY_USERINFO;
741 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
742 typedef struct r_samr_query_user_info
744 uint32 ptr; /* pointer */
745 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - same as in query */
746 /* uint8[2] padding. */
748 union
750 SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
751 SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
752 SAM_USER_INFO_21 *id21; /* auth-level 21 */
753 void* id; /* to make typecasting easy */
755 } info;
757 uint32 status; /* return status */
759 } SAMR_R_QUERY_USERINFO;
762 /****************************************************************************
763 SAMR_Q_LOOKUP_IDS - do a conversion from name to RID.
765 the policy handle allocated by an "samr open secret" call is associated
766 with a SID. this policy handle is what is queried here, *not* the SID
767 itself. the response to the lookup rids is relative to this SID.
768 *****************************************************************************/
769 /* SAMR_Q_LOOKUP_IDS */
770 typedef struct q_samr_lookup_ids_info
772 POLICY_HND pol; /* policy handle */
774 uint32 num_sids1; /* number of rids being looked up */
775 uint32 ptr; /* buffer pointer */
776 uint32 num_sids2; /* number of rids being looked up */
778 uint32 ptr_sid[MAX_LOOKUP_SIDS]; /* pointers to sids to be looked up */
779 DOM_SID2 sid [MAX_LOOKUP_SIDS]; /* sids to be looked up. */
781 } SAMR_Q_LOOKUP_IDS;
784 /* SAMR_R_LOOKUP_IDS */
785 typedef struct r_samr_lookup_ids_info
787 uint32 num_entries;
788 uint32 ptr; /* undocumented buffer pointer */
790 uint32 num_entries2;
791 uint32 rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
793 uint32 status; /* return code */
795 } SAMR_R_LOOKUP_IDS;
798 /****************************************************************************
799 SAMR_Q_LOOKUP_NAMES - do a conversion from SID to RID.
801 the policy handle allocated by an "samr open secret" call is associated
802 with a SID. this policy handle is what is queried here, *not* the SID
803 itself. the response to the lookup rids is relative to this SID.
804 *****************************************************************************/
805 /* SAMR_Q_LOOKUP_NAMES */
806 typedef struct q_samr_lookup_names_info
808 POLICY_HND pol; /* policy handle */
810 uint32 num_rids1; /* number of rids being looked up */
811 uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */
812 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
813 uint32 num_rids2; /* number of rids being looked up */
815 UNIHDR hdr_user_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
816 UNISTR2 uni_user_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
818 } SAMR_Q_LOOKUP_NAMES;
821 /* SAMR_R_LOOKUP_NAMES */
822 typedef struct r_samr_lookup_names_info
824 uint32 num_entries;
825 uint32 undoc_buffer; /* undocumented buffer pointer */
827 uint32 num_entries2;
828 DOM_RID3 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
830 uint32 num_entries3;
832 uint32 status; /* return code */
834 } SAMR_R_LOOKUP_NAMES;
837 /****************************************************************************
838 SAMR_Q_UNKNOWN_12 - do a conversion from RID groups to something.
840 called to resolve domain RID groups.
841 *****************************************************************************/
842 /* SAMR_Q_UNKNOWN_12 */
843 typedef struct q_samr_unknown_12_info
845 POLICY_HND pol; /* policy handle */
847 uint32 num_gids1; /* number of rids being looked up */
848 uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */
849 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
850 uint32 num_gids2; /* number of rids being looked up */
852 uint32 gid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
854 } SAMR_Q_UNKNOWN_12;
857 /****************************************************************************
858 SAMR_R_UNKNOWN_12 - do a conversion from group RID to names
860 *****************************************************************************/
861 /* SAMR_R_UNKNOWN_12 */
862 typedef struct r_samr_unknown_12_info
864 POLICY_HND pol; /* policy handle */
866 uint32 num_aliases1; /* number of aliases being looked up */
867 uint32 ptr_aliases; /* pointer to aliases */
868 uint32 num_aliases2; /* number of aliases being looked up */
870 UNIHDR hdr_als_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
871 UNISTR2 uni_als_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
873 uint32 num_als_usrs1; /* number of users in aliases being looked up */
874 uint32 ptr_als_usrs; /* pointer to users in aliases */
875 uint32 num_als_usrs2; /* number of users in aliases being looked up */
877 uint32 num_als_usrs[MAX_LOOKUP_SIDS]; /* number of users per group */
879 uint32 status;
881 } SAMR_R_UNKNOWN_12;
884 /* SAMR_Q_OPEN_USER - probably an open */
885 typedef struct q_samr_open_user_info
887 POLICY_HND domain_pol; /* policy handle */
888 uint32 unknown_0; /* 32 bit unknown - 0x02011b */
889 uint32 user_rid; /* user RID */
891 } SAMR_Q_OPEN_USER;
894 /* SAMR_R_OPEN_USER - probably an open */
895 typedef struct r_samr_open_user_info
897 POLICY_HND user_pol; /* policy handle associated with unknown id */
898 uint32 status; /* return status */
900 } SAMR_R_OPEN_USER;
903 /* SAMR_Q_UNKNOWN_13 - probably an open alias in domain */
904 typedef struct q_samr_unknown_13_info
906 POLICY_HND alias_pol; /* policy handle */
908 uint16 unknown_1; /* 16 bit unknown - 0x0200 */
909 uint16 unknown_2; /* 16 bit unknown - 0x0000 */
911 } SAMR_Q_UNKNOWN_13;
914 /* SAMR_Q_UNKNOWN_21 - probably an open group in domain */
915 typedef struct q_samr_unknown_21_info
917 POLICY_HND group_pol; /* policy handle */
919 uint16 unknown_1; /* 16 bit unknown - 0x0477 */
920 uint16 unknown_2; /* 16 bit unknown - 0x0000 */
922 } SAMR_Q_UNKNOWN_21;
925 /* SAMR_Q_UNKNOWN_32 - probably a "create SAM entry" */
926 typedef struct q_samr_unknown_32_info
928 POLICY_HND pol; /* policy handle */
930 UNIHDR hdr_mach_acct; /* unicode machine account name header */
931 UNISTR2 uni_mach_acct; /* unicode machine account name */
933 uint32 acct_ctrl; /* 32 bit ACB_XXXX */
934 uint16 unknown_1; /* 16 bit unknown - 0x00B0 */
935 uint16 unknown_2; /* 16 bit unknown - 0xe005 */
937 } SAMR_Q_UNKNOWN_32;
940 /* SAMR_R_UNKNOWN_32 - probably a "create SAM entry" */
941 typedef struct r_samr_unknown_32_info
943 POLICY_HND pol; /* policy handle */
945 /* rid4.unknown - fail: 0030 success: 0x03ff */
946 DOM_RID4 rid4; /* rid and attributes */
948 uint32 status; /* return status - fail: 0xC000 0099: user exists */
950 } SAMR_R_UNKNOWN_32;
953 /* SAMR_Q_OPEN_ALIAS - probably an open */
954 typedef struct q_samr_open_alias_info
956 uint32 unknown_0; /* 0x0000 0008 */
957 uint32 rid_alias; /* rid */
959 } SAMR_Q_OPEN_ALIAS;
962 /* SAMR_R_OPEN_ALIAS - probably an open */
963 typedef struct r_samr_open_alias_info
965 POLICY_HND pol; /* policy handle */
966 uint32 status; /* return status */
968 } SAMR_R_OPEN_ALIAS;
971 /* SAMR_Q_CONNECT_ANON - probably an open */
972 typedef struct q_samr_connect_anon_info
974 uint32 ptr; /* ptr? */
975 uint16 unknown_0; /* 0x005c */
976 uint16 unknown_1; /* 0x0001 */
977 uint32 unknown_2; /* 0x0000 0020 */
979 } SAMR_Q_CONNECT_ANON;
981 /* SAMR_R_CONNECT_ANON - probably an open */
982 typedef struct r_samr_connect_anon_info
984 POLICY_HND connect_pol; /* policy handle */
985 uint32 status; /* return status */
987 } SAMR_R_CONNECT_ANON;
989 /* SAMR_Q_CONNECT - probably an open */
990 typedef struct q_samr_connect_info
992 uint32 ptr_srv_name; /* pointer (to server name?) */
993 UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */
995 uint32 unknown_0; /* 32 bit unknown */
997 } SAMR_Q_CONNECT;
1000 /* SAMR_R_CONNECT - probably an open */
1001 typedef struct r_samr_connect_info
1003 POLICY_HND connect_pol; /* policy handle */
1004 uint32 status; /* return status */
1006 } SAMR_R_CONNECT;
1008 /* SAMR_Q_UNKNOWN_38 */
1009 typedef struct q_samr_unknown_38
1011 uint32 ptr;
1012 UNIHDR hdr_srv_name;
1013 UNISTR2 uni_srv_name;
1015 } SAMR_Q_UNKNOWN_38;
1017 /* SAMR_R_UNKNOWN_38 */
1018 typedef struct r_samr_unknown_38
1020 uint16 unk_0;
1021 uint16 unk_1;
1022 uint16 unk_2;
1023 uint16 unk_3;
1025 } SAMR_R_UNKNOWN_38;
1027 /* SAMR_ENC_PASSWD */
1028 typedef struct enc_passwd_info
1030 uint32 ptr;
1031 uint8 pass[516];
1033 } SAMR_ENC_PASSWD;
1035 /* SAMR_ENC_HASH */
1036 typedef struct enc_hash_info
1038 uint32 ptr;
1039 uint8 hash[16];
1041 } SAMR_ENC_HASH;
1043 /* SAMR_Q_CHGPASSWD_USER */
1044 typedef struct q_samr_chgpasswd_user_info
1046 uint32 ptr_0;
1048 UNIHDR hdr_dest_host; /* server name unicode header */
1049 UNISTR2 uni_dest_host; /* server name unicode string */
1051 UNIHDR hdr_user_name; /* username unicode string header */
1052 UNISTR2 uni_user_name; /* username unicode string */
1054 SAMR_ENC_PASSWD nt_newpass;
1055 SAMR_ENC_HASH nt_oldhash;
1057 uint32 unknown; /* 0x0000 0001 */
1059 SAMR_ENC_PASSWD lm_newpass;
1060 SAMR_ENC_HASH lm_oldhash;
1062 } SAMR_Q_CHGPASSWD_USER;
1064 /* SAMR_R_CHGPASSWD_USER */
1065 typedef struct r_samr_chgpasswd_user_info
1067 uint32 status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1069 } SAMR_R_CHGPASSWD_USER;
1071 #endif /* _RPC_SAMR_H */