2 Unix SMB/Netbios implementation.
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 */
31 /*******************************************************************
32 the following information comes from a QuickView on samsrv.dll,
33 and gives an idea of exactly what is needed:
35 x SamrAddMemberToAlias
36 x SamrAddMemberToGroup
37 SamrAddMultipleMembersToAlias
38 x SamrChangePasswordUser
41 x SamrCreateAliasInDomain
42 x SamrCreateGroupInDomain
43 SamrCreateUserInDomain
47 x SamrEnumerateAliasesInDomain
48 SamrEnumerateDomainsInSamServer
49 x SamrEnumerateGroupsInDomain
50 x SamrEnumerateUsersInDomain
51 SamrGetUserDomainPasswordInformation
52 SamrLookupDomainInSamServer
53 ? SamrLookupIdsInDomain
54 x SamrLookupNamesInDomain
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
75 SamrTestPrivateFunctionsDomain
76 SamrTestPrivateFunctionsUser
78 ********************************************************************/
80 #define SAMR_CONNECT_ANON 0x00
81 #define SAMR_CLOSE_HND 0x01
83 #define SAMR_UNKNOWN_3 0x03
84 #define SAMR_OPEN_DOMAIN 0x07
86 #define SAMR_QUERY_DOMAIN_INFO 0x08
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
94 #define SAMR_LOOKUP_NAMES 0x11
95 #define SAMR_UNKNOWN_12 0x12
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_QUERY_GROUPMEM 0x19
103 #define SAMR_OPEN_ALIAS 0x1b
104 #define SAMR_QUERY_ALIASINFO 0x1c
105 #define SAMR_SET_ALIASINFO 0x1d
106 #define SAMR_DELETE_DOM_ALIAS 0x1e
107 #define SAMR_UNK_ALIAS 0x1f
108 #define SAMR_ADD_ALIASMEM 0x20
109 #define SAMR_QUERY_ALIASMEM 0x21
111 #define SAMR_OPEN_USER 0x22
113 #define SAMR_QUERY_USERINFO 0x24
114 #define SAMR_QUERY_USERGROUPS 0x27
115 #define SAMR_QUERY_DISPINFO 0x28
117 #define SAMR_UNKNOWN_2C 0x2c
118 #define SAMR_ENUM_DOM_GROUPS 0x30
119 #define SAMR_UNKNOWN_32 0x32
120 #define SAMR_UNKNOWN_34 0x34
122 #define SAMR_CHGPASSWD_USER 0x37
123 #define SAMR_UNKNOWN_38 0x38
125 #define SAMR_CONNECT 0x39
128 typedef struct logon_hours_info
130 uint32 len; /* normally 21 bytes */
135 /* SAM_USER_INFO_21 */
136 typedef struct sam_user_info_21
138 NTTIME logon_time; /* logon time */
139 NTTIME logoff_time; /* logoff time */
140 NTTIME kickoff_time; /* kickoff time */
141 NTTIME pass_last_set_time; /* password last set time */
142 NTTIME pass_can_change_time; /* password can change time */
143 NTTIME pass_must_change_time; /* password must change time */
145 UNIHDR hdr_user_name; /* username unicode string header */
146 UNIHDR hdr_full_name; /* user's full name unicode string header */
147 UNIHDR hdr_home_dir; /* home directory unicode string header */
148 UNIHDR hdr_dir_drive; /* home drive unicode string header */
149 UNIHDR hdr_logon_script; /* logon script unicode string header */
150 UNIHDR hdr_profile_path; /* profile path unicode string header */
151 UNIHDR hdr_acct_desc ; /* user description */
152 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
153 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
154 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
156 uint8 lm_pwd[16]; /* lm user passwords */
157 uint8 nt_pwd[16]; /* nt user passwords */
159 uint32 user_rid; /* Primary User ID */
160 uint32 group_rid; /* Primary Group ID */
162 uint16 acb_info; /* account info (ACB_xxxx bit-mask) */
165 uint32 unknown_3; /* 0x00ff ffff */
167 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
169 uint32 ptr_logon_hrs; /* unknown pointer */
171 uint32 unknown_5; /* 0x0002 0000 */
175 UNISTR2 uni_user_name; /* username unicode string */
176 UNISTR2 uni_full_name; /* user's full name unicode string */
177 UNISTR2 uni_home_dir; /* home directory unicode string */
178 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
179 UNISTR2 uni_logon_script; /* logon script unicode string */
180 UNISTR2 uni_profile_path; /* profile path unicode string */
181 UNISTR2 uni_acct_desc ; /* user description unicode string */
182 UNISTR2 uni_workstations; /* login from workstations unicode string */
183 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
184 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
186 uint32 unknown_6; /* 0x0000 04ec */
194 /* SAM_USER_INFO_11 */
195 typedef struct sam_user_info_11
197 uint8 padding_0[16]; /* 0 - padding 16 bytes */
198 NTTIME expiry; /* expiry time or something? */
199 uint8 padding_1[24]; /* 0 - padding 24 bytes */
201 UNIHDR hdr_mach_acct; /* unicode header for machine account */
202 uint32 padding_2; /* 0 - padding 4 bytes */
204 uint32 ptr_1; /* pointer */
205 uint8 padding_3[32]; /* 0 - padding 32 bytes */
206 uint32 padding_4; /* 0 - padding 4 bytes */
208 uint32 ptr_2; /* pointer */
209 uint32 padding_5; /* 0 - padding 4 bytes */
211 uint32 ptr_3; /* pointer */
212 uint8 padding_6[32]; /* 0 - padding 32 bytes */
214 uint32 rid_user; /* user RID */
215 uint32 rid_group; /* group RID */
217 uint16 acct_ctrl; /* 0080 - ACB_XXXX */
218 uint16 unknown_3; /* 16 bit padding */
220 uint16 unknown_4; /* 0x003f - 16 bit unknown */
221 uint16 unknown_5; /* 0x003c - 16 bit unknown */
223 uint8 padding_7[16]; /* 0 - padding 16 bytes */
224 uint32 padding_8; /* 0 - padding 4 bytes */
226 UNISTR2 uni_mach_acct; /* unicode string for machine account */
228 uint8 padding_9[48]; /* 0 - padding 48 bytes */
233 /* SAM_USER_INFO_10 */
234 typedef struct sam_user_info_10
242 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
243 typedef struct q_samr_close_hnd_info
245 POLICY_HND pol; /* policy handle */
250 /* SAMR_R_CLOSE_HND - probably a policy handle close */
251 typedef struct r_samr_close_hnd_info
253 POLICY_HND pol; /* policy handle */
254 uint32 status; /* return status */
259 /****************************************************************************
260 SAMR_Q_UNKNOWN_2C - a "set user info" occurs just after this
261 *****************************************************************************/
263 /* SAMR_Q_UNKNOWN_2C */
264 typedef struct q_samr_unknown_2c_info
266 POLICY_HND user_pol; /* policy handle */
271 /****************************************************************************
272 SAMR_R_UNKNOWN_2C - a "set user info" occurs just after this
273 *****************************************************************************/
275 /* SAMR_R_UNKNOWN_2C */
276 typedef struct r_samr_unknown_2c_info
278 uint32 unknown_0; /* 0x0016 0000 */
279 uint32 unknown_1; /* 0x0000 0000 */
285 /****************************************************************************
286 SAMR_Q_UNKNOWN_3 - info level 4. returns SIDs.
287 *****************************************************************************/
289 /* SAMR_Q_UNKNOWN_3 - probably get domain info... */
290 typedef struct q_samr_unknown_3_info
292 POLICY_HND user_pol; /* policy handle */
293 uint16 switch_value; /* 0x0000 0004 */
299 0x14 0x035b 0x0002 S-1-1
300 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
301 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ACCOUNT_OPS
302 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03f1
306 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03ee
307 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
308 0x14 0x035b 0x0002 S-1-1
311 /* DOM_SID3 - security id */
312 typedef struct sid_info_3
314 uint16 len; /* length, bytes, including length of len :-) */
322 #define MAX_SAM_SIDS 15
325 typedef struct sid_stuff_info
327 uint16 unknown_2; /* 0x0001 */
328 uint16 unknown_3; /* 0x8004 */
332 uint32 unknown_4; /* 0x0000 0014 */
333 uint32 unknown_5; /* 0x0000 0014 */
335 uint16 unknown_6; /* 0x0002 */
336 uint16 unknown_7; /* 0x5800 */
342 DOM_SID3 sid[MAX_SAM_SIDS];
346 /* SAMR_R_UNKNOWN_3 - probably an open */
347 typedef struct r_samr_unknown_3_info
350 uint32 sid_stuff_len0;
353 uint32 sid_stuff_len1;
355 SAM_SID_STUFF sid_stuff;
357 uint32 status; /* return status */
362 /****************************************************************************
363 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
364 *****************************************************************************/
366 /* SAMR_Q_QUERY_DOMAIN_INFO - */
367 typedef struct q_samr_query_domain_info
369 POLICY_HND domain_pol; /* policy handle */
370 uint16 switch_value; /* 0x0002 */
372 } SAMR_Q_QUERY_DOMAIN_INFO;
374 typedef struct sam_unkown_info_2_info
376 uint32 unknown_0; /* 0x0000 0000 */
377 uint32 unknown_1; /* 0x8000 0000 */
378 uint32 unknown_2; /* 0x0000 0000 */
380 uint32 ptr_0; /* pointer to unknown structure */
381 UNIHDR hdr_domain; /* domain name unicode header */
382 UNIHDR hdr_server; /* server name unicode header */
384 /* put all the data in here, at the moment, including what the above
385 pointer is referring to
388 uint32 seq_num; /* some sort of incrementing sequence number? */
389 uint32 unknown_3; /* 0x0000 0000 */
391 uint32 unknown_4; /* 0x0000 0001 */
392 uint32 unknown_5; /* 0x0000 0003 */
393 uint32 unknown_6; /* 0x0000 0001 */
394 uint32 num_domain_usrs; /* number of users in domain */
395 uint32 num_domain_grps; /* number of domain groups in domain */
396 uint32 num_local_grps; /* number of local groups in domain */
398 uint8 padding[12]; /* 12 bytes zeros */
400 UNISTR2 uni_domain; /* domain name unicode string */
401 UNISTR2 uni_server; /* server name unicode string */
406 typedef struct sam_unknown_ctr_info
417 /* SAMR_R_QUERY_DOMAIN_INFO - */
418 typedef struct r_samr_query_domain_info
421 uint16 switch_value; /* same as in query */
425 uint32 status; /* return status */
427 } SAMR_R_QUERY_DOMAIN_INFO;
430 /****************************************************************************
431 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
433 0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
434 0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
435 *****************************************************************************/
437 /* SAMR_Q_OPEN_DOMAIN */
438 typedef struct q_samr_open_domain_info
440 POLICY_HND connect_pol; /* policy handle */
441 uint32 rid; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - a RID? */
442 DOM_SID2 dom_sid; /* domain SID */
444 } SAMR_Q_OPEN_DOMAIN;
447 /* SAMR_R_OPEN_DOMAIN - probably an open */
448 typedef struct r_samr_open_domain_info
450 POLICY_HND domain_pol; /* policy handle associated with the SID */
451 uint32 status; /* return status */
453 } SAMR_R_OPEN_DOMAIN;
456 #define MAX_SAM_ENTRIES 250
458 typedef struct samr_entry_info
465 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
466 typedef struct q_samr_enum_dom_users_info
468 POLICY_HND pol; /* policy handle */
470 uint16 req_num_entries; /* number of values (0 indicates unlimited?) */
471 uint16 unknown_0; /* enumeration context? */
472 uint16 acb_mask; /* 0x0000 indicates all */
473 uint16 unknown_1; /* 0x0000 */
475 uint32 max_size; /* 0x0000 ffff */
477 } SAMR_Q_ENUM_DOM_USERS;
480 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
481 typedef struct r_samr_enum_dom_users_info
483 uint16 total_num_entries; /* number of entries that match without the acb mask */
484 uint16 unknown_0; /* same as unknown_0 (enum context?) in request */
485 uint32 ptr_entries1; /* actual number of entries to follow, having masked some out */
492 SAM_ENTRY sam[MAX_SAM_ENTRIES];
493 UNISTR2 uni_acct_name[MAX_SAM_ENTRIES];
499 } SAMR_R_ENUM_DOM_USERS;
502 typedef struct samr_entry_info3
514 typedef struct samr_str_entry_info3
516 UNISTR2 uni_grp_name;
517 UNISTR2 uni_grp_desc;
521 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
522 typedef struct q_samr_enum_dom_groups_info
524 POLICY_HND pol; /* policy handle */
526 /* these are possibly an enumeration context handle... */
527 uint16 switch_level; /* 0x0003 */
528 uint16 unknown_0; /* 0x0000 */
529 uint32 start_idx; /* presumably the start enumeration index */
530 uint32 unknown_1; /* 0x0000 07d0 */
532 uint32 max_size; /* 0x0000 7fff */
534 } SAMR_Q_ENUM_DOM_GROUPS;
537 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
538 typedef struct r_samr_enum_dom_groups_info
540 uint32 unknown_0; /* 0x0000 0492 or 0x0000 00be */
541 uint32 unknown_1; /* 0x0000 049a or 0x0000 00be */
542 uint32 switch_level; /* 0x0000 0003 */
549 SAM_ENTRY3 sam[MAX_SAM_ENTRIES];
550 SAM_STR3 str[MAX_SAM_ENTRIES];
554 } SAMR_R_ENUM_DOM_GROUPS;
558 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
559 typedef struct q_samr_enum_dom_aliases_info
561 POLICY_HND pol; /* policy handle */
563 /* this is possibly an enumeration context handle... */
564 uint32 unknown_0; /* 0x0000 0000 */
566 uint32 max_size; /* 0x0000 ffff */
568 } SAMR_Q_ENUM_DOM_ALIASES;
570 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
571 typedef struct r_samr_enum_dom_aliases_info
581 SAM_ENTRY sam[MAX_SAM_ENTRIES];
582 UNISTR2 uni_grp_name[MAX_SAM_ENTRIES];
588 } SAMR_R_ENUM_DOM_ALIASES;
592 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
593 typedef struct q_samr_query_disp_info
595 POLICY_HND pol; /* policy handle */
597 uint16 switch_level; /* 0x0001 and 0x0002 seen */
598 uint16 unknown_0; /* 0x0000 and 0x2000 seen */
599 uint32 start_idx; /* presumably the start enumeration index */
600 uint32 unknown_1; /* 0x0000 07d0, 0x0000 0400 and 0x0000 0200 seen */
602 uint32 max_size; /* 0x0000 7fff, 0x0000 7ffe and 0x0000 3fff seen*/
604 } SAMR_Q_QUERY_DISPINFO;
606 typedef struct samr_entry_info1
614 UNIHDR hdr_acct_name;
615 UNIHDR hdr_user_name;
616 UNIHDR hdr_user_desc;
620 typedef struct samr_str_entry_info1
622 UNISTR2 uni_acct_name;
623 UNISTR2 uni_full_name;
624 UNISTR2 uni_acct_desc;
628 typedef struct sam_entry_info_1
634 SAM_ENTRY1 sam[MAX_SAM_ENTRIES];
635 SAM_STR1 str[MAX_SAM_ENTRIES];
640 typedef struct samr_entry_info2
653 typedef struct samr_str_entry_info2
655 UNISTR2 uni_srv_name;
656 UNISTR2 uni_srv_desc;
660 typedef struct sam_entry_info_2
666 SAM_ENTRY2 sam[MAX_SAM_ENTRIES];
667 SAM_STR2 str[MAX_SAM_ENTRIES];
671 typedef struct sam_info_ctr_info
675 SAM_INFO_1 *info1; /* server info */
676 SAM_INFO_2 *info2; /* user info */
677 void *info; /* allows assignment without typecasting, */
683 /* SAMR_R_QUERY_DISPINFO - SAM rids, names and descriptions */
684 typedef struct r_samr_query_dispinfo_info
686 uint32 unknown_0; /* container length? 0x0000 0492 or 0x0000 00be */
687 uint32 unknown_1; /* container length? 0x0000 049a or 0x0000 00be */
688 uint16 switch_level; /* 0x0001 or 0x0002 */
695 } SAMR_R_QUERY_DISPINFO;
698 #define SAMR_CREATE_DOM_GROUP 0x0a
700 /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */
701 typedef struct q_samr_create_dom_group_info
703 POLICY_HND pol; /* policy handle */
705 UNIHDR hdr_acct_desc;
706 UNISTR2 uni_acct_desc;
708 uint16 unknown_1; /* 0x0002 */
709 uint16 unknown_2; /* 0x0001 */
711 } SAMR_Q_CREATE_DOM_GROUP;
713 /* SAMR_R_CREATE_DOM_GROUP - SAM create group */
714 typedef struct r_samr_create_dom_group_info
716 POLICY_HND pol; /* policy handle */
721 } SAMR_R_CREATE_DOM_GROUP;
723 /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */
724 typedef struct q_samr_query_group_info
726 POLICY_HND pol; /* policy handle */
728 uint16 switch_level; /* 0x0001 seen */
730 } SAMR_Q_QUERY_GROUPINFO;
732 typedef struct samr_group_info1
734 UNIHDR hdr_acct_name;
735 UNIHDR hdr_acct_desc;
737 uint32 unknown_1; /* 0x0000 0003 - number of group members? */
738 uint32 unknown_2; /* 0x0000 0001 - number of group members? */
740 UNISTR2 uni_acct_name;
741 UNISTR2 uni_acct_desc;
745 typedef struct samr_group_info4
747 UNIHDR hdr_acct_desc;
748 UNISTR2 uni_acct_desc;
752 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
753 typedef struct r_samr_query_groupinfo_info
756 uint16 switch_value; /* 0x0001 seen */
757 /* uint8[2] padding */
767 } SAMR_R_QUERY_GROUPINFO;
770 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
771 typedef struct q_samr_set_group_info
773 POLICY_HND pol; /* policy handle */
774 uint16 switch_value1; /* 0x0004 seen */
775 uint16 switch_value2; /* 0x0004 seen */
783 } SAMR_Q_SET_GROUPINFO;
785 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
786 typedef struct r_samr_set_group_info
790 } SAMR_R_SET_GROUPINFO;
793 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
794 typedef struct q_samr_delete_dom_alias_info
796 POLICY_HND alias_pol; /* policy handle */
798 } SAMR_Q_DELETE_DOM_ALIAS;
801 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
802 typedef struct r_samr_delete_dom_alias_info
804 POLICY_HND pol; /* policy handle */
805 uint32 status; /* return status */
807 } SAMR_R_DELETE_DOM_ALIAS;
810 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
811 typedef struct q_samr_create_dom_alias_info
813 POLICY_HND dom_pol; /* policy handle */
815 UNIHDR hdr_acct_desc;
816 UNISTR2 uni_acct_desc;
818 uint16 unknown_1; /* 0x001f */
819 uint16 unknown_2; /* 0x000f */
821 } SAMR_Q_CREATE_DOM_ALIAS;
823 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
824 typedef struct r_samr_create_dom_alias_info
826 POLICY_HND alias_pol; /* policy handle */
831 } SAMR_R_CREATE_DOM_ALIAS;
833 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
834 typedef struct q_samr_query_alias_info
836 POLICY_HND pol; /* policy handle */
838 uint16 switch_level; /* 0x0003 seen */
840 } SAMR_Q_QUERY_ALIASINFO;
842 typedef struct samr_alias_info3
844 UNIHDR hdr_acct_desc;
845 UNISTR2 uni_acct_desc;
850 typedef struct alias_info_ctr
862 /* SAMR_R_QUERY_ALIASINFO - SAM alias info */
863 typedef struct r_samr_query_aliasinfo_info
870 } SAMR_R_QUERY_ALIASINFO;
873 /* SAMR_Q_SET_ALIASINFO - SAM Alias Info */
874 typedef struct q_samr_set_alias_info
876 POLICY_HND alias_pol; /* policy handle */
879 } SAMR_Q_SET_ALIASINFO;
881 /* SAMR_R_SET_ALIASINFO - SAM alias info */
882 typedef struct r_samr_set_aliasinfo_info
886 } SAMR_R_SET_ALIASINFO;
889 /* SAMR_Q_QUERY_USERGROUPS - */
890 typedef struct q_samr_query_usergroup_info
892 POLICY_HND pol; /* policy handle associated with unknown id */
894 } SAMR_Q_QUERY_USERGROUPS;
896 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
897 typedef struct r_samr_query_usergroup_info
899 uint32 ptr_0; /* pointer */
900 uint32 num_entries; /* number of RID groups */
901 uint32 ptr_1; /* pointer */
902 uint32 num_entries2; /* number of RID groups */
904 DOM_GID *gid; /* group info */
906 uint32 status; /* return status */
908 } SAMR_R_QUERY_USERGROUPS;
911 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
912 typedef struct q_samr_query_user_info
914 POLICY_HND pol; /* policy handle associated with unknown id */
915 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
917 } SAMR_Q_QUERY_USERINFO;
919 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
920 typedef struct r_samr_query_user_info
922 uint32 ptr; /* pointer */
923 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - same as in query */
924 /* uint8[2] padding. */
928 SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
929 SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
930 SAM_USER_INFO_21 *id21; /* auth-level 21 */
931 void* id; /* to make typecasting easy */
935 uint32 status; /* return status */
937 } SAMR_R_QUERY_USERINFO;
940 /****************************************************************************
941 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
943 the policy handle allocated by an "samr open secret" call is associated
944 with a SID. this policy handle is what is queried here, *not* the SID
945 itself. the response to the lookup rids is relative to this SID.
946 *****************************************************************************/
947 /* SAMR_Q_QUERY_USERALIASES */
948 typedef struct q_samr_query_useraliases_info
950 POLICY_HND pol; /* policy handle */
952 uint32 num_sids1; /* number of rids being looked up */
953 uint32 ptr; /* buffer pointer */
954 uint32 num_sids2; /* number of rids being looked up */
956 uint32 ptr_sid[MAX_LOOKUP_SIDS]; /* pointers to sids to be looked up */
957 DOM_SID2 sid [MAX_LOOKUP_SIDS]; /* sids to be looked up. */
959 } SAMR_Q_QUERY_USERALIASES;
962 /* SAMR_R_QUERY_USERALIASES */
963 typedef struct r_samr_query_useraliases_info
966 uint32 ptr; /* undocumented buffer pointer */
969 uint32 *rid; /* domain RIDs being looked up */
971 uint32 status; /* return code */
973 } SAMR_R_QUERY_USERALIASES;
976 /****************************************************************************
977 SAMR_Q_LOOKUP_NAMES - do a conversion from SID to RID.
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_LOOKUP_NAMES */
984 typedef struct q_samr_lookup_names_info
986 POLICY_HND pol; /* policy handle */
988 uint32 num_rids1; /* number of rids being looked up */
989 uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */
990 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
991 uint32 num_rids2; /* number of rids being looked up */
993 UNIHDR hdr_user_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
994 UNISTR2 uni_user_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
996 } SAMR_Q_LOOKUP_NAMES;
999 /* SAMR_R_LOOKUP_NAMES */
1000 typedef struct r_samr_lookup_names_info
1003 uint32 undoc_buffer; /* undocumented buffer pointer */
1005 uint32 num_entries2;
1006 DOM_RID3 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
1008 uint32 num_entries3;
1010 uint32 status; /* return code */
1012 } SAMR_R_LOOKUP_NAMES;
1015 /****************************************************************************
1016 SAMR_Q_UNKNOWN_12 - do a conversion from RID groups to something.
1018 called to resolve domain RID groups.
1019 *****************************************************************************/
1020 /* SAMR_Q_UNKNOWN_12 */
1021 typedef struct q_samr_unknown_12_info
1023 POLICY_HND pol; /* policy handle */
1025 uint32 num_gids1; /* number of rids being looked up */
1026 uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */
1027 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1028 uint32 num_gids2; /* number of rids being looked up */
1030 uint32 gid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
1032 } SAMR_Q_UNKNOWN_12;
1035 /****************************************************************************
1036 SAMR_R_UNKNOWN_12 - do a conversion from group RID to names
1038 *****************************************************************************/
1039 /* SAMR_R_UNKNOWN_12 */
1040 typedef struct r_samr_unknown_12_info
1042 POLICY_HND pol; /* policy handle */
1044 uint32 num_aliases1; /* number of aliases being looked up */
1045 uint32 ptr_aliases; /* pointer to aliases */
1046 uint32 num_aliases2; /* number of aliases being looked up */
1048 UNIHDR hdr_als_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
1049 UNISTR2 uni_als_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
1051 uint32 num_als_usrs1; /* number of users in aliases being looked up */
1052 uint32 ptr_als_usrs; /* pointer to users in aliases */
1053 uint32 num_als_usrs2; /* number of users in aliases being looked up */
1055 uint32 num_als_usrs[MAX_LOOKUP_SIDS]; /* number of users per group */
1059 } SAMR_R_UNKNOWN_12;
1062 /* SAMR_Q_OPEN_USER - probably an open */
1063 typedef struct q_samr_open_user_info
1065 POLICY_HND domain_pol; /* policy handle */
1066 uint32 unknown_0; /* 32 bit unknown - 0x02011b */
1067 uint32 user_rid; /* user RID */
1072 /* SAMR_R_OPEN_USER - probably an open */
1073 typedef struct r_samr_open_user_info
1075 POLICY_HND user_pol; /* policy handle associated with unknown id */
1076 uint32 status; /* return status */
1082 /* SAMR_Q_UNKNOWN_32 - probably a "create SAM entry" */
1083 typedef struct q_samr_unknown_32_info
1085 POLICY_HND pol; /* policy handle */
1087 UNIHDR hdr_mach_acct; /* unicode machine account name header */
1088 UNISTR2 uni_mach_acct; /* unicode machine account name */
1090 uint32 acct_ctrl; /* 32 bit ACB_XXXX */
1091 uint16 unknown_1; /* 16 bit unknown - 0x00B0 */
1092 uint16 unknown_2; /* 16 bit unknown - 0xe005 */
1094 } SAMR_Q_UNKNOWN_32;
1097 /* SAMR_R_UNKNOWN_32 - probably a "create SAM entry" */
1098 typedef struct r_samr_unknown_32_info
1100 POLICY_HND pol; /* policy handle */
1102 /* rid4.unknown - fail: 0030 success: 0x03ff */
1103 DOM_RID4 rid4; /* rid and attributes */
1105 uint32 status; /* return status - fail: 0xC000 0099: user exists */
1107 } SAMR_R_UNKNOWN_32;
1110 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
1111 typedef struct q_samr_add_group_mem_info
1113 POLICY_HND pol; /* policy handle */
1115 uint32 rid; /* rid */
1116 uint32 unknown; /* 0x0000 0005 */
1118 } SAMR_Q_ADD_GROUPMEM;
1121 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
1122 typedef struct r_samr_add_group_mem_info
1124 uint32 status; /* return status */
1126 } SAMR_R_ADD_GROUPMEM;
1129 /* SAMR_Q_OPEN_GROUP - probably an open */
1130 typedef struct q_samr_open_group_info
1132 POLICY_HND domain_pol; /* policy handle */
1133 uint32 unknown; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
1134 uint32 rid_group; /* rid */
1136 } SAMR_Q_OPEN_GROUP;
1139 /* SAMR_R_OPEN_GROUP - probably an open */
1140 typedef struct r_samr_open_group_info
1142 POLICY_HND pol; /* policy handle */
1143 uint32 status; /* return status */
1145 } SAMR_R_OPEN_GROUP;
1148 /* SAMR_Q_UNKNOWN_21 - probably an open group in domain */
1149 typedef struct q_samr_unknown_21_info
1151 POLICY_HND group_pol; /* policy handle */
1153 uint16 unknown_1; /* 16 bit unknown - 0x0477 */
1154 uint16 unknown_2; /* 16 bit unknown - 0x0000 */
1156 } SAMR_Q_UNKNOWN_21;
1159 /* SAMR_Q_UNK_ALIASMEM - don't know! */
1160 typedef struct q_samr_unk_alias_mem_info
1162 POLICY_HND alias_pol; /* policy handle */
1164 DOM_SID sid; /* member sid to be "something"ed to do with the alias */
1166 } SAMR_Q_UNK_ALIASMEM;
1169 /* SAMR_R_UNK_ALIASMEM - probably an open */
1170 typedef struct r_samr_unk_alias_mem_info
1172 uint32 status; /* return status */
1174 } SAMR_R_UNK_ALIASMEM;
1177 /* SAMR_Q_ADD_ALIASMEM - probably an add member */
1178 typedef struct q_samr_add_alias_mem_info
1180 POLICY_HND alias_pol; /* policy handle */
1182 DOM_SID sid; /* member sid to be added to alias */
1184 } SAMR_Q_ADD_ALIASMEM;
1187 /* SAMR_R_ADD_ALIASMEM - probably an open */
1188 typedef struct r_samr_add_alias_mem_info
1190 uint32 status; /* return status */
1192 } SAMR_R_ADD_ALIASMEM;
1196 /* SAMR_Q_OPEN_ALIAS - probably an open */
1197 typedef struct q_samr_open_alias_info
1199 uint32 unknown_0; /* 0x0000 0008 */
1200 uint32 rid_alias; /* rid */
1202 } SAMR_Q_OPEN_ALIAS;
1205 /* SAMR_R_OPEN_ALIAS - probably an open */
1206 typedef struct r_samr_open_alias_info
1208 POLICY_HND pol; /* policy handle */
1209 uint32 status; /* return status */
1211 } SAMR_R_OPEN_ALIAS;
1214 /* SAMR_Q_CONNECT_ANON - probably an open */
1215 typedef struct q_samr_connect_anon_info
1217 uint32 ptr; /* ptr? */
1218 uint16 unknown_0; /* 0x005c */
1219 uint16 unknown_1; /* 0x0001 */
1220 uint32 unknown_2; /* 0x0000 0020 */
1222 } SAMR_Q_CONNECT_ANON;
1224 /* SAMR_R_CONNECT_ANON - probably an open */
1225 typedef struct r_samr_connect_anon_info
1227 POLICY_HND connect_pol; /* policy handle */
1228 uint32 status; /* return status */
1230 } SAMR_R_CONNECT_ANON;
1232 /* SAMR_Q_CONNECT - probably an open */
1233 typedef struct q_samr_connect_info
1235 uint32 ptr_srv_name; /* pointer (to server name?) */
1236 UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */
1238 uint32 unknown_0; /* 32 bit unknown */
1243 /* SAMR_R_CONNECT - probably an open */
1244 typedef struct r_samr_connect_info
1246 POLICY_HND connect_pol; /* policy handle */
1247 uint32 status; /* return status */
1251 /* SAMR_Q_UNKNOWN_38 */
1252 typedef struct q_samr_unknown_38
1255 UNIHDR hdr_srv_name;
1256 UNISTR2 uni_srv_name;
1258 } SAMR_Q_UNKNOWN_38;
1260 /* SAMR_R_UNKNOWN_38 */
1261 typedef struct r_samr_unknown_38
1268 } SAMR_R_UNKNOWN_38;
1270 /* SAMR_ENC_PASSWD */
1271 typedef struct enc_passwd_info
1279 typedef struct enc_hash_info
1286 /* SAMR_Q_CHGPASSWD_USER */
1287 typedef struct q_samr_chgpasswd_user_info
1291 UNIHDR hdr_dest_host; /* server name unicode header */
1292 UNISTR2 uni_dest_host; /* server name unicode string */
1294 UNIHDR hdr_user_name; /* username unicode string header */
1295 UNISTR2 uni_user_name; /* username unicode string */
1297 SAMR_ENC_PASSWD nt_newpass;
1298 SAMR_ENC_HASH nt_oldhash;
1300 uint32 unknown; /* 0x0000 0001 */
1302 SAMR_ENC_PASSWD lm_newpass;
1303 SAMR_ENC_HASH lm_oldhash;
1305 } SAMR_Q_CHGPASSWD_USER;
1307 /* SAMR_R_CHGPASSWD_USER */
1308 typedef struct r_samr_chgpasswd_user_info
1310 uint32 status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1312 } SAMR_R_CHGPASSWD_USER;
1314 #endif /* _RPC_SAMR_H */