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),
16 pointer_default_top(unique)
19 declare bitmap security_secinfo;
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 = Encryped 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_NO_AUTH_DATA_REQD = 0x00080000 /* 1 = No authorization data required */
44 typedef [bitmap32bit] bitmap {
45 SAMR_ACCESS_CONNECT_TO_SERVER = 0x00000001,
46 SAMR_ACCESS_SHUTDOWN_SERVER = 0x00000002,
47 SAMR_ACCESS_INITIALIZE_SERVER = 0x00000004,
48 SAMR_ACCESS_CREATE_DOMAIN = 0x00000008,
49 SAMR_ACCESS_ENUM_DOMAINS = 0x00000010,
50 SAMR_ACCESS_OPEN_DOMAIN = 0x00000020
51 } samr_ConnectAccessMask;
53 typedef [bitmap32bit] bitmap {
54 GROUP_ACCESS_LOOKUP_INFO = 0x00000001,
55 GROUP_ACCESS_SET_INFO = 0x00000002,
56 GROUP_ACCESS_ADD_MEMBER = 0x00000004,
57 GROUP_ACCESS_REMOVE_MEMBER = 0x00000008,
58 GROUP_ACCESS_GET_MEMBERS = 0x00000010
59 } samr_GroupAccessMask;
61 typedef [bitmap32bit] bitmap {
62 ALIAS_ACCESS_ADD_MEMBER = 0x00000001,
63 ALIAS_ACCESS_REMOVE_MEMBER = 0x00000002,
64 ALIAS_ACCESS_GET_MEMBERS = 0x00000004,
65 ALIAS_ACCESS_LOOKUP_INFO = 0x00000008,
66 ALIAS_ACCESS_SET_INFO = 0x00000010
67 } samr_AliasAccessMask;
71 NTSTATUS samr_Connect (
72 /* notice the lack of [string] */
73 [in] uint16 *system_name,
74 [in] samr_ConnectAccessMask access_mask,
75 [out,ref] policy_handle *connect_handle
81 [public] NTSTATUS samr_Close (
82 [in,out,ref] policy_handle *handle
88 NTSTATUS samr_SetSecurity (
89 [in,ref] policy_handle *handle,
90 [in] security_secinfo sec_info,
91 [in,ref] sec_desc_buf *sdbuf
97 NTSTATUS samr_QuerySecurity (
98 [in,ref] policy_handle *handle,
99 [in] security_secinfo sec_info,
100 [out] sec_desc_buf *sdbuf
107 shutdown the SAM - once you call this the SAM will be dead
109 NTSTATUS samr_Shutdown (
110 [in,ref] policy_handle *connect_handle
115 NTSTATUS samr_LookupDomain (
116 [in,ref] policy_handle *connect_handle,
117 [in,ref] lsa_String *domain_name,
132 [size_is(count)] samr_SamEntry *entries;
135 NTSTATUS samr_EnumDomains (
136 [in,ref] policy_handle *connect_handle,
137 [in,out,ref] uint32 *resume_handle,
138 [in] uint32 buf_size,
139 [out] samr_SamArray *sam,
140 [out] uint32 num_entries
144 /************************/
146 [public] NTSTATUS samr_OpenDomain(
147 [in,ref] policy_handle *connect_handle,
148 [in] uint32 access_mask,
149 [in,ref] dom_sid2 *sid,
150 [out,ref] policy_handle *domain_handle
153 /************************/
156 typedef [v1_enum] enum {
157 SAMR_ROLE_STANDALONE = 0,
158 SAMR_ROLE_DOMAIN_MEMBER = 1,
159 SAMR_ROLE_DOMAIN_BDC = 2,
160 SAMR_ROLE_DOMAIN_PDC = 3
163 /* password properties flags */
164 typedef [public,bitmap32bit] bitmap {
165 DOMAIN_PASSWORD_COMPLEX = 0x00000001,
166 DOMAIN_PASSWORD_NO_ANON_CHANGE = 0x00000002,
167 DOMAIN_PASSWORD_NO_CLEAR_CHANGE = 0x00000004,
168 DOMAIN_PASSWORD_LOCKOUT_ADMINS = 0x00000008,
169 DOMAIN_PASSWORD_STORE_CLEARTEXT = 0x00000010,
170 DOMAIN_REFUSE_PASSWORD_CHANGE = 0x00000020
171 } samr_PasswordProperties;
174 uint16 min_password_length;
175 uint16 password_history_length;
176 samr_PasswordProperties password_properties;
177 /* yes, these are signed. They are in negative 100ns */
178 dlong max_password_age;
179 dlong min_password_age;
183 NTTIME force_logoff_time;
185 lsa_String domain_name;
186 lsa_String primary; /* PDC name if this is a BDC */
197 NTTIME force_logoff_time;
205 lsa_String domain_name;
218 NTTIME domain_create_time;
222 uint32 unknown; /* w2k3 returns 1 */
227 hyper lockout_duration;
228 hyper lockout_window;
229 uint16 lockout_threshold;
233 hyper lockout_duration;
234 hyper lockout_window;
235 uint16 lockout_threshold;
240 NTTIME domain_create_time;
245 typedef [switch_type(uint16)] union {
246 [case(1)] samr_DomInfo1 info1;
247 [case(2)] samr_DomInfo2 info2;
248 [case(3)] samr_DomInfo3 info3;
249 [case(4)] samr_DomInfo4 info4;
250 [case(5)] samr_DomInfo5 info5;
251 [case(6)] samr_DomInfo6 info6;
252 [case(7)] samr_DomInfo7 info7;
253 [case(8)] samr_DomInfo8 info8;
254 [case(9)] samr_DomInfo9 info9;
255 [case(11)] samr_DomInfo11 info11;
256 [case(12)] samr_DomInfo12 info12;
257 [case(13)] samr_DomInfo13 info13;
260 NTSTATUS samr_QueryDomainInfo(
261 [in,ref] policy_handle *domain_handle,
263 [out,switch_is(level)] samr_DomainInfo *info
266 /************************/
269 only levels 1, 3, 4, 6, 7, 9, 12 are valid for this
272 NTSTATUS samr_SetDomainInfo(
273 [in,ref] policy_handle *domain_handle,
275 [in,switch_is(level),ref] samr_DomainInfo *info
279 /************************/
281 NTSTATUS samr_CreateDomainGroup(
282 [in,ref] policy_handle *domain_handle,
283 [in,ref] lsa_String *name,
284 [in] samr_GroupAccessMask access_mask,
285 [out,ref] policy_handle *group_handle,
286 [out,ref] uint32 *rid
290 /************************/
292 NTSTATUS samr_EnumDomainGroups(
293 [in,ref] policy_handle *domain_handle,
294 [in,out,ref] uint32 *resume_handle,
295 [in] uint32 max_size,
296 [out] samr_SamArray *sam,
297 [out] uint32 num_entries
300 /************************/
302 NTSTATUS samr_CreateUser(
303 [in,ref] policy_handle *domain_handle,
304 [in,ref] lsa_String *account_name,
305 [in] uint32 access_mask,
306 [out,ref] policy_handle *user_handle,
307 [out,ref] uint32 *rid
310 /************************/
314 /* w2k3 treats max_size as max_users*54 and sets the
315 resume_handle as the rid of the last user sent
317 const int SAMR_ENUM_USERS_MULTIPLIER = 54;
319 NTSTATUS samr_EnumDomainUsers(
320 [in,ref] policy_handle *domain_handle,
321 [in,out,ref] uint32 *resume_handle,
322 [in] samr_AcctFlags acct_flags,
323 [in] uint32 max_size,
324 [out] samr_SamArray *sam,
325 [out] uint32 num_entries
328 /************************/
330 NTSTATUS samr_CreateDomAlias(
331 [in,ref] policy_handle *domain_handle,
332 [in,ref] lsa_String *alias_name,
333 [in] samr_AliasAccessMask access_mask,
334 [out,ref] policy_handle *alias_handle,
335 [out,ref] uint32 *rid
338 /************************/
340 NTSTATUS samr_EnumDomainAliases(
341 [in,ref] policy_handle *domain_handle,
342 [in,out,ref] uint32 *resume_handle,
343 [in] samr_AcctFlags acct_flags,
344 [out] samr_SamArray *sam,
345 [out] uint32 num_entries
348 /************************/
352 [range(0,1024)] uint32 count;
353 [size_is(count)] uint32 *ids;
356 NTSTATUS samr_GetAliasMembership(
357 [in,ref] policy_handle *domain_handle,
358 [in,ref] lsa_SidArray *sids,
359 [out,ref] samr_Ids *rids
362 /************************/
365 [public] NTSTATUS samr_LookupNames(
366 [in,ref] policy_handle *domain_handle,
367 [in,range(0,1000)] uint32 num_names,
368 [in,size_is(1000),length_is(num_names)] lsa_String names[],
374 /************************/
376 NTSTATUS samr_LookupRids(
377 [in,ref] policy_handle *domain_handle,
378 [in,range(0,1000)] uint32 num_rids,
379 [in,size_is(1000),length_is(num_rids)] uint32 rids[],
380 [out] lsa_Strings names,
384 /************************/
386 NTSTATUS samr_OpenGroup(
387 [in,ref] policy_handle *domain_handle,
388 [in] samr_GroupAccessMask access_mask,
390 [out,ref] policy_handle *group_handle
393 /* Group attributes */
394 typedef [public,bitmap32bit] bitmap {
395 SE_GROUP_MANDATORY = 0x00000001,
396 SE_GROUP_ENABLED_BY_DEFAULT = 0x00000002,
397 SE_GROUP_ENABLED = 0x00000004,
398 SE_GROUP_OWNER = 0x00000008,
399 SE_GROUP_USE_FOR_DENY_ONLY = 0x00000010,
400 SE_GROUP_RESOURCE = 0x20000000,
401 SE_GROUP_LOGON_ID = 0xC0000000
404 /************************/
409 samr_GroupAttrs attributes;
411 lsa_String description;
415 samr_GroupAttrs attributes;
416 } samr_GroupInfoAttributes;
419 lsa_String description;
420 } samr_GroupInfoDescription;
425 GROUPINFOATTRIBUTES = 3,
426 GROUPINFODESCRIPTION = 4,
428 } samr_GroupInfoEnum;
430 typedef [switch_type(samr_GroupInfoEnum)] union {
431 [case(GROUPINFOALL)] samr_GroupInfoAll all;
432 [case(GROUPINFONAME)] lsa_String name;
433 [case(GROUPINFOATTRIBUTES)] samr_GroupInfoAttributes attributes;
434 [case(GROUPINFODESCRIPTION)] lsa_String description;
435 [case(GROUPINFOALL2)] samr_GroupInfoAll all2;
438 NTSTATUS samr_QueryGroupInfo(
439 [in,ref] policy_handle *group_handle,
440 [in] samr_GroupInfoEnum level,
441 [out,switch_is(level)] samr_GroupInfo *info
444 /************************/
446 NTSTATUS samr_SetGroupInfo(
447 [in,ref] policy_handle *group_handle,
448 [in] samr_GroupInfoEnum level,
449 [in,switch_is(level),ref] samr_GroupInfo *info
452 /************************/
454 NTSTATUS samr_AddGroupMember(
455 [in,ref] policy_handle *group_handle,
460 /************************/
462 NTSTATUS samr_DeleteDomainGroup(
463 [in,out,ref] policy_handle *group_handle
466 /************************/
468 NTSTATUS samr_DeleteGroupMember(
469 [in,ref] policy_handle *group_handle,
474 /************************/
478 [size_is(count)] uint32 *rids;
479 [size_is(count)] uint32 *types;
482 NTSTATUS samr_QueryGroupMember(
483 [in,ref] policy_handle *group_handle,
484 [out] samr_RidTypeArray *rids
488 /************************/
492 win2003 seems to accept any data at all for the two integers
493 below, and doesn't seem to do anything with them that I can
494 see. Weird. I really expected the first integer to be a rid
495 and the second to be the attributes for that rid member.
497 NTSTATUS samr_SetMemberAttributesOfGroup(
498 [in,ref] policy_handle *group_handle,
499 [in] uint32 unknown1,
504 /************************/
506 NTSTATUS samr_OpenAlias (
507 [in,ref] policy_handle *domain_handle,
508 [in] samr_AliasAccessMask access_mask,
510 [out,ref] policy_handle *alias_handle
514 /************************/
520 lsa_String description;
526 ALIASINFODESCRIPTION = 3
527 } samr_AliasInfoEnum;
529 typedef [switch_type(samr_AliasInfoEnum)] union {
530 [case(ALIASINFOALL)] samr_AliasInfoAll all;
531 [case(ALIASINFONAME)] lsa_String name;
532 [case(ALIASINFODESCRIPTION)] lsa_String description;
535 NTSTATUS samr_QueryAliasInfo(
536 [in,ref] policy_handle *alias_handle,
537 [in] samr_AliasInfoEnum level,
538 [out,switch_is(level)] samr_AliasInfo *info
541 /************************/
543 NTSTATUS samr_SetAliasInfo(
544 [in,ref] policy_handle *alias_handle,
545 [in] samr_AliasInfoEnum level,
546 [in,switch_is(level),ref] samr_AliasInfo *info
549 /************************/
551 NTSTATUS samr_DeleteDomAlias(
552 [in,out,ref] policy_handle *alias_handle
555 /************************/
557 NTSTATUS samr_AddAliasMember(
558 [in,ref] policy_handle *alias_handle,
559 [in,ref] dom_sid2 *sid
562 /************************/
564 NTSTATUS samr_DeleteAliasMember(
565 [in,ref] policy_handle *alias_handle,
566 [in,ref] dom_sid2 *sid
569 /************************/
571 NTSTATUS samr_GetMembersInAlias(
572 [in,ref] policy_handle *alias_handle,
573 [out,ref] lsa_SidArray *sids
576 /************************/
578 [public] NTSTATUS samr_OpenUser(
579 [in,ref] policy_handle *domain_handle,
580 [in] uint32 access_mask,
582 [out,ref] policy_handle *user_handle
585 /************************/
587 NTSTATUS samr_DeleteUser(
588 [in,out,ref] policy_handle *user_handle
591 /************************/
594 lsa_String account_name;
595 lsa_String full_name;
597 lsa_String description;
603 lsa_String unknown; /* settable, but doesn't stick. probably obsolete */
608 /* this is also used in samr and netlogon */
609 typedef [public, flag(NDR_PAHEX)] struct {
610 uint16 units_per_week;
611 [size_is(1260), length_is(units_per_week/8)] uint8 *bits;
615 lsa_String account_name;
616 lsa_String full_name;
619 lsa_String home_directory;
620 lsa_String home_drive;
621 lsa_String logon_script;
622 lsa_String profile_path;
623 lsa_String workstations;
626 NTTIME last_password_change;
627 NTTIME allow_password_change;
628 NTTIME force_password_change;
629 samr_LogonHours logon_hours;
630 uint16 bad_password_count;
632 samr_AcctFlags acct_flags;
636 samr_LogonHours logon_hours;
640 lsa_String account_name;
641 lsa_String full_name;
644 lsa_String home_directory;
645 lsa_String home_drive;
646 lsa_String logon_script;
647 lsa_String profile_path;
648 lsa_String description;
649 lsa_String workstations;
652 samr_LogonHours logon_hours;
653 uint16 bad_password_count;
655 NTTIME last_password_change;
657 samr_AcctFlags acct_flags;
661 lsa_String account_name;
662 lsa_String full_name;
666 lsa_String account_name;
670 lsa_String full_name;
678 lsa_String home_directory;
679 lsa_String home_drive;
683 lsa_String logon_script;
687 lsa_String profile_path;
691 lsa_String description;
695 lsa_String workstations;
699 samr_AcctFlags acct_flags;
707 lsa_String parameters;
710 /* this defines the bits used for fields_present in info21 */
711 typedef [bitmap32bit] bitmap {
712 SAMR_FIELD_ACCOUNT_NAME = 0x00000001,
713 SAMR_FIELD_FULL_NAME = 0x00000002,
714 SAMR_FIELD_RID = 0x00000004,
715 SAMR_FIELD_PRIMARY_GID = 0x00000008,
716 SAMR_FIELD_DESCRIPTION = 0x00000010,
717 SAMR_FIELD_COMMENT = 0x00000020,
718 SAMR_FIELD_HOME_DIRECTORY = 0x00000040,
719 SAMR_FIELD_HOME_DRIVE = 0x00000080,
720 SAMR_FIELD_LOGON_SCRIPT = 0x00000100,
721 SAMR_FIELD_PROFILE_PATH = 0x00000200,
722 SAMR_FIELD_WORKSTATIONS = 0x00000400,
723 SAMR_FIELD_LAST_LOGON = 0x00000800,
724 SAMR_FIELD_LAST_LOGOFF = 0x00001000,
725 SAMR_FIELD_LOGON_HOURS = 0x00002000,
726 SAMR_FIELD_BAD_PWD_COUNT = 0x00004000,
727 SAMR_FIELD_NUM_LOGONS = 0x00008000,
728 SAMR_FIELD_ALLOW_PWD_CHANGE = 0x00010000,
729 SAMR_FIELD_FORCE_PWD_CHANGE = 0x00020000,
730 SAMR_FIELD_LAST_PWD_CHANGE = 0x00040000,
731 SAMR_FIELD_ACCT_EXPIRY = 0x00080000,
732 SAMR_FIELD_ACCT_FLAGS = 0x00100000,
733 SAMR_FIELD_PARAMETERS = 0x00200000,
734 SAMR_FIELD_COUNTRY_CODE = 0x00400000,
735 SAMR_FIELD_CODE_PAGE = 0x00800000,
736 SAMR_FIELD_PASSWORD = 0x01000000, /* either of these */
737 SAMR_FIELD_PASSWORD2 = 0x02000000, /* two bits seems to work */
738 SAMR_FIELD_PRIVATE_DATA = 0x04000000,
739 SAMR_FIELD_EXPIRED_FLAG = 0x08000000,
740 SAMR_FIELD_SEC_DESC = 0x10000000,
741 SAMR_FIELD_OWF_PWD = 0x20000000
742 } samr_FieldsPresent;
747 NTTIME last_password_change;
749 NTTIME allow_password_change;
750 NTTIME force_password_change;
751 lsa_String account_name;
752 lsa_String full_name;
753 lsa_String home_directory;
754 lsa_String home_drive;
755 lsa_String logon_script;
756 lsa_String profile_path;
757 lsa_String description;
758 lsa_String workstations;
760 lsa_String parameters;
765 [size_is(buf_count)] uint8 *buffer;
768 samr_AcctFlags acct_flags;
769 samr_FieldsPresent fields_present;
770 samr_LogonHours logon_hours;
771 uint16 bad_password_count;
775 uint8 nt_password_set;
776 uint8 lm_password_set;
777 uint8 password_expired;
781 typedef [public, flag(NDR_PAHEX)] struct {
783 } samr_CryptPassword;
786 samr_UserInfo21 info;
787 samr_CryptPassword password;
791 samr_CryptPassword password;
795 typedef [flag(NDR_PAHEX)] struct {
797 } samr_CryptPasswordEx;
800 samr_UserInfo21 info;
801 samr_CryptPasswordEx password;
805 samr_CryptPasswordEx password;
809 typedef [switch_type(uint16)] union {
810 [case(1)] samr_UserInfo1 info1;
811 [case(2)] samr_UserInfo2 info2;
812 [case(3)] samr_UserInfo3 info3;
813 [case(4)] samr_UserInfo4 info4;
814 [case(5)] samr_UserInfo5 info5;
815 [case(6)] samr_UserInfo6 info6;
816 [case(7)] samr_UserInfo7 info7;
817 [case(8)] samr_UserInfo8 info8;
818 [case(9)] samr_UserInfo9 info9;
819 [case(10)] samr_UserInfo10 info10;
820 [case(11)] samr_UserInfo11 info11;
821 [case(12)] samr_UserInfo12 info12;
822 [case(13)] samr_UserInfo13 info13;
823 [case(14)] samr_UserInfo14 info14;
824 [case(16)] samr_UserInfo16 info16;
825 [case(17)] samr_UserInfo17 info17;
826 [case(20)] samr_UserInfo20 info20;
827 [case(21)] samr_UserInfo21 info21;
828 [case(23)] samr_UserInfo23 info23;
829 [case(24)] samr_UserInfo24 info24;
830 [case(25)] samr_UserInfo25 info25;
831 [case(26)] samr_UserInfo26 info26;
834 [public] NTSTATUS samr_QueryUserInfo(
835 [in,ref] policy_handle *user_handle,
837 [out,switch_is(level)] samr_UserInfo *info
841 /************************/
843 [public] NTSTATUS samr_SetUserInfo(
844 [in,ref] policy_handle *user_handle,
846 [in,ref,switch_is(level)] samr_UserInfo *info
849 /************************/
851 typedef [public, flag(NDR_PAHEX)] struct {
856 this is a password change interface that doesn't give
857 the server the plaintext password. Depricated.
859 NTSTATUS samr_ChangePasswordUser(
860 [in,ref] policy_handle *user_handle,
861 [in] boolean8 lm_present,
862 [in] samr_Password *old_lm_crypted,
863 [in] samr_Password *new_lm_crypted,
864 [in] boolean8 nt_present,
865 [in] samr_Password *old_nt_crypted,
866 [in] samr_Password *new_nt_crypted,
867 [in] boolean8 cross1_present,
868 [in] samr_Password *nt_cross,
869 [in] boolean8 cross2_present,
870 [in] samr_Password *lm_cross
873 /************************/
876 typedef [public] struct {
878 samr_GroupAttrs attributes;
879 } samr_RidWithAttribute;
881 typedef [public] struct {
883 [size_is(count)] samr_RidWithAttribute *rids;
884 } samr_RidWithAttributeArray;
886 NTSTATUS samr_GetGroupsForUser(
887 [in,ref] policy_handle *user_handle,
888 [out] samr_RidWithAttributeArray *rids
891 /************************/
897 samr_AcctFlags acct_flags;
898 lsa_String account_name;
899 lsa_String description;
900 lsa_String full_name;
901 } samr_DispEntryGeneral;
905 [size_is(count)] samr_DispEntryGeneral *entries;
906 } samr_DispInfoGeneral;
911 samr_AcctFlags acct_flags;
912 lsa_String account_name;
913 lsa_String description;
914 } samr_DispEntryFull;
918 [size_is(count)] samr_DispEntryFull *entries;
924 samr_GroupAttrs acct_flags;
925 lsa_String account_name;
926 lsa_String description;
927 } samr_DispEntryFullGroup;
931 [size_is(count)] samr_DispEntryFullGroup *entries;
932 } samr_DispInfoFullGroups;
936 lsa_AsciiString account_name;
937 } samr_DispEntryAscii;
941 [size_is(count)] samr_DispEntryAscii *entries;
942 } samr_DispInfoAscii;
944 typedef [switch_type(uint16)] union {
945 [case(1)] samr_DispInfoGeneral info1;/* users */
946 [case(2)] samr_DispInfoFull info2; /* trust accounts? */
947 [case(3)] samr_DispInfoFullGroups info3; /* groups */
948 [case(4)] samr_DispInfoAscii info4; /* users */
949 [case(5)] samr_DispInfoAscii info5; /* groups */
952 NTSTATUS samr_QueryDisplayInfo(
953 [in,ref] policy_handle *domain_handle,
955 [in] uint32 start_idx,
956 [in] uint32 max_entries,
957 [in] uint32 buf_size,
958 [out] uint32 total_size,
959 [out] uint32 returned_size,
960 [out,switch_is(level)] samr_DispInfo info
964 /************************/
968 this seems to be an alphabetic search function. The returned index
969 is the index for samr_QueryDisplayInfo needed to get names occurring
970 after the specified name. The supplied name does not need to exist
971 in the database (for example you can supply just a first letter for
972 searching starting at that letter)
974 The level corresponds to the samr_QueryDisplayInfo level
976 NTSTATUS samr_GetDisplayEnumerationIndex(
977 [in,ref] policy_handle *domain_handle,
979 [in] lsa_String name,
985 /************************/
989 w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this
991 NTSTATUS samr_TestPrivateFunctionsDomain(
992 [in,ref] policy_handle *domain_handle
996 /************************/
1000 w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this
1002 NTSTATUS samr_TestPrivateFunctionsUser(
1003 [in,ref] policy_handle *user_handle
1007 /************************/
1011 uint16 min_password_length;
1012 samr_PasswordProperties password_properties;
1015 [public] NTSTATUS samr_GetUserPwInfo(
1016 [in,ref] policy_handle *user_handle,
1017 [out] samr_PwInfo info
1020 /************************/
1022 NTSTATUS samr_RemoveMemberFromForeignDomain(
1023 [in,ref] policy_handle *domain_handle,
1024 [in,ref] dom_sid2 *sid
1027 /************************/
1031 how is this different from QueryDomainInfo ??
1033 NTSTATUS samr_QueryDomainInfo2(
1034 [in,ref] policy_handle *domain_handle,
1036 [out,switch_is(level)] samr_DomainInfo *info
1039 /************************/
1043 how is this different from QueryUserInfo ??
1045 NTSTATUS samr_QueryUserInfo2(
1046 [in,ref] policy_handle *user_handle,
1048 [out,switch_is(level)] samr_UserInfo *info
1051 /************************/
1055 how is this different from QueryDisplayInfo??
1057 NTSTATUS samr_QueryDisplayInfo2(
1058 [in,ref] policy_handle *domain_handle,
1060 [in] uint32 start_idx,
1061 [in] uint32 max_entries,
1062 [in] uint32 buf_size,
1063 [out] uint32 total_size,
1064 [out] uint32 returned_size,
1065 [out,switch_is(level)] samr_DispInfo info
1068 /************************/
1072 how is this different from GetDisplayEnumerationIndex ??
1074 NTSTATUS samr_GetDisplayEnumerationIndex2(
1075 [in,ref] policy_handle *domain_handle,
1077 [in] lsa_String name,
1082 /************************/
1084 NTSTATUS samr_CreateUser2(
1085 [in,ref] policy_handle *domain_handle,
1086 [in,ref] lsa_String *account_name,
1087 [in] samr_AcctFlags acct_flags,
1088 [in] uint32 access_mask,
1089 [out,ref] policy_handle *user_handle,
1090 [out,ref] uint32 *access_granted,
1091 [out,ref] uint32 *rid
1095 /************************/
1099 another duplicate. There must be a reason ....
1101 NTSTATUS samr_QueryDisplayInfo3(
1102 [in,ref] policy_handle *domain_handle,
1104 [in] uint32 start_idx,
1105 [in] uint32 max_entries,
1106 [in] uint32 buf_size,
1107 [out] uint32 total_size,
1108 [out] uint32 returned_size,
1109 [out,switch_is(level)] samr_DispInfo info
1112 /************************/
1114 NTSTATUS samr_AddMultipleMembersToAlias(
1115 [in,ref] policy_handle *alias_handle,
1116 [in,ref] lsa_SidArray *sids
1119 /************************/
1121 NTSTATUS samr_RemoveMultipleMembersFromAlias(
1122 [in,ref] policy_handle *alias_handle,
1123 [in,ref] lsa_SidArray *sids
1126 /************************/
1129 NTSTATUS samr_OemChangePasswordUser2(
1130 [in] lsa_AsciiString *server,
1131 [in,ref] lsa_AsciiString *account,
1132 [in] samr_CryptPassword *password,
1133 [in] samr_Password *hash
1136 /************************/
1138 NTSTATUS samr_ChangePasswordUser2(
1139 [in] lsa_String *server,
1140 [in,ref] lsa_String *account,
1141 [in] samr_CryptPassword *nt_password,
1142 [in] samr_Password *nt_verifier,
1143 [in] boolean8 lm_change,
1144 [in] samr_CryptPassword *lm_password,
1145 [in] samr_Password *lm_verifier
1148 /************************/
1150 NTSTATUS samr_GetDomPwInfo(
1151 [in] lsa_String *domain_name,
1152 [out] samr_PwInfo info
1155 /************************/
1157 NTSTATUS samr_Connect2(
1158 [in,string,charset(UTF16)] uint16 *system_name,
1159 [in] samr_ConnectAccessMask access_mask,
1160 [out,ref] policy_handle *connect_handle
1163 /************************/
1166 seems to be an exact alias for samr_SetUserInfo()
1168 [public] NTSTATUS samr_SetUserInfo2(
1169 [in,ref] policy_handle *user_handle,
1171 [in,ref,switch_is(level)] samr_UserInfo *info
1174 /************************/
1177 this one is mysterious. I have a few guesses, but nothing working yet
1179 NTSTATUS samr_SetBootKeyInformation(
1180 [in,ref] policy_handle *connect_handle,
1181 [in] uint32 unknown1,
1182 [in] uint32 unknown2,
1183 [in] uint32 unknown3
1186 /************************/
1188 NTSTATUS samr_GetBootKeyInformation(
1189 [in,ref] policy_handle *domain_handle,
1190 [out] uint32 unknown
1193 /************************/
1195 NTSTATUS samr_Connect3(
1196 [in,string,charset(UTF16)] uint16 *system_name,
1197 /* this unknown value seems to be completely ignored by w2k3 */
1198 [in] uint32 unknown,
1199 [in] samr_ConnectAccessMask access_mask,
1200 [out,ref] policy_handle *connect_handle
1203 /************************/
1205 NTSTATUS samr_Connect4(
1206 [in,string,charset(UTF16)] uint16 *system_name,
1207 [in] uint32 unknown,
1208 [in] samr_ConnectAccessMask access_mask,
1209 [out,ref] policy_handle *connect_handle
1212 /************************/
1215 declare enum samr_RejectReason;
1218 samr_RejectReason reason;
1221 } samr_ChangeReject;
1223 NTSTATUS samr_ChangePasswordUser3(
1224 [in] lsa_String *server,
1225 [in,ref] lsa_String *account,
1226 [in] samr_CryptPassword *nt_password,
1227 [in] samr_Password *nt_verifier,
1228 [in] boolean8 lm_change,
1229 [in] samr_CryptPassword *lm_password,
1230 [in] samr_Password *lm_verifier,
1231 [in] samr_CryptPassword *password3,
1232 [out] samr_DomInfo1 *dominfo,
1233 [out] samr_ChangeReject *reject
1236 /************************/
1240 uint32 unknown1; /* w2k3 gives 3 */
1241 uint32 unknown2; /* w2k3 gives 0 */
1242 } samr_ConnectInfo1;
1245 [case(1)] samr_ConnectInfo1 info1;
1248 [public] NTSTATUS samr_Connect5(
1249 [in,string,charset(UTF16)] uint16 *system_name,
1250 [in] samr_ConnectAccessMask access_mask,
1251 [in,out] uint32 level,
1252 [in,out,switch_is(level),ref] samr_ConnectInfo *info,
1253 [out,ref] policy_handle *connect_handle
1256 /************************/
1258 NTSTATUS samr_RidToSid(
1259 [in,ref] policy_handle *domain_handle,
1265 /************************/
1269 this should set the DSRM password for the server, which is used
1270 when booting into Directory Services Recovery Mode on a DC. Win2003
1271 gives me NT_STATUS_NOT_SUPPORTED
1274 NTSTATUS samr_SetDsrmPassword(
1275 [in] lsa_String *name,
1276 [in] uint32 unknown,
1277 [in] samr_Password *hash
1281 /************************/
1284 I haven't been able to work out the format of this one yet.
1285 Seems to start with a switch level for a union?
1287 NTSTATUS samr_ValidatePassword();