4 samr interface definition
6 import
"misc.idl", "lsa.idl", "security.idl";
9 Thanks to Todd Sabin for some information from his samr.idl in acltools
12 [ uuid("12345778-1234-abcd-ef00-0123456789ac"),
14 endpoint("ncacn_np:[\\pipe\\samr]","ncacn_ip_tcp:", "ncalrpc:"),
15 pointer_default(unique)
18 typedef bitmap security_secinfo security_secinfo
;
19 typedef bitmap security_GroupAttrs security_GroupAttrs
;
21 /* account control (acct_flags) bits */
22 typedef [public,bitmap32bit
] bitmap
{
23 ACB_DISABLED
= 0x00000001, /* 1 = User account disabled */
24 ACB_HOMDIRREQ
= 0x00000002, /* 1 = Home directory required */
25 ACB_PWNOTREQ
= 0x00000004, /* 1 = User password not required */
26 ACB_TEMPDUP
= 0x00000008, /* 1 = Temporary duplicate account */
27 ACB_NORMAL
= 0x00000010, /* 1 = Normal user account */
28 ACB_MNS
= 0x00000020, /* 1 = MNS logon user account */
29 ACB_DOMTRUST
= 0x00000040, /* 1 = Interdomain trust account */
30 ACB_WSTRUST
= 0x00000080, /* 1 = Workstation trust account */
31 ACB_SVRTRUST
= 0x00000100, /* 1 = Server trust account */
32 ACB_PWNOEXP
= 0x00000200, /* 1 = User password does not expire */
33 ACB_AUTOLOCK
= 0x00000400, /* 1 = Account auto locked */
34 ACB_ENC_TXT_PWD_ALLOWED
= 0x00000800, /* 1 = Encrypted text password is allowed */
35 ACB_SMARTCARD_REQUIRED
= 0x00001000, /* 1 = Smart Card required */
36 ACB_TRUSTED_FOR_DELEGATION
= 0x00002000, /* 1 = Trusted for Delegation */
37 ACB_NOT_DELEGATED
= 0x00004000, /* 1 = Not delegated */
38 ACB_USE_DES_KEY_ONLY
= 0x00008000, /* 1 = Use DES key only */
39 ACB_DONT_REQUIRE_PREAUTH
= 0x00010000, /* 1 = Preauth not required */
40 ACB_PW_EXPIRED
= 0x00020000, /* 1 = Password Expired */
41 ACB_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION
= 0x00040000,
42 ACB_NO_AUTH_DATA_REQD
= 0x00080000, /* 1 = No authorization data required */
43 ACB_PARTIAL_SECRETS_ACCOUNT
= 0x00100000,
44 ACB_USE_AES_KEYS
= 0x00200000
47 /* SAM server specific access rights */
49 typedef [bitmap32bit
] bitmap
{
50 SAMR_ACCESS_CONNECT_TO_SERVER
= 0x00000001,
51 SAMR_ACCESS_SHUTDOWN_SERVER
= 0x00000002,
52 SAMR_ACCESS_INITIALIZE_SERVER
= 0x00000004,
53 SAMR_ACCESS_CREATE_DOMAIN
= 0x00000008,
54 SAMR_ACCESS_ENUM_DOMAINS
= 0x00000010,
55 SAMR_ACCESS_LOOKUP_DOMAIN
= 0x00000020
56 } samr_ConnectAccessMask
;
58 const int SAMR_ACCESS_ALL_ACCESS
= 0x0000003F;
60 const int GENERIC_RIGHTS_SAM_ALL_ACCESS
=
61 (STANDARD_RIGHTS_REQUIRED_ACCESS |
62 SAMR_ACCESS_ALL_ACCESS
);
64 const int GENERIC_RIGHTS_SAM_READ
=
65 (STANDARD_RIGHTS_READ_ACCESS |
66 SAMR_ACCESS_ENUM_DOMAINS
);
68 const int GENERIC_RIGHTS_SAM_WRITE
=
69 (STANDARD_RIGHTS_WRITE_ACCESS |
70 SAMR_ACCESS_CREATE_DOMAIN |
71 SAMR_ACCESS_INITIALIZE_SERVER |
72 SAMR_ACCESS_SHUTDOWN_SERVER
);
74 const int GENERIC_RIGHTS_SAM_EXECUTE
=
75 (STANDARD_RIGHTS_EXECUTE_ACCESS |
76 SAMR_ACCESS_LOOKUP_DOMAIN |
77 SAMR_ACCESS_CONNECT_TO_SERVER
);
79 /* User Object specific access rights */
81 typedef [bitmap32bit
] bitmap
{
82 SAMR_USER_ACCESS_GET_NAME_ETC
= 0x00000001,
83 SAMR_USER_ACCESS_GET_LOCALE
= 0x00000002,
84 SAMR_USER_ACCESS_SET_LOC_COM
= 0x00000004,
85 SAMR_USER_ACCESS_GET_LOGONINFO
= 0x00000008,
86 SAMR_USER_ACCESS_GET_ATTRIBUTES
= 0x00000010,
87 SAMR_USER_ACCESS_SET_ATTRIBUTES
= 0x00000020,
88 SAMR_USER_ACCESS_CHANGE_PASSWORD
= 0x00000040,
89 SAMR_USER_ACCESS_SET_PASSWORD
= 0x00000080,
90 SAMR_USER_ACCESS_GET_GROUPS
= 0x00000100,
91 SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP
= 0x00000200,
92 SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP
= 0x00000400
93 } samr_UserAccessMask
;
95 const int SAMR_USER_ACCESS_ALL_ACCESS
= 0x000007FF;
97 const int GENERIC_RIGHTS_USER_ALL_ACCESS
=
98 (STANDARD_RIGHTS_REQUIRED_ACCESS |
99 SAMR_USER_ACCESS_ALL_ACCESS
); /* 0x000f07ff */
101 const int GENERIC_RIGHTS_USER_READ
=
102 (STANDARD_RIGHTS_READ_ACCESS |
103 SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP |
104 SAMR_USER_ACCESS_GET_GROUPS |
105 SAMR_USER_ACCESS_GET_ATTRIBUTES |
106 SAMR_USER_ACCESS_GET_LOGONINFO |
107 SAMR_USER_ACCESS_GET_LOCALE
); /* 0x0002031a */
109 const int GENERIC_RIGHTS_USER_WRITE
=
110 (STANDARD_RIGHTS_WRITE_ACCESS |
111 SAMR_USER_ACCESS_CHANGE_PASSWORD |
112 SAMR_USER_ACCESS_SET_LOC_COM |
113 SAMR_USER_ACCESS_SET_ATTRIBUTES |
114 SAMR_USER_ACCESS_SET_PASSWORD |
115 SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP
); /* 0x000204e4 */
117 const int GENERIC_RIGHTS_USER_EXECUTE
=
118 (STANDARD_RIGHTS_EXECUTE_ACCESS |
119 SAMR_USER_ACCESS_CHANGE_PASSWORD |
120 SAMR_USER_ACCESS_GET_NAME_ETC
); /* 0x00020041 */
122 /* Domain Object specific access rights */
124 typedef [bitmap32bit
] bitmap
{
125 SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1
= 0x00000001,
126 SAMR_DOMAIN_ACCESS_SET_INFO_1
= 0x00000002,
127 SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2
= 0x00000004,
128 SAMR_DOMAIN_ACCESS_SET_INFO_2
= 0x00000008,
129 SAMR_DOMAIN_ACCESS_CREATE_USER
= 0x00000010,
130 SAMR_DOMAIN_ACCESS_CREATE_GROUP
= 0x00000020,
131 SAMR_DOMAIN_ACCESS_CREATE_ALIAS
= 0x00000040,
132 SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS
= 0x00000080,
133 SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS
= 0x00000100,
134 SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT
= 0x00000200,
135 SAMR_DOMAIN_ACCESS_SET_INFO_3
= 0x00000400
136 } samr_DomainAccessMask
;
138 const int SAMR_DOMAIN_ACCESS_ALL_ACCESS
= 0x000007FF;
140 const int GENERIC_RIGHTS_DOMAIN_ALL_ACCESS
=
141 (STANDARD_RIGHTS_REQUIRED_ACCESS |
142 SAMR_DOMAIN_ACCESS_ALL_ACCESS
);
144 const int GENERIC_RIGHTS_DOMAIN_READ
=
145 (STANDARD_RIGHTS_READ_ACCESS |
146 SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS |
147 SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2
);
149 const int GENERIC_RIGHTS_DOMAIN_WRITE
=
150 (STANDARD_RIGHTS_WRITE_ACCESS |
151 SAMR_DOMAIN_ACCESS_SET_INFO_3 |
152 SAMR_DOMAIN_ACCESS_CREATE_ALIAS |
153 SAMR_DOMAIN_ACCESS_CREATE_GROUP |
154 SAMR_DOMAIN_ACCESS_CREATE_USER |
155 SAMR_DOMAIN_ACCESS_SET_INFO_2 |
156 SAMR_DOMAIN_ACCESS_SET_INFO_1
);
158 const int GENERIC_RIGHTS_DOMAIN_EXECUTE
=
159 (STANDARD_RIGHTS_EXECUTE_ACCESS |
160 SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT |
161 SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS |
162 SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1
);
164 /* Group Object specific access rights */
166 typedef [bitmap32bit
] bitmap
{
167 SAMR_GROUP_ACCESS_LOOKUP_INFO
= 0x00000001,
168 SAMR_GROUP_ACCESS_SET_INFO
= 0x00000002,
169 SAMR_GROUP_ACCESS_ADD_MEMBER
= 0x00000004,
170 SAMR_GROUP_ACCESS_REMOVE_MEMBER
= 0x00000008,
171 SAMR_GROUP_ACCESS_GET_MEMBERS
= 0x00000010
172 } samr_GroupAccessMask
;
174 const int SAMR_GROUP_ACCESS_ALL_ACCESS
= 0x0000001F;
176 const int GENERIC_RIGHTS_GROUP_ALL_ACCESS
=
177 (STANDARD_RIGHTS_REQUIRED_ACCESS |
178 SAMR_GROUP_ACCESS_ALL_ACCESS
); /* 0x000f001f */
180 const int GENERIC_RIGHTS_GROUP_READ
=
181 (STANDARD_RIGHTS_READ_ACCESS |
182 SAMR_GROUP_ACCESS_GET_MEMBERS
); /* 0x00020010 */
184 const int GENERIC_RIGHTS_GROUP_WRITE
=
185 (STANDARD_RIGHTS_WRITE_ACCESS |
186 SAMR_GROUP_ACCESS_REMOVE_MEMBER |
187 SAMR_GROUP_ACCESS_ADD_MEMBER |
188 SAMR_GROUP_ACCESS_SET_INFO
); /* 0x0002000e */
190 const int GENERIC_RIGHTS_GROUP_EXECUTE
=
191 (STANDARD_RIGHTS_EXECUTE_ACCESS |
192 SAMR_GROUP_ACCESS_LOOKUP_INFO
); /* 0x00020001 */
194 /* Alias Object specific access rights */
196 typedef [bitmap32bit
] bitmap
{
197 SAMR_ALIAS_ACCESS_ADD_MEMBER
= 0x00000001,
198 SAMR_ALIAS_ACCESS_REMOVE_MEMBER
= 0x00000002,
199 SAMR_ALIAS_ACCESS_GET_MEMBERS
= 0x00000004,
200 SAMR_ALIAS_ACCESS_LOOKUP_INFO
= 0x00000008,
201 SAMR_ALIAS_ACCESS_SET_INFO
= 0x00000010
202 } samr_AliasAccessMask
;
204 const int SAMR_ALIAS_ACCESS_ALL_ACCESS
= 0x0000001F;
206 const int GENERIC_RIGHTS_ALIAS_ALL_ACCESS
=
207 (STANDARD_RIGHTS_REQUIRED_ACCESS |
208 SAMR_ALIAS_ACCESS_ALL_ACCESS
); /* 0x000f001f */
210 const int GENERIC_RIGHTS_ALIAS_READ
=
211 (STANDARD_RIGHTS_READ_ACCESS |
212 SAMR_ALIAS_ACCESS_GET_MEMBERS
); /* 0x00020004 */
214 const int GENERIC_RIGHTS_ALIAS_WRITE
=
215 (STANDARD_RIGHTS_WRITE_ACCESS |
216 SAMR_ALIAS_ACCESS_REMOVE_MEMBER |
217 SAMR_ALIAS_ACCESS_ADD_MEMBER |
218 SAMR_ALIAS_ACCESS_SET_INFO
); /* 0x00020013 */
220 const int GENERIC_RIGHTS_ALIAS_EXECUTE
=
221 (STANDARD_RIGHTS_EXECUTE_ACCESS |
222 SAMR_ALIAS_ACCESS_LOOKUP_INFO
); /* 0x00020008 */
226 NTSTATUS samr_Connect
(
227 /* notice the lack of [string] */
228 [in,unique] uint16
*system_name
,
229 [in] samr_ConnectAccessMask access_mask
,
230 [out,ref] policy_handle
*connect_handle
236 [public] NTSTATUS samr_Close
(
237 [in,out,ref] policy_handle
*handle
243 NTSTATUS samr_SetSecurity
(
244 [in,ref] policy_handle
*handle,
245 [in] security_secinfo sec_info
,
246 [in,ref] sec_desc_buf
*sdbuf
252 NTSTATUS samr_QuerySecurity
(
253 [in,ref] policy_handle
*handle,
254 [in] security_secinfo sec_info
,
255 [out,ref] sec_desc_buf
**sdbuf
262 shutdown the SAM - once you call this the SAM will be dead
264 NTSTATUS samr_Shutdown
(
265 [in,ref] policy_handle
*connect_handle
270 NTSTATUS samr_LookupDomain
(
271 [in,ref] policy_handle
*connect_handle
,
272 [in,ref] lsa_String
*domain_name
,
273 [out,ref] dom_sid2
**sid
287 [size_is(count
)] samr_SamEntry
*entries
;
290 NTSTATUS samr_EnumDomains
(
291 [in,ref] policy_handle
*connect_handle
,
292 [in,out,ref] uint32
*resume_handle
,
293 [out,ref] samr_SamArray
**sam
,
294 [in] uint32 buf_size
,
295 [out,ref] uint32
*num_entries
299 /************************/
301 [public] NTSTATUS samr_OpenDomain
(
302 [in,ref] policy_handle
*connect_handle
,
303 [in] samr_DomainAccessMask access_mask
,
304 [in,ref] dom_sid2
*sid
,
305 [out,ref] policy_handle
*domain_handle
308 /************************/
312 DomainPasswordInformation
= 1,
313 DomainGeneralInformation
= 2,
314 DomainLogoffInformation
= 3,
315 DomainOemInformation
= 4,
316 DomainNameInformation
= 5,
317 DomainReplicationInformation
= 6,
318 DomainServerRoleInformation
= 7,
319 DomainModifiedInformation
= 8,
320 DomainStateInformation
= 9,
321 DomainUasInformation
= 10,
322 DomainGeneralInformation2
= 11,
323 DomainLockoutInformation
= 12,
324 DomainModifiedInformation2
= 13
325 } samr_DomainInfoClass
;
328 typedef [v1_enum] enum {
329 SAMR_ROLE_STANDALONE
= 0,
330 SAMR_ROLE_DOMAIN_MEMBER
= 1,
331 SAMR_ROLE_DOMAIN_BDC
= 2,
332 SAMR_ROLE_DOMAIN_PDC
= 3
335 /* password properties flags */
336 typedef [public,bitmap32bit
] bitmap
{
337 DOMAIN_PASSWORD_COMPLEX
= 0x00000001,
338 DOMAIN_PASSWORD_NO_ANON_CHANGE
= 0x00000002,
339 DOMAIN_PASSWORD_NO_CLEAR_CHANGE
= 0x00000004,
340 DOMAIN_PASSWORD_LOCKOUT_ADMINS
= 0x00000008,
341 DOMAIN_PASSWORD_STORE_CLEARTEXT
= 0x00000010,
342 DOMAIN_REFUSE_PASSWORD_CHANGE
= 0x00000020
343 } samr_PasswordProperties
;
345 typedef [v1_enum] enum {
346 DOMAIN_SERVER_ENABLED
= 1,
347 DOMAIN_SERVER_DISABLED
= 2
348 } samr_DomainServerState
;
350 typedef [public] struct {
351 uint16 min_password_length
;
352 uint16 password_history_length
;
353 samr_PasswordProperties password_properties
;
354 /* yes, these are signed. They are in negative 100ns */
355 dlong max_password_age
;
356 dlong min_password_age
;
360 NTTIME force_logoff_time
;
361 lsa_String oem_information
; /* comment */
362 lsa_String domain_name
;
363 lsa_String primary
; /* PDC name if this is a BDC */
365 samr_DomainServerState domain_server_state
;
371 } samr_DomGeneralInformation
;
374 NTTIME force_logoff_time
;
378 lsa_String oem_information
; /* comment */
379 } samr_DomOEMInformation
;
382 lsa_String domain_name
;
395 NTTIME domain_create_time
;
399 samr_DomainServerState domain_server_state
;
403 samr_DomGeneralInformation general
;
404 hyper lockout_duration
;
405 hyper lockout_window
;
406 uint16 lockout_threshold
;
407 } samr_DomGeneralInformation2
;
410 hyper lockout_duration
;
411 hyper lockout_window
;
412 uint16 lockout_threshold
;
417 NTTIME domain_create_time
;
418 hyper modified_count_at_last_promotion
;
421 typedef [switch_type(uint16
)] union {
422 [case(1)] samr_DomInfo1 info1
;
423 [case(2)] samr_DomGeneralInformation general
;
424 [case(3)] samr_DomInfo3 info3
;
425 [case(4)] samr_DomOEMInformation oem
;
426 [case(5)] samr_DomInfo5 info5
;
427 [case(6)] samr_DomInfo6 info6
;
428 [case(7)] samr_DomInfo7 info7
;
429 [case(8)] samr_DomInfo8 info8
;
430 [case(9)] samr_DomInfo9 info9
;
431 [case(11)] samr_DomGeneralInformation2 general2
;
432 [case(12)] samr_DomInfo12 info12
;
433 [case(13)] samr_DomInfo13 info13
;
436 NTSTATUS samr_QueryDomainInfo
(
437 [in,ref] policy_handle
*domain_handle
,
438 [in] samr_DomainInfoClass level
,
439 [out,ref,switch_is(level
)] samr_DomainInfo
**info
442 /************************/
445 only levels 1, 3, 4, 6, 7, 9, 12 are valid for this
448 NTSTATUS samr_SetDomainInfo
(
449 [in,ref] policy_handle
*domain_handle
,
450 [in] samr_DomainInfoClass level
,
451 [in,switch_is(level
),ref] samr_DomainInfo
*info
455 /************************/
457 NTSTATUS samr_CreateDomainGroup
(
458 [in,ref] policy_handle
*domain_handle
,
459 [in,ref] lsa_String
*name
,
460 [in] samr_GroupAccessMask access_mask
,
461 [out,ref] policy_handle
*group_handle
,
462 [out,ref] uint32
*rid
466 /************************/
468 NTSTATUS samr_EnumDomainGroups
(
469 [in] policy_handle
*domain_handle
,
470 [in,out,ref] uint32
*resume_handle
,
471 [out,ref] samr_SamArray
**sam
,
472 [in] uint32 max_size
,
473 [out,ref] uint32
*num_entries
476 /************************/
478 NTSTATUS samr_CreateUser
(
479 [in,ref] policy_handle
*domain_handle
,
480 [in,ref] lsa_String
*account_name
,
481 [in] samr_UserAccessMask access_mask
,
482 [out,ref] policy_handle
*user_handle
,
483 [out,ref] uint32
*rid
486 /************************/
490 /* w2k3 treats max_size as max_users*54 and sets the
491 resume_handle as the rid of the last user sent
493 const int SAMR_ENUM_USERS_MULTIPLIER
= 54;
495 NTSTATUS samr_EnumDomainUsers
(
496 [in] policy_handle
*domain_handle
,
497 [in,out,ref] uint32
*resume_handle
,
498 [in] samr_AcctFlags acct_flags
,
499 [out,ref] samr_SamArray
**sam
,
500 [in] uint32 max_size
,
501 [out,ref] uint32
*num_entries
504 /************************/
506 NTSTATUS samr_CreateDomAlias
(
507 [in,ref] policy_handle
*domain_handle
,
508 [in,ref] lsa_String
*alias_name
,
509 [in] samr_AliasAccessMask access_mask
,
510 [out,ref] policy_handle
*alias_handle
,
511 [out,ref] uint32
*rid
514 /************************/
516 NTSTATUS samr_EnumDomainAliases
(
517 [in] policy_handle
*domain_handle
,
518 [in,out,ref] uint32
*resume_handle
,
519 [out,ref] samr_SamArray
**sam
,
520 [in] uint32 max_size
,
521 [out,ref] uint32
*num_entries
524 /************************/
528 [range(0,1024)] uint32 count
;
529 [size_is(count
)] uint32
*ids
;
532 NTSTATUS samr_GetAliasMembership
(
533 [in,ref] policy_handle
*domain_handle
,
534 [in,ref] lsa_SidArray
*sids
,
535 [out,ref] samr_Ids
*rids
538 /************************/
541 [public] NTSTATUS samr_LookupNames
(
542 [in,ref] policy_handle
*domain_handle
,
543 [in,range(0,1000)] uint32 num_names
,
544 [in,size_is(1000),length_is(num_names
)] lsa_String names
[],
545 [out,ref] samr_Ids
*rids
,
546 [out,ref] samr_Ids
*types
550 /************************/
552 NTSTATUS samr_LookupRids
(
553 [in,ref] policy_handle
*domain_handle
,
554 [in,range(0,1000)] uint32 num_rids
,
555 [in,size_is(1000),length_is(num_rids
)] uint32 rids
[],
556 [out,ref] lsa_Strings
*names
,
557 [out,ref] samr_Ids
*types
560 /************************/
562 NTSTATUS samr_OpenGroup
(
563 [in,ref] policy_handle
*domain_handle
,
564 [in] samr_GroupAccessMask access_mask
,
566 [out,ref] policy_handle
*group_handle
569 /************************/
574 security_GroupAttrs attributes
;
576 lsa_String description
;
580 security_GroupAttrs attributes
;
581 } samr_GroupInfoAttributes
;
584 lsa_String description
;
585 } samr_GroupInfoDescription
;
590 GROUPINFOATTRIBUTES
= 3,
591 GROUPINFODESCRIPTION
= 4,
593 } samr_GroupInfoEnum
;
595 typedef [switch_type(samr_GroupInfoEnum
)] union {
596 [case(GROUPINFOALL
)] samr_GroupInfoAll all
;
597 [case(GROUPINFONAME
)] lsa_String name
;
598 [case(GROUPINFOATTRIBUTES
)] samr_GroupInfoAttributes attributes
;
599 [case(GROUPINFODESCRIPTION
)] lsa_String description
;
600 [case(GROUPINFOALL2
)] samr_GroupInfoAll all2
;
603 NTSTATUS samr_QueryGroupInfo
(
604 [in,ref] policy_handle
*group_handle
,
605 [in] samr_GroupInfoEnum level
,
606 [out,ref,switch_is(level
)] samr_GroupInfo
**info
609 /************************/
611 NTSTATUS samr_SetGroupInfo
(
612 [in,ref] policy_handle
*group_handle
,
613 [in] samr_GroupInfoEnum level
,
614 [in,switch_is(level
),ref] samr_GroupInfo
*info
617 /************************/
619 NTSTATUS samr_AddGroupMember
(
620 [in,ref] policy_handle
*group_handle
,
625 /************************/
627 NTSTATUS samr_DeleteDomainGroup
(
628 [in,out,ref] policy_handle
*group_handle
631 /************************/
633 NTSTATUS samr_DeleteGroupMember
(
634 [in,ref] policy_handle
*group_handle
,
639 /************************/
643 [size_is(count
)] uint32
*rids
;
644 [size_is(count
)] security_GroupAttrs
*attributes
;
647 NTSTATUS samr_QueryGroupMember
(
648 [in,ref] policy_handle
*group_handle
,
649 [out,ref] samr_RidAttrArray
**rids
653 /************************/
657 win2003 seems to accept any data at all for the two integers
658 below, and doesn't seem to do anything with them that I can
659 see. Weird. I really expected the first integer to be a rid
660 and the second to be the attributes for that rid member.
662 NTSTATUS samr_SetMemberAttributesOfGroup
(
663 [in,ref] policy_handle
*group_handle
,
664 [in] uint32 unknown1
,
669 /************************/
671 NTSTATUS samr_OpenAlias
(
672 [in,ref] policy_handle
*domain_handle
,
673 [in] samr_AliasAccessMask access_mask
,
675 [out,ref] policy_handle
*alias_handle
679 /************************/
685 lsa_String description
;
691 ALIASINFODESCRIPTION
= 3
692 } samr_AliasInfoEnum
;
694 typedef [switch_type(samr_AliasInfoEnum
)] union {
695 [case(ALIASINFOALL
)] samr_AliasInfoAll all
;
696 [case(ALIASINFONAME
)] lsa_String name
;
697 [case(ALIASINFODESCRIPTION
)] lsa_String description
;
700 NTSTATUS samr_QueryAliasInfo
(
701 [in,ref] policy_handle
*alias_handle
,
702 [in] samr_AliasInfoEnum level
,
703 [out,ref,switch_is(level
)] samr_AliasInfo
**info
706 /************************/
708 NTSTATUS samr_SetAliasInfo
(
709 [in,ref] policy_handle
*alias_handle
,
710 [in] samr_AliasInfoEnum level
,
711 [in,switch_is(level
),ref] samr_AliasInfo
*info
714 /************************/
716 NTSTATUS samr_DeleteDomAlias
(
717 [in,out,ref] policy_handle
*alias_handle
720 /************************/
722 NTSTATUS samr_AddAliasMember
(
723 [in,ref] policy_handle
*alias_handle
,
724 [in,ref] dom_sid2
*sid
727 /************************/
729 NTSTATUS samr_DeleteAliasMember
(
730 [in,ref] policy_handle
*alias_handle
,
731 [in,ref] dom_sid2
*sid
734 /************************/
736 NTSTATUS samr_GetMembersInAlias
(
737 [in,ref] policy_handle
*alias_handle
,
738 [out,ref] lsa_SidArray
*sids
741 /************************/
743 [public] NTSTATUS samr_OpenUser
(
744 [in,ref] policy_handle
*domain_handle
,
745 [in] samr_UserAccessMask access_mask
,
747 [out,ref] policy_handle
*user_handle
750 /************************/
752 NTSTATUS samr_DeleteUser
(
753 [in,out,ref] policy_handle
*user_handle
756 /************************/
760 UserGeneralInformation
= 1,
761 UserPreferencesInformation
= 2,
762 UserLogonInformation
= 3,
763 UserLogonHoursInformation
= 4,
764 UserAccountInformation
= 5,
765 UserNameInformation
= 6,
766 UserAccountNameInformation
= 7,
767 UserFullNameInformation
= 8,
768 UserPrimaryGroupInformation
= 9,
769 UserHomeInformation
= 10,
770 UserScriptInformation
= 11,
771 UserProfileInformation
= 12,
772 UserAdminCommentInformation
= 13,
773 UserWorkStationsInformation
= 14,
774 UserControlInformation
= 16,
775 UserExpiresInformation
= 17,
776 UserInternal1Information
= 18,
777 UserParametersInformation
= 20,
778 UserAllInformation
= 21,
779 UserInternal4Information
= 23,
780 UserInternal5Information
= 24,
781 UserInternal4InformationNew
= 25,
782 UserInternal5InformationNew
= 26,
783 UserInternal7InformationNew
= 31,
784 UserInternal8InformationNew
= 32
785 } samr_UserInfoLevel
;
788 lsa_String account_name
;
789 lsa_String full_name
;
791 lsa_String description
;
797 lsa_String reserved
; /* settable, but doesn't stick. probably obsolete */
802 /* this is also used in samr and netlogon */
803 typedef [public, flag
(NDR_PAHEX
)] struct {
804 uint16 units_per_week
;
805 [size_is(1260), length_is(units_per_week
/8)] uint8
*bits
;
809 lsa_String account_name
;
810 lsa_String full_name
;
813 lsa_String home_directory
;
814 lsa_String home_drive
;
815 lsa_String logon_script
;
816 lsa_String profile_path
;
817 lsa_String workstations
;
820 NTTIME last_password_change
;
821 NTTIME allow_password_change
;
822 NTTIME force_password_change
;
823 samr_LogonHours logon_hours
;
824 uint16 bad_password_count
;
826 samr_AcctFlags acct_flags
;
830 samr_LogonHours logon_hours
;
834 lsa_String account_name
;
835 lsa_String full_name
;
838 lsa_String home_directory
;
839 lsa_String home_drive
;
840 lsa_String logon_script
;
841 lsa_String profile_path
;
842 lsa_String description
;
843 lsa_String workstations
;
846 samr_LogonHours logon_hours
;
847 uint16 bad_password_count
;
849 NTTIME last_password_change
;
851 samr_AcctFlags acct_flags
;
855 lsa_String account_name
;
856 lsa_String full_name
;
860 lsa_String account_name
;
864 lsa_String full_name
;
872 lsa_String home_directory
;
873 lsa_String home_drive
;
877 lsa_String logon_script
;
881 lsa_String profile_path
;
885 lsa_String description
;
889 lsa_String workstations
;
893 samr_AcctFlags acct_flags
;
900 typedef [public, flag
(NDR_PAHEX
)] struct {
905 samr_Password nt_pwd
;
906 samr_Password lm_pwd
;
907 boolean8 nt_pwd_active
;
908 boolean8 lm_pwd_active
;
909 uint8 password_expired
;
913 lsa_BinaryString parameters
;
916 /* this defines the bits used for fields_present in info21 */
917 typedef [bitmap32bit
] bitmap
{
918 SAMR_FIELD_ACCOUNT_NAME
= 0x00000001,
919 SAMR_FIELD_FULL_NAME
= 0x00000002,
920 SAMR_FIELD_RID
= 0x00000004,
921 SAMR_FIELD_PRIMARY_GID
= 0x00000008,
922 SAMR_FIELD_DESCRIPTION
= 0x00000010,
923 SAMR_FIELD_COMMENT
= 0x00000020,
924 SAMR_FIELD_HOME_DIRECTORY
= 0x00000040,
925 SAMR_FIELD_HOME_DRIVE
= 0x00000080,
926 SAMR_FIELD_LOGON_SCRIPT
= 0x00000100,
927 SAMR_FIELD_PROFILE_PATH
= 0x00000200,
928 SAMR_FIELD_WORKSTATIONS
= 0x00000400,
929 SAMR_FIELD_LAST_LOGON
= 0x00000800,
930 SAMR_FIELD_LAST_LOGOFF
= 0x00001000,
931 SAMR_FIELD_LOGON_HOURS
= 0x00002000,
932 SAMR_FIELD_BAD_PWD_COUNT
= 0x00004000,
933 SAMR_FIELD_NUM_LOGONS
= 0x00008000,
934 SAMR_FIELD_ALLOW_PWD_CHANGE
= 0x00010000,
935 SAMR_FIELD_FORCE_PWD_CHANGE
= 0x00020000,
936 SAMR_FIELD_LAST_PWD_CHANGE
= 0x00040000,
937 SAMR_FIELD_ACCT_EXPIRY
= 0x00080000,
938 SAMR_FIELD_ACCT_FLAGS
= 0x00100000,
939 SAMR_FIELD_PARAMETERS
= 0x00200000,
940 SAMR_FIELD_COUNTRY_CODE
= 0x00400000,
941 SAMR_FIELD_CODE_PAGE
= 0x00800000,
942 SAMR_FIELD_NT_PASSWORD_PRESENT
= 0x01000000, /* either of these */
943 SAMR_FIELD_LM_PASSWORD_PRESENT
= 0x02000000, /* two bits seems to work */
944 SAMR_FIELD_PRIVATE_DATA
= 0x04000000,
945 SAMR_FIELD_EXPIRED_FLAG
= 0x08000000,
946 SAMR_FIELD_SEC_DESC
= 0x10000000,
947 SAMR_FIELD_OWF_PWD
= 0x20000000
948 } samr_FieldsPresent
;
950 /* used for 'password_expired' in samr_UserInfo21 */
951 const int PASS_MUST_CHANGE_AT_NEXT_LOGON
= 0x01;
952 const int PASS_DONT_CHANGE_AT_NEXT_LOGON
= 0x00;
957 NTTIME last_password_change
;
959 NTTIME allow_password_change
;
960 NTTIME force_password_change
;
961 lsa_String account_name
;
962 lsa_String full_name
;
963 lsa_String home_directory
;
964 lsa_String home_drive
;
965 lsa_String logon_script
;
966 lsa_String profile_path
;
967 lsa_String description
;
968 lsa_String workstations
;
970 lsa_BinaryString parameters
;
971 lsa_BinaryString lm_owf_password
;
972 lsa_BinaryString nt_owf_password
;
973 lsa_String private_data
;
975 [size_is(buf_count
)] uint8
*buffer
;
978 samr_AcctFlags acct_flags
;
979 samr_FieldsPresent fields_present
;
980 samr_LogonHours logon_hours
;
981 uint16 bad_password_count
;
985 uint8 lm_password_set
;
986 uint8 nt_password_set
;
987 uint8 password_expired
;
988 uint8 private_data_sensitive
;
991 typedef [public, flag
(NDR_PAHEX
)] struct {
993 } samr_CryptPassword
;
996 samr_UserInfo21 info
;
997 samr_CryptPassword password
;
1001 samr_CryptPassword password
;
1002 uint8 password_expired
;
1005 typedef [flag
(NDR_PAHEX
)] struct {
1007 } samr_CryptPasswordEx
;
1010 samr_UserInfo21 info
;
1011 samr_CryptPasswordEx password
;
1015 samr_CryptPasswordEx password
;
1016 uint8 password_expired
;
1020 uint8 auth_data
[64];
1023 [size_is(cipher_len
)] uint8
*cipher
;
1024 hyper PBKDF2Iterations
;
1025 } samr_EncryptedPasswordAES
;
1028 samr_EncryptedPasswordAES password
;
1029 uint8 password_expired
;
1033 samr_UserInfo21 info
;
1034 samr_EncryptedPasswordAES password
;
1037 typedef [switch_type(uint16
)] union {
1038 [case(1)] samr_UserInfo1 info1
;
1039 [case(2)] samr_UserInfo2 info2
;
1040 [case(3)] samr_UserInfo3 info3
;
1041 [case(4)] samr_UserInfo4 info4
;
1042 [case(5)] samr_UserInfo5 info5
;
1043 [case(6)] samr_UserInfo6 info6
;
1044 [case(7)] samr_UserInfo7 info7
;
1045 [case(8)] samr_UserInfo8 info8
;
1046 [case(9)] samr_UserInfo9 info9
;
1047 [case(10)] samr_UserInfo10 info10
;
1048 [case(11)] samr_UserInfo11 info11
;
1049 [case(12)] samr_UserInfo12 info12
;
1050 [case(13)] samr_UserInfo13 info13
;
1051 [case(14)] samr_UserInfo14 info14
;
1052 [case(16)] samr_UserInfo16 info16
;
1053 [case(17)] samr_UserInfo17 info17
;
1054 [case(18)] samr_UserInfo18 info18
;
1055 [case(20)] samr_UserInfo20 info20
;
1056 [case(21)] samr_UserInfo21 info21
;
1057 [case(23)] samr_UserInfo23 info23
;
1058 [case(24)] samr_UserInfo24 info24
;
1059 [case(25)] samr_UserInfo25 info25
;
1060 [case(26)] samr_UserInfo26 info26
;
1061 [case(31)] samr_UserInfo31 info31
;
1062 [case(32)] samr_UserInfo32 info32
;
1065 [public] NTSTATUS samr_QueryUserInfo
(
1066 [in,ref] policy_handle
*user_handle
,
1067 [in] samr_UserInfoLevel level
,
1068 [out,ref,switch_is(level
)] samr_UserInfo
**info
1072 /************************/
1074 [public] NTSTATUS samr_SetUserInfo
(
1075 [in,ref] policy_handle
*user_handle
,
1076 [in] samr_UserInfoLevel level
,
1077 [in,ref,switch_is(level
)] samr_UserInfo
*info
1080 /************************/
1083 this is a password change interface that doesn't give
1084 the server the plaintext password. Deprecated.
1086 NTSTATUS samr_ChangePasswordUser
(
1087 [in,ref] policy_handle
*user_handle
,
1088 [in] boolean8 lm_present
,
1089 [in,unique] samr_Password
*old_lm_crypted
,
1090 [in,unique] samr_Password
*new_lm_crypted
,
1091 [in] boolean8 nt_present
,
1092 [in,unique] samr_Password
*old_nt_crypted
,
1093 [in,unique] samr_Password
*new_nt_crypted
,
1094 [in] boolean8 cross1_present
,
1095 [in,unique] samr_Password
*nt_cross
,
1096 [in] boolean8 cross2_present
,
1097 [in,unique] samr_Password
*lm_cross
1100 /************************/
1103 typedef [public] struct {
1105 security_GroupAttrs attributes
;
1106 } samr_RidWithAttribute
;
1108 typedef [public] struct {
1110 [size_is(count
)] samr_RidWithAttribute
*rids
;
1111 } samr_RidWithAttributeArray
;
1113 NTSTATUS samr_GetGroupsForUser
(
1114 [in,ref] policy_handle
*user_handle
,
1115 [out,ref] samr_RidWithAttributeArray
**rids
1118 /************************/
1124 samr_AcctFlags acct_flags
;
1125 lsa_String account_name
;
1126 lsa_String description
;
1127 lsa_String full_name
;
1128 } samr_DispEntryGeneral
;
1132 [size_is(count
)] samr_DispEntryGeneral
*entries
;
1133 } samr_DispInfoGeneral
;
1138 samr_AcctFlags acct_flags
;
1139 lsa_String account_name
;
1140 lsa_String description
;
1141 } samr_DispEntryFull
;
1145 [size_is(count
)] samr_DispEntryFull
*entries
;
1146 } samr_DispInfoFull
;
1151 security_GroupAttrs acct_flags
;
1152 lsa_String account_name
;
1153 lsa_String description
;
1154 } samr_DispEntryFullGroup
;
1158 [size_is(count
)] samr_DispEntryFullGroup
*entries
;
1159 } samr_DispInfoFullGroups
;
1163 lsa_AsciiStringLarge account_name
;
1164 } samr_DispEntryAscii
;
1168 [size_is(count
)] samr_DispEntryAscii
*entries
;
1169 } samr_DispInfoAscii
;
1171 typedef [switch_type(uint16
)] union {
1172 [case(1)] samr_DispInfoGeneral info1
;/* users */
1173 [case(2)] samr_DispInfoFull info2
; /* trust accounts? */
1174 [case(3)] samr_DispInfoFullGroups info3
; /* groups */
1175 [case(4)] samr_DispInfoAscii info4
; /* users */
1176 [case(5)] samr_DispInfoAscii info5
; /* groups */
1179 NTSTATUS samr_QueryDisplayInfo
(
1180 [in,ref] policy_handle
*domain_handle
,
1182 [in] uint32 start_idx
,
1183 [in] uint32 max_entries
,
1184 [in] uint32 buf_size
,
1185 [out,ref] uint32
*total_size
,
1186 [out,ref] uint32
*returned_size
,
1187 [out,ref,switch_is(level
)] samr_DispInfo
*info
1191 /************************/
1195 this seems to be an alphabetic search function. The returned index
1196 is the index for samr_QueryDisplayInfo needed to get names occurring
1197 after the specified name. The supplied name does not need to exist
1198 in the database (for example you can supply just a first letter for
1199 searching starting at that letter)
1201 The level corresponds to the samr_QueryDisplayInfo level
1203 NTSTATUS samr_GetDisplayEnumerationIndex
(
1204 [in,ref] policy_handle
*domain_handle
,
1206 [in,ref] lsa_String
*name
,
1207 [out,ref] uint32
*idx
1212 /************************/
1216 w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this
1218 NTSTATUS samr_TestPrivateFunctionsDomain
(
1219 [in,ref] policy_handle
*domain_handle
1223 /************************/
1227 w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this
1229 NTSTATUS samr_TestPrivateFunctionsUser
(
1230 [in,ref] policy_handle
*user_handle
1234 /************************/
1238 uint16 min_password_length
;
1239 samr_PasswordProperties password_properties
;
1242 [public] NTSTATUS samr_GetUserPwInfo
(
1243 [in,ref] policy_handle
*user_handle
,
1244 [out,ref] samr_PwInfo
*info
1247 /************************/
1249 NTSTATUS samr_RemoveMemberFromForeignDomain
(
1250 [in,ref] policy_handle
*domain_handle
,
1251 [in,ref] dom_sid2
*sid
1254 /************************/
1258 how is this different from QueryDomainInfo ??
1260 NTSTATUS samr_QueryDomainInfo2
(
1261 [in,ref] policy_handle
*domain_handle
,
1262 [in] samr_DomainInfoClass level
,
1263 [out,ref,switch_is(level
)] samr_DomainInfo
**info
1266 /************************/
1270 how is this different from QueryUserInfo ??
1272 NTSTATUS samr_QueryUserInfo2
(
1273 [in,ref] policy_handle
*user_handle
,
1274 [in] samr_UserInfoLevel level
,
1275 [out,ref,switch_is(level
)] samr_UserInfo
**info
1278 /************************/
1282 how is this different from QueryDisplayInfo??
1284 NTSTATUS samr_QueryDisplayInfo2
(
1285 [in,ref] policy_handle
*domain_handle
,
1287 [in] uint32 start_idx
,
1288 [in] uint32 max_entries
,
1289 [in] uint32 buf_size
,
1290 [out,ref] uint32
*total_size
,
1291 [out,ref] uint32
*returned_size
,
1292 [out,ref,switch_is(level
)] samr_DispInfo
*info
1295 /************************/
1299 how is this different from GetDisplayEnumerationIndex ??
1301 NTSTATUS samr_GetDisplayEnumerationIndex2
(
1302 [in,ref] policy_handle
*domain_handle
,
1304 [in,ref] lsa_String
*name
,
1305 [out,ref] uint32
*idx
1309 /************************/
1311 NTSTATUS samr_CreateUser2
(
1312 [in,ref] policy_handle
*domain_handle
,
1313 [in,ref] lsa_String
*account_name
,
1314 [in] samr_AcctFlags acct_flags
,
1315 [in] samr_UserAccessMask access_mask
,
1316 [out,ref] policy_handle
*user_handle
,
1317 [out,ref] uint32
*access_granted
,
1318 [out,ref] uint32
*rid
1322 /************************/
1326 another duplicate. There must be a reason ....
1328 NTSTATUS samr_QueryDisplayInfo3
(
1329 [in,ref] policy_handle
*domain_handle
,
1331 [in] uint32 start_idx
,
1332 [in] uint32 max_entries
,
1333 [in] uint32 buf_size
,
1334 [out,ref] uint32
*total_size
,
1335 [out,ref] uint32
*returned_size
,
1336 [out,ref,switch_is(level
)] samr_DispInfo
*info
1339 /************************/
1341 NTSTATUS samr_AddMultipleMembersToAlias
(
1342 [in,ref] policy_handle
*alias_handle
,
1343 [in,ref] lsa_SidArray
*sids
1346 /************************/
1348 NTSTATUS samr_RemoveMultipleMembersFromAlias
(
1349 [in,ref] policy_handle
*alias_handle
,
1350 [in,ref] lsa_SidArray
*sids
1353 /************************/
1356 NTSTATUS samr_OemChangePasswordUser2
(
1357 [in,unique] lsa_AsciiString
*server
,
1358 [in,ref] lsa_AsciiString
*account
,
1359 [in,unique] samr_CryptPassword
*password
,
1360 [in,unique] samr_Password
*hash
1363 /************************/
1365 NTSTATUS samr_ChangePasswordUser2
(
1366 [in,unique] lsa_String
*server
,
1367 [in,ref] lsa_String
*account
,
1368 [in,unique] samr_CryptPassword
*nt_password
,
1369 [in,unique] samr_Password
*nt_verifier
,
1370 [in] boolean8 lm_change
,
1371 [in,unique] samr_CryptPassword
*lm_password
,
1372 [in,unique] samr_Password
*lm_verifier
1375 /************************/
1377 NTSTATUS samr_GetDomPwInfo
(
1378 [in,unique] lsa_String
*domain_name
,
1379 [out,ref] samr_PwInfo
*info
1382 /************************/
1384 NTSTATUS samr_Connect2
(
1385 [in,unique,string,charset
(UTF16
)] uint16
*system_name
,
1386 [in] samr_ConnectAccessMask access_mask
,
1387 [out,ref] policy_handle
*connect_handle
1390 /************************/
1393 seems to be an exact alias for samr_SetUserInfo()
1395 [public] NTSTATUS samr_SetUserInfo2
(
1396 [in,ref] policy_handle
*user_handle
,
1397 [in] samr_UserInfoLevel level
,
1398 [in,ref,switch_is(level
)] samr_UserInfo
*info
1401 /************************/
1404 this one is mysterious. I have a few guesses, but nothing working yet
1406 NTSTATUS samr_SetBootKeyInformation
(
1407 [in,ref] policy_handle
*connect_handle
,
1408 [in] uint32 unknown1
,
1409 [in] uint32 unknown2
,
1410 [in] uint32 unknown3
1413 /************************/
1415 NTSTATUS samr_GetBootKeyInformation
(
1416 [in,ref] policy_handle
*domain_handle
,
1417 [out,ref] uint32
*unknown
1420 /************************/
1422 NTSTATUS samr_Connect3
(
1423 [in,unique,string,charset
(UTF16
)] uint16
*system_name
,
1424 /* this unknown value seems to be completely ignored by w2k3 */
1425 [in] uint32 unknown
,
1426 [in] samr_ConnectAccessMask access_mask
,
1427 [out,ref] policy_handle
*connect_handle
1430 /************************/
1433 typedef [v1_enum] enum {
1434 SAMR_CONNECT_PRE_W2K
= 1,
1435 SAMR_CONNECT_W2K
= 2,
1436 SAMR_CONNECT_AFTER_W2K
= 3
1437 } samr_ConnectVersion
;
1439 NTSTATUS samr_Connect4
(
1440 [in,unique,string,charset
(UTF16
)] uint16
*system_name
,
1441 [in] samr_ConnectVersion client_version
,
1442 [in] samr_ConnectAccessMask access_mask
,
1443 [out,ref] policy_handle
*connect_handle
1446 /************************/
1449 typedef [public,v1_enum] enum {
1450 SAM_PWD_CHANGE_NO_ERROR
= 0,
1451 SAM_PWD_CHANGE_PASSWORD_TOO_SHORT
= 1,
1452 SAM_PWD_CHANGE_PWD_IN_HISTORY
= 2,
1453 SAM_PWD_CHANGE_USERNAME_IN_PASSWORD
= 3,
1454 SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD
= 4,
1455 SAM_PWD_CHANGE_NOT_COMPLEX
= 5,
1456 SAM_PWD_CHANGE_MACHINE_NOT_DEFAULT
= 6,
1457 SAM_PWD_CHANGE_FAILED_BY_FILTER
= 7,
1458 SAM_PWD_CHANGE_PASSWORD_TOO_LONG
= 8
1459 } samPwdChangeReason
;
1462 samPwdChangeReason extendedFailureReason
;
1463 lsa_String filterModuleName
;
1464 } userPwdChangeFailureInformation
;
1466 [public] NTSTATUS samr_ChangePasswordUser3
(
1467 [in,unique] lsa_String
*server
,
1468 [in,ref] lsa_String
*account
,
1469 [in,unique] samr_CryptPassword
*nt_password
,
1470 [in,unique] samr_Password
*nt_verifier
,
1471 [in] boolean8 lm_change
,
1472 [in,unique] samr_CryptPassword
*lm_password
,
1473 [in,unique] samr_Password
*lm_verifier
,
1474 [in,unique] samr_CryptPassword
*password3
,
1475 [out,ref] samr_DomInfo1
**dominfo
,
1476 [out,ref] userPwdChangeFailureInformation
**reject
1479 /************************/
1482 typedef [v1_enum] enum {
1483 SAMR_CONNECT_FEATURE_RID_ONLY
= 0x00000001,
1484 SAMR_CONNECT_FEATURE_RESRVED1
= 0x00000002,
1485 SAMR_CONNECT_FEATURE_RESRVED2
= 0x00000004,
1486 SAMR_CONNECT_FEATURE_USE_AES
= 0x00000010
1487 } samr_SupportedFeatures
;
1490 samr_ConnectVersion client_version
; /* w2k3 gives 3 */
1491 samr_SupportedFeatures supported_features
;
1492 } samr_ConnectInfo1
;
1495 [case(1)] samr_ConnectInfo1 info1
;
1498 [public] NTSTATUS samr_Connect5
(
1499 [in,unique,string,charset
(UTF16
)] uint16
*system_name
,
1500 [in] samr_ConnectAccessMask access_mask
,
1501 [in] uint32 level_in
,
1502 [in,ref,switch_is(level_in
)] samr_ConnectInfo
*info_in
,
1503 [out,ref] uint32
*level_out
,
1504 [out,ref,switch_is(*level_out
)] samr_ConnectInfo
*info_out
,
1505 [out,ref] policy_handle
*connect_handle
1508 /************************/
1510 NTSTATUS samr_RidToSid
(
1511 [in,ref] policy_handle
*domain_handle
,
1513 [out,ref] dom_sid2
**sid
1516 /************************/
1520 this should set the DSRM password for the server, which is used
1521 when booting into Directory Services Recovery Mode on a DC. Win2003
1522 gives me NT_STATUS_NOT_SUPPORTED
1525 NTSTATUS samr_SetDsrmPassword
(
1526 [in,unique] lsa_String
*name
,
1527 [in] uint32 unknown
,
1528 [in,unique] samr_Password
*hash
1532 /************************/
1534 /************************/
1535 typedef [bitmap32bit
] bitmap
{
1536 SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET
= 0x00000001,
1537 SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME
= 0x00000002,
1538 SAMR_VALIDATE_FIELD_LOCKOUT_TIME
= 0x00000004,
1539 SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT
= 0x00000008,
1540 SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH
= 0x00000010,
1541 SAMR_VALIDATE_FIELD_PASSWORD_HISTORY
= 0x00000020
1542 } samr_ValidateFieldsPresent
;
1545 NetValidateAuthentication
= 1,
1546 NetValidatePasswordChange
= 2,
1547 NetValidatePasswordReset
= 3
1548 } samr_ValidatePasswordLevel
;
1550 /* NetApi maps samr_ValidationStatus errors to WERRORs. Haven't
1551 * identified the mapping of
1552 * - NERR_PasswordFilterError
1553 * - NERR_PasswordExpired and
1554 * - NERR_PasswordCantChange
1559 SAMR_VALIDATION_STATUS_SUCCESS
= 0,
1560 SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE
= 1,
1561 SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT
= 2,
1562 SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED
= 3,
1563 SAMR_VALIDATION_STATUS_BAD_PASSWORD
= 4,
1564 SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT
= 5,
1565 SAMR_VALIDATION_STATUS_PWD_TOO_SHORT
= 6,
1566 SAMR_VALIDATION_STATUS_PWD_TOO_LONG
= 7,
1567 SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH
= 8,
1568 SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT
= 9,
1569 SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR
= 10
1570 } samr_ValidationStatus
;
1574 [size_is(length
)] uint8
*data
;
1575 } samr_ValidationBlob
;
1578 samr_ValidateFieldsPresent fields_present
;
1579 NTTIME_hyper last_password_change
;
1580 NTTIME_hyper bad_password_time
;
1581 NTTIME_hyper lockout_time
;
1582 uint32 bad_pwd_count
;
1583 uint32 pwd_history_len
;
1584 [size_is(pwd_history_len
)] samr_ValidationBlob
*pwd_history
;
1585 } samr_ValidatePasswordInfo
;
1588 samr_ValidatePasswordInfo info
;
1589 samr_ValidationStatus status
;
1590 } samr_ValidatePasswordRepCtr
;
1592 typedef [switch_type(uint16
)] union {
1593 [case(1)] samr_ValidatePasswordRepCtr ctr1
;
1594 [case(2)] samr_ValidatePasswordRepCtr ctr2
;
1595 [case(3)] samr_ValidatePasswordRepCtr ctr3
;
1596 } samr_ValidatePasswordRep
;
1599 samr_ValidatePasswordInfo info
;
1600 lsa_StringLarge password
;
1601 lsa_StringLarge account
;
1602 samr_ValidationBlob hash
;
1603 boolean8 pwd_must_change_at_next_logon
;
1604 boolean8 clear_lockout
;
1605 } samr_ValidatePasswordReq3
;
1608 samr_ValidatePasswordInfo info
;
1609 lsa_StringLarge password
;
1610 lsa_StringLarge account
;
1611 samr_ValidationBlob hash
;
1612 boolean8 password_matched
;
1613 } samr_ValidatePasswordReq2
;
1616 samr_ValidatePasswordInfo info
;
1617 boolean8 password_matched
;
1618 } samr_ValidatePasswordReq1
;
1620 typedef [switch_type(uint16
)] union {
1621 [case(1)] samr_ValidatePasswordReq1 req1
;
1622 [case(2)] samr_ValidatePasswordReq2 req2
;
1623 [case(3)] samr_ValidatePasswordReq3 req3
;
1624 } samr_ValidatePasswordReq
;
1626 NTSTATUS samr_ValidatePassword
(
1627 [in] samr_ValidatePasswordLevel level
,
1628 [in,switch_is(level
)] samr_ValidatePasswordReq
*req
,
1629 [out,ref,switch_is(level
)] samr_ValidatePasswordRep
**rep
1632 /************************/
1634 /************************/
1635 [todo
] void samr_Opnum68NotUsedOnWire
(void);
1637 /************************/
1639 /************************/
1640 [todo
] void samr_Opnum69NotUsedOnWire
(void);
1642 /************************/
1644 /************************/
1645 [todo
] void samr_Opnum70NotUsedOnWire
(void);
1647 /************************/
1649 /************************/
1650 [todo
] void samr_Opnum71NotUsedOnWire
(void);
1652 /************************/
1654 /************************/
1655 [todo
] void samr_Opnum72NotUsedOnWire
(void);
1657 /************************/
1659 /************************/
1660 [public] NTSTATUS samr_ChangePasswordUser4
(
1661 [in,unique] lsa_String
*server
,
1662 [in,ref] lsa_String
*account
,
1663 [in,ref] samr_EncryptedPasswordAES
*password