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_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 */
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) */
143 uint32 unknown_3
; /* 0x00ff ffff */
145 uint16 logon_divs
; /* 0x0000 00a8 which is 168 which is num hrs in a week */
147 uint32 ptr_logon_hrs
; /* unknown pointer */
149 uint32 unknown_5
; /* 0x0002 0000 */
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 */
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 */
211 /* SAM_USER_INFO_10 */
212 typedef struct 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 */
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 */
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 */
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 */
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 */
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
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 :-) */
300 #define MAX_SAM_SIDS 15
303 typedef struct sid_stuff_info
305 uint16 unknown_2
; /* 0x0001 */
306 uint16 unknown_3
; /* 0x8004 */
310 uint32 unknown_4
; /* 0x0000 0014 */
311 uint32 unknown_5
; /* 0x0000 0014 */
313 uint16 unknown_6
; /* 0x0002 */
314 uint16 unknown_7
; /* 0x5800 */
320 DOM_SID3 sid
[MAX_SAM_SIDS
];
324 /* SAMR_R_UNKNOWN_3 - probably an open */
325 typedef struct r_samr_unknown_3_info
328 uint32 sid_stuff_len0
;
331 uint32 sid_stuff_len1
;
333 SAM_SID_STUFF sid_stuff
;
335 uint32 status
; /* return status */
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 */
384 typedef struct sam_unknown_ctr_info
395 /* SAMR_R_QUERY_DOMAIN_INFO - */
396 typedef struct r_samr_query_domain_info
399 uint16 switch_value
; /* same as in query */
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
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 */
470 SAM_ENTRY sam
[MAX_SAM_ENTRIES
];
471 UNISTR2 uni_acct_name
[MAX_SAM_ENTRIES
];
477 } SAMR_R_ENUM_DOM_USERS
;
480 typedef struct samr_entry_info3
492 typedef struct samr_str_entry_info3
494 UNISTR2 uni_grp_name
;
495 UNISTR2 uni_grp_desc
;
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 */
527 SAM_ENTRY3 sam
[MAX_SAM_ENTRIES
];
528 SAM_STR3 str
[MAX_SAM_ENTRIES
];
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
559 SAM_ENTRY sam
[MAX_SAM_ENTRIES
];
560 UNISTR2 uni_grp_name
[MAX_SAM_ENTRIES
];
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
592 UNIHDR hdr_acct_name
;
593 UNIHDR hdr_user_name
;
594 UNIHDR hdr_user_desc
;
598 typedef struct samr_str_entry_info1
600 UNISTR2 uni_acct_name
;
601 UNISTR2 uni_full_name
;
602 UNISTR2 uni_acct_desc
;
606 typedef struct sam_entry_info_1
612 SAM_ENTRY1 sam
[MAX_SAM_ENTRIES
];
613 SAM_STR1 str
[MAX_SAM_ENTRIES
];
618 typedef struct samr_entry_info2
631 typedef struct samr_str_entry_info2
633 UNISTR2 uni_srv_name
;
634 UNISTR2 uni_srv_desc
;
638 typedef struct sam_entry_info_2
644 SAM_ENTRY2 sam
[MAX_SAM_ENTRIES
];
645 SAM_STR2 str
[MAX_SAM_ENTRIES
];
649 typedef struct sam_info_ctr_info
653 SAM_INFO_1
*info1
; /* server info */
654 SAM_INFO_2
*info2
; /* user info */
655 void *info
; /* allows assignment without typecasting, */
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 */
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
;
693 /* SAMR_R_QUERY_ALIASINFO - SAM rids, names and descriptions */
694 typedef struct r_samr_query_aliasinfo_info
697 uint16 switch_value
; /* 0x0003 */
698 /* uint8[2] padding */
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. */
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 */
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. */
784 /* SAMR_R_LOOKUP_IDS */
785 typedef struct r_samr_lookup_ids_info
788 uint32 ptr
; /* undocumented buffer pointer */
791 uint32 rid
[MAX_LOOKUP_SIDS
]; /* domain RIDs being looked up */
793 uint32 status
; /* return code */
797 /****************************************************************************
798 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
799 *****************************************************************************/
800 /* SAMR_Q_LOOKUP_NAMES */
801 typedef struct q_samr_lookup_names_info
803 POLICY_HND pol
; /* policy handle */
805 uint32 num_names1
; /* number of names being looked up */
806 uint32 flags
; /* 0x0000 03e8 - unknown */
807 uint32 ptr
; /* 0x0000 0000 - 32 bit unknown */
808 uint32 num_names2
; /* number of names being looked up */
810 UNIHDR hdr_name
[MAX_LOOKUP_SIDS
]; /* unicode account name header */
811 UNISTR2 uni_name
[MAX_LOOKUP_SIDS
]; /* unicode account name string */
813 } SAMR_Q_LOOKUP_NAMES
;
815 /* SAMR_R_LOOKUP_NAMES */
816 typedef struct r_samr_lookup_names_info
818 uint32 num_rids1
; /* number of aliases being looked up */
819 uint32 ptr_rids
; /* pointer to aliases */
820 uint32 num_rids2
; /* number of aliases being looked up */
822 uint32 rid
[MAX_LOOKUP_SIDS
]; /* rids */
824 uint32 num_types1
; /* number of users in aliases being looked up */
825 uint32 ptr_types
; /* pointer to users in aliases */
826 uint32 num_types2
; /* number of users in aliases being looked up */
828 uint32 type
[MAX_LOOKUP_SIDS
]; /* SID_ENUM type */
830 uint32 status
; /* return code */
832 } SAMR_R_LOOKUP_NAMES
;
834 /****************************************************************************
835 SAMR_Q_UNKNOWN_12 - do a conversion from RID groups to something.
837 called to resolve domain RID groups.
838 *****************************************************************************/
839 /* SAMR_Q_UNKNOWN_12 */
840 typedef struct q_samr_unknown_12_info
842 POLICY_HND pol
; /* policy handle */
844 uint32 num_gids1
; /* number of rids being looked up */
845 uint32 rid
; /* 0x0000 03e8 - RID of the server doing the query? */
846 uint32 ptr
; /* 0x0000 0000 - 32 bit unknown */
847 uint32 num_gids2
; /* number of rids being looked up */
849 uint32 gid
[MAX_LOOKUP_SIDS
]; /* domain RIDs being looked up */
854 /****************************************************************************
855 SAMR_R_UNKNOWN_12 - do a conversion from group RID to names
857 *****************************************************************************/
858 /* SAMR_R_UNKNOWN_12 */
859 typedef struct r_samr_unknown_12_info
861 POLICY_HND pol
; /* policy handle */
863 uint32 num_aliases1
; /* number of aliases being looked up */
864 uint32 ptr_aliases
; /* pointer to aliases */
865 uint32 num_aliases2
; /* number of aliases being looked up */
867 UNIHDR hdr_als_name
[MAX_LOOKUP_SIDS
]; /* unicode account name header */
868 UNISTR2 uni_als_name
[MAX_LOOKUP_SIDS
]; /* unicode account name string */
870 uint32 num_als_usrs1
; /* number of users in aliases being looked up */
871 uint32 ptr_als_usrs
; /* pointer to users in aliases */
872 uint32 num_als_usrs2
; /* number of users in aliases being looked up */
874 uint32 num_als_usrs
[MAX_LOOKUP_SIDS
]; /* number of users per group */
881 /* SAMR_Q_OPEN_USER - probably an open */
882 typedef struct q_samr_open_user_info
884 POLICY_HND domain_pol
; /* policy handle */
885 uint32 unknown_0
; /* 32 bit unknown - 0x02011b */
886 uint32 user_rid
; /* user RID */
891 /* SAMR_R_OPEN_USER - probably an open */
892 typedef struct r_samr_open_user_info
894 POLICY_HND user_pol
; /* policy handle associated with unknown id */
895 uint32 status
; /* return status */
900 /* SAMR_Q_UNKNOWN_13 - probably an open alias in domain */
901 typedef struct q_samr_unknown_13_info
903 POLICY_HND alias_pol
; /* policy handle */
905 uint16 unknown_1
; /* 16 bit unknown - 0x0200 */
906 uint16 unknown_2
; /* 16 bit unknown - 0x0000 */
911 /* SAMR_Q_UNKNOWN_21 - probably an open group in domain */
912 typedef struct q_samr_unknown_21_info
914 POLICY_HND group_pol
; /* policy handle */
916 uint16 unknown_1
; /* 16 bit unknown - 0x0477 */
917 uint16 unknown_2
; /* 16 bit unknown - 0x0000 */
922 /* SAMR_Q_UNKNOWN_32 - probably a "create SAM entry" */
923 typedef struct q_samr_unknown_32_info
925 POLICY_HND pol
; /* policy handle */
927 UNIHDR hdr_mach_acct
; /* unicode machine account name header */
928 UNISTR2 uni_mach_acct
; /* unicode machine account name */
930 uint32 acct_ctrl
; /* 32 bit ACB_XXXX */
931 uint16 unknown_1
; /* 16 bit unknown - 0x00B0 */
932 uint16 unknown_2
; /* 16 bit unknown - 0xe005 */
937 /* SAMR_R_UNKNOWN_32 - probably a "create SAM entry" */
938 typedef struct r_samr_unknown_32_info
940 POLICY_HND pol
; /* policy handle */
942 /* rid4.unknown - fail: 0030 success: 0x03ff */
943 DOM_RID4 rid4
; /* rid and attributes */
945 uint32 status
; /* return status - fail: 0xC000 0099: user exists */
949 /* SAMR_Q_OPEN_ALIAS - probably an open */
950 typedef struct q_samr_open_alias_info
952 uint32 unknown_0
; /* 0x0000 0008 */
953 uint32 rid_alias
; /* rid */
958 /* SAMR_R_OPEN_ALIAS - probably an open */
959 typedef struct r_samr_open_alias_info
961 POLICY_HND pol
; /* policy handle */
962 uint32 status
; /* return status */
967 /* SAMR_Q_CONNECT_ANON - probably an open */
968 typedef struct q_samr_connect_anon_info
970 uint32 ptr
; /* ptr? */
971 uint16 unknown_0
; /* 0x005c */
972 uint16 unknown_1
; /* 0x0001 */
973 uint32 unknown_2
; /* 0x0000 0020 */
975 } SAMR_Q_CONNECT_ANON
;
977 /* SAMR_R_CONNECT_ANON - probably an open */
978 typedef struct r_samr_connect_anon_info
980 POLICY_HND connect_pol
; /* policy handle */
981 uint32 status
; /* return status */
983 } SAMR_R_CONNECT_ANON
;
985 /* SAMR_Q_CONNECT - probably an open */
986 typedef struct q_samr_connect_info
988 uint32 ptr_srv_name
; /* pointer (to server name?) */
989 UNISTR2 uni_srv_name
; /* unicode server name starting with '\\' */
991 uint32 unknown_0
; /* 32 bit unknown */
996 /* SAMR_R_CONNECT - probably an open */
997 typedef struct r_samr_connect_info
999 POLICY_HND connect_pol
; /* policy handle */
1000 uint32 status
; /* return status */
1004 /* SAMR_Q_UNKNOWN_38 */
1005 typedef struct q_samr_unknown_38
1008 UNIHDR hdr_srv_name
;
1009 UNISTR2 uni_srv_name
;
1011 } SAMR_Q_UNKNOWN_38
;
1013 /* SAMR_R_UNKNOWN_38 */
1014 typedef struct r_samr_unknown_38
1020 uint32 status
; /* return status */
1022 } SAMR_R_UNKNOWN_38
;
1024 /* SAMR_ENC_PASSWD */
1025 typedef struct enc_passwd_info
1033 typedef struct enc_hash_info
1040 /* SAMR_Q_CHGPASSWD_USER */
1041 typedef struct q_samr_chgpasswd_user_info
1045 UNIHDR hdr_dest_host
; /* server name unicode header */
1046 UNISTR2 uni_dest_host
; /* server name unicode string */
1048 UNIHDR hdr_user_name
; /* username unicode string header */
1049 UNISTR2 uni_user_name
; /* username unicode string */
1051 SAMR_ENC_PASSWD nt_newpass
;
1052 SAMR_ENC_HASH nt_oldhash
;
1054 uint32 unknown
; /* 0x0000 0001 */
1056 SAMR_ENC_PASSWD lm_newpass
;
1057 SAMR_ENC_HASH lm_oldhash
;
1059 } SAMR_Q_CHGPASSWD_USER
;
1061 /* SAMR_R_CHGPASSWD_USER */
1062 typedef struct r_samr_chgpasswd_user_info
1064 uint32 status
; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1066 } SAMR_R_CHGPASSWD_USER
;
1068 #endif /* _RPC_SAMR_H */