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:
37 SamrAddMultipleMembersToAlias
38 SamrChangePasswordUser
41 SamrCreateAliasInDomain
42 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 SamrSetInformationAlias
69 SamrSetInformationDomain
70 SamrSetInformationGroup
71 SamrSetInformationUser
72 SamrSetMemberAttributesOfGroup
75 SamrTestPrivateFunctionsDomain
76 SamrTestPrivateFunctionsUser
78 ********************************************************************/
80 #define SAMR_CLOSE_HND 0x01
81 #define SAMR_LOOKUP_DOMAIN 0x05
82 #define SAMR_ENUM_DOMAINS 0x06
83 #define SAMR_OPEN_DOMAIN 0x07
84 #define SAMR_QUERY_DOMAIN_INFO 0x08
85 #define SAMR_LOOKUP_IDS 0x10
86 #define SAMR_LOOKUP_NAMES 0x11
87 #define SAMR_UNKNOWN_3 0x03
88 #define SAMR_QUERY_DISPINFO 0x28
89 #define SAMR_OPEN_USER 0x22
90 #define SAMR_QUERY_USERINFO 0x24
91 #define SAMR_QUERY_USERGROUPS 0x27
92 #define SAMR_UNKNOWN_12 0x12
93 #define SAMR_UNKNOWN_21 0x21
94 #define SAMR_UNKNOWN_2C 0x2c
95 #define SAMR_UNKNOWN_32 0x32
96 #define SAMR_UNKNOWN_34 0x34
97 #define SAMR_CHGPASSWD_USER 0x37
98 #define SAMR_UNKNOWN_38 0x38
99 #define SAMR_CONNECT 0x39
100 #define SAMR_CONNECT_ANON 0x00
101 #define SAMR_OPEN_ALIAS 0x1b
102 #define SAMR_QUERY_ALIASINFO 0x1c
103 #define SAMR_ENUM_DOM_USERS 0x0d
104 #define SAMR_ENUM_DOM_ALIASES 0x0f
105 #define SAMR_ENUM_DOM_GROUPS 0x30
108 typedef struct logon_hours_info
110 uint32 len; /* normally 21 bytes */
115 /* SAM_USER_INFO_21 */
116 typedef struct sam_user_info_21
118 NTTIME logon_time; /* logon time */
119 NTTIME logoff_time; /* logoff time */
120 NTTIME kickoff_time; /* kickoff time */
121 NTTIME pass_last_set_time; /* password last set time */
122 NTTIME pass_can_change_time; /* password can change time */
123 NTTIME pass_must_change_time; /* password must change time */
125 UNIHDR hdr_user_name; /* username unicode string header */
126 UNIHDR hdr_full_name; /* user's full name unicode string header */
127 UNIHDR hdr_home_dir; /* home directory unicode string header */
128 UNIHDR hdr_dir_drive; /* home drive unicode string header */
129 UNIHDR hdr_logon_script; /* logon script unicode string header */
130 UNIHDR hdr_profile_path; /* profile path unicode string header */
131 UNIHDR hdr_acct_desc ; /* user description */
132 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
133 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
134 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
136 uint8 lm_pwd[16]; /* lm user passwords */
137 uint8 nt_pwd[16]; /* nt user passwords */
139 uint32 user_rid; /* Primary User ID */
140 uint32 group_rid; /* Primary Group ID */
142 uint16 acb_info; /* account info (ACB_xxxx bit-mask) */
145 uint32 unknown_3; /* 0x00ff ffff */
147 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
149 uint32 ptr_logon_hrs; /* unknown pointer */
151 uint32 unknown_5; /* 0x0002 0000 */
155 UNISTR2 uni_user_name; /* username unicode string */
156 UNISTR2 uni_full_name; /* user's full name unicode string */
157 UNISTR2 uni_home_dir; /* home directory unicode string */
158 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
159 UNISTR2 uni_logon_script; /* logon script unicode string */
160 UNISTR2 uni_profile_path; /* profile path unicode string */
161 UNISTR2 uni_acct_desc ; /* user description unicode string */
162 UNISTR2 uni_workstations; /* login from workstations unicode string */
163 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
164 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
166 uint32 unknown_6; /* 0x0000 04ec */
174 /* SAM_USER_INFO_11 */
175 typedef struct sam_user_info_11
177 uint8 padding_0[16]; /* 0 - padding 16 bytes */
178 NTTIME expiry; /* expiry time or something? */
179 uint8 padding_1[24]; /* 0 - padding 24 bytes */
181 UNIHDR hdr_mach_acct; /* unicode header for machine account */
182 uint32 padding_2; /* 0 - padding 4 bytes */
184 uint32 ptr_1; /* pointer */
185 uint8 padding_3[32]; /* 0 - padding 32 bytes */
186 uint32 padding_4; /* 0 - padding 4 bytes */
188 uint32 ptr_2; /* pointer */
189 uint32 padding_5; /* 0 - padding 4 bytes */
191 uint32 ptr_3; /* pointer */
192 uint8 padding_6[32]; /* 0 - padding 32 bytes */
194 uint32 rid_user; /* user RID */
195 uint32 rid_group; /* group RID */
197 uint16 acct_ctrl; /* 0080 - ACB_XXXX */
198 uint16 unknown_3; /* 16 bit padding */
200 uint16 unknown_4; /* 0x003f - 16 bit unknown */
201 uint16 unknown_5; /* 0x003c - 16 bit unknown */
203 uint8 padding_7[16]; /* 0 - padding 16 bytes */
204 uint32 padding_8; /* 0 - padding 4 bytes */
206 UNISTR2 uni_mach_acct; /* unicode string for machine account */
208 uint8 padding_9[48]; /* 0 - padding 48 bytes */
213 /* SAM_USER_INFO_10 */
214 typedef struct sam_user_info_10
222 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
223 typedef struct q_samr_close_hnd_info
225 POLICY_HND pol; /* policy handle */
230 /* SAMR_R_CLOSE_HND - probably a policy handle close */
231 typedef struct r_samr_close_hnd_info
233 POLICY_HND pol; /* policy handle */
234 uint32 status; /* return status */
239 /****************************************************************************
240 SAMR_Q_UNKNOWN_2C - a "set user info" occurs just after this
241 *****************************************************************************/
243 /* SAMR_Q_UNKNOWN_2C */
244 typedef struct q_samr_unknown_2c_info
246 POLICY_HND user_pol; /* policy handle */
251 /****************************************************************************
252 SAMR_R_UNKNOWN_2C - a "set user info" occurs just after this
253 *****************************************************************************/
255 /* SAMR_R_UNKNOWN_2C */
256 typedef struct r_samr_unknown_2c_info
258 uint32 unknown_0; /* 0x0016 0000 */
259 uint32 unknown_1; /* 0x0000 0000 */
265 /****************************************************************************
266 SAMR_Q_UNKNOWN_3 - info level 4. returns SIDs.
267 *****************************************************************************/
269 /* SAMR_Q_UNKNOWN_3 - probably get domain info... */
270 typedef struct q_samr_unknown_3_info
272 POLICY_HND user_pol; /* policy handle */
273 uint16 switch_value; /* 0x0000 0004 */
279 0x14 0x035b 0x0002 S-1-1
280 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
281 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ACCOUNT_OPS
282 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03f1
286 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03ee
287 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
288 0x14 0x035b 0x0002 S-1-1
291 /* DOM_SID3 - security id */
292 typedef struct sid_info_3
294 uint16 len; /* length, bytes, including length of len :-) */
302 #define MAX_SAM_SIDS 15
305 typedef struct sid_stuff_info
307 uint16 unknown_2; /* 0x0001 */
308 uint16 unknown_3; /* 0x8004 */
312 uint32 unknown_4; /* 0x0000 0014 */
313 uint32 unknown_5; /* 0x0000 0014 */
315 uint16 unknown_6; /* 0x0002 */
316 uint16 unknown_7; /* 0x5800 */
322 DOM_SID3 sid[MAX_SAM_SIDS];
326 /* SAMR_R_UNKNOWN_3 - probably an open */
327 typedef struct r_samr_unknown_3_info
330 uint32 sid_stuff_len0;
333 uint32 sid_stuff_len1;
335 SAM_SID_STUFF sid_stuff;
337 uint32 status; /* return status */
342 /****************************************************************************
343 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
344 *****************************************************************************/
346 /* SAMR_Q_QUERY_DOMAIN_INFO - */
347 typedef struct q_samr_query_domain_info
349 POLICY_HND domain_pol; /* policy handle */
350 uint16 switch_value; /* 0x0002 */
352 } SAMR_Q_QUERY_DOMAIN_INFO;
354 typedef struct sam_unkown_info_2_info
356 uint32 unknown_0; /* 0x0000 0000 */
357 uint32 unknown_1; /* 0x8000 0000 */
358 uint32 unknown_2; /* 0x0000 0000 */
360 uint32 ptr_0; /* pointer to unknown structure */
361 UNIHDR hdr_domain; /* domain name unicode header */
362 UNIHDR hdr_server; /* server name unicode header */
364 /* put all the data in here, at the moment, including what the above
365 pointer is referring to
368 uint32 seq_num; /* some sort of incrementing sequence number? */
369 uint32 unknown_3; /* 0x0000 0000 */
371 uint32 unknown_4; /* 0x0000 0001 */
372 uint32 unknown_5; /* 0x0000 0003 */
373 uint32 unknown_6; /* 0x0000 0001 */
374 uint32 num_domain_usrs; /* number of users in domain */
375 uint32 num_domain_grps; /* number of domain groups in domain */
376 uint32 num_local_grps; /* number of local groups in domain */
378 uint8 padding[12]; /* 12 bytes zeros */
380 UNISTR2 uni_domain; /* domain name unicode string */
381 UNISTR2 uni_server; /* server name unicode string */
386 typedef struct sam_unknown_ctr_info
397 /* SAMR_R_QUERY_DOMAIN_INFO - */
398 typedef struct r_samr_query_domain_info
401 uint16 switch_value; /* same as in query */
405 uint32 status; /* return status */
407 } SAMR_R_QUERY_DOMAIN_INFO;
410 /****************************************************************************
411 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
413 0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
414 0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
415 *****************************************************************************/
417 /* SAMR_Q_OPEN_DOMAIN */
418 typedef struct q_samr_open_domain_info
420 POLICY_HND connect_pol; /* policy handle */
421 uint32 rid; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - a RID? */
422 DOM_SID2 dom_sid; /* domain SID */
424 } SAMR_Q_OPEN_DOMAIN;
427 /* SAMR_R_OPEN_DOMAIN - probably an open */
428 typedef struct r_samr_open_domain_info
430 POLICY_HND domain_pol; /* policy handle associated with the SID */
431 uint32 status; /* return status */
433 } SAMR_R_OPEN_DOMAIN;
436 #define MAX_SAM_ENTRIES 600
438 typedef struct samr_entry_info
445 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
446 typedef struct q_samr_enum_dom_users_info
448 POLICY_HND pol; /* policy handle */
450 uint16 req_num_entries; /* number of values (0 indicates unlimited?) */
451 uint16 unknown_0; /* enumeration context? */
452 uint16 acb_mask; /* 0x0000 indicates all */
453 uint16 unknown_1; /* 0x0000 */
455 uint32 max_size; /* 0x0000 ffff */
457 } SAMR_Q_ENUM_DOM_USERS;
460 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
461 typedef struct r_samr_enum_dom_users_info
463 uint16 total_num_entries; /* number of entries that match without the acb mask */
464 uint16 unknown_0; /* same as unknown_0 (enum context?) in request */
465 uint32 ptr_entries1; /* actual number of entries to follow, having masked some out */
472 SAM_ENTRY sam[MAX_SAM_ENTRIES];
473 UNISTR2 uni_acct_name[MAX_SAM_ENTRIES];
479 } SAMR_R_ENUM_DOM_USERS;
482 typedef struct samr_entry_info3
494 typedef struct samr_str_entry_info3
496 UNISTR2 uni_grp_name;
497 UNISTR2 uni_grp_desc;
501 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
502 typedef struct q_samr_enum_dom_groups_info
504 POLICY_HND pol; /* policy handle */
506 /* these are possibly an enumeration context handle... */
507 uint16 switch_level; /* 0x0003 */
508 uint16 unknown_0; /* 0x0000 */
509 uint32 start_idx; /* presumably the start enumeration index */
510 uint32 unknown_1; /* 0x0000 07d0 */
512 uint32 max_size; /* 0x0000 7fff */
514 } SAMR_Q_ENUM_DOM_GROUPS;
517 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
518 typedef struct r_samr_enum_dom_groups_info
520 uint32 unknown_0; /* 0x0000 0492 or 0x0000 00be */
521 uint32 unknown_1; /* 0x0000 049a or 0x0000 00be */
522 uint32 switch_level; /* 0x0000 0003 */
529 SAM_ENTRY3 sam[MAX_SAM_ENTRIES];
530 SAM_STR3 str[MAX_SAM_ENTRIES];
534 } SAMR_R_ENUM_DOM_GROUPS;
538 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
539 typedef struct q_samr_enum_dom_aliases_info
541 POLICY_HND pol; /* policy handle */
543 /* this is possibly an enumeration context handle... */
544 uint32 unknown_0; /* 0x0000 0000 */
546 uint32 max_size; /* 0x0000 ffff */
548 } SAMR_Q_ENUM_DOM_ALIASES;
550 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
551 typedef struct r_samr_enum_dom_aliases_info
561 SAM_ENTRY sam[MAX_SAM_ENTRIES];
562 UNISTR2 uni_grp_name[MAX_SAM_ENTRIES];
568 } SAMR_R_ENUM_DOM_ALIASES;
570 /***************************************************************************
571 SAMR_Q_LOOKUP_DOMAIN - obtain SID for a local domain
572 ***************************************************************************/
573 typedef struct q_samr_lookup_domain_info
575 POLICY_HND connect_pol;
580 } SAMR_Q_LOOKUP_DOMAIN;
582 /* SAMR_R_LOOKUP_DOMAIN */
583 typedef struct r_samr_lookup_domain_info
590 } SAMR_R_LOOKUP_DOMAIN;
592 /**********************************************************************
593 SAMR_Q_ENUM_DOMAINS - SAM rids and names
594 **********************************************************************/
595 typedef struct q_samr_enum_domains_info
597 POLICY_HND pol; /* policy handle */
599 uint32 start_idx; /* enumeration handle */
600 uint32 max_size; /* 0x0000 ffff */
602 } SAMR_Q_ENUM_DOMAINS;
604 /* SAMR_R_ENUM_DOMAINS - SAM rids and Domain names */
605 typedef struct r_samr_enum_domains_info
607 uint32 next_idx; /* next starting index required for enum */
616 UNISTR2 *uni_dom_name;
622 } SAMR_R_ENUM_DOMAINS;
625 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
626 typedef struct q_samr_query_disp_info
628 POLICY_HND pol; /* policy handle */
630 uint16 switch_level; /* 0x0001 and 0x0002 seen */
631 uint32 start_idx; /* presumably the start enumeration index */
632 uint32 max_entries; /* 0x0000 07d0, 0x0000 0400 and 0x0000 0200 seen */
634 uint32 max_size; /* 0x0000 7fff, 0x0000 7ffe and 0x0000 3fff seen*/
636 } SAMR_Q_QUERY_DISPINFO;
638 typedef struct samr_entry_info1
646 UNIHDR hdr_acct_name;
647 UNIHDR hdr_user_name;
648 UNIHDR hdr_user_desc;
652 typedef struct samr_str_entry_info1
654 UNISTR2 uni_acct_name;
655 UNISTR2 uni_full_name;
656 UNISTR2 uni_acct_desc;
660 typedef struct sam_entry_info_1
666 SAM_ENTRY1 sam[MAX_SAM_ENTRIES];
667 SAM_STR1 str[MAX_SAM_ENTRIES];
672 typedef struct samr_entry_info2
685 typedef struct samr_str_entry_info2
687 UNISTR2 uni_srv_name;
688 UNISTR2 uni_srv_desc;
692 typedef struct sam_entry_info_2
698 SAM_ENTRY2 sam[MAX_SAM_ENTRIES];
699 SAM_STR2 str[MAX_SAM_ENTRIES];
703 typedef struct sam_info_ctr_info
707 SAM_INFO_1 *info1; /* server info */
708 SAM_INFO_2 *info2; /* user info */
709 void *info; /* allows assignment without typecasting, */
715 /* SAMR_R_QUERY_DISPINFO - SAM rids, names and descriptions */
716 typedef struct r_samr_query_dispinfo_info
718 uint32 unknown_0; /* container length? 0x0000 0492 or 0x0000 00be */
719 uint32 unknown_1; /* container length? 0x0000 049a or 0x0000 00be */
720 uint16 switch_level; /* 0x0001 or 0x0002 */
727 } SAMR_R_QUERY_DISPINFO;
731 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
732 typedef struct q_samr_enum_alias_info
734 POLICY_HND pol; /* policy handle */
736 uint16 switch_level; /* 0x0003 seen (0x0001 seen from NT5) */
738 } SAMR_Q_QUERY_ALIASINFO;
740 typedef struct samr_alias_info1
742 uint32 switch_value_1;
743 UNIHDR hdr_alias_name;
744 UNISTR2 uni_alias_name;
745 UNIHDR hdr_alias_desc;
746 UNISTR2 uni_alias_desc;
749 typedef struct samr_alias_info3
751 UNIHDR hdr_acct_desc;
752 UNISTR2 uni_acct_desc;
756 /* SAMR_R_QUERY_ALIASINFO - SAM rids, names and descriptions */
757 typedef struct r_samr_query_aliasinfo_info
760 uint16 switch_value; /* 0x0003 */
761 /* uint8[2] padding */
772 } SAMR_R_QUERY_ALIASINFO;
775 /* SAMR_Q_QUERY_USERGROUPS - */
776 typedef struct q_samr_query_usergroup_info
778 POLICY_HND pol; /* policy handle associated with unknown id */
780 } SAMR_Q_QUERY_USERGROUPS;
782 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
783 typedef struct r_samr_query_usergroup_info
785 uint32 ptr_0; /* pointer */
786 uint32 num_entries; /* number of RID groups */
787 uint32 ptr_1; /* pointer */
788 uint32 num_entries2; /* number of RID groups */
790 DOM_GID *gid; /* group info */
792 uint32 status; /* return status */
794 } SAMR_R_QUERY_USERGROUPS;
797 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
798 typedef struct q_samr_query_user_info
800 POLICY_HND pol; /* policy handle associated with unknown id */
801 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
803 } SAMR_Q_QUERY_USERINFO;
805 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
806 typedef struct r_samr_query_user_info
808 uint32 ptr; /* pointer */
809 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - same as in query */
810 /* uint8[2] padding. */
814 SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
815 SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
816 SAM_USER_INFO_21 *id21; /* auth-level 21 */
817 void* id; /* to make typecasting easy */
821 uint32 status; /* return status */
823 } SAMR_R_QUERY_USERINFO;
826 /****************************************************************************
827 SAMR_Q_LOOKUP_IDS - do a conversion from name to RID.
829 the policy handle allocated by an "samr open secret" call is associated
830 with a SID. this policy handle is what is queried here, *not* the SID
831 itself. the response to the lookup rids is relative to this SID.
832 *****************************************************************************/
833 /* SAMR_Q_LOOKUP_IDS */
834 typedef struct q_samr_lookup_ids_info
836 POLICY_HND pol; /* policy handle */
838 uint32 num_sids1; /* number of rids being looked up */
839 uint32 ptr; /* buffer pointer */
840 uint32 num_sids2; /* number of rids being looked up */
842 uint32 ptr_sid[MAX_LOOKUP_SIDS]; /* pointers to sids to be looked up */
843 DOM_SID2 sid [MAX_LOOKUP_SIDS]; /* sids to be looked up. */
848 /* SAMR_R_LOOKUP_IDS */
849 typedef struct r_samr_lookup_ids_info
852 uint32 ptr; /* undocumented buffer pointer */
855 uint32 rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
857 uint32 status; /* return code */
861 /****************************************************************************
862 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
863 *****************************************************************************/
864 /* SAMR_Q_LOOKUP_NAMES */
865 typedef struct q_samr_lookup_names_info
867 POLICY_HND pol; /* policy handle */
869 uint32 num_names1; /* number of names being looked up */
870 uint32 flags; /* 0x0000 03e8 - unknown */
871 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
872 uint32 num_names2; /* number of names being looked up */
874 UNIHDR hdr_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
875 UNISTR2 uni_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
877 } SAMR_Q_LOOKUP_NAMES;
879 /* SAMR_R_LOOKUP_NAMES */
880 typedef struct r_samr_lookup_names_info
882 uint32 num_rids1; /* number of aliases being looked up */
883 uint32 ptr_rids; /* pointer to aliases */
884 uint32 num_rids2; /* number of aliases being looked up */
886 uint32 rid[MAX_LOOKUP_SIDS]; /* rids */
888 uint32 num_types1; /* number of users in aliases being looked up */
889 uint32 ptr_types; /* pointer to users in aliases */
890 uint32 num_types2; /* number of users in aliases being looked up */
892 uint32 type[MAX_LOOKUP_SIDS]; /* SID_ENUM type */
894 uint32 status; /* return code */
896 } SAMR_R_LOOKUP_NAMES;
898 /****************************************************************************
899 SAMR_Q_UNKNOWN_12 - do a conversion from RID groups to something.
901 called to resolve domain RID groups.
902 *****************************************************************************/
903 /* SAMR_Q_UNKNOWN_12 */
904 typedef struct q_samr_unknown_12_info
906 POLICY_HND pol; /* policy handle */
908 uint32 num_gids1; /* number of rids being looked up */
909 uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */
910 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
911 uint32 num_gids2; /* number of rids being looked up */
913 uint32 gid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
918 /****************************************************************************
919 SAMR_R_UNKNOWN_12 - do a conversion from group RID to names
921 *****************************************************************************/
922 /* SAMR_R_UNKNOWN_12 */
923 typedef struct r_samr_unknown_12_info
925 POLICY_HND pol; /* policy handle */
927 uint32 num_aliases1; /* number of aliases being looked up */
928 uint32 ptr_aliases; /* pointer to aliases */
929 uint32 num_aliases2; /* number of aliases being looked up */
931 UNIHDR hdr_als_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
932 UNISTR2 uni_als_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
934 uint32 num_als_usrs1; /* number of users in aliases being looked up */
935 uint32 ptr_als_usrs; /* pointer to users in aliases */
936 uint32 num_als_usrs2; /* number of users in aliases being looked up */
938 uint32 num_als_usrs[MAX_LOOKUP_SIDS]; /* number of users per group */
945 /* SAMR_Q_OPEN_USER - probably an open */
946 typedef struct q_samr_open_user_info
948 POLICY_HND domain_pol; /* policy handle */
949 uint32 unknown_0; /* 32 bit unknown - 0x02011b */
950 uint32 user_rid; /* user RID */
955 /* SAMR_R_OPEN_USER - probably an open */
956 typedef struct r_samr_open_user_info
958 POLICY_HND user_pol; /* policy handle associated with unknown id */
959 uint32 status; /* return status */
964 /* SAMR_Q_UNKNOWN_13 - probably an open alias in domain */
965 typedef struct q_samr_unknown_13_info
967 POLICY_HND alias_pol; /* policy handle */
969 uint16 unknown_1; /* 16 bit unknown - 0x0200 */
970 uint16 unknown_2; /* 16 bit unknown - 0x0000 */
975 /* SAMR_Q_UNKNOWN_21 - probably an open group in domain */
976 typedef struct q_samr_unknown_21_info
978 POLICY_HND group_pol; /* policy handle */
980 uint16 unknown_1; /* 16 bit unknown - 0x0477 */
981 uint16 unknown_2; /* 16 bit unknown - 0x0000 */
986 /* SAMR_Q_UNKNOWN_32 - probably a "create SAM entry" */
987 typedef struct q_samr_unknown_32_info
989 POLICY_HND pol; /* policy handle */
991 UNIHDR hdr_mach_acct; /* unicode machine account name header */
992 UNISTR2 uni_mach_acct; /* unicode machine account name */
994 uint32 acct_ctrl; /* 32 bit ACB_XXXX */
995 uint16 unknown_1; /* 16 bit unknown - 0x00B0 */
996 uint16 unknown_2; /* 16 bit unknown - 0xe005 */
1001 /* SAMR_R_UNKNOWN_32 - probably a "create SAM entry" */
1002 typedef struct r_samr_unknown_32_info
1004 POLICY_HND pol; /* policy handle */
1006 /* rid4.unknown - fail: 0030 success: 0x03ff */
1007 DOM_RID4 rid4; /* rid and attributes */
1009 uint32 status; /* return status - fail: 0xC000 0099: user exists */
1011 } SAMR_R_UNKNOWN_32;
1013 /* SAMR_Q_OPEN_ALIAS - probably an open */
1014 typedef struct q_samr_open_alias_info
1016 uint32 unknown_0; /* 0x0000 0008 */
1017 uint32 rid_alias; /* rid */
1019 } SAMR_Q_OPEN_ALIAS;
1022 /* SAMR_R_OPEN_ALIAS - probably an open */
1023 typedef struct r_samr_open_alias_info
1025 POLICY_HND pol; /* policy handle */
1026 uint32 status; /* return status */
1028 } SAMR_R_OPEN_ALIAS;
1031 /* SAMR_Q_CONNECT_ANON - probably an open */
1032 typedef struct q_samr_connect_anon_info
1034 uint32 ptr; /* ptr? */
1035 uint16 unknown_0; /* 0x005c */
1036 uint16 unknown_1; /* 0x0001 */
1037 uint32 unknown_2; /* 0x0000 0020 */
1039 } SAMR_Q_CONNECT_ANON;
1041 /* SAMR_R_CONNECT_ANON - probably an open */
1042 typedef struct r_samr_connect_anon_info
1044 POLICY_HND connect_pol; /* policy handle */
1045 uint32 status; /* return status */
1047 } SAMR_R_CONNECT_ANON;
1049 /* SAMR_Q_CONNECT - probably an open */
1050 typedef struct q_samr_connect_info
1052 uint32 ptr_srv_name; /* pointer (to server name?) */
1053 UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */
1055 uint32 unknown_0; /* 32 bit unknown */
1060 /* SAMR_R_CONNECT - probably an open */
1061 typedef struct r_samr_connect_info
1063 POLICY_HND connect_pol; /* policy handle */
1064 uint32 status; /* return status */
1068 /* SAMR_Q_UNKNOWN_38 */
1069 typedef struct q_samr_unknown_38
1072 UNIHDR hdr_srv_name;
1073 UNISTR2 uni_srv_name;
1075 } SAMR_Q_UNKNOWN_38;
1077 /* SAMR_R_UNKNOWN_38 */
1078 typedef struct r_samr_unknown_38
1084 uint32 status; /* return status */
1086 } SAMR_R_UNKNOWN_38;
1088 /* SAMR_ENC_PASSWD */
1089 typedef struct enc_passwd_info
1097 typedef struct enc_hash_info
1104 /* SAMR_Q_CHGPASSWD_USER */
1105 typedef struct q_samr_chgpasswd_user_info
1109 UNIHDR hdr_dest_host; /* server name unicode header */
1110 UNISTR2 uni_dest_host; /* server name unicode string */
1112 UNIHDR hdr_user_name; /* username unicode string header */
1113 UNISTR2 uni_user_name; /* username unicode string */
1115 SAMR_ENC_PASSWD nt_newpass;
1116 SAMR_ENC_HASH nt_oldhash;
1118 uint32 unknown; /* 0x0000 0001 */
1120 SAMR_ENC_PASSWD lm_newpass;
1121 SAMR_ENC_HASH lm_oldhash;
1123 } SAMR_Q_CHGPASSWD_USER;
1125 /* SAMR_R_CHGPASSWD_USER */
1126 typedef struct r_samr_chgpasswd_user_info
1128 uint32 status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1130 } SAMR_R_CHGPASSWD_USER;
1132 #endif /* _RPC_SAMR_H */