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_UNKNOWN_8 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_32 0x32
93 #define SAMR_UNKNOWN_34 0x34
94 #define SAMR_CHGPASSWD_USER 0x37
95 #define SAMR_UNKNOWN_38 0x38
96 #define SAMR_CONNECT 0x39
97 #define SAMR_CONNECT_ANON 0x00
98 #define SAMR_OPEN_ALIAS 0x1b
99 #define SAMR_QUERY_ALIASINFO 0x1c
100 #define SAMR_ENUM_DOM_USERS 0x0d
101 #define SAMR_ENUM_DOM_ALIASES 0x0f
102 #define SAMR_ENUM_DOM_GROUPS 0x30
105 typedef struct logon_hours_info
107 uint32 len; /* normally 21 bytes */
112 /* SAM_USER_INFO_21 */
113 typedef struct sam_user_info_21
115 NTTIME logon_time; /* logon time */
116 NTTIME logoff_time; /* logoff time */
117 NTTIME kickoff_time; /* kickoff time */
118 NTTIME pass_last_set_time; /* password last set time */
119 NTTIME pass_can_change_time; /* password can change time */
120 NTTIME pass_must_change_time; /* password must change time */
122 UNIHDR hdr_user_name; /* username unicode string header */
123 UNIHDR hdr_full_name; /* user's full name unicode string header */
124 UNIHDR hdr_home_dir; /* home directory unicode string header */
125 UNIHDR hdr_dir_drive; /* home drive unicode string header */
126 UNIHDR hdr_logon_script; /* logon script unicode string header */
127 UNIHDR hdr_profile_path; /* profile path unicode string header */
128 UNIHDR hdr_acct_desc ; /* user description */
129 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
130 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
131 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
133 uint8 lm_pwd[16]; /* lm user passwords */
134 uint8 nt_pwd[16]; /* nt user passwords */
136 uint32 user_rid; /* Primary User ID */
137 uint32 group_rid; /* Primary Group ID */
139 uint16 acb_info; /* account info (ACB_xxxx bit-mask) */
142 uint32 unknown_3; /* 0x00ff ffff */
144 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
146 uint32 ptr_logon_hrs; /* unknown pointer */
148 uint32 unknown_5; /* 0x0002 0000 */
152 UNISTR2 uni_user_name; /* username unicode string */
153 UNISTR2 uni_full_name; /* user's full name unicode string */
154 UNISTR2 uni_home_dir; /* home directory unicode string */
155 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
156 UNISTR2 uni_logon_script; /* logon script unicode string */
157 UNISTR2 uni_profile_path; /* profile path unicode string */
158 UNISTR2 uni_acct_desc ; /* user description unicode string */
159 UNISTR2 uni_workstations; /* login from workstations unicode string */
160 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
161 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
163 uint32 unknown_6; /* 0x0000 04ec */
171 /* SAM_USER_INFO_11 */
172 typedef struct sam_user_info_11
174 uint8 padding_0[16]; /* 0 - padding 16 bytes */
175 NTTIME expiry; /* expiry time or something? */
176 uint8 padding_1[24]; /* 0 - padding 24 bytes */
178 UNIHDR hdr_mach_acct; /* unicode header for machine account */
179 uint32 padding_2; /* 0 - padding 4 bytes */
181 uint32 ptr_1; /* pointer */
182 uint8 padding_3[32]; /* 0 - padding 32 bytes */
183 uint32 padding_4; /* 0 - padding 4 bytes */
185 uint32 ptr_2; /* pointer */
186 uint32 padding_5; /* 0 - padding 4 bytes */
188 uint32 ptr_3; /* pointer */
189 uint8 padding_6[32]; /* 0 - padding 32 bytes */
191 uint32 rid_user; /* user RID */
192 uint32 rid_group; /* group RID */
194 uint16 acct_ctrl; /* 0080 - ACB_XXXX */
195 uint16 unknown_3; /* 16 bit padding */
197 uint16 unknown_4; /* 0x003f - 16 bit unknown */
198 uint16 unknown_5; /* 0x003c - 16 bit unknown */
200 uint8 padding_7[16]; /* 0 - padding 16 bytes */
201 uint32 padding_8; /* 0 - padding 4 bytes */
203 UNISTR2 uni_mach_acct; /* unicode string for machine account */
205 uint8 padding_9[48]; /* 0 - padding 48 bytes */
210 /* SAM_USER_INFO_10 */
211 typedef struct sam_user_info_10
219 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
220 typedef struct q_samr_close_hnd_info
222 POLICY_HND pol; /* policy handle */
227 /* SAMR_R_CLOSE_HND - probably a policy handle close */
228 typedef struct r_samr_close_hnd_info
230 POLICY_HND pol; /* policy handle */
231 uint32 status; /* return status */
236 /****************************************************************************
237 SAMR_Q_UNKNOWN_3 - info level 4. returns SIDs.
238 *****************************************************************************/
240 /* SAMR_Q_UNKNOWN_3 - probably get domain info... */
241 typedef struct q_samr_unknown_3_info
243 POLICY_HND user_pol; /* policy handle */
244 uint16 switch_value; /* 0x0000 0004 */
250 0x14 0x035b 0x0002 S-1-1
251 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
252 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ACCOUNT_OPS
253 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03f1
257 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03ee
258 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS
259 0x14 0x035b 0x0002 S-1-1
262 /* DOM_SID3 - security id */
263 typedef struct sid_info_3
265 uint16 len; /* length, bytes, including length of len :-) */
273 #define MAX_SAM_SIDS 15
276 typedef struct sid_stuff_info
278 uint16 unknown_2; /* 0x0001 */
279 uint16 unknown_3; /* 0x8004 */
283 uint32 unknown_4; /* 0x0000 0014 */
284 uint32 unknown_5; /* 0x0000 0014 */
286 uint16 unknown_6; /* 0x0002 */
287 uint16 unknown_7; /* 0x5800 */
293 DOM_SID3 sid[MAX_SAM_SIDS];
297 /* SAMR_R_UNKNOWN_3 - probably an open */
298 typedef struct r_samr_unknown_3_info
301 uint32 sid_stuff_len0;
304 uint32 sid_stuff_len1;
306 SAM_SID_STUFF sid_stuff;
308 uint32 status; /* return status */
313 /****************************************************************************
314 SAMR_Q_UNKNOWN_8 - probably a query on domain group info.
315 *****************************************************************************/
317 /* SAMR_Q_UNKNOWN_8 - */
318 typedef struct q_samr_unknown_8_info
320 POLICY_HND domain_pol; /* policy handle */
321 uint16 switch_value; /* 0x0002 */
325 typedef struct sam_unkown_info_2_info
327 uint32 unknown_0; /* 0x0000 0000 */
328 uint32 unknown_1; /* 0x0000 0000 */
329 uint32 unknown_2; /* 0x8000 0000 */
330 uint32 unknown_3; /* 0x0000 0000 */
332 uint32 ptr_0; /* pointer to unknown structure */
333 UNIHDR hdr_domain; /* domain name unicode header */
334 UNIHDR hdr_server; /* server name unicode header */
336 /* put all the data in here, at the moment, including what the above
337 pointer is referring to
340 uint32 unknown_4; /* 0x0000 0099 */
341 uint32 unknown_5; /* 0x0000 0000 */
343 uint32 unknown_6 ; /* 0x0000 0001 */
344 uint32 unknown_7 ; /* 0x0000 0003 */
345 uint32 unknown_8 ; /* 0x0000 0001 */
346 uint32 unknown_9 ; /* 0x0000 0008 */
347 uint32 unknown_10; /* 0x0000 0003 */
349 uint8 padding[16]; /* 16 bytes zeros */
351 UNISTR2 uni_domain; /* domain name unicode string */
352 UNISTR2 uni_server; /* server name unicode string */
357 typedef struct sam_unknown_ctr_info
368 /* SAMR_R_UNKNOWN_8 - */
369 typedef struct r_samr_unknown_8_info
372 uint16 switch_value; /* same as in query */
376 uint32 status; /* return status */
381 /****************************************************************************
382 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
384 0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
385 0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
386 *****************************************************************************/
388 /* SAMR_Q_OPEN_DOMAIN */
389 typedef struct q_samr_open_domain_info
391 POLICY_HND connect_pol; /* policy handle */
392 uint32 rid; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - a RID? */
393 DOM_SID2 dom_sid; /* domain SID */
395 } SAMR_Q_OPEN_DOMAIN;
398 /* SAMR_R_OPEN_DOMAIN - probably an open */
399 typedef struct r_samr_open_domain_info
401 POLICY_HND domain_pol; /* policy handle associated with the SID */
402 uint32 status; /* return status */
404 } SAMR_R_OPEN_DOMAIN;
407 #define MAX_SAM_ENTRIES 250
409 typedef struct samr_entry_info
416 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
417 typedef struct q_samr_enum_dom_users_info
419 POLICY_HND pol; /* policy handle */
421 uint16 req_num_entries; /* number of values (0 indicates unlimited?) */
422 uint16 unknown_0; /* enumeration context? */
423 uint16 acb_mask; /* 0x0000 indicates all */
424 uint16 unknown_1; /* 0x0000 */
426 uint32 max_size; /* 0x0000 ffff */
428 } SAMR_Q_ENUM_DOM_USERS;
431 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
432 typedef struct r_samr_enum_dom_users_info
434 uint16 total_num_entries; /* number of entries that match without the acb mask */
435 uint16 unknown_0; /* same as unknown_0 (enum context?) in request */
436 uint32 ptr_entries1; /* actual number of entries to follow, having masked some out */
443 SAM_ENTRY sam[MAX_SAM_ENTRIES];
444 UNISTR2 uni_acct_name[MAX_SAM_ENTRIES];
450 } SAMR_R_ENUM_DOM_USERS;
453 typedef struct samr_entry_info3
465 typedef struct samr_str_entry_info3
467 UNISTR2 uni_grp_name;
468 UNISTR2 uni_grp_desc;
472 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
473 typedef struct q_samr_enum_dom_groups_info
475 POLICY_HND pol; /* policy handle */
477 /* these are possibly an enumeration context handle... */
478 uint16 switch_level; /* 0x0003 */
479 uint16 unknown_0; /* 0x0000 */
480 uint32 start_idx; /* presumably the start enumeration index */
481 uint32 unknown_1; /* 0x0000 07d0 */
483 uint32 max_size; /* 0x0000 7fff */
485 } SAMR_Q_ENUM_DOM_GROUPS;
488 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
489 typedef struct r_samr_enum_dom_groups_info
491 uint32 unknown_0; /* 0x0000 0492 or 0x0000 00be */
492 uint32 unknown_1; /* 0x0000 049a or 0x0000 00be */
493 uint32 switch_level; /* 0x0000 0003 */
500 SAM_ENTRY3 sam[MAX_SAM_ENTRIES];
501 SAM_STR3 str[MAX_SAM_ENTRIES];
505 } SAMR_R_ENUM_DOM_GROUPS;
509 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
510 typedef struct q_samr_enum_dom_aliases_info
512 POLICY_HND pol; /* policy handle */
514 /* this is possibly an enumeration context handle... */
515 uint32 unknown_0; /* 0x0000 0000 */
517 uint32 max_size; /* 0x0000 ffff */
519 } SAMR_Q_ENUM_DOM_ALIASES;
521 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
522 typedef struct r_samr_enum_dom_aliases_info
532 SAM_ENTRY sam[MAX_SAM_ENTRIES];
533 UNISTR2 uni_grp_name[MAX_SAM_ENTRIES];
539 } SAMR_R_ENUM_DOM_ALIASES;
543 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
544 typedef struct q_samr_query_disp_info
546 POLICY_HND pol; /* policy handle */
548 uint16 switch_level; /* 0x0001 and 0x0002 seen */
549 uint16 unknown_0; /* 0x0000 and 0x2000 seen */
550 uint32 start_idx; /* presumably the start enumeration index */
551 uint32 unknown_1; /* 0x0000 07d0, 0x0000 0400 and 0x0000 0200 seen */
553 uint32 max_size; /* 0x0000 7fff, 0x0000 7ffe and 0x0000 3fff seen*/
555 } SAMR_Q_QUERY_DISPINFO;
557 typedef struct samr_entry_info1
565 UNIHDR hdr_acct_name;
566 UNIHDR hdr_user_name;
567 UNIHDR hdr_user_desc;
571 typedef struct samr_str_entry_info1
573 UNISTR2 uni_acct_name;
574 UNISTR2 uni_full_name;
575 UNISTR2 uni_acct_desc;
579 typedef struct sam_entry_info_1
585 SAM_ENTRY1 sam[MAX_SAM_ENTRIES];
586 SAM_STR1 str[MAX_SAM_ENTRIES];
591 typedef struct samr_entry_info2
604 typedef struct samr_str_entry_info2
606 UNISTR2 uni_srv_name;
607 UNISTR2 uni_srv_desc;
611 typedef struct sam_entry_info_2
617 SAM_ENTRY2 sam[MAX_SAM_ENTRIES];
618 SAM_STR2 str[MAX_SAM_ENTRIES];
622 typedef struct sam_info_ctr_info
626 SAM_INFO_1 *info1; /* server info */
627 SAM_INFO_2 *info2; /* user info */
628 void *info; /* allows assignment without typecasting, */
634 /* SAMR_R_QUERY_DISPINFO - SAM rids, names and descriptions */
635 typedef struct r_samr_query_dispinfo_info
637 uint32 unknown_0; /* container length? 0x0000 0492 or 0x0000 00be */
638 uint32 unknown_1; /* container length? 0x0000 049a or 0x0000 00be */
639 uint16 switch_level; /* 0x0001 or 0x0002 */
646 } SAMR_R_QUERY_DISPINFO;
650 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
651 typedef struct q_samr_enum_alias_info
653 POLICY_HND pol; /* policy handle */
655 uint16 switch_level; /* 0x0003 seen */
657 } SAMR_Q_QUERY_ALIASINFO;
659 typedef struct samr_alias_info3
661 UNIHDR hdr_acct_desc;
662 UNISTR2 uni_acct_desc;
666 /* SAMR_R_QUERY_ALIASINFO - SAM rids, names and descriptions */
667 typedef struct r_samr_query_aliasinfo_info
670 uint16 switch_value; /* 0x0003 */
671 /* uint8[2] padding */
681 } SAMR_R_QUERY_ALIASINFO;
684 /* SAMR_Q_QUERY_USERGROUPS - */
685 typedef struct q_samr_query_usergroup_info
687 POLICY_HND pol; /* policy handle associated with unknown id */
689 } SAMR_Q_QUERY_USERGROUPS;
691 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
692 typedef struct r_samr_query_usergroup_info
694 uint32 ptr_0; /* pointer */
695 uint32 num_entries; /* number of RID groups */
696 uint32 ptr_1; /* pointer */
697 uint32 num_entries2; /* number of RID groups */
699 DOM_GID *gid; /* group info */
701 uint32 status; /* return status */
703 } SAMR_R_QUERY_USERGROUPS;
706 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
707 typedef struct q_samr_query_user_info
709 POLICY_HND pol; /* policy handle associated with unknown id */
710 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
712 } SAMR_Q_QUERY_USERINFO;
714 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
715 typedef struct r_samr_query_user_info
717 uint32 ptr; /* pointer */
718 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - same as in query */
719 /* uint8[2] padding. */
723 SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
724 SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
725 SAM_USER_INFO_21 *id21; /* auth-level 21 */
726 void* id; /* to make typecasting easy */
730 uint32 status; /* return status */
732 } SAMR_R_QUERY_USERINFO;
735 /****************************************************************************
736 SAMR_Q_LOOKUP_IDS - do a conversion from name to RID.
738 the policy handle allocated by an "samr open secret" call is associated
739 with a SID. this policy handle is what is queried here, *not* the SID
740 itself. the response to the lookup rids is relative to this SID.
741 *****************************************************************************/
742 /* SAMR_Q_LOOKUP_IDS */
743 typedef struct q_samr_lookup_ids_info
745 POLICY_HND pol; /* policy handle */
747 uint32 num_sids1; /* number of rids being looked up */
748 uint32 ptr; /* buffer pointer */
749 uint32 num_sids2; /* number of rids being looked up */
751 uint32 ptr_sid[MAX_LOOKUP_SIDS]; /* pointers to sids to be looked up */
752 DOM_SID2 sid [MAX_LOOKUP_SIDS]; /* sids to be looked up. */
757 /* SAMR_R_LOOKUP_IDS */
758 typedef struct r_samr_lookup_ids_info
761 uint32 ptr; /* undocumented buffer pointer */
764 uint32 rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
766 uint32 status; /* return code */
771 /****************************************************************************
772 SAMR_Q_LOOKUP_NAMES - do a conversion from SID to RID.
774 the policy handle allocated by an "samr open secret" call is associated
775 with a SID. this policy handle is what is queried here, *not* the SID
776 itself. the response to the lookup rids is relative to this SID.
777 *****************************************************************************/
778 /* SAMR_Q_LOOKUP_NAMES */
779 typedef struct q_samr_lookup_names_info
781 POLICY_HND pol; /* policy handle */
783 uint32 num_rids1; /* number of rids being looked up */
784 uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */
785 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
786 uint32 num_rids2; /* number of rids being looked up */
788 UNIHDR hdr_user_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
789 UNISTR2 uni_user_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
791 } SAMR_Q_LOOKUP_NAMES;
794 /* SAMR_R_LOOKUP_NAMES */
795 typedef struct r_samr_lookup_names_info
798 uint32 undoc_buffer; /* undocumented buffer pointer */
801 DOM_RID3 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
805 uint32 status; /* return code */
807 } SAMR_R_LOOKUP_NAMES;
810 /****************************************************************************
811 SAMR_Q_UNKNOWN_12 - do a conversion from RID groups to something.
813 called to resolve domain RID groups.
814 *****************************************************************************/
815 /* SAMR_Q_UNKNOWN_12 */
816 typedef struct q_samr_unknown_12_info
818 POLICY_HND pol; /* policy handle */
820 uint32 num_gids1; /* number of rids being looked up */
821 uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */
822 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
823 uint32 num_gids2; /* number of rids being looked up */
825 uint32 gid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
830 /****************************************************************************
831 SAMR_R_UNKNOWN_12 - do a conversion from group RID to names
833 *****************************************************************************/
834 /* SAMR_R_UNKNOWN_12 */
835 typedef struct r_samr_unknown_12_info
837 POLICY_HND pol; /* policy handle */
839 uint32 num_aliases1; /* number of aliases being looked up */
840 uint32 ptr_aliases; /* pointer to aliases */
841 uint32 num_aliases2; /* number of aliases being looked up */
843 UNIHDR hdr_als_name[MAX_LOOKUP_SIDS]; /* unicode account name header */
844 UNISTR2 uni_als_name[MAX_LOOKUP_SIDS]; /* unicode account name string */
846 uint32 num_als_usrs1; /* number of users in aliases being looked up */
847 uint32 ptr_als_usrs; /* pointer to users in aliases */
848 uint32 num_als_usrs2; /* number of users in aliases being looked up */
850 uint32 num_als_usrs[MAX_LOOKUP_SIDS]; /* number of users per group */
857 /* SAMR_Q_OPEN_USER - probably an open */
858 typedef struct q_samr_open_user_info
860 POLICY_HND domain_pol; /* policy handle */
861 uint32 unknown_0; /* 32 bit unknown - 0x02011b */
862 uint32 user_rid; /* user RID */
867 /* SAMR_R_OPEN_USER - probably an open */
868 typedef struct r_samr_open_user_info
870 POLICY_HND user_pol; /* policy handle associated with unknown id */
871 uint32 status; /* return status */
876 /* SAMR_Q_UNKNOWN_13 - probably an open alias in domain */
877 typedef struct q_samr_unknown_13_info
879 POLICY_HND alias_pol; /* policy handle */
881 uint16 unknown_1; /* 16 bit unknown - 0x0200 */
882 uint16 unknown_2; /* 16 bit unknown - 0x0000 */
887 /* SAMR_Q_UNKNOWN_21 - probably an open group in domain */
888 typedef struct q_samr_unknown_21_info
890 POLICY_HND group_pol; /* policy handle */
892 uint16 unknown_1; /* 16 bit unknown - 0x0477 */
893 uint16 unknown_2; /* 16 bit unknown - 0x0000 */
898 /* SAMR_Q_UNKNOWN_32 - probably a "create SAM entry" */
899 typedef struct q_samr_unknown_32_info
901 POLICY_HND pol; /* policy handle */
903 UNIHDR hdr_mach_acct; /* unicode machine account name header */
904 UNISTR2 uni_mach_acct; /* unicode machine account name */
906 uint32 acct_ctrl; /* 32 bit ACB_XXXX */
907 uint16 unknown_1; /* 16 bit unknown - 0x00B0 */
908 uint16 unknown_2; /* 16 bit unknown - 0xe005 */
913 /* SAMR_R_UNKNOWN_32 - probably a "create SAM entry" */
914 typedef struct r_samr_unknown_32_info
916 POLICY_HND pol; /* policy handle */
918 /* rid4.unknown - fail: 0030 success: 0x03ff */
919 DOM_RID4 rid4; /* rid and attributes */
921 uint32 status; /* return status - fail: 0xC000 0099: user exists */
926 /* SAMR_Q_OPEN_ALIAS - probably an open */
927 typedef struct q_samr_open_alias_info
929 uint32 unknown_0; /* 0x0000 0008 */
930 uint32 rid_alias; /* rid */
935 /* SAMR_R_OPEN_ALIAS - probably an open */
936 typedef struct r_samr_open_alias_info
938 POLICY_HND pol; /* policy handle */
939 uint32 status; /* return status */
944 /* SAMR_Q_CONNECT_ANON - probably an open */
945 typedef struct q_samr_connect_anon_info
947 uint32 ptr; /* ptr? */
948 uint16 unknown_0; /* 0x005c */
949 uint16 unknown_1; /* 0x0001 */
950 uint32 unknown_2; /* 0x0000 0020 */
952 } SAMR_Q_CONNECT_ANON;
954 /* SAMR_R_CONNECT_ANON - probably an open */
955 typedef struct r_samr_connect_anon_info
957 POLICY_HND connect_pol; /* policy handle */
958 uint32 status; /* return status */
960 } SAMR_R_CONNECT_ANON;
962 /* SAMR_Q_CONNECT - probably an open */
963 typedef struct q_samr_connect_info
965 uint32 ptr_srv_name; /* pointer (to server name?) */
966 UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */
968 uint32 unknown_0; /* 32 bit unknown */
973 /* SAMR_R_CONNECT - probably an open */
974 typedef struct r_samr_connect_info
976 POLICY_HND connect_pol; /* policy handle */
977 uint32 status; /* return status */
981 /* SAMR_Q_UNKNOWN_38 */
982 typedef struct q_samr_unknown_38
986 UNISTR2 uni_srv_name;
990 /* SAMR_R_UNKNOWN_38 */
991 typedef struct r_samr_unknown_38
1000 /* SAMR_ENC_PASSWD */
1001 typedef struct enc_passwd_info
1009 typedef struct enc_hash_info
1016 /* SAMR_Q_CHGPASSWD_USER */
1017 typedef struct q_samr_chgpasswd_user_info
1021 UNIHDR hdr_dest_host; /* server name unicode header */
1022 UNISTR2 uni_dest_host; /* server name unicode string */
1024 UNIHDR hdr_user_name; /* username unicode string header */
1025 UNISTR2 uni_user_name; /* username unicode string */
1027 SAMR_ENC_PASSWD nt_newpass;
1028 SAMR_ENC_HASH nt_oldhash;
1030 uint32 unknown; /* 0x0000 0001 */
1032 SAMR_ENC_PASSWD lm_newpass;
1033 SAMR_ENC_HASH lm_oldhash;
1035 } SAMR_Q_CHGPASSWD_USER;
1037 /* SAMR_R_CHGPASSWD_USER */
1038 typedef struct r_samr_chgpasswd_user_info
1040 uint32 status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1042 } SAMR_R_CHGPASSWD_USER;
1044 #endif /* _RPC_SAMR_H */