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 typedef struct logon_hours_info
152 uint32 len
; /* normally 21 bytes */
157 /* SAM_USER_INFO_23 */
158 typedef struct sam_user_info_23
160 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
161 NTTIME logon_time
; /* logon time */
162 NTTIME logoff_time
; /* logoff time */
163 NTTIME kickoff_time
; /* kickoff time */
164 NTTIME pass_last_set_time
; /* password last set time */
165 NTTIME pass_can_change_time
; /* password can change time */
166 NTTIME pass_must_change_time
; /* password must change time */
168 UNIHDR hdr_user_name
; /* NULL - user name unicode string header */
169 UNIHDR hdr_full_name
; /* user's full name unicode string header */
170 UNIHDR hdr_home_dir
; /* home directory unicode string header */
171 UNIHDR hdr_dir_drive
; /* home drive unicode string header */
172 UNIHDR hdr_logon_script
; /* logon script unicode string header */
173 UNIHDR hdr_profile_path
; /* profile path unicode string header */
174 UNIHDR hdr_acct_desc
; /* user description */
175 UNIHDR hdr_workstations
; /* comma-separated workstations user can log in from */
176 UNIHDR hdr_unknown_str
; /* don't know what this is, yet. */
177 UNIHDR hdr_munged_dial
; /* munged path name and dial-back tel number */
179 uint8 lm_pwd
[16]; /* lm user passwords */
180 uint8 nt_pwd
[16]; /* nt user passwords */
182 uint32 user_rid
; /* Primary User ID */
183 uint32 group_rid
; /* Primary Group ID */
185 uint32 acb_info
; /* account info (ACB_xxxx bit-mask) */
187 uint32 unknown_3
; /* 0x09f8 27fa */
189 uint16 logon_divs
; /* 0x0000 00a8 which is 168 which is num hrs in a week */
191 uint32 ptr_logon_hrs
; /* pointer to logon hours */
193 uint32 unknown_5
; /* 0x0001 0000 */
197 uint8 passmustchange
; /* 0x00 must change = 0x01 */
203 UNISTR2 uni_user_name
; /* NULL - username unicode string */
204 UNISTR2 uni_full_name
; /* user's full name unicode string */
205 UNISTR2 uni_home_dir
; /* home directory unicode string */
206 UNISTR2 uni_dir_drive
; /* home directory drive unicode string */
207 UNISTR2 uni_logon_script
; /* logon script unicode string */
208 UNISTR2 uni_profile_path
; /* profile path unicode string */
209 UNISTR2 uni_acct_desc
; /* user description unicode string */
210 UNISTR2 uni_workstations
; /* login from workstations unicode string */
211 UNISTR2 uni_unknown_str
; /* don't know what this is, yet. */
212 UNISTR2 uni_munged_dial
; /* munged path name and dial-back tel no */
214 uint32 unknown_6
; /* 0x0000 04ec */
221 /* SAM_USER_INFO_24 */
222 typedef struct sam_user_info_24
229 * NB. This structure is *definately* incorrect. It's my best guess
230 * currently for W2K SP2. The password field is encrypted in a different
231 * way than normal... And there are definately other problems. JRA.
234 /* SAM_USER_INFO_25 */
235 typedef struct sam_user_info_25
237 /* TIMES MAY NOT IN RIGHT ORDER!!!! */
238 NTTIME logon_time
; /* logon time */
239 NTTIME logoff_time
; /* logoff time */
240 NTTIME kickoff_time
; /* kickoff time */
241 NTTIME pass_last_set_time
; /* password last set time */
242 NTTIME pass_can_change_time
; /* password can change time */
243 NTTIME pass_must_change_time
; /* password must change time */
245 UNIHDR hdr_user_name
; /* NULL - user name unicode string header */
246 UNIHDR hdr_full_name
; /* user's full name unicode string header */
247 UNIHDR hdr_home_dir
; /* home directory unicode string header */
248 UNIHDR hdr_dir_drive
; /* home drive unicode string header */
249 UNIHDR hdr_logon_script
; /* logon script unicode string header */
250 UNIHDR hdr_profile_path
; /* profile path unicode string header */
251 UNIHDR hdr_acct_desc
; /* user description */
252 UNIHDR hdr_workstations
; /* comma-separated workstations user can log in from */
253 UNIHDR hdr_unknown_str
; /* don't know what this is, yet. */
254 UNIHDR hdr_munged_dial
; /* munged path name and dial-back tel number */
256 uint8 lm_pwd
[16]; /* lm user passwords */
257 uint8 nt_pwd
[16]; /* nt user passwords */
259 uint32 user_rid
; /* Primary User ID */
260 uint32 group_rid
; /* Primary Group ID */
262 uint32 acb_info
; /* account info (ACB_xxxx bit-mask) */
268 UNISTR2 uni_user_name
; /* NULL - username unicode string */
269 UNISTR2 uni_full_name
; /* user's full name unicode string */
270 UNISTR2 uni_home_dir
; /* home directory unicode string */
271 UNISTR2 uni_dir_drive
; /* home directory drive unicode string */
272 UNISTR2 uni_logon_script
; /* logon script unicode string */
273 UNISTR2 uni_profile_path
; /* profile path unicode string */
274 UNISTR2 uni_acct_desc
; /* user description unicode string */
275 UNISTR2 uni_workstations
; /* login from workstations unicode string */
276 UNISTR2 uni_unknown_str
; /* don't know what this is, yet. */
277 UNISTR2 uni_munged_dial
; /* munged path name and dial-back tel no */
281 /* SAM_USER_INFO_21 */
282 typedef struct sam_user_info_21
284 NTTIME logon_time
; /* logon time */
285 NTTIME logoff_time
; /* logoff time */
286 NTTIME kickoff_time
; /* kickoff time */
287 NTTIME pass_last_set_time
; /* password last set time */
288 NTTIME pass_can_change_time
; /* password can change time */
289 NTTIME pass_must_change_time
; /* password must change time */
291 UNIHDR hdr_user_name
; /* username unicode string header */
292 UNIHDR hdr_full_name
; /* user's full name unicode string header */
293 UNIHDR hdr_home_dir
; /* home directory unicode string header */
294 UNIHDR hdr_dir_drive
; /* home drive unicode string header */
295 UNIHDR hdr_logon_script
; /* logon script unicode string header */
296 UNIHDR hdr_profile_path
; /* profile path unicode string header */
297 UNIHDR hdr_acct_desc
; /* user description */
298 UNIHDR hdr_workstations
; /* comma-separated workstations user can log in from */
299 UNIHDR hdr_unknown_str
; /* don't know what this is, yet. */
300 UNIHDR hdr_munged_dial
; /* munged path name and dial-back tel number */
302 uint8 lm_pwd
[16]; /* lm user passwords */
303 uint8 nt_pwd
[16]; /* nt user passwords */
305 uint32 user_rid
; /* Primary User ID */
306 uint32 group_rid
; /* Primary Group ID */
308 uint32 acb_info
; /* account info (ACB_xxxx bit-mask) */
310 uint32 unknown_3
; /* 0x00ff ffff */
312 uint16 logon_divs
; /* 0x0000 00a8 which is 168 which is num hrs in a week */
314 uint32 ptr_logon_hrs
; /* unknown pointer */
316 uint32 unknown_5
; /* 0x0002 0000 */
320 uint8 passmustchange
; /* 0x00 must change = 0x01 */
324 UNISTR2 uni_user_name
; /* username unicode string */
325 UNISTR2 uni_full_name
; /* user's full name unicode string */
326 UNISTR2 uni_home_dir
; /* home directory unicode string */
327 UNISTR2 uni_dir_drive
; /* home directory drive unicode string */
328 UNISTR2 uni_logon_script
; /* logon script unicode string */
329 UNISTR2 uni_profile_path
; /* profile path unicode string */
330 UNISTR2 uni_acct_desc
; /* user description unicode string */
331 UNISTR2 uni_workstations
; /* login from workstations unicode string */
332 UNISTR2 uni_unknown_str
; /* don't know what this is, yet. */
333 UNISTR2 uni_munged_dial
; /* munged path name and dial-back tel number */
335 uint32 unknown_6
; /* 0x0000 04ec */
342 #define PASS_MUST_CHANGE_AT_NEXT_LOGON 0x01
343 #define PASS_DONT_CHANGE_AT_NEXT_LOGON 0x00
345 /* SAM_USER_INFO_20 */
346 typedef struct sam_user_info_20
348 UNIHDR hdr_munged_dial
; /* munged path name and dial-back tel number */
350 UNISTR2 uni_munged_dial
; /* munged path name and dial-back tel number */
354 /* SAM_USER_INFO_12 */
355 typedef struct sam_user_info_12
357 uint8 lm_pwd
[16]; /* lm user passwords */
358 uint8 nt_pwd
[16]; /* nt user passwords */
365 /* SAM_USER_INFO_11 */
366 typedef struct sam_user_info_11
368 uint8 padding_0
[16]; /* 0 - padding 16 bytes */
369 NTTIME expiry
; /* expiry time or something? */
370 uint8 padding_1
[24]; /* 0 - padding 24 bytes */
372 UNIHDR hdr_mach_acct
; /* unicode header for machine account */
373 uint32 padding_2
; /* 0 - padding 4 bytes */
375 uint32 ptr_1
; /* pointer */
376 uint8 padding_3
[32]; /* 0 - padding 32 bytes */
377 uint32 padding_4
; /* 0 - padding 4 bytes */
379 uint32 ptr_2
; /* pointer */
380 uint32 padding_5
; /* 0 - padding 4 bytes */
382 uint32 ptr_3
; /* pointer */
383 uint8 padding_6
[32]; /* 0 - padding 32 bytes */
385 uint32 rid_user
; /* user RID */
386 uint32 rid_group
; /* group RID */
388 uint16 acct_ctrl
; /* 0080 - ACB_XXXX */
389 uint16 unknown_3
; /* 16 bit padding */
391 uint16 unknown_4
; /* 0x003f - 16 bit unknown */
392 uint16 unknown_5
; /* 0x003c - 16 bit unknown */
394 uint8 padding_7
[16]; /* 0 - padding 16 bytes */
395 uint32 padding_8
; /* 0 - padding 4 bytes */
397 UNISTR2 uni_mach_acct
; /* unicode string for machine account */
399 uint8 padding_9
[48]; /* 0 - padding 48 bytes */
404 /* SAM_USER_INFO_10 */
405 typedef struct sam_user_info_10
413 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
414 typedef struct q_samr_close_hnd_info
416 POLICY_HND pol
; /* policy handle */
421 /* SAMR_R_CLOSE_HND - probably a policy handle close */
422 typedef struct r_samr_close_hnd_info
424 POLICY_HND pol
; /* policy handle */
425 NTSTATUS status
; /* return status */
430 /****************************************************************************
431 SAMR_Q_GET_USRDOM_PWINFO - a "set user info" occurs just after this
432 *****************************************************************************/
434 /* SAMR_Q_GET_USRDOM_PWINFO */
435 typedef struct q_samr_usrdom_pwinfo_info
437 POLICY_HND user_pol
; /* policy handle */
439 } SAMR_Q_GET_USRDOM_PWINFO
;
442 /****************************************************************************
443 SAMR_R_GET_USRDOM_PWINFO - a "set user info" occurs just after this
444 *****************************************************************************/
446 /* SAMR_R_GET_USRDOM_PWINFO */
447 typedef struct r_samr_usrdom_pwinfo_info
449 uint16 unknown_0
; /* 0000 */
450 uint16 unknown_1
; /* 0x0016 or 0x0015 */
451 uint32 unknown_2
; /* 0x0000 0000 */
454 } SAMR_R_GET_USRDOM_PWINFO
;
456 /****************************************************************************
457 SAMR_Q_SET_SEC_OBJ - info level 4.
458 *****************************************************************************/
460 /* SAMR_Q_SET_SEC_OBJ - */
461 typedef struct q_samr_set_sec_obj_info
463 POLICY_HND pol
; /* policy handle */
464 uint32 sec_info
; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
467 } SAMR_Q_SET_SEC_OBJ
;
469 /* SAMR_R_SET_SEC_OBJ - */
470 typedef struct r_samr_set_sec_obj_info
472 NTSTATUS status
; /* return status */
474 } SAMR_R_SET_SEC_OBJ
;
477 /****************************************************************************
478 SAMR_Q_QUERY_SEC_OBJ - info level 4. returns SIDs.
479 *****************************************************************************/
481 /* SAMR_Q_QUERY_SEC_OBJ - probably get domain info... */
482 typedef struct q_samr_query_sec_obj_info
484 POLICY_HND user_pol
; /* policy handle */
485 uint32 sec_info
; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
487 } SAMR_Q_QUERY_SEC_OBJ
;
489 /* SAMR_R_QUERY_SEC_OBJ - probably an open */
490 typedef struct r_samr_query_sec_obj_info
495 NTSTATUS status
; /* return status */
497 } SAMR_R_QUERY_SEC_OBJ
;
500 /****************************************************************************
501 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
502 *****************************************************************************/
504 /* SAMR_Q_QUERY_DOMAIN_INFO - */
505 typedef struct q_samr_query_domain_info
507 POLICY_HND domain_pol
; /* policy handle */
508 uint16 switch_value
; /* 0x0002, 0x0001 */
510 } SAMR_Q_QUERY_DOMAIN_INFO
;
512 typedef struct sam_unknown_info_3_info
515 /* 0x8000 0000 */ /* DON'T forcibly disconnect remote users from server when logon hours expire*/
517 /* 0x0000 0000 */ /* forcibly disconnect remote users from server when logon hours expire*/
521 typedef struct sam_unknown_info_6_info
523 uint32 unknown_0
; /* 0x0000 0000 */
525 uint32 ptr_0
; /* pointer to unknown structure */
526 uint8 padding
[12]; /* 12 bytes zeros */
530 typedef struct sam_unknown_info_7_info
532 uint16 unknown_0
; /* 0x0003 */
536 typedef struct sam_unknown_info_12_inf
540 uint16 bad_attempt_lockout
;
544 typedef struct sam_unknown_info_5_inf
546 UNIHDR hdr_server
; /* server name unicode header */
547 UNISTR2 uni_server
; /* server name unicode string */
551 typedef struct sam_unknown_info_2_inf
553 uint32 unknown_0
; /* 0x0000 0000 */
554 uint32 unknown_1
; /* 0x8000 0000 */
555 uint32 unknown_2
; /* 0x0000 0000 */
557 uint32 ptr_0
; /* pointer to unknown structure */
558 UNIHDR hdr_domain
; /* domain name unicode header */
559 UNIHDR hdr_server
; /* server name unicode header */
561 /* put all the data in here, at the moment, including what the above
562 pointer is referring to
565 uint32 seq_num
; /* some sort of incrementing sequence number? */
566 uint32 unknown_3
; /* 0x0000 0000 */
568 uint32 unknown_4
; /* 0x0000 0001 */
569 uint32 unknown_5
; /* 0x0000 0003 */
570 uint32 unknown_6
; /* 0x0000 0001 */
571 uint32 num_domain_usrs
; /* number of users in domain */
572 uint32 num_domain_grps
; /* number of domain groups in domain */
573 uint32 num_local_grps
; /* number of local groups in domain */
575 uint8 padding
[12]; /* 12 bytes zeros */
577 UNISTR2 uni_domain
; /* domain name unicode string */
578 UNISTR2 uni_server
; /* server name unicode string */
582 typedef struct sam_unknown_info_1_inf
584 uint16 min_length_password
;
585 uint16 password_history
;
588 NTTIME min_passwordage
;
593 typedef struct sam_unknown_ctr_info
603 SAM_UNK_INFO_12 inf12
;
610 /* SAMR_R_QUERY_DOMAIN_INFO - */
611 typedef struct r_samr_query_domain_info
614 uint16 switch_value
; /* same as in query */
618 NTSTATUS status
; /* return status */
620 } SAMR_R_QUERY_DOMAIN_INFO
;
623 /* SAMR_Q_LOOKUP_DOMAIN - obtain SID for a local domain */
624 typedef struct q_samr_lookup_domain_info
626 POLICY_HND connect_pol
;
631 } SAMR_Q_LOOKUP_DOMAIN
;
634 /* SAMR_R_LOOKUP_DOMAIN */
635 typedef struct r_samr_lookup_domain_info
642 } SAMR_R_LOOKUP_DOMAIN
;
645 /****************************************************************************
646 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
648 0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
649 0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
650 *****************************************************************************/
652 /* SAMR_Q_OPEN_DOMAIN */
653 typedef struct q_samr_open_domain_info
655 POLICY_HND pol
; /* policy handle */
656 uint32 flags
; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */
657 DOM_SID2 dom_sid
; /* domain SID */
659 } SAMR_Q_OPEN_DOMAIN
;
662 /* SAMR_R_OPEN_DOMAIN - probably an open */
663 typedef struct r_samr_open_domain_info
665 POLICY_HND domain_pol
; /* policy handle associated with the SID */
666 NTSTATUS status
; /* return status */
668 } SAMR_R_OPEN_DOMAIN
;
670 #define MAX_SAM_ENTRIES_W2K 0x400
671 #define MAX_SAM_ENTRIES_W95 50
672 /* The following should be the greater of the preceeding two. */
673 #define MAX_SAM_ENTRIES MAX_SAM_ENTRIES_W2K
675 typedef struct samr_entry_info
683 /* SAMR_Q_ENUM_DOMAINS - SAM rids and names */
684 typedef struct q_samr_enum_domains_info
686 POLICY_HND pol
; /* policy handle */
688 uint32 start_idx
; /* enumeration handle */
689 uint32 max_size
; /* 0x0000 ffff */
691 } SAMR_Q_ENUM_DOMAINS
;
693 /* SAMR_R_ENUM_DOMAINS - SAM rids and Domain names */
694 typedef struct r_samr_enum_domains_info
696 uint32 next_idx
; /* next starting index required for enum */
705 UNISTR2
*uni_dom_name
;
711 } SAMR_R_ENUM_DOMAINS
;
713 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
714 typedef struct q_samr_enum_dom_users_info
716 POLICY_HND pol
; /* policy handle */
718 uint32 start_idx
; /* number of values (0 indicates unlimited?) */
719 uint16 acb_mask
; /* 0x0000 indicates all */
720 uint16 unknown_1
; /* 0x0000 */
722 uint32 max_size
; /* 0x0000 ffff */
724 } SAMR_Q_ENUM_DOM_USERS
;
727 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
728 typedef struct r_samr_enum_dom_users_info
730 uint32 next_idx
; /* next starting index required for enum */
739 UNISTR2
*uni_acct_name
;
745 } SAMR_R_ENUM_DOM_USERS
;
748 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
749 typedef struct q_samr_enum_dom_groups_info
751 POLICY_HND pol
; /* policy handle */
753 /* this is possibly an enumeration context handle... */
754 uint32 start_idx
; /* 0x0000 0000 */
756 uint32 max_size
; /* 0x0000 ffff */
758 } SAMR_Q_ENUM_DOM_GROUPS
;
761 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
762 typedef struct r_samr_enum_dom_groups_info
773 UNISTR2
*uni_grp_name
;
779 } SAMR_R_ENUM_DOM_GROUPS
;
782 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
783 typedef struct q_samr_enum_dom_aliases_info
785 POLICY_HND pol
; /* policy handle */
787 /* this is possibly an enumeration context handle... */
788 uint32 start_idx
; /* 0x0000 0000 */
790 uint32 max_size
; /* 0x0000 ffff */
792 } SAMR_Q_ENUM_DOM_ALIASES
;
795 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
796 typedef struct r_samr_enum_dom_aliases_info
807 UNISTR2
*uni_grp_name
;
813 } SAMR_R_ENUM_DOM_ALIASES
;
816 /* -- Level 1 Display Info - User Information -- */
818 typedef struct samr_entry_info1
825 UNIHDR hdr_acct_name
;
826 UNIHDR hdr_user_name
;
827 UNIHDR hdr_user_desc
;
831 typedef struct samr_str_entry_info1
833 UNISTR2 uni_acct_name
;
834 UNISTR2 uni_full_name
;
835 UNISTR2 uni_acct_desc
;
839 typedef struct sam_entry_info_1
847 /* -- Level 2 Display Info - Trust Account Information -- */
849 typedef struct samr_entry_info2
861 typedef struct samr_str_entry_info2
863 UNISTR2 uni_srv_name
;
864 UNISTR2 uni_srv_desc
;
868 typedef struct sam_entry_info_2
876 /* -- Level 3 Display Info - Domain Group Information -- */
878 typedef struct samr_entry_info3
883 uint32 attr
; /* SE_GROUP_xxx, usually 7 */
890 typedef struct samr_str_entry_info3
892 UNISTR2 uni_grp_name
;
893 UNISTR2 uni_grp_desc
;
897 typedef struct sam_entry_info_3
905 /* -- Level 4 Display Info - User List (ASCII) -- */
907 typedef struct samr_entry_info4
910 STRHDR hdr_acct_name
;
914 typedef struct samr_str_entry_info4
920 typedef struct sam_entry_info_4
928 /* -- Level 5 Display Info - Group List (ASCII) -- */
930 typedef struct samr_entry_info5
937 typedef struct samr_str_entry_info5
943 typedef struct sam_entry_info_5
951 typedef struct sam_dispinfo_ctr_info
955 SAM_DISPINFO_1
*info1
; /* users/names/descriptions */
956 SAM_DISPINFO_2
*info2
; /* trust accounts */
957 SAM_DISPINFO_3
*info3
; /* domain groups/descriptions */
958 SAM_DISPINFO_4
*info4
; /* user list (ASCII) - used by Win95 */
959 SAM_DISPINFO_5
*info5
; /* group list (ASCII) */
960 void *info
; /* allows assignment without typecasting, */
967 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
968 typedef struct q_samr_query_disp_info
970 POLICY_HND domain_pol
;
972 uint16 switch_level
; /* see SAM_DISPINFO_CTR above */
975 uint32 start_idx
; /* start enumeration index */
976 uint32 max_entries
; /* maximum number of entries to return */
977 uint32 max_size
; /* recommended data size; if exceeded server
978 should return STATUS_MORE_ENTRIES */
980 } SAMR_Q_QUERY_DISPINFO
;
983 /* SAMR_R_QUERY_DISPINFO */
984 typedef struct r_samr_query_dispinfo_info
986 uint32 total_size
; /* total data size for all matching entries
987 (0 = uncalculated) */
988 uint32 data_size
; /* actual data size returned = size of SAM_ENTRY
989 structures + total length of strings */
991 uint16 switch_level
; /* see SAM_DISPINFO_CTR above */
994 uint32 num_entries
; /* number of entries returned */
998 SAM_DISPINFO_CTR
*ctr
;
1002 } SAMR_R_QUERY_DISPINFO
;
1005 /* SAMR_Q_DELETE_DOM_GROUP - delete domain group */
1006 typedef struct q_samr_delete_dom_group_info
1008 POLICY_HND group_pol
; /* policy handle */
1010 } SAMR_Q_DELETE_DOM_GROUP
;
1013 /* SAMR_R_DELETE_DOM_GROUP - delete domain group */
1014 typedef struct r_samr_delete_dom_group_info
1016 POLICY_HND pol
; /* policy handle */
1017 NTSTATUS status
; /* return status */
1019 } SAMR_R_DELETE_DOM_GROUP
;
1022 /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */
1023 typedef struct q_samr_create_dom_group_info
1025 POLICY_HND pol
; /* policy handle */
1027 UNIHDR hdr_acct_desc
;
1028 UNISTR2 uni_acct_desc
;
1032 } SAMR_Q_CREATE_DOM_GROUP
;
1034 /* SAMR_R_CREATE_DOM_GROUP - SAM create group */
1035 typedef struct r_samr_create_dom_group_info
1037 POLICY_HND pol
; /* policy handle */
1042 } SAMR_R_CREATE_DOM_GROUP
;
1044 /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */
1045 typedef struct q_samr_query_group_info
1047 POLICY_HND pol
; /* policy handle */
1049 uint16 switch_level
; /* 0x0001 seen */
1051 } SAMR_Q_QUERY_GROUPINFO
;
1053 typedef struct samr_group_info1
1055 UNIHDR hdr_acct_name
;
1057 uint32 unknown_1
; /* 0x0000 0003 - number of group members? */
1058 uint32 num_members
; /* 0x0000 0001 - number of group members? */
1060 UNIHDR hdr_acct_desc
;
1062 UNISTR2 uni_acct_name
;
1063 UNISTR2 uni_acct_desc
;
1067 typedef struct samr_group_info3
1069 uint32 unknown_1
; /* 0x0000 0003 - number of group members? */
1073 typedef struct samr_group_info4
1075 UNIHDR hdr_acct_desc
;
1076 UNISTR2 uni_acct_desc
;
1080 /* GROUP_INFO_CTR */
1081 typedef struct group_info_ctr
1083 uint16 switch_value1
;
1095 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
1096 typedef struct r_samr_query_groupinfo_info
1099 GROUP_INFO_CTR
*ctr
;
1103 } SAMR_R_QUERY_GROUPINFO
;
1106 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
1107 typedef struct q_samr_set_group_info
1109 POLICY_HND pol
; /* policy handle */
1110 GROUP_INFO_CTR
*ctr
;
1112 } SAMR_Q_SET_GROUPINFO
;
1114 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
1115 typedef struct r_samr_set_group_info
1119 } SAMR_R_SET_GROUPINFO
;
1122 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
1123 typedef struct q_samr_delete_dom_alias_info
1125 POLICY_HND alias_pol
; /* policy handle */
1127 } SAMR_Q_DELETE_DOM_ALIAS
;
1130 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
1131 typedef struct r_samr_delete_dom_alias_info
1133 POLICY_HND pol
; /* policy handle */
1134 NTSTATUS status
; /* return status */
1136 } SAMR_R_DELETE_DOM_ALIAS
;
1139 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
1140 typedef struct q_samr_create_dom_alias_info
1142 POLICY_HND dom_pol
; /* policy handle */
1144 UNIHDR hdr_acct_desc
;
1145 UNISTR2 uni_acct_desc
;
1147 uint32 access_mask
; /* 0x001f000f */
1149 } SAMR_Q_CREATE_DOM_ALIAS
;
1151 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
1152 typedef struct r_samr_create_dom_alias_info
1154 POLICY_HND alias_pol
; /* policy handle */
1159 } SAMR_R_CREATE_DOM_ALIAS
;
1161 /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */
1162 typedef struct q_samr_query_alias_info
1164 POLICY_HND pol
; /* policy handle */
1166 uint16 switch_level
; /* 0x0003 seen */
1168 } SAMR_Q_QUERY_ALIASINFO
;
1170 typedef struct samr_alias_info1
1172 UNIHDR hdr_acct_name
;
1173 UNIHDR hdr_acct_desc
;
1175 UNISTR2 uni_acct_name
;
1176 UNISTR2 uni_acct_desc
;
1180 typedef struct samr_alias_info3
1182 UNIHDR hdr_acct_desc
;
1183 UNISTR2 uni_acct_desc
;
1187 /* ALIAS_INFO_CTR */
1188 typedef struct alias_info_ctr
1190 uint16 switch_value1
;
1191 uint16 switch_value2
;
1202 /* SAMR_R_QUERY_ALIASINFO - SAM alias info */
1203 typedef struct r_samr_query_aliasinfo_info
1210 } SAMR_R_QUERY_ALIASINFO
;
1213 /* SAMR_Q_SET_ALIASINFO - SAM Alias Info */
1214 typedef struct q_samr_set_alias_info
1216 POLICY_HND alias_pol
; /* policy handle */
1219 } SAMR_Q_SET_ALIASINFO
;
1221 /* SAMR_R_SET_ALIASINFO - SAM alias info */
1222 typedef struct r_samr_set_aliasinfo_info
1226 } SAMR_R_SET_ALIASINFO
;
1229 /* SAMR_Q_QUERY_USERGROUPS - */
1230 typedef struct q_samr_query_usergroup_info
1232 POLICY_HND pol
; /* policy handle associated with unknown id */
1234 } SAMR_Q_QUERY_USERGROUPS
;
1236 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
1237 typedef struct r_samr_query_usergroup_info
1239 uint32 ptr_0
; /* pointer */
1240 uint32 num_entries
; /* number of RID groups */
1241 uint32 ptr_1
; /* pointer */
1242 uint32 num_entries2
; /* number of RID groups */
1244 DOM_GID
*gid
; /* group info */
1246 NTSTATUS status
; /* return status */
1248 } SAMR_R_QUERY_USERGROUPS
;
1250 /* SAM_USERINFO_CTR - sam user info */
1251 typedef struct sam_userinfo_ctr_info
1253 uint16 switch_value
;
1257 SAM_USER_INFO_10
*id10
; /* auth-level 0x10 */
1258 SAM_USER_INFO_11
*id11
; /* auth-level 0x11 */
1259 SAM_USER_INFO_12
*id12
; /* auth-level 0x12 */
1260 SAM_USER_INFO_20
*id20
; /* auth-level 20 */
1261 SAM_USER_INFO_21
*id21
; /* auth-level 21 */
1262 SAM_USER_INFO_23
*id23
; /* auth-level 0x17 */
1263 SAM_USER_INFO_24
*id24
; /* auth-level 0x18 */
1264 SAM_USER_INFO_25
*id25
; /* auth-level 0x19 */
1265 void* id
; /* to make typecasting easy */
1272 /* SAMR_Q_SET_USERINFO2 - set sam info */
1273 typedef struct q_samr_set_user_info2
1275 POLICY_HND pol
; /* policy handle associated with user */
1276 uint16 switch_value
; /* 0x0010 */
1278 SAM_USERINFO_CTR
*ctr
;
1280 } SAMR_Q_SET_USERINFO2
;
1282 /* SAMR_R_SET_USERINFO2 - set sam info */
1283 typedef struct r_samr_set_user_info2
1285 NTSTATUS status
; /* return status */
1287 } SAMR_R_SET_USERINFO2
;
1289 /* SAMR_Q_SET_USERINFO - set sam info */
1290 typedef struct q_samr_set_user_info
1292 POLICY_HND pol
; /* policy handle associated with user */
1293 uint16 switch_value
;
1294 SAM_USERINFO_CTR
*ctr
;
1296 } SAMR_Q_SET_USERINFO
;
1298 /* SAMR_R_SET_USERINFO - set sam info */
1299 typedef struct r_samr_set_user_info
1301 NTSTATUS status
; /* return status */
1303 } SAMR_R_SET_USERINFO
;
1306 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
1307 typedef struct q_samr_query_user_info
1309 POLICY_HND pol
; /* policy handle associated with unknown id */
1310 uint16 switch_value
; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
1312 } SAMR_Q_QUERY_USERINFO
;
1314 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
1315 typedef struct r_samr_query_user_info
1317 uint32 ptr
; /* pointer */
1318 SAM_USERINFO_CTR
*ctr
;
1320 NTSTATUS status
; /* return status */
1322 } SAMR_R_QUERY_USERINFO
;
1325 /****************************************************************************
1326 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
1328 the policy handle allocated by an "samr open secret" call is associated
1329 with a SID. this policy handle is what is queried here, *not* the SID
1330 itself. the response to the lookup rids is relative to this SID.
1331 *****************************************************************************/
1332 /* SAMR_Q_QUERY_USERALIASES */
1333 typedef struct q_samr_query_useraliases_info
1335 POLICY_HND pol
; /* policy handle */
1337 uint32 num_sids1
; /* number of rids being looked up */
1338 uint32 ptr
; /* buffer pointer */
1339 uint32 num_sids2
; /* number of rids being looked up */
1341 uint32
*ptr_sid
; /* pointers to sids to be looked up */
1342 DOM_SID2
*sid
; /* sids to be looked up. */
1344 } SAMR_Q_QUERY_USERALIASES
;
1347 /* SAMR_R_QUERY_USERALIASES */
1348 typedef struct r_samr_query_useraliases_info
1351 uint32 ptr
; /* undocumented buffer pointer */
1353 uint32 num_entries2
;
1354 uint32
*rid
; /* domain RIDs being looked up */
1356 NTSTATUS status
; /* return code */
1358 } SAMR_R_QUERY_USERALIASES
;
1361 /****************************************************************************
1362 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
1363 *****************************************************************************/
1364 /* SAMR_Q_LOOKUP_NAMES */
1365 typedef struct q_samr_lookup_names_info
1367 POLICY_HND pol
; /* policy handle */
1369 uint32 num_names1
; /* number of names being looked up */
1370 uint32 flags
; /* 0x0000 03e8 - unknown */
1371 uint32 ptr
; /* 0x0000 0000 - 32 bit unknown */
1372 uint32 num_names2
; /* number of names being looked up */
1374 UNIHDR
*hdr_name
; /* unicode account name header */
1375 UNISTR2
*uni_name
; /* unicode account name string */
1377 } SAMR_Q_LOOKUP_NAMES
;
1380 /* SAMR_R_LOOKUP_NAMES */
1381 typedef struct r_samr_lookup_names_info
1383 uint32 num_rids1
; /* number of aliases being looked up */
1384 uint32 ptr_rids
; /* pointer to aliases */
1385 uint32 num_rids2
; /* number of aliases being looked up */
1387 uint32
*rids
; /* rids */
1389 uint32 num_types1
; /* number of users in aliases being looked up */
1390 uint32 ptr_types
; /* pointer to users in aliases */
1391 uint32 num_types2
; /* number of users in aliases being looked up */
1393 uint32
*types
; /* SID_ENUM type */
1395 NTSTATUS status
; /* return code */
1397 } SAMR_R_LOOKUP_NAMES
;
1400 /****************************************************************************
1401 SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something.
1403 called to resolve domain RID groups.
1404 *****************************************************************************/
1405 /* SAMR_Q_LOOKUP_RIDS */
1406 typedef struct q_samr_lookup_rids_info
1408 POLICY_HND pol
; /* policy handle */
1410 uint32 num_rids1
; /* number of rids being looked up */
1411 uint32 flags
; /* 0x0000 03e8 - unknown */
1412 uint32 ptr
; /* 0x0000 0000 - 32 bit unknown */
1413 uint32 num_rids2
; /* number of rids being looked up */
1415 uint32
*rid
; /* domain RIDs being looked up */
1417 } SAMR_Q_LOOKUP_RIDS
;
1420 /****************************************************************************
1421 SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names
1423 *****************************************************************************/
1424 /* SAMR_R_LOOKUP_RIDS */
1425 typedef struct r_samr_lookup_rids_info
1427 uint32 num_names1
; /* number of aliases being looked up */
1428 uint32 ptr_names
; /* pointer to aliases */
1429 uint32 num_names2
; /* number of aliases being looked up */
1431 UNIHDR
*hdr_name
; /* unicode account name header */
1432 UNISTR2
*uni_name
; /* unicode account name string */
1434 uint32 num_types1
; /* number of users in aliases being looked up */
1435 uint32 ptr_types
; /* pointer to users in aliases */
1436 uint32 num_types2
; /* number of users in aliases being looked up */
1438 uint32
*type
; /* SID_ENUM type */
1442 } SAMR_R_LOOKUP_RIDS
;
1445 /* SAMR_Q_OPEN_USER - probably an open */
1446 typedef struct q_samr_open_user_info
1448 POLICY_HND domain_pol
; /* policy handle */
1449 uint32 access_mask
; /* 32 bit unknown - 0x02011b */
1450 uint32 user_rid
; /* user RID */
1455 /* SAMR_R_OPEN_USER - probably an open */
1456 typedef struct r_samr_open_user_info
1458 POLICY_HND user_pol
; /* policy handle associated with unknown id */
1459 NTSTATUS status
; /* return status */
1464 /* SAMR_Q_CREATE_USER - probably a create */
1465 typedef struct q_samr_create_user_info
1467 POLICY_HND domain_pol
; /* policy handle */
1469 UNIHDR hdr_name
; /* unicode account name header */
1470 UNISTR2 uni_name
; /* unicode account name */
1472 uint32 acb_info
; /* account control info */
1473 uint32 access_mask
; /* 0xe005 00b0 */
1475 } SAMR_Q_CREATE_USER
;
1478 /* SAMR_R_CREATE_USER - probably a create */
1479 typedef struct r_samr_create_user_info
1481 POLICY_HND user_pol
; /* policy handle associated with user */
1483 uint32 access_granted
;
1484 uint32 user_rid
; /* user RID */
1485 NTSTATUS status
; /* return status */
1487 } SAMR_R_CREATE_USER
;
1490 /* SAMR_Q_DELETE_DOM_USER - delete domain user */
1491 typedef struct q_samr_delete_dom_user_info
1493 POLICY_HND user_pol
; /* policy handle */
1495 } SAMR_Q_DELETE_DOM_USER
;
1498 /* SAMR_R_DELETE_DOM_USER - delete domain user */
1499 typedef struct r_samr_delete_dom_user_info
1501 POLICY_HND pol
; /* policy handle */
1502 NTSTATUS status
; /* return status */
1504 } SAMR_R_DELETE_DOM_USER
;
1507 /* SAMR_Q_QUERY_GROUPMEM - query group members */
1508 typedef struct q_samr_query_groupmem_info
1510 POLICY_HND group_pol
; /* policy handle */
1512 } SAMR_Q_QUERY_GROUPMEM
;
1515 /* SAMR_R_QUERY_GROUPMEM - query group members */
1516 typedef struct r_samr_query_groupmem_info
1532 } SAMR_R_QUERY_GROUPMEM
;
1535 /* SAMR_Q_DEL_GROUPMEM - probably an del group member */
1536 typedef struct q_samr_del_group_mem_info
1538 POLICY_HND pol
; /* policy handle */
1539 uint32 rid
; /* rid */
1541 } SAMR_Q_DEL_GROUPMEM
;
1544 /* SAMR_R_DEL_GROUPMEM - probably an del group member */
1545 typedef struct r_samr_del_group_mem_info
1547 NTSTATUS status
; /* return status */
1549 } SAMR_R_DEL_GROUPMEM
;
1552 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
1553 typedef struct q_samr_add_group_mem_info
1555 POLICY_HND pol
; /* policy handle */
1557 uint32 rid
; /* rid */
1558 uint32 unknown
; /* 0x0000 0005 */
1560 } SAMR_Q_ADD_GROUPMEM
;
1563 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
1564 typedef struct r_samr_add_group_mem_info
1566 NTSTATUS status
; /* return status */
1568 } SAMR_R_ADD_GROUPMEM
;
1571 /* SAMR_Q_OPEN_GROUP - probably an open */
1572 typedef struct q_samr_open_group_info
1574 POLICY_HND domain_pol
; /* policy handle */
1575 uint32 access_mask
; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
1576 uint32 rid_group
; /* rid */
1578 } SAMR_Q_OPEN_GROUP
;
1581 /* SAMR_R_OPEN_GROUP - probably an open */
1582 typedef struct r_samr_open_group_info
1584 POLICY_HND pol
; /* policy handle */
1585 NTSTATUS status
; /* return status */
1587 } SAMR_R_OPEN_GROUP
;
1590 /* SAMR_Q_QUERY_ALIASMEM - query alias members */
1591 typedef struct q_samr_query_aliasmem_info
1593 POLICY_HND alias_pol
; /* policy handle */
1595 } SAMR_Q_QUERY_ALIASMEM
;
1598 /* SAMR_R_QUERY_ALIASMEM - query alias members */
1599 typedef struct r_samr_query_aliasmem_info
1609 } SAMR_R_QUERY_ALIASMEM
;
1612 /* SAMR_Q_ADD_ALIASMEM - add alias member */
1613 typedef struct q_samr_add_alias_mem_info
1615 POLICY_HND alias_pol
; /* policy handle */
1617 DOM_SID2 sid
; /* member sid to be added to the alias */
1619 } SAMR_Q_ADD_ALIASMEM
;
1622 /* SAMR_R_ADD_ALIASMEM - add alias member */
1623 typedef struct r_samr_add_alias_mem_info
1625 NTSTATUS status
; /* return status */
1627 } SAMR_R_ADD_ALIASMEM
;
1630 /* SAMR_Q_DEL_ALIASMEM - add an add alias member */
1631 typedef struct q_samr_del_alias_mem_info
1633 POLICY_HND alias_pol
; /* policy handle */
1635 DOM_SID2 sid
; /* member sid to be added to alias */
1637 } SAMR_Q_DEL_ALIASMEM
;
1640 /* SAMR_R_DEL_ALIASMEM - delete alias member */
1641 typedef struct r_samr_del_alias_mem_info
1643 NTSTATUS status
; /* return status */
1645 } SAMR_R_DEL_ALIASMEM
;
1649 /* SAMR_Q_OPEN_ALIAS - probably an open */
1650 typedef struct q_samr_open_alias_info
1657 } SAMR_Q_OPEN_ALIAS
;
1660 /* SAMR_R_OPEN_ALIAS - probably an open */
1661 typedef struct r_samr_open_alias_info
1663 POLICY_HND pol
; /* policy handle */
1664 NTSTATUS status
; /* return status */
1666 } SAMR_R_OPEN_ALIAS
;
1669 /* SAMR_Q_CONNECT_ANON - probably an open */
1670 typedef struct q_samr_connect_anon_info
1672 uint32 ptr
; /* ptr? */
1673 uint16 unknown_0
; /* 0x005c */
1674 uint16 unknown_1
; /* 0x0001 */
1677 } SAMR_Q_CONNECT_ANON
;
1679 /* SAMR_R_CONNECT_ANON - probably an open */
1680 typedef struct r_samr_connect_anon_info
1682 POLICY_HND connect_pol
; /* policy handle */
1683 NTSTATUS status
; /* return status */
1685 } SAMR_R_CONNECT_ANON
;
1687 /* SAMR_Q_CONNECT - probably an open */
1688 typedef struct q_samr_connect_info
1690 uint32 ptr_srv_name
; /* pointer (to server name?) */
1691 UNISTR2 uni_srv_name
; /* unicode server name starting with '\\' */
1698 /* SAMR_R_CONNECT - probably an open */
1699 typedef struct r_samr_connect_info
1701 POLICY_HND connect_pol
; /* policy handle */
1702 NTSTATUS status
; /* return status */
1706 /* SAMR_Q_CONNECT4 */
1707 typedef struct q_samr_connect4_info
1709 uint32 ptr_srv_name
; /* pointer to server name */
1710 UNISTR2 uni_srv_name
;
1712 uint32 unk_0
; /* possible server name type, 1 for IP num, 2 for name */
1716 /* SAMR_R_CONNECT4 - same format as connect */
1717 typedef struct r_samr_connect_info SAMR_R_CONNECT4
;
1719 /* SAMR_Q_GET_DOM_PWINFO */
1720 typedef struct q_samr_get_dom_pwinfo
1723 UNIHDR hdr_srv_name
;
1724 UNISTR2 uni_srv_name
;
1726 } SAMR_Q_GET_DOM_PWINFO
;
1728 /* SAMR_R_GET_DOM_PWINFO */
1729 typedef struct r_samr_get_dom_pwinfo
1732 * Previously this was 3 uint16's. However, after some tests
1733 * it appears that the data len for the signing needs to be 16.
1734 * Not sure how 3 unit16's ever worked since the length always
1735 * turned out to 12. 3 uint32's + NT_STATUS == 16 bytes. Tested
1736 * using NT and 2k. --jerry
1743 } SAMR_R_GET_DOM_PWINFO
;
1745 /* SAMR_ENC_PASSWD */
1746 typedef struct enc_passwd_info
1754 typedef struct enc_hash_info
1761 /* SAMR_Q_CHGPASSWD_USER */
1762 typedef struct q_samr_chgpasswd_user_info
1766 UNIHDR hdr_dest_host
; /* server name unicode header */
1767 UNISTR2 uni_dest_host
; /* server name unicode string */
1769 UNIHDR hdr_user_name
; /* username unicode string header */
1770 UNISTR2 uni_user_name
; /* username unicode string */
1772 SAMR_ENC_PASSWD nt_newpass
;
1773 SAMR_ENC_HASH nt_oldhash
;
1775 uint32 unknown
; /* 0x0000 0001 */
1777 SAMR_ENC_PASSWD lm_newpass
;
1778 SAMR_ENC_HASH lm_oldhash
;
1780 } SAMR_Q_CHGPASSWD_USER
;
1782 /* SAMR_R_CHGPASSWD_USER */
1783 typedef struct r_samr_chgpasswd_user_info
1785 NTSTATUS status
; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
1787 } SAMR_R_CHGPASSWD_USER
;
1790 /* SAMR_Q_UNKNOWN_2D */
1791 typedef struct q_samr_unknown_2d_info
1793 POLICY_HND dom_pol
; /* policy handle */
1794 DOM_SID2 sid
; /* SID */
1796 } SAMR_Q_UNKNOWN_2D
;
1799 /* SAMR_R_UNKNOWN_2D - probably an open */
1800 typedef struct r_samr_unknown_2d_info
1802 NTSTATUS status
; /* return status */
1804 } SAMR_R_UNKNOWN_2D
;
1808 /* these are from the old rpc_samr.h - they are needed while the merge
1809 is still going on */
1810 #define MAX_SAM_SIDS 15
1812 /* DOM_SID3 - security id */
1813 typedef struct sid_info_3
1815 uint16 len
; /* length, bytes, including length of len :-) */
1822 /* SAMR_Q_UNKNOWN_2E */
1823 typedef struct q_samr_unknown_2e_info
1825 POLICY_HND domain_pol
; /* policy handle */
1826 uint16 switch_value
;
1828 } SAMR_Q_UNKNOWN_2E
;
1830 /* SAMR_R_UNKNOWN_2E */
1831 typedef struct r_samr_unknown_2e_info
1834 uint16 switch_value
;
1836 NTSTATUS status
; /* return status */
1838 } SAMR_R_UNKNOWN_2E
;
1840 /* SAMR_Q_SET_DOMAIN_INFO */
1841 typedef struct q_samr_set_domain_info
1843 POLICY_HND domain_pol
; /* policy handle */
1844 uint16 switch_value0
;
1845 uint16 switch_value
;
1848 } SAMR_Q_SET_DOMAIN_INFO
;
1850 /* SAMR_R_SET_DOMAIN_INFO */
1851 typedef struct r_samr_set_domain_info
1853 NTSTATUS status
; /* return status */
1855 } SAMR_R_SET_DOMAIN_INFO
;
1857 #endif /* _RPC_SAMR_H */