📄 samr.idl
字号:
/************************/ /* Function 0x15 */ NTSTATUS samr_SetGroupInfo( [in,ref] policy_handle *group_handle, [in] samr_GroupInfoEnum level, [in,switch_is(level),ref] samr_GroupInfo *info ); /************************/ /* Function 0x16 */ NTSTATUS samr_AddGroupMember( [in,ref] policy_handle *group_handle, [in] uint32 rid, [in] uint32 flags ); /************************/ /* Function 0x17 */ NTSTATUS samr_DeleteDomainGroup( [in,out,ref] policy_handle *group_handle ); /************************/ /* Function 0x18 */ NTSTATUS samr_DeleteGroupMember( [in,ref] policy_handle *group_handle, [in] uint32 rid ); /************************/ /* Function 0x19 */ typedef struct { uint32 count; [size_is(count)] uint32 *rids; [size_is(count)] uint32 *types; } samr_RidTypeArray; NTSTATUS samr_QueryGroupMember( [in,ref] policy_handle *group_handle, [out,unique] samr_RidTypeArray *rids ); /************************/ /* Function 0x1a */ /* win2003 seems to accept any data at all for the two integers below, and doesn't seem to do anything with them that I can see. Weird. I really expected the first integer to be a rid and the second to be the attributes for that rid member. */ NTSTATUS samr_SetMemberAttributesOfGroup( [in,ref] policy_handle *group_handle, [in] uint32 unknown1, [in] uint32 unknown2 ); /************************/ /* Function 0x1b */ NTSTATUS samr_OpenAlias ( [in,ref] policy_handle *domain_handle, [in] samr_AliasAccessMask access_mask, [in] uint32 rid, [out,ref] policy_handle *alias_handle ); /************************/ /* Function 0x1c */ typedef struct { lsa_String name; uint32 num_members; lsa_String description; } samr_AliasInfoAll; typedef enum { ALIASINFOALL = 1, ALIASINFONAME = 2, ALIASINFODESCRIPTION = 3 } samr_AliasInfoEnum; typedef [switch_type(samr_AliasInfoEnum)] union { [case(ALIASINFOALL)] samr_AliasInfoAll all; [case(ALIASINFONAME)] lsa_String name; [case(ALIASINFODESCRIPTION)] lsa_String description; } samr_AliasInfo; NTSTATUS samr_QueryAliasInfo( [in,ref] policy_handle *alias_handle, [in] samr_AliasInfoEnum level, [out,switch_is(level),unique] samr_AliasInfo *info ); /************************/ /* Function 0x1d */ NTSTATUS samr_SetAliasInfo( [in,ref] policy_handle *alias_handle, [in] samr_AliasInfoEnum level, [in,switch_is(level),ref] samr_AliasInfo *info ); /************************/ /* Function 0x1e */ NTSTATUS samr_DeleteDomAlias( [in,out,ref] policy_handle *alias_handle ); /************************/ /* Function 0x1f */ NTSTATUS samr_AddAliasMember( [in,ref] policy_handle *alias_handle, [in,ref] dom_sid2 *sid ); /************************/ /* Function 0x20 */ NTSTATUS samr_DeleteAliasMember( [in,ref] policy_handle *alias_handle, [in,ref] dom_sid2 *sid ); /************************/ /* Function 0x21 */ NTSTATUS samr_GetMembersInAlias( [in,ref] policy_handle *alias_handle, [out,ref] lsa_SidArray *sids ); /************************/ /* Function 0x22 */ [public] NTSTATUS samr_OpenUser( [in,ref] policy_handle *domain_handle, [in] samr_UserAccessMask access_mask, [in] uint32 rid, [out,ref] policy_handle *user_handle ); /************************/ /* Function 0x23 */ NTSTATUS samr_DeleteUser( [in,out,ref] policy_handle *user_handle ); /************************/ /* Function 0x24 */ typedef struct { lsa_String account_name; lsa_String full_name; uint32 primary_gid; lsa_String description; lsa_String comment; } samr_UserInfo1; typedef struct { lsa_String comment; lsa_String unknown; /* settable, but doesn't stick. probably obsolete */ uint16 country_code; uint16 code_page; } samr_UserInfo2; /* this is also used in samr and netlogon */ typedef [public, flag(NDR_PAHEX)] struct { uint16 units_per_week; [size_is(1260), length_is(units_per_week/8)] uint8 *bits; } samr_LogonHours; typedef struct { lsa_String account_name; lsa_String full_name; uint32 rid; uint32 primary_gid; lsa_String home_directory; lsa_String home_drive; lsa_String logon_script; lsa_String profile_path; lsa_String workstations; NTTIME last_logon; NTTIME last_logoff; NTTIME last_password_change; NTTIME allow_password_change; NTTIME force_password_change; samr_LogonHours logon_hours; uint16 bad_password_count; uint16 logon_count; samr_AcctFlags acct_flags; } samr_UserInfo3; typedef struct { samr_LogonHours logon_hours; } samr_UserInfo4; typedef struct { lsa_String account_name; lsa_String full_name; uint32 rid; uint32 primary_gid; lsa_String home_directory; lsa_String home_drive; lsa_String logon_script; lsa_String profile_path; lsa_String description; lsa_String workstations; NTTIME last_logon; NTTIME last_logoff; samr_LogonHours logon_hours; uint16 bad_password_count; uint16 logon_count; NTTIME last_password_change; NTTIME acct_expiry; samr_AcctFlags acct_flags; } samr_UserInfo5; typedef struct { lsa_String account_name; lsa_String full_name; } samr_UserInfo6; typedef struct { lsa_String account_name; } samr_UserInfo7; typedef struct { lsa_String full_name; } samr_UserInfo8; typedef struct { uint32 primary_gid; } samr_UserInfo9; typedef struct { lsa_String home_directory; lsa_String home_drive; } samr_UserInfo10; typedef struct { lsa_String logon_script; } samr_UserInfo11; typedef struct { lsa_String profile_path; } samr_UserInfo12; typedef struct { lsa_String description; } samr_UserInfo13; typedef struct { lsa_String workstations; } samr_UserInfo14; typedef struct { samr_AcctFlags acct_flags; } samr_UserInfo16; typedef struct { NTTIME acct_expiry; } samr_UserInfo17; typedef struct { lsa_String parameters; } samr_UserInfo20; /* this defines the bits used for fields_present in info21 */ typedef [bitmap32bit] bitmap { SAMR_FIELD_ACCOUNT_NAME = 0x00000001, SAMR_FIELD_FULL_NAME = 0x00000002, SAMR_FIELD_RID = 0x00000004, SAMR_FIELD_PRIMARY_GID = 0x00000008, SAMR_FIELD_DESCRIPTION = 0x00000010, SAMR_FIELD_COMMENT = 0x00000020, SAMR_FIELD_HOME_DIRECTORY = 0x00000040, SAMR_FIELD_HOME_DRIVE = 0x00000080, SAMR_FIELD_LOGON_SCRIPT = 0x00000100, SAMR_FIELD_PROFILE_PATH = 0x00000200, SAMR_FIELD_WORKSTATIONS = 0x00000400, SAMR_FIELD_LAST_LOGON = 0x00000800, SAMR_FIELD_LAST_LOGOFF = 0x00001000, SAMR_FIELD_LOGON_HOURS = 0x00002000, SAMR_FIELD_BAD_PWD_COUNT = 0x00004000, SAMR_FIELD_NUM_LOGONS = 0x00008000, SAMR_FIELD_ALLOW_PWD_CHANGE = 0x00010000, SAMR_FIELD_FORCE_PWD_CHANGE = 0x00020000, SAMR_FIELD_LAST_PWD_CHANGE = 0x00040000, SAMR_FIELD_ACCT_EXPIRY = 0x00080000, SAMR_FIELD_ACCT_FLAGS = 0x00100000, SAMR_FIELD_PARAMETERS = 0x00200000, SAMR_FIELD_COUNTRY_CODE = 0x00400000, SAMR_FIELD_CODE_PAGE = 0x00800000, SAMR_FIELD_PASSWORD = 0x01000000, /* either of these */ SAMR_FIELD_PASSWORD2 = 0x02000000, /* two bits seems to work */ SAMR_FIELD_PRIVATE_DATA = 0x04000000, SAMR_FIELD_EXPIRED_FLAG = 0x08000000, SAMR_FIELD_SEC_DESC = 0x10000000, SAMR_FIELD_OWF_PWD = 0x20000000 } samr_FieldsPresent; typedef struct { NTTIME last_logon; NTTIME last_logoff; NTTIME last_password_change; NTTIME acct_expiry; NTTIME allow_password_change; NTTIME force_password_change; lsa_String account_name; lsa_String full_name; lsa_String home_directory; lsa_String home_drive; lsa_String logon_script; lsa_String profile_path; lsa_String description; lsa_String workstations; lsa_String comment; lsa_String parameters; lsa_String unknown1; lsa_String unknown2; lsa_String unknown3; uint32 buf_count; [size_is(buf_count)] uint8 *buffer; uint32 rid; uint32 primary_gid; samr_AcctFlags acct_flags; samr_FieldsPresent fields_present; samr_LogonHours logon_hours; uint16 bad_password_count; uint16 logon_count; uint16 country_code; uint16 code_page; uint8 nt_password_set; uint8 lm_password_set; uint8 password_expired; uint8 unknown4; } samr_UserInfo21; typedef [public, flag(NDR_PAHEX)] struct { uint8 data[516]; } samr_CryptPassword; typedef struct { samr_UserInfo21 info; samr_CryptPassword password; } samr_UserInfo23; typedef struct { samr_CryptPassword password; uint8 pw_len; } samr_UserInfo24; typedef [flag(NDR_PAHEX)] struct { uint8 data[532]; } samr_CryptPasswordEx; typedef struct { samr_UserInfo21 info; samr_CryptPasswordEx password; } samr_UserInfo25; typedef struct { samr_CryptPasswordEx password; uint8 pw_len; } samr_UserInfo26; typedef [switch_type(uint16)] union { [case(1)] samr_UserInfo1 info1; [case(2)] samr_UserInfo2 info2; [case(3)] samr_UserInfo3 info3; [case(4)] samr_UserInfo4 info4; [case(5)] samr_UserInfo5 info5; [case(6)] samr_UserInfo6 info6; [case(7)] samr_UserInfo7 info7; [case(8)] samr_UserInfo8 info8; [case(9)] samr_UserInfo9 info9; [case(10)] samr_UserInfo10 info10; [case(11)] samr_UserInfo11 info11; [case(12)] samr_UserInfo12 info12; [case(13)] samr_UserInfo13 info13; [case(14)] samr_UserInfo14 info14; [case(16)] samr_UserInfo16 info16; [case(17)] samr_UserInfo17 info17; [case(20)] samr_UserInfo20 info20; [case(21)] samr_UserInfo21 info21; [case(23)] samr_UserInfo23 info23; [case(24)] samr_UserInfo24 info24; [case(25)] samr_UserInfo25 info25; [case(26)] samr_UserInfo26 info26; } samr_UserInfo; [public] NTSTATUS samr_QueryUserInfo( [in,ref] policy_handle *user_handle, [in] uint16 level, [out,unique,switch_is(level)] samr_UserInfo *info ); /************************/ /* Function 0x25 */ [public] NTSTATUS samr_SetUserInfo( [in,ref] policy_handle *user_handle, [in] uint16 level, [in,ref,switch_is(level)] samr_UserInfo *info ); /************************/ /* Function 0x26 */ typedef [public, flag(NDR_PAHEX)] struct { uint8 hash[16]; } samr_Password; /* this is a password change interface that doesn't give the server the plaintext password. Depricated. */ NTSTATUS samr_ChangePasswordUser( [in,ref] policy_handle *user_handle, [in] boolean8 lm_present, [in,unique] samr_Password *old_lm_crypted, [in,unique] samr_Password *new_lm_crypted, [in] boolean8 nt_present, [in,unique] samr_Password *old_nt_crypted, [in,unique] samr_Password *new_nt_crypted, [in] boolean8 cross1_present, [in,unique] samr_Password *nt_cross, [in] boolean8 cross2_present, [in,unique] samr_Password *lm_cross ); /************************/ /* Function 0x27 */ typedef [public] struct { uint32 rid; samr_GroupAttrs attributes; } samr_RidWithAttribute; typedef [public] struct { uint32 count; [size_is(count)] samr_RidWithAttribute *rids; } samr_RidWithAttributeArray; NTSTATUS samr_GetGroupsForUser( [in,ref] policy_handle *user_handle, [out,unique] samr_RidWithAttributeArray *rids ); /************************/ /* Function 0x28 */ typedef struct { uint32 idx; uint32 rid; samr_AcctFlags acct_flags; lsa_String account_name; lsa_String description; lsa_String full_name; } samr_DispEntryGeneral; typedef struct { uint32 count; [size_is(count)] samr_DispEntryGeneral *entries; } samr_DispInfoGeneral; typedef struct { uint32 idx; uint32 rid; samr_AcctFlags acct_flags;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -