2 Unix SMB/CIFS implementation.
3 SMB parameters and setup
4 Copyright (C) Andrew Tridgell 1992-2000
5 Copyright (C) Luke Kenneth Casson Leighton 1996-2000
6 Copyright (C) Paul Ashton 1997-2000
7 Copyright (C) Jean François Micouleau 1998-2001
8 Copyright (C) Anthony Liguori 2002
9 Copyright (C) Jim McDonough 2002
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #ifndef _RPC_SAMR_H /* _RPC_SAMR_H */
32 /*******************************************************************
33 the following information comes from a QuickView on samsrv.dll,
34 and gives an idea of exactly what is needed:
36 x SamrAddMemberToAlias
37 x SamrAddMemberToGroup
38 SamrAddMultipleMembersToAlias
39 x SamrChangePasswordUser
42 x SamrCreateAliasInDomain
43 x SamrCreateGroupInDomain
44 x SamrCreateUserInDomain
48 x SamrEnumerateAliasesInDomain
49 SamrEnumerateDomainsInSamServer
50 x SamrEnumerateGroupsInDomain
51 x SamrEnumerateUsersInDomain
52 SamrGetUserDomainPasswordInformation
53 SamrLookupDomainInSamServer
54 ? SamrLookupIdsInDomain
55 x SamrLookupNamesInDomain
60 x SamrQueryDisplayInformation
61 x SamrQueryInformationAlias
62 SamrQueryInformationDomain
63 ? SamrQueryInformationUser
64 x SamrQuerySecurityObject
65 SamrRemoveMemberFromAlias
66 SamrRemoveMemberFromForiegnDomain
67 SamrRemoveMemberFromGroup
68 SamrRemoveMultipleMembersFromAlias
69 x SamrSetInformationAlias
70 SamrSetInformationDomain
71 x SamrSetInformationGroup
72 x SamrSetInformationUser
73 SamrSetMemberAttributesOfGroup
76 SamrTestPrivateFunctionsDomain
77 SamrTestPrivateFunctionsUser
79 ********************************************************************/
81 #define SAMR_CONNECT_ANON 0x00
82 #define SAMR_CLOSE_HND 0x01
83 #define SAMR_SET_SEC_OBJECT 0x02
84 #define SAMR_QUERY_SEC_OBJECT 0x03
86 #define SAMR_UNKNOWN_4 0x04 /* profile info? */
87 #define SAMR_LOOKUP_DOMAIN 0x05
88 #define SAMR_ENUM_DOMAINS 0x06
89 #define SAMR_OPEN_DOMAIN 0x07
90 #define SAMR_QUERY_DOMAIN_INFO 0x08
91 #define SAMR_SET_DOMAIN_INFO 0x09
93 #define SAMR_CREATE_DOM_GROUP 0x0a
94 #define SAMR_ENUM_DOM_GROUPS 0x0b
95 #define SAMR_ENUM_DOM_USERS 0x0d
96 #define SAMR_CREATE_DOM_ALIAS 0x0e
97 #define SAMR_ENUM_DOM_ALIASES 0x0f
98 #define SAMR_QUERY_USERALIASES 0x10
100 #define SAMR_LOOKUP_NAMES 0x11
101 #define SAMR_LOOKUP_RIDS 0x12
103 #define SAMR_OPEN_GROUP 0x13
104 #define SAMR_QUERY_GROUPINFO 0x14
105 #define SAMR_SET_GROUPINFO 0x15
106 #define SAMR_ADD_GROUPMEM 0x16
107 #define SAMR_DELETE_DOM_GROUP 0x17
108 #define SAMR_DEL_GROUPMEM 0x18
109 #define SAMR_QUERY_GROUPMEM 0x19
110 #define SAMR_UNKNOWN_1A 0x1a
112 #define SAMR_OPEN_ALIAS 0x1b
113 #define SAMR_QUERY_ALIASINFO 0x1c
114 #define SAMR_SET_ALIASINFO 0x1d
115 #define SAMR_DELETE_DOM_ALIAS 0x1e
116 #define SAMR_ADD_ALIASMEM 0x1f
117 #define SAMR_DEL_ALIASMEM 0x20
118 #define SAMR_QUERY_ALIASMEM 0x21
120 #define SAMR_OPEN_USER 0x22
121 #define SAMR_DELETE_DOM_USER 0x23
122 #define SAMR_QUERY_USERINFO 0x24
123 #define SAMR_SET_USERINFO2 0x25
124 #define SAMR_QUERY_USERGROUPS 0x27
126 #define SAMR_QUERY_DISPINFO 0x28
127 #define SAMR_UNKNOWN_29 0x29
128 #define SAMR_UNKNOWN_2a 0x2a
129 #define SAMR_UNKNOWN_2b 0x2b
130 #define SAMR_GET_USRDOM_PWINFO 0x2c
131 #define SAMR_UNKNOWN_2D 0x2d
132 #define SAMR_UNKNOWN_2E 0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */
133 #define SAMR_UNKNOWN_2f 0x2f
134 #define SAMR_QUERY_DISPINFO3 0x30 /* Alias for SAMR_QUERY_DISPINFO
136 #define SAMR_UNKNOWN_31 0x31
137 #define SAMR_CREATE_USER 0x32
138 #define SAMR_QUERY_DISPINFO4 0x33 /* Alias for SAMR_QUERY_DISPINFO
140 #define SAMR_ADDMULTI_ALIASMEM 0x34
142 #define SAMR_UNKNOWN_35 0x35
143 #define SAMR_UNKNOWN_36 0x36
144 #define SAMR_CHGPASSWD_USER 0x37
145 #define SAMR_GET_DOM_PWINFO 0x38
146 #define SAMR_CONNECT 0x39
147 #define SAMR_SET_USERINFO 0x3A
148 #define SAMR_CONNECT4 0x3E
150 /* Access bits to the SAM-object */
152 #define SAMR_ACCESS_UNKNOWN_1 0x00000001
153 #define SAMR_ACCESS_SHUTDOWN_SERVER 0x00000002
154 #define SAMR_ACCESS_UNKNOWN_4 0x00000004
155 #define SAMR_ACCESS_UNKNOWN_8 0x00000008
156 #define SAMR_ACCESS_ENUM_DOMAINS 0x00000010
157 #define SAMR_ACCESS_OPEN_DOMAIN 0x00000020
159 #define SAMR_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
160 SAMR_ACCESS_OPEN_DOMAIN | \
161 SAMR_ACCESS_ENUM_DOMAINS | \
162 SAMR_ACCESS_UNKNOWN_8 | \
163 SAMR_ACCESS_UNKNOWN_4 | \
164 SAMR_ACCESS_SHUTDOWN_SERVER | \
165 SAMR_ACCESS_UNKNOWN_1 )
167 #define SAMR_READ ( STANDARD_RIGHTS_READ_ACCESS | \
168 SAMR_ACCESS_ENUM_DOMAINS )
170 #define SAMR_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS | \
171 SAMR_ACCESS_UNKNOWN_8 | \
172 SAMR_ACCESS_UNKNOWN_4 | \
173 SAMR_ACCESS_SHUTDOWN_SERVER )
175 #define SAMR_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS | \
176 SAMR_ACCESS_OPEN_DOMAIN | \
177 SAMR_ACCESS_UNKNOWN_1 )
179 /* Access bits to Domain-objects */
181 #define DOMAIN_ACCESS_LOOKUP_INFO_1 0x000000001
182 #define DOMAIN_ACCESS_SET_INFO_1 0x000000002
183 #define DOMAIN_ACCESS_LOOKUP_INFO_2 0x000000004
184 #define DOMAIN_ACCESS_SET_INFO_2 0x000000008
185 #define DOMAIN_ACCESS_CREATE_USER 0x000000010
186 #define DOMAIN_ACCESS_CREATE_GROUP 0x000000020
187 #define DOMAIN_ACCESS_CREATE_ALIAS 0x000000040
188 #define DOMAIN_ACCESS_LOOKUP_ALIAS_BY_MEM 0x000000080
189 #define DOMAIN_ACCESS_ENUM_ACCOUNTS 0x000000100
190 #define DOMAIN_ACCESS_OPEN_ACCOUNT 0x000000200
191 #define DOMAIN_ACCESS_SET_INFO_3 0x000000400
193 #define DOMAIN_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
194 DOMAIN_ACCESS_SET_INFO_3 | \
195 DOMAIN_ACCESS_OPEN_ACCOUNT | \
196 DOMAIN_ACCESS_ENUM_ACCOUNTS | \
197 DOMAIN_ACCESS_LOOKUP_ALIAS_BY_MEM | \
198 DOMAIN_ACCESS_CREATE_ALIAS | \
199 DOMAIN_ACCESS_CREATE_GROUP | \
200 DOMAIN_ACCESS_CREATE_USER | \
201 DOMAIN_ACCESS_SET_INFO_2 | \
202 DOMAIN_ACCESS_LOOKUP_INFO_2 | \
203 DOMAIN_ACCESS_SET_INFO_1 | \
204 DOMAIN_ACCESS_LOOKUP_INFO_1 )
206 #define DOMAIN_READ ( STANDARD_RIGHTS_READ_ACCESS | \
207 DOMAIN_ACCESS_LOOKUP_ALIAS_BY_MEM | \
208 DOMAIN_ACCESS_LOOKUP_INFO_2 )
210 #define DOMAIN_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS | \
211 DOMAIN_ACCESS_SET_INFO_3 | \
212 DOMAIN_ACCESS_CREATE_ALIAS | \
213 DOMAIN_ACCESS_CREATE_GROUP | \
214 DOMAIN_ACCESS_CREATE_USER | \
215 DOMAIN_ACCESS_SET_INFO_2 | \
216 DOMAIN_ACCESS_SET_INFO_1 )
218 #define DOMAIN_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS | \
219 DOMAIN_ACCESS_OPEN_ACCOUNT | \
220 DOMAIN_ACCESS_ENUM_ACCOUNTS | \
221 DOMAIN_ACCESS_LOOKUP_INFO_1 )
223 /* Access bits to User-objects */
225 #define USER_ACCESS_GET_NAME_ETC 0x00000001
226 #define USER_ACCESS_GET_LOCALE 0x00000002
227 #define USER_ACCESS_SET_LOC_COM 0x00000004
228 #define USER_ACCESS_GET_LOGONINFO 0x00000008
229 #define USER_ACCESS_UNKNOWN_10 0x00000010
230 #define USER_ACCESS_SET_ATTRIBUTES 0x00000020
231 #define USER_ACCESS_CHANGE_PASSWORD 0x00000040
232 #define USER_ACCESS_SET_PASSWORD 0x00000080
233 #define USER_ACCESS_GET_GROUPS 0x00000100
234 #define USER_ACCESS_UNKNOWN_200 0x00000200
235 #define USER_ACCESS_UNKNOWN_400 0x00000400
237 #define USER_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
238 USER_ACCESS_UNKNOWN_400 | \
239 USER_ACCESS_UNKNOWN_200 | \
240 USER_ACCESS_GET_GROUPS | \
241 USER_ACCESS_SET_PASSWORD | \
242 USER_ACCESS_CHANGE_PASSWORD | \
243 USER_ACCESS_SET_ATTRIBUTES | \
244 USER_ACCESS_UNKNOWN_10 | \
245 USER_ACCESS_GET_LOGONINFO | \
246 USER_ACCESS_SET_LOC_COM | \
247 USER_ACCESS_GET_LOCALE | \
248 USER_ACCESS_GET_NAME_ETC )
250 #define USER_READ ( STANDARD_RIGHTS_READ_ACCESS | \
251 USER_ACCESS_UNKNOWN_200 | \
252 USER_ACCESS_GET_GROUPS | \
253 USER_ACCESS_UNKNOWN_10 | \
254 USER_ACCESS_GET_LOGONINFO | \
255 USER_ACCESS_GET_LOCALE )
257 #define USER_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS | \
258 USER_ACCESS_CHANGE_PASSWORD | \
259 USER_ACCESS_SET_LOC_COM )
261 #define USER_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS | \
262 USER_ACCESS_CHANGE_PASSWORD | \
263 USER_ACCESS_GET_NAME_ETC )
265 /* Access bits to Group-objects */
267 #define GROUP_ACCESS_LOOKUP_INFO 0x00000001
268 #define GROUP_ACCESS_SET_INFO 0x00000002
269 #define GROUP_ACCESS_ADD_MEMBER 0x00000004
270 #define GROUP_ACCESS_REMOVE_MEMBER 0x00000008
271 #define GROUP_ACCESS_GET_MEMBERS 0x00000010
273 #define GROUP_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
274 GROUP_ACCESS_GET_MEMBERS | \
275 GROUP_ACCESS_REMOVE_MEMBER | \
276 GROUP_ACCESS_ADD_MEMBER | \
277 GROUP_ACCESS_SET_INFO | \
278 GROUP_ACCESS_LOOKUP_INFO )
280 #define GROUP_READ ( STANDARD_RIGHTS_READ_ACCESS | \
281 GROUP_ACCESS_GET_MEMBERS )
283 #define GROUP_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS | \
284 GROUP_ACCESS_REMOVE_MEMBER | \
285 GROUP_ACCESS_ADD_MEMBER | \
286 GROUP_ACCESS_SET_INFO )
288 #define GROUP_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS | \
289 GROUP_ACCESS_LOOKUP_INFO )
291 /* Access bits to Alias-objects */
293 #define ALIAS_ACCESS_ADD_MEMBER 0x00000001
294 #define ALIAS_ACCESS_REMOVE_MEMBER 0x00000002
295 #define ALIAS_ACCESS_GET_MEMBERS 0x00000004
296 #define ALIAS_ACCESS_LOOKUP_INFO 0x00000008
297 #define ALIAS_ACCESS_SET_INFO 0x00000010
299 #define ALIAS_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
300 ALIAS_ACCESS_GET_MEMBERS | \
301 ALIAS_ACCESS_REMOVE_MEMBER | \
302 ALIAS_ACCESS_ADD_MEMBER | \
303 ALIAS_ACCESS_SET_INFO | \
304 ALIAS_ACCESS_LOOKUP_INFO )
306 #define ALIAS_READ ( STANDARD_RIGHTS_READ_ACCESS | \
307 ALIAS_ACCESS_GET_MEMBERS )
309 #define ALIAS_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS | \
310 ALIAS_ACCESS_REMOVE_MEMBER | \
311 ALIAS_ACCESS_ADD_MEMBER | \
312 ALIAS_ACCESS_SET_INFO )
314 #define ALIAS_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS | \
315 ALIAS_ACCESS_LOOKUP_INFO )
317 typedef struct _DISP_USER_INFO {
321 typedef struct _DISP_GROUP_INFO {
326 typedef struct logon_hours_info
328 uint32 len; /* normally 21 bytes */
333 /* SAM_USER_INFO_23 */
334 typedef struct sam_user_info_23
336 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
337 NTTIME logon_time; /* logon time */
338 NTTIME logoff_time; /* logoff time */
339 NTTIME kickoff_time; /* kickoff time */
340 NTTIME pass_last_set_time; /* password last set time */
341 NTTIME pass_can_change_time; /* password can change time */
342 NTTIME pass_must_change_time; /* password must change time */
344 UNIHDR hdr_user_name; /* NULL - user name unicode string header */
345 UNIHDR hdr_full_name; /* user's full name unicode string header */
346 UNIHDR hdr_home_dir; /* home directory unicode string header */
347 UNIHDR hdr_dir_drive; /* home drive unicode string header */
348 UNIHDR hdr_logon_script; /* logon script unicode string header */
349 UNIHDR hdr_profile_path; /* profile path unicode string header */
350 UNIHDR hdr_acct_desc ; /* user description */
351 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
352 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
353 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
355 uint8 lm_pwd[16]; /* lm user passwords */
356 uint8 nt_pwd[16]; /* nt user passwords */
358 uint32 user_rid; /* Primary User ID */
359 uint32 group_rid; /* Primary Group ID */
361 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
363 uint32 unknown_3; /* 0x09f8 27fa */
365 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
367 uint32 ptr_logon_hrs; /* pointer to logon hours */
369 uint32 unknown_5; /* 0x0001 0000 */
373 uint8 passmustchange; /* 0x00 must change = 0x01 */
379 UNISTR2 uni_user_name; /* NULL - username unicode string */
380 UNISTR2 uni_full_name; /* user's full name unicode string */
381 UNISTR2 uni_home_dir; /* home directory unicode string */
382 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
383 UNISTR2 uni_logon_script; /* logon script unicode string */
384 UNISTR2 uni_profile_path; /* profile path unicode string */
385 UNISTR2 uni_acct_desc ; /* user description unicode string */
386 UNISTR2 uni_workstations; /* login from workstations unicode string */
387 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
388 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
390 uint32 unknown_6; /* 0x0000 04ec */
397 /* SAM_USER_INFO_24 */
398 typedef struct sam_user_info_24
405 * NB. This structure is *definately* incorrect. It's my best guess
406 * currently for W2K SP2. The password field is encrypted in a different
407 * way than normal... And there are definately other problems. JRA.
410 /* SAM_USER_INFO_25 */
411 typedef struct sam_user_info_25
413 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
414 NTTIME logon_time; /* logon time */
415 NTTIME logoff_time; /* logoff time */
416 NTTIME kickoff_time; /* kickoff time */
417 NTTIME pass_last_set_time; /* password last set time */
418 NTTIME pass_can_change_time; /* password can change time */
419 NTTIME pass_must_change_time; /* password must change time */
421 UNIHDR hdr_user_name; /* NULL - user name unicode string header */
422 UNIHDR hdr_full_name; /* user's full name unicode string header */
423 UNIHDR hdr_home_dir; /* home directory unicode string header */
424 UNIHDR hdr_dir_drive; /* home drive unicode string header */
425 UNIHDR hdr_logon_script; /* logon script unicode string header */
426 UNIHDR hdr_profile_path; /* profile path unicode string header */
427 UNIHDR hdr_acct_desc ; /* user description */
428 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
429 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
430 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
432 uint8 lm_pwd[16]; /* lm user passwords */
433 uint8 nt_pwd[16]; /* nt user passwords */
435 uint32 user_rid; /* Primary User ID */
436 uint32 group_rid; /* Primary Group ID */
438 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
444 UNISTR2 uni_user_name; /* NULL - username unicode string */
445 UNISTR2 uni_full_name; /* user's full name unicode string */
446 UNISTR2 uni_home_dir; /* home directory unicode string */
447 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
448 UNISTR2 uni_logon_script; /* logon script unicode string */
449 UNISTR2 uni_profile_path; /* profile path unicode string */
450 UNISTR2 uni_acct_desc ; /* user description unicode string */
451 UNISTR2 uni_workstations; /* login from workstations unicode string */
452 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
453 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
457 /* SAM_USER_INFO_21 */
458 typedef struct sam_user_info_21
460 NTTIME logon_time; /* logon time */
461 NTTIME logoff_time; /* logoff time */
462 NTTIME kickoff_time; /* kickoff time */
463 NTTIME pass_last_set_time; /* password last set time */
464 NTTIME pass_can_change_time; /* password can change time */
465 NTTIME pass_must_change_time; /* password must change time */
467 UNIHDR hdr_user_name; /* username unicode string header */
468 UNIHDR hdr_full_name; /* user's full name unicode string header */
469 UNIHDR hdr_home_dir; /* home directory unicode string header */
470 UNIHDR hdr_dir_drive; /* home drive unicode string header */
471 UNIHDR hdr_logon_script; /* logon script unicode string header */
472 UNIHDR hdr_profile_path; /* profile path unicode string header */
473 UNIHDR hdr_acct_desc ; /* user description */
474 UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
475 UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
476 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
478 uint8 lm_pwd[16]; /* lm user passwords */
479 uint8 nt_pwd[16]; /* nt user passwords */
481 uint32 user_rid; /* Primary User ID */
482 uint32 group_rid; /* Primary Group ID */
484 uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
486 uint32 unknown_3; /* 0x00ff ffff */
488 uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
490 uint32 ptr_logon_hrs; /* unknown pointer */
492 uint32 unknown_5; /* 0x0002 0000 */
496 uint8 passmustchange; /* 0x00 must change = 0x01 */
500 UNISTR2 uni_user_name; /* username unicode string */
501 UNISTR2 uni_full_name; /* user's full name unicode string */
502 UNISTR2 uni_home_dir; /* home directory unicode string */
503 UNISTR2 uni_dir_drive; /* home directory drive unicode string */
504 UNISTR2 uni_logon_script; /* logon script unicode string */
505 UNISTR2 uni_profile_path; /* profile path unicode string */
506 UNISTR2 uni_acct_desc ; /* user description unicode string */
507 UNISTR2 uni_workstations; /* login from workstations unicode string */
508 UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
509 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
511 uint32 unknown_6; /* 0x0000 04ec */
518 #define PASS_MUST_CHANGE_AT_NEXT_LOGON 0x01
519 #define PASS_DONT_CHANGE_AT_NEXT_LOGON 0x00
521 /* SAM_USER_INFO_20 */
522 typedef struct sam_user_info_20
524 UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
526 UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
530 /* SAM_USER_INFO_12 */
531 typedef struct sam_user_info_12
533 uint8 lm_pwd[16]; /* lm user passwords */
534 uint8 nt_pwd[16]; /* nt user passwords */
541 /* SAM_USER_INFO_11 */
542 typedef struct sam_user_info_11
544 uint8 padding_0[16]; /* 0 - padding 16 bytes */
545 NTTIME expiry; /* expiry time or something? */
546 uint8 padding_1[24]; /* 0 - padding 24 bytes */
548 UNIHDR hdr_mach_acct; /* unicode header for machine account */
549 uint32 padding_2; /* 0 - padding 4 bytes */
551 uint32 ptr_1; /* pointer */
552 uint8 padding_3[32]; /* 0 - padding 32 bytes */
553 uint32 padding_4; /* 0 - padding 4 bytes */
555 uint32 ptr_2; /* pointer */
556 uint32 padding_5; /* 0 - padding 4 bytes */
558 uint32 ptr_3; /* pointer */
559 uint8 padding_6[32]; /* 0 - padding 32 bytes */
561 uint32 rid_user; /* user RID */
562 uint32 rid_group; /* group RID */
564 uint16 acct_ctrl; /* 0080 - ACB_XXXX */
565 uint16 unknown_3; /* 16 bit padding */
567 uint16 unknown_4; /* 0x003f - 16 bit unknown */
568 uint16 unknown_5; /* 0x003c - 16 bit unknown */
570 uint8 padding_7[16]; /* 0 - padding 16 bytes */
571 uint32 padding_8; /* 0 - padding 4 bytes */
573 UNISTR2 uni_mach_acct; /* unicode string for machine account */
575 uint8 padding_9[48]; /* 0 - padding 48 bytes */
580 /* SAM_USER_INFO_10 */
581 typedef struct sam_user_info_10
589 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
590 typedef struct q_samr_close_hnd_info
592 POLICY_HND pol; /* policy handle */
597 /* SAMR_R_CLOSE_HND - probably a policy handle close */
598 typedef struct r_samr_close_hnd_info
600 POLICY_HND pol; /* policy handle */
601 NTSTATUS status; /* return status */
606 /****************************************************************************
607 SAMR_Q_GET_USRDOM_PWINFO - a "set user info" occurs just after this
608 *****************************************************************************/
610 /* SAMR_Q_GET_USRDOM_PWINFO */
611 typedef struct q_samr_usrdom_pwinfo_info
613 POLICY_HND user_pol; /* policy handle */
615 } SAMR_Q_GET_USRDOM_PWINFO;
618 /****************************************************************************
619 SAMR_R_GET_USRDOM_PWINFO - a "set user info" occurs just after this
620 *****************************************************************************/
622 /* SAMR_R_GET_USRDOM_PWINFO */
623 typedef struct r_samr_usrdom_pwinfo_info
625 uint16 unknown_0; /* 0000 */
626 uint16 unknown_1; /* 0x0016 or 0x0015 */
627 uint32 unknown_2; /* 0x0000 0000 */
630 } SAMR_R_GET_USRDOM_PWINFO;
632 /****************************************************************************
633 SAMR_Q_SET_SEC_OBJ - info level 4.
634 *****************************************************************************/
636 /* SAMR_Q_SET_SEC_OBJ - */
637 typedef struct q_samr_set_sec_obj_info
639 POLICY_HND pol; /* policy handle */
640 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
643 } SAMR_Q_SET_SEC_OBJ;
645 /* SAMR_R_SET_SEC_OBJ - */
646 typedef struct r_samr_set_sec_obj_info
648 NTSTATUS status; /* return status */
650 } SAMR_R_SET_SEC_OBJ;
653 /****************************************************************************
654 SAMR_Q_QUERY_SEC_OBJ - info level 4. returns SIDs.
655 *****************************************************************************/
657 /* SAMR_Q_QUERY_SEC_OBJ - probably get domain info... */
658 typedef struct q_samr_query_sec_obj_info
660 POLICY_HND user_pol; /* policy handle */
661 uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
663 } SAMR_Q_QUERY_SEC_OBJ;
665 /* SAMR_R_QUERY_SEC_OBJ - probably an open */
666 typedef struct r_samr_query_sec_obj_info
671 NTSTATUS status; /* return status */
673 } SAMR_R_QUERY_SEC_OBJ;
676 /****************************************************************************
677 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
678 *****************************************************************************/
680 /* SAMR_Q_QUERY_DOMAIN_INFO - */
681 typedef struct q_samr_query_domain_info
683 POLICY_HND domain_pol; /* policy handle */
684 uint16 switch_value; /* 0x0002, 0x0001 */
686 } SAMR_Q_QUERY_DOMAIN_INFO;
688 typedef struct sam_unknown_info_3_info
691 /* 0x8000 0000 */ /* DON'T forcibly disconnect remote users from server when logon hours expire*/
693 /* 0x0000 0000 */ /* forcibly disconnect remote users from server when logon hours expire*/
697 typedef struct sam_unknown_info_6_info
699 uint32 unknown_0; /* 0x0000 0000 */
701 uint32 ptr_0; /* pointer to unknown structure */
702 uint8 padding[12]; /* 12 bytes zeros */
706 typedef struct sam_unknown_info_7_info
708 uint16 unknown_0; /* 0x0003 */
712 typedef struct sam_unknown_info_12_inf
716 uint16 bad_attempt_lockout;
720 typedef struct sam_unknown_info_5_inf
722 UNIHDR hdr_server; /* server name unicode header */
723 UNISTR2 uni_server; /* server name unicode string */
727 typedef struct sam_unknown_info_2_inf
729 uint32 unknown_0; /* 0x0000 0000 */
730 uint32 unknown_1; /* 0x8000 0000 */
731 uint32 unknown_2; /* 0x0000 0000 */
733 uint32 ptr_0; /* pointer to unknown structure */
734 UNIHDR hdr_domain; /* domain name unicode header */
735 UNIHDR hdr_server; /* server name unicode header */
737 /* put all the data in here, at the moment, including what the above
738 pointer is referring to
741 uint32 seq_num; /* some sort of incrementing sequence number? */
742 uint32 unknown_3; /* 0x0000 0000 */
744 uint32 unknown_4; /* 0x0000 0001 */
745 uint32 unknown_5; /* 0x0000 0003 */
746 uint32 unknown_6; /* 0x0000 0001 */
747 uint32 num_domain_usrs; /* number of users in domain */
748 uint32 num_domain_grps; /* number of domain groups in domain */
749 uint32 num_local_grps; /* number of local groups in domain */
751 uint8 padding[12]; /* 12 bytes zeros */
753 UNISTR2 uni_domain; /* domain name unicode string */
754 UNISTR2 uni_server; /* server name unicode string */
758 typedef struct sam_unknown_info_1_inf
760 uint16 min_length_password;
761 uint16 password_history;
764 NTTIME min_passwordage;
769 typedef struct sam_unknown_ctr_info
779 SAM_UNK_INFO_12 inf12;
786 /* SAMR_R_QUERY_DOMAIN_INFO - */
787 typedef struct r_samr_query_domain_info
790 uint16 switch_value; /* same as in query */
794 NTSTATUS status; /* return status */
796 } SAMR_R_QUERY_DOMAIN_INFO;
799 /* SAMR_Q_LOOKUP_DOMAIN - obtain SID for a local domain */
800 typedef struct q_samr_lookup_domain_info
802 POLICY_HND connect_pol;
807 } SAMR_Q_LOOKUP_DOMAIN;
810 /* SAMR_R_LOOKUP_DOMAIN */
811 typedef struct r_samr_lookup_domain_info
818 } SAMR_R_LOOKUP_DOMAIN;
821 /****************************************************************************
822 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
824 0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
825 0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
826 *****************************************************************************/
828 /* SAMR_Q_OPEN_DOMAIN */
829 typedef struct q_samr_open_domain_info
831 POLICY_HND pol; /* policy handle */
832 uint32 flags; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */
833 DOM_SID2 dom_sid; /* domain SID */
835 } SAMR_Q_OPEN_DOMAIN;
838 /* SAMR_R_OPEN_DOMAIN - probably an open */
839 typedef struct r_samr_open_domain_info
841 POLICY_HND domain_pol; /* policy handle associated with the SID */
842 NTSTATUS status; /* return status */
844 } SAMR_R_OPEN_DOMAIN;
846 #define MAX_SAM_ENTRIES_W2K 0x400
847 #define MAX_SAM_ENTRIES_W95 50
848 /* The following should be the greater of the preceeding two. */
849 #define MAX_SAM_ENTRIES MAX_SAM_ENTRIES_W2K
851 typedef struct samr_entry_info
859 /* SAMR_Q_ENUM_DOMAINS - SAM rids and names */
860 typedef struct q_samr_enum_domains_info
862 POLICY_HND pol; /* policy handle */
864 uint32 start_idx; /* enumeration handle */
865 uint32 max_size; /* 0x0000 ffff */
867 } SAMR_Q_ENUM_DOMAINS;
869 /* SAMR_R_ENUM_DOMAINS - SAM rids and Domain names */
870 typedef struct r_samr_enum_domains_info
872 uint32 next_idx; /* next starting index required for enum */
881 UNISTR2 *uni_dom_name;
887 } SAMR_R_ENUM_DOMAINS;
889 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
890 typedef struct q_samr_enum_dom_users_info
892 POLICY_HND pol; /* policy handle */
894 uint32 start_idx; /* number of values (0 indicates unlimited?) */
895 uint16 acb_mask; /* 0x0000 indicates all */
896 uint16 unknown_1; /* 0x0000 */
898 uint32 max_size; /* 0x0000 ffff */
900 } SAMR_Q_ENUM_DOM_USERS;
903 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
904 typedef struct r_samr_enum_dom_users_info
906 uint32 next_idx; /* next starting index required for enum */
915 UNISTR2 *uni_acct_name;
921 } SAMR_R_ENUM_DOM_USERS;
924 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
925 typedef struct q_samr_enum_dom_groups_info
927 POLICY_HND pol; /* policy handle */
929 /* this is possibly an enumeration context handle... */
930 uint32 start_idx; /* 0x0000 0000 */
932 uint32 max_size; /* 0x0000 ffff */
934 } SAMR_Q_ENUM_DOM_GROUPS;
937 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
938 typedef struct r_samr_enum_dom_groups_info
949 UNISTR2 *uni_grp_name;
955 } SAMR_R_ENUM_DOM_GROUPS;
958 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
959 typedef struct q_samr_enum_dom_aliases_info
961 POLICY_HND pol; /* policy handle */
963 /* this is possibly an enumeration context handle... */
964 uint32 start_idx; /* 0x0000 0000 */
966 uint32 max_size; /* 0x0000 ffff */
968 } SAMR_Q_ENUM_DOM_ALIASES;
971 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
972 typedef struct r_samr_enum_dom_aliases_info
983 UNISTR2 *uni_grp_name;
989 } SAMR_R_ENUM_DOM_ALIASES;
992 /* -- Level 1 Display Info - User Information -- */
994 typedef struct samr_entry_info1
1001 UNIHDR hdr_acct_name;
1002 UNIHDR hdr_user_name;
1003 UNIHDR hdr_user_desc;
1007 typedef struct samr_str_entry_info1
1009 UNISTR2 uni_acct_name;
1010 UNISTR2 uni_full_name;
1011 UNISTR2 uni_acct_desc;
1015 typedef struct sam_entry_info_1
1023 /* -- Level 2 Display Info - Trust Account Information -- */
1025 typedef struct samr_entry_info2
1032 UNIHDR hdr_srv_name;
1033 UNIHDR hdr_srv_desc;
1037 typedef struct samr_str_entry_info2
1039 UNISTR2 uni_srv_name;
1040 UNISTR2 uni_srv_desc;
1044 typedef struct sam_entry_info_2
1052 /* -- Level 3 Display Info - Domain Group Information -- */
1054 typedef struct samr_entry_info3
1059 uint32 attr; /* SE_GROUP_xxx, usually 7 */
1061 UNIHDR hdr_grp_name;
1062 UNIHDR hdr_grp_desc;
1066 typedef struct samr_str_entry_info3
1068 UNISTR2 uni_grp_name;
1069 UNISTR2 uni_grp_desc;
1073 typedef struct sam_entry_info_3
1081 /* -- Level 4 Display Info - User List (ASCII) -- */
1083 typedef struct samr_entry_info4
1086 STRHDR hdr_acct_name;
1090 typedef struct samr_str_entry_info4
1096 typedef struct sam_entry_info_4
1104 /* -- Level 5 Display Info - Group List (ASCII) -- */
1106 typedef struct samr_entry_info5
1109 STRHDR hdr_grp_name;
1113 typedef struct samr_str_entry_info5
1119 typedef struct sam_entry_info_5
1127 typedef struct sam_dispinfo_ctr_info
1131 SAM_DISPINFO_1 *info1; /* users/names/descriptions */
1132 SAM_DISPINFO_2 *info2; /* trust accounts */
1133 SAM_DISPINFO_3 *info3; /* domain groups/descriptions */
1134 SAM_DISPINFO_4 *info4; /* user list (ASCII) - used by Win95 */
1135 SAM_DISPINFO_5 *info5; /* group list (ASCII) */
1136 void *info; /* allows assignment without typecasting, */
1143 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
1144 typedef struct q_samr_query_disp_info
1146 POLICY_HND domain_pol;
1148 uint16 switch_level; /* see SAM_DISPINFO_CTR above */
1151 uint32 start_idx; /* start enumeration index */
1152 uint32 max_entries; /* maximum number of entries to return */
1153 uint32 max_size; /* recommended data size; if exceeded server
1154 should return STATUS_MORE_ENTRIES */
1156 } SAMR_Q_QUERY_DISPINFO;
1159 /* SAMR_R_QUERY_DISPINFO */
1160 typedef struct r_samr_query_dispinfo_info
1162 uint32 total_size; /* total data size for all matching entries
1163 (0 = uncalculated) */
1164 uint32 data_size; /* actual data size returned = size of SAM_ENTRY
1165 structures + total length of strings */
1167 uint16 switch_level; /* see SAM_DISPINFO_CTR above */
1170 uint32 num_entries; /* number of entries returned */
1172 uint32 num_entries2;
1174 SAM_DISPINFO_CTR *ctr;
1178 } SAMR_R_QUERY_DISPINFO;
1181 /* SAMR_Q_DELETE_DOM_GROUP - delete domain group */
1182 typedef struct q_samr_delete_dom_group_info
1184 POLICY_HND group_pol; /* policy handle */
1186 } SAMR_Q_DELETE_DOM_GROUP;
1189 /* SAMR_R_DELETE_DOM_GROUP - delete domain group */
1190 typedef struct r_samr_delete_dom_group_info
1192 POLICY_HND pol; /* policy handle */
1193 NTSTATUS status; /* return status */
1195 } SAMR_R_DELETE_DOM_GROUP;
1198 /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */
1199 typedef struct q_samr_create_dom_group_info
1201 POLICY_HND pol; /* policy handle */
1203 UNIHDR hdr_acct_desc;
1204 UNISTR2 uni_acct_desc;
1208 } SAMR_Q_CREATE_DOM_GROUP;
1210 /* SAMR_R_CREATE_DOM_GROUP - SAM create group */
1211 typedef struct r_samr_create_dom_group_info
1213 POLICY_HND pol; /* policy handle */
1218 } SAMR_R_CREATE_DOM_GROUP;
1220 /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */
1221 typedef struct q_samr_query_group_info
1223 POLICY_HND pol; /* policy handle */
1225 uint16 switch_level; /* 0x0001 seen */
1227 } SAMR_Q_QUERY_GROUPINFO;
1229 typedef struct samr_group_info1
1231 UNIHDR hdr_acct_name;
1233 uint32 unknown_1; /* 0x0000 0003 - number of group members? */
1234 uint32 num_members; /* 0x0000 0001 - number of group members? */
1236 UNIHDR hdr_acct_desc;
1238 UNISTR2 uni_acct_name;
1239 UNISTR2 uni_acct_desc;
1243 typedef struct samr_group_info3
1245 uint32 unknown_1; /* 0x0000 0003 - number of group members? */
1249 typedef struct samr_group_info4
1251 UNIHDR hdr_acct_desc;
1252 UNISTR2 uni_acct_desc;
1256 /* GROUP_INFO_CTR */
1257 typedef struct group_info_ctr
1259 uint16 switch_value1;
1271 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
1272 typedef struct r_samr_query_groupinfo_info
1275 GROUP_INFO_CTR *ctr;
1279 } SAMR_R_QUERY_GROUPINFO;
1282 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
1283 typedef struct q_samr_set_group_info
1285 POLICY_HND pol; /* policy handle */
1286 GROUP_INFO_CTR *ctr;
1288 } SAMR_Q_SET_GROUPINFO;
1290 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
1291 typedef struct r_samr_set_group_info
1295 } SAMR_R_SET_GROUPINFO;
1298 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
1299 typedef struct q_samr_delete_dom_alias_info
1301 POLICY_HND alias_pol; /* policy handle */
1303 } SAMR_Q_DELETE_DOM_ALIAS;
1306 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
1307 typedef struct r_samr_delete_dom_alias_info
1309 POLICY_HND pol; /* policy handle */
1310 NTSTATUS status; /* return status */
1312 } SAMR_R_DELETE_DOM_ALIAS;
1315 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
1316 typedef struct q_samr_create_dom_alias_info
1318 POLICY_HND dom_pol; /* policy handle */
1320 UNIHDR hdr_acct_desc;
1321 UNISTR2 uni_acct_desc;
1323 uint32 access_mask; /* 0x001f000f */
1325 } SAMR_Q_CREATE_DOM_ALIAS;
1327 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
1328 typedef struct r_samr_create_dom_alias_info
1330 POLICY_HND alias_pol; /* policy handle */
1335 } SAMR_R_CREATE_DOM_ALIAS;
1337 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
1338 typedef struct q_samr_query_alias_info
1340 POLICY_HND pol; /* policy handle */
1342 uint16 switch_level; /* 0x0003 seen */
1344 } SAMR_Q_QUERY_ALIASINFO;
1346 typedef struct samr_alias_info1
1348 UNIHDR hdr_acct_name;
1349 UNIHDR hdr_acct_desc;
1351 UNISTR2 uni_acct_name;
1352 UNISTR2 uni_acct_desc;
1356 typedef struct samr_alias_info3
1358 UNIHDR hdr_acct_desc;
1359 UNISTR2 uni_acct_desc;
1363 /* ALIAS_INFO_CTR */
1364 typedef struct alias_info_ctr
1366 uint16 switch_value1;
1367 uint16 switch_value2;
1378 /* SAMR_R_QUERY_ALIASINFO - SAM alias info */
1379 typedef struct r_samr_query_aliasinfo_info
1386 } SAMR_R_QUERY_ALIASINFO;
1389 /* SAMR_Q_SET_ALIASINFO - SAM Alias Info */
1390 typedef struct q_samr_set_alias_info
1392 POLICY_HND alias_pol; /* policy handle */
1395 } SAMR_Q_SET_ALIASINFO;
1397 /* SAMR_R_SET_ALIASINFO - SAM alias info */
1398 typedef struct r_samr_set_aliasinfo_info
1402 } SAMR_R_SET_ALIASINFO;
1405 /* SAMR_Q_QUERY_USERGROUPS - */
1406 typedef struct q_samr_query_usergroup_info
1408 POLICY_HND pol; /* policy handle associated with unknown id */
1410 } SAMR_Q_QUERY_USERGROUPS;
1412 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
1413 typedef struct r_samr_query_usergroup_info
1415 uint32 ptr_0; /* pointer */
1416 uint32 num_entries; /* number of RID groups */
1417 uint32 ptr_1; /* pointer */
1418 uint32 num_entries2; /* number of RID groups */
1420 DOM_GID *gid; /* group info */
1422 NTSTATUS status; /* return status */
1424 } SAMR_R_QUERY_USERGROUPS;
1426 /* SAM_USERINFO_CTR - sam user info */
1427 typedef struct sam_userinfo_ctr_info
1429 uint16 switch_value;
1433 SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
1434 SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
1435 SAM_USER_INFO_12 *id12; /* auth-level 0x12 */
1436 SAM_USER_INFO_20 *id20; /* auth-level 20 */
1437 SAM_USER_INFO_21 *id21; /* auth-level 21 */
1438 SAM_USER_INFO_23 *id23; /* auth-level 0x17 */
1439 SAM_USER_INFO_24 *id24; /* auth-level 0x18 */
1440 SAM_USER_INFO_25 *id25; /* auth-level 0x19 */
1441 void* id; /* to make typecasting easy */
1448 /* SAMR_Q_SET_USERINFO2 - set sam info */
1449 typedef struct q_samr_set_user_info2
1451 POLICY_HND pol; /* policy handle associated with user */
1452 uint16 switch_value; /* 0x0010 */
1454 SAM_USERINFO_CTR *ctr;
1456 } SAMR_Q_SET_USERINFO2;
1458 /* SAMR_R_SET_USERINFO2 - set sam info */
1459 typedef struct r_samr_set_user_info2
1461 NTSTATUS status; /* return status */
1463 } SAMR_R_SET_USERINFO2;
1465 /* SAMR_Q_SET_USERINFO - set sam info */
1466 typedef struct q_samr_set_user_info
1468 POLICY_HND pol; /* policy handle associated with user */
1469 uint16 switch_value;
1470 SAM_USERINFO_CTR *ctr;
1472 } SAMR_Q_SET_USERINFO;
1474 /* SAMR_R_SET_USERINFO - set sam info */
1475 typedef struct r_samr_set_user_info
1477 NTSTATUS status; /* return status */
1479 } SAMR_R_SET_USERINFO;
1482 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
1483 typedef struct q_samr_query_user_info
1485 POLICY_HND pol; /* policy handle associated with unknown id */
1486 uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
1488 } SAMR_Q_QUERY_USERINFO;
1490 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
1491 typedef struct r_samr_query_user_info
1493 uint32 ptr; /* pointer */
1494 SAM_USERINFO_CTR *ctr;
1496 NTSTATUS status; /* return status */
1498 } SAMR_R_QUERY_USERINFO;
1501 /****************************************************************************
1502 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
1504 the policy handle allocated by an "samr open secret" call is associated
1505 with a SID. this policy handle is what is queried here, *not* the SID
1506 itself. the response to the lookup rids is relative to this SID.
1507 *****************************************************************************/
1508 /* SAMR_Q_QUERY_USERALIASES */
1509 typedef struct q_samr_query_useraliases_info
1511 POLICY_HND pol; /* policy handle */
1513 uint32 num_sids1; /* number of rids being looked up */
1514 uint32 ptr; /* buffer pointer */
1515 uint32 num_sids2; /* number of rids being looked up */
1517 uint32 *ptr_sid; /* pointers to sids to be looked up */
1518 DOM_SID2 *sid ; /* sids to be looked up. */
1520 } SAMR_Q_QUERY_USERALIASES;
1523 /* SAMR_R_QUERY_USERALIASES */
1524 typedef struct r_samr_query_useraliases_info
1527 uint32 ptr; /* undocumented buffer pointer */
1529 uint32 num_entries2;
1530 uint32 *rid; /* domain RIDs being looked up */
1532 NTSTATUS status; /* return code */
1534 } SAMR_R_QUERY_USERALIASES;
1537 /****************************************************************************
1538 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
1539 *****************************************************************************/
1540 /* SAMR_Q_LOOKUP_NAMES */
1541 typedef struct q_samr_lookup_names_info
1543 POLICY_HND pol; /* policy handle */
1545 uint32 num_names1; /* number of names being looked up */
1546 uint32 flags; /* 0x0000 03e8 - unknown */
1547 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1548 uint32 num_names2; /* number of names being looked up */
1550 UNIHDR *hdr_name; /* unicode account name header */
1551 UNISTR2 *uni_name; /* unicode account name string */
1553 } SAMR_Q_LOOKUP_NAMES;
1556 /* SAMR_R_LOOKUP_NAMES */
1557 typedef struct r_samr_lookup_names_info
1559 uint32 num_rids1; /* number of aliases being looked up */
1560 uint32 ptr_rids; /* pointer to aliases */
1561 uint32 num_rids2; /* number of aliases being looked up */
1563 uint32 *rids; /* rids */
1565 uint32 num_types1; /* number of users in aliases being looked up */
1566 uint32 ptr_types; /* pointer to users in aliases */
1567 uint32 num_types2; /* number of users in aliases being looked up */
1569 uint32 *types; /* SID_ENUM type */
1571 NTSTATUS status; /* return code */
1573 } SAMR_R_LOOKUP_NAMES;
1576 /****************************************************************************
1577 SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something.
1579 called to resolve domain RID groups.
1580 *****************************************************************************/
1581 /* SAMR_Q_LOOKUP_RIDS */
1582 typedef struct q_samr_lookup_rids_info
1584 POLICY_HND pol; /* policy handle */
1586 uint32 num_rids1; /* number of rids being looked up */
1587 uint32 flags; /* 0x0000 03e8 - unknown */
1588 uint32 ptr; /* 0x0000 0000 - 32 bit unknown */
1589 uint32 num_rids2; /* number of rids being looked up */
1591 uint32 *rid; /* domain RIDs being looked up */
1593 } SAMR_Q_LOOKUP_RIDS;
1596 /****************************************************************************
1597 SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names
1599 *****************************************************************************/
1600 /* SAMR_R_LOOKUP_RIDS */
1601 typedef struct r_samr_lookup_rids_info
1603 uint32 num_names1; /* number of aliases being looked up */
1604 uint32 ptr_names; /* pointer to aliases */
1605 uint32 num_names2; /* number of aliases being looked up */
1607 UNIHDR *hdr_name; /* unicode account name header */
1608 UNISTR2 *uni_name; /* unicode account name string */
1610 uint32 num_types1; /* number of users in aliases being looked up */
1611 uint32 ptr_types; /* pointer to users in aliases */
1612 uint32 num_types2; /* number of users in aliases being looked up */
1614 uint32 *type; /* SID_ENUM type */
1618 } SAMR_R_LOOKUP_RIDS;
1621 /* SAMR_Q_OPEN_USER - probably an open */
1622 typedef struct q_samr_open_user_info
1624 POLICY_HND domain_pol; /* policy handle */
1625 uint32 access_mask; /* 32 bit unknown - 0x02011b */
1626 uint32 user_rid; /* user RID */
1631 /* SAMR_R_OPEN_USER - probably an open */
1632 typedef struct r_samr_open_user_info
1634 POLICY_HND user_pol; /* policy handle associated with unknown id */
1635 NTSTATUS status; /* return status */
1640 /* SAMR_Q_CREATE_USER - probably a create */
1641 typedef struct q_samr_create_user_info
1643 POLICY_HND domain_pol; /* policy handle */
1645 UNIHDR hdr_name; /* unicode account name header */
1646 UNISTR2 uni_name; /* unicode account name */
1648 uint32 acb_info; /* account control info */
1649 uint32 access_mask; /* 0xe005 00b0 */
1651 } SAMR_Q_CREATE_USER;
1654 /* SAMR_R_CREATE_USER - probably a create */
1655 typedef struct r_samr_create_user_info
1657 POLICY_HND user_pol; /* policy handle associated with user */
1659 uint32 access_granted;
1660 uint32 user_rid; /* user RID */
1661 NTSTATUS status; /* return status */
1663 } SAMR_R_CREATE_USER;
1666 /* SAMR_Q_DELETE_DOM_USER - delete domain user */
1667 typedef struct q_samr_delete_dom_user_info
1669 POLICY_HND user_pol; /* policy handle */
1671 } SAMR_Q_DELETE_DOM_USER;
1674 /* SAMR_R_DELETE_DOM_USER - delete domain user */
1675 typedef struct r_samr_delete_dom_user_info
1677 POLICY_HND pol; /* policy handle */
1678 NTSTATUS status; /* return status */
1680 } SAMR_R_DELETE_DOM_USER;
1683 /* SAMR_Q_QUERY_GROUPMEM - query group members */
1684 typedef struct q_samr_query_groupmem_info
1686 POLICY_HND group_pol; /* policy handle */
1688 } SAMR_Q_QUERY_GROUPMEM;
1691 /* SAMR_R_QUERY_GROUPMEM - query group members */
1692 typedef struct r_samr_query_groupmem_info
1708 } SAMR_R_QUERY_GROUPMEM;
1711 /* SAMR_Q_DEL_GROUPMEM - probably an del group member */
1712 typedef struct q_samr_del_group_mem_info
1714 POLICY_HND pol; /* policy handle */
1715 uint32 rid; /* rid */
1717 } SAMR_Q_DEL_GROUPMEM;
1720 /* SAMR_R_DEL_GROUPMEM - probably an del group member */
1721 typedef struct r_samr_del_group_mem_info
1723 NTSTATUS status; /* return status */
1725 } SAMR_R_DEL_GROUPMEM;
1728 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
1729 typedef struct q_samr_add_group_mem_info
1731 POLICY_HND pol; /* policy handle */
1733 uint32 rid; /* rid */
1734 uint32 unknown; /* 0x0000 0005 */
1736 } SAMR_Q_ADD_GROUPMEM;
1739 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
1740 typedef struct r_samr_add_group_mem_info
1742 NTSTATUS status; /* return status */
1744 } SAMR_R_ADD_GROUPMEM;
1747 /* SAMR_Q_OPEN_GROUP - probably an open */
1748 typedef struct q_samr_open_group_info
1750 POLICY_HND domain_pol; /* policy handle */
1751 uint32 access_mask; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
1752 uint32 rid_group; /* rid */
1754 } SAMR_Q_OPEN_GROUP;
1757 /* SAMR_R_OPEN_GROUP - probably an open */
1758 typedef struct r_samr_open_group_info
1760 POLICY_HND pol; /* policy handle */
1761 NTSTATUS status; /* return status */
1763 } SAMR_R_OPEN_GROUP;
1766 /* SAMR_Q_QUERY_ALIASMEM - query alias members */
1767 typedef struct q_samr_query_aliasmem_info
1769 POLICY_HND alias_pol; /* policy handle */
1771 } SAMR_Q_QUERY_ALIASMEM;
1774 /* SAMR_R_QUERY_ALIASMEM - query alias members */
1775 typedef struct r_samr_query_aliasmem_info
1785 } SAMR_R_QUERY_ALIASMEM;
1788 /* SAMR_Q_ADD_ALIASMEM - add alias member */
1789 typedef struct q_samr_add_alias_mem_info
1791 POLICY_HND alias_pol; /* policy handle */
1793 DOM_SID2 sid; /* member sid to be added to the alias */
1795 } SAMR_Q_ADD_ALIASMEM;
1798 /* SAMR_R_ADD_ALIASMEM - add alias member */
1799 typedef struct r_samr_add_alias_mem_info
1801 NTSTATUS status; /* return status */
1803 } SAMR_R_ADD_ALIASMEM;
1806 /* SAMR_Q_DEL_ALIASMEM - add an add alias member */
1807 typedef struct q_samr_del_alias_mem_info
1809 POLICY_HND alias_pol; /* policy handle */
1811 DOM_SID2 sid; /* member sid to be added to alias */
1813 } SAMR_Q_DEL_ALIASMEM;
1816 /* SAMR_R_DEL_ALIASMEM - delete alias member */
1817 typedef struct r_samr_del_alias_mem_info
1819 NTSTATUS status; /* return status */
1821 } SAMR_R_DEL_ALIASMEM;
1825 /* SAMR_Q_OPEN_ALIAS - probably an open */
1826 typedef struct q_samr_open_alias_info
1833 } SAMR_Q_OPEN_ALIAS;
1836 /* SAMR_R_OPEN_ALIAS - probably an open */
1837 typedef struct r_samr_open_alias_info
1839 POLICY_HND pol; /* policy handle */
1840 NTSTATUS status; /* return status */
1842 } SAMR_R_OPEN_ALIAS;
1845 /* SAMR_Q_CONNECT_ANON - probably an open */
1846 typedef struct q_samr_connect_anon_info
1848 uint32 ptr; /* ptr? */
1849 uint16 unknown_0; /* 0x005c */
1850 uint16 unknown_1; /* 0x0001 */
1853 } SAMR_Q_CONNECT_ANON;
1855 /* SAMR_R_CONNECT_ANON - probably an open */
1856 typedef struct r_samr_connect_anon_info
1858 POLICY_HND connect_pol; /* policy handle */
1859 NTSTATUS status; /* return status */
1861 } SAMR_R_CONNECT_ANON;
1863 /* SAMR_Q_CONNECT - probably an open */
1864 typedef struct q_samr_connect_info
1866 uint32 ptr_srv_name; /* pointer (to server name?) */
1867 UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */
1874 /* SAMR_R_CONNECT - probably an open */
1875 typedef struct r_samr_connect_info
1877 POLICY_HND connect_pol; /* policy handle */
1878 NTSTATUS status; /* return status */
1882 /* SAMR_Q_CONNECT4 */
1883 typedef struct q_samr_connect4_info
1885 uint32 ptr_srv_name; /* pointer to server name */
1886 UNISTR2 uni_srv_name;
1888 uint32 unk_0; /* possible server name type, 1 for IP num, 2 for name */
1892 /* SAMR_R_CONNECT4 - same format as connect */
1893 typedef struct r_samr_connect_info SAMR_R_CONNECT4;
1895 /* SAMR_Q_GET_DOM_PWINFO */
1896 typedef struct q_samr_get_dom_pwinfo
1899 UNIHDR hdr_srv_name;
1900 UNISTR2 uni_srv_name;
1902 } SAMR_Q_GET_DOM_PWINFO;
1904 /* SAMR_R_GET_DOM_PWINFO */
1905 typedef struct r_samr_get_dom_pwinfo
1908 * Previously this was 3 uint16's. However, after some tests
1909 * it appears that the data len for the signing needs to be 16.
1910 * Not sure how 3 unit16's ever worked since the length always
1911 * turned out to 12. 3 uint32's + NT_STATUS == 16 bytes. Tested
1912 * using NT and 2k. --jerry
1919 } SAMR_R_GET_DOM_PWINFO;
1921 /* SAMR_ENC_PASSWD */
1922 typedef struct enc_passwd_info
1930 typedef struct enc_hash_info
1937 /* SAMR_Q_CHGPASSWD_USER */
1938 typedef struct q_samr_chgpasswd_user_info
1942 UNIHDR hdr_dest_host; /* server name unicode header */
1943 UNISTR2 uni_dest_host; /* server name unicode string */
1945 UNIHDR hdr_user_name; /* username unicode string header */
1946 UNISTR2 uni_user_name; /* username unicode string */
1948 SAMR_ENC_PASSWD nt_newpass;
1949 SAMR_ENC_HASH nt_oldhash;
1951 uint32 unknown; /* 0x0000 0001 */
1953 SAMR_ENC_PASSWD lm_newpass;
1954 SAMR_ENC_HASH lm_oldhash;
1956 } SAMR_Q_CHGPASSWD_USER;
1958 /* SAMR_R_CHGPASSWD_USER */
1959 typedef struct r_samr_chgpasswd_user_info
1961 NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1963 } SAMR_R_CHGPASSWD_USER;
1966 /* SAMR_Q_UNKNOWN_2D */
1967 typedef struct q_samr_unknown_2d_info
1969 POLICY_HND dom_pol; /* policy handle */
1970 DOM_SID2 sid; /* SID */
1972 } SAMR_Q_UNKNOWN_2D;
1975 /* SAMR_R_UNKNOWN_2D - probably an open */
1976 typedef struct r_samr_unknown_2d_info
1978 NTSTATUS status; /* return status */
1980 } SAMR_R_UNKNOWN_2D;
1984 /* these are from the old rpc_samr.h - they are needed while the merge
1985 is still going on */
1986 #define MAX_SAM_SIDS 15
1988 /* DOM_SID3 - security id */
1989 typedef struct sid_info_3
1991 uint16 len; /* length, bytes, including length of len :-) */
1998 /* SAMR_Q_UNKNOWN_2E */
1999 typedef struct q_samr_unknown_2e_info
2001 POLICY_HND domain_pol; /* policy handle */
2002 uint16 switch_value;
2004 } SAMR_Q_UNKNOWN_2E;
2006 /* SAMR_R_UNKNOWN_2E */
2007 typedef struct r_samr_unknown_2e_info
2010 uint16 switch_value;
2012 NTSTATUS status; /* return status */
2014 } SAMR_R_UNKNOWN_2E;
2016 /* SAMR_Q_SET_DOMAIN_INFO */
2017 typedef struct q_samr_set_domain_info
2019 POLICY_HND domain_pol; /* policy handle */
2020 uint16 switch_value0;
2021 uint16 switch_value;
2024 } SAMR_Q_SET_DOMAIN_INFO;
2026 /* SAMR_R_SET_DOMAIN_INFO */
2027 typedef struct r_samr_set_domain_info
2029 NTSTATUS status; /* return status */
2031 } SAMR_R_SET_DOMAIN_INFO;
2033 #endif /* _RPC_SAMR_H */