#ifndef _RPC_SAMR_H
#define _RPC_SAMR_H
#include "rpc_misc.h"
#define SAMR_CONNECT_ANON 0x00
#define SAMR_CLOSE_HND 0x01
#define SAMR_SET_SEC_OBJECT 0x02
#define SAMR_QUERY_SEC_OBJECT 0x03
#define SAMR_UNKNOWN_4 0x04
#define SAMR_LOOKUP_DOMAIN 0x05
#define SAMR_ENUM_DOMAINS 0x06
#define SAMR_OPEN_DOMAIN 0x07
#define SAMR_QUERY_DOMAIN_INFO 0x08
#define SAMR_SET_DOMAIN_INFO 0x09
#define SAMR_CREATE_DOM_GROUP 0x0a
#define SAMR_ENUM_DOM_GROUPS 0x0b
#define SAMR_ENUM_DOM_USERS 0x0d
#define SAMR_CREATE_DOM_ALIAS 0x0e
#define SAMR_ENUM_DOM_ALIASES 0x0f
#define SAMR_QUERY_USERALIASES 0x10
#define SAMR_LOOKUP_NAMES 0x11
#define SAMR_LOOKUP_RIDS 0x12
#define SAMR_OPEN_GROUP 0x13
#define SAMR_QUERY_GROUPINFO 0x14
#define SAMR_SET_GROUPINFO 0x15
#define SAMR_ADD_GROUPMEM 0x16
#define SAMR_DELETE_DOM_GROUP 0x17
#define SAMR_DEL_GROUPMEM 0x18
#define SAMR_QUERY_GROUPMEM 0x19
#define SAMR_UNKNOWN_1A 0x1a
#define SAMR_OPEN_ALIAS 0x1b
#define SAMR_QUERY_ALIASINFO 0x1c
#define SAMR_SET_ALIASINFO 0x1d
#define SAMR_DELETE_DOM_ALIAS 0x1e
#define SAMR_ADD_ALIASMEM 0x1f
#define SAMR_DEL_ALIASMEM 0x20
#define SAMR_QUERY_ALIASMEM 0x21
#define SAMR_OPEN_USER 0x22
#define SAMR_DELETE_DOM_USER 0x23
#define SAMR_QUERY_USERINFO 0x24
#define SAMR_SET_USERINFO2 0x25
#define SAMR_QUERY_USERGROUPS 0x27
#define SAMR_QUERY_DISPINFO 0x28
#define SAMR_UNKNOWN_29 0x29
#define SAMR_UNKNOWN_2a 0x2a
#define SAMR_UNKNOWN_2b 0x2b
#define SAMR_GET_USRDOM_PWINFO 0x2c
#define SAMR_REMOVE_SID_FOREIGN_DOMAIN 0x2d
#define SAMR_UNKNOWN_2E 0x2e
#define SAMR_UNKNOWN_2f 0x2f
#define SAMR_QUERY_DISPINFO3 0x30
#define SAMR_UNKNOWN_31 0x31
#define SAMR_CREATE_USER 0x32
#define SAMR_QUERY_DISPINFO4 0x33
#define SAMR_ADDMULTI_ALIASMEM 0x34
#define SAMR_UNKNOWN_35 0x35
#define SAMR_UNKNOWN_36 0x36
#define SAMR_CHGPASSWD_USER 0x37
#define SAMR_GET_DOM_PWINFO 0x38
#define SAMR_CONNECT 0x39
#define SAMR_SET_USERINFO 0x3A
#define SAMR_CONNECT4 0x3E
typedef struct logon_hours_info
{
uint32 len;
uint8 hours[32];
} LOGON_HRS;
typedef struct sam_user_info_23
{
NTTIME logon_time;
NTTIME logoff_time;
NTTIME kickoff_time;
NTTIME pass_last_set_time;
NTTIME pass_can_change_time;
NTTIME pass_must_change_time;
UNIHDR hdr_user_name;
UNIHDR hdr_full_name;
UNIHDR hdr_home_dir;
UNIHDR hdr_dir_drive;
UNIHDR hdr_logon_script;
UNIHDR hdr_profile_path;
UNIHDR hdr_acct_desc ;
UNIHDR hdr_workstations;
UNIHDR hdr_unknown_str ;
UNIHDR hdr_munged_dial ;
uint8 lm_pwd[16];
uint8 nt_pwd[16];
uint32 user_rid;
uint32 group_rid;
uint32 acb_info;
uint32 fields_present;
uint16 logon_divs;
uint32 ptr_logon_hrs;
uint16 bad_password_count;
uint16 logon_count;
uint8 padding1[6];
uint8 passmustchange;
uint8 padding2;
uint8 pass[516];
UNISTR2 uni_user_name;
UNISTR2 uni_full_name;
UNISTR2 uni_home_dir;
UNISTR2 uni_dir_drive;
UNISTR2 uni_logon_script;
UNISTR2 uni_profile_path;
UNISTR2 uni_acct_desc ;
UNISTR2 uni_workstations;
UNISTR2 uni_unknown_str ;
UNISTR2 uni_munged_dial ;
uint32 unknown_6;
uint32 padding4;
LOGON_HRS logon_hrs;
} SAM_USER_INFO_23;
typedef struct sam_user_info_24
{
uint8 pass[516];
uint16 pw_len;
} SAM_USER_INFO_24;
typedef struct sam_user_info_25
{
NTTIME logon_time;
NTTIME logoff_time;
NTTIME kickoff_time;
NTTIME pass_last_set_time;
NTTIME pass_can_change_time;
NTTIME pass_must_change_time;
UNIHDR hdr_user_name;
UNIHDR hdr_full_name;
UNIHDR hdr_home_dir;
UNIHDR hdr_dir_drive;
UNIHDR hdr_logon_script;
UNIHDR hdr_profile_path;
UNIHDR hdr_acct_desc ;
UNIHDR hdr_workstations;
UNIHDR hdr_unknown_str ;
UNIHDR hdr_munged_dial ;
uint8 lm_pwd[16];
uint8 nt_pwd[16];
uint32 user_rid;
uint32 group_rid;
uint32 acb_info;
uint32 unknown_6[6];
uint8 pass[532];
UNISTR2 uni_user_name;
UNISTR2 uni_full_name;
UNISTR2 uni_home_dir;
UNISTR2 uni_dir_drive;
UNISTR2 uni_logon_script;
UNISTR2 uni_profile_path;
UNISTR2 uni_acct_desc ;
UNISTR2 uni_workstations;
UNISTR2 uni_unknown_str ;
UNISTR2 uni_munged_dial ;
} SAM_USER_INFO_25;
typedef struct sam_user_info_21
{
NTTIME logon_time;
NTTIME logoff_time;
NTTIME kickoff_time;
NTTIME pass_last_set_time;
NTTIME pass_can_change_time;
NTTIME pass_must_change_time;
UNIHDR hdr_user_name;
UNIHDR hdr_full_name;
UNIHDR hdr_home_dir;
UNIHDR hdr_dir_drive;
UNIHDR hdr_logon_script;
UNIHDR hdr_profile_path;
UNIHDR hdr_acct_desc ;
UNIHDR hdr_workstations;
UNIHDR hdr_unknown_str ;
UNIHDR hdr_munged_dial ;
uint8 lm_pwd[16];
uint8 nt_pwd[16];
uint32 user_rid;
uint32 group_rid;
uint32 acb_info;
uint32 fields_present;
uint16 logon_divs;
uint32 ptr_logon_hrs;
uint16 bad_password_count;
uint16 logon_count;
uint8 padding1[6];
uint8 passmustchange;
uint8 padding2;
UNISTR2 uni_user_name;
UNISTR2 uni_full_name;
UNISTR2 uni_home_dir;
UNISTR2 uni_dir_drive;
UNISTR2 uni_logon_script;
UNISTR2 uni_profile_path;
UNISTR2 uni_acct_desc ;
UNISTR2 uni_workstations;
UNISTR2 uni_unknown_str ;
UNISTR2 uni_munged_dial ;
uint32 unknown_6;
uint32 padding4;
LOGON_HRS logon_hrs;
} SAM_USER_INFO_21;
#define PASS_MUST_CHANGE_AT_NEXT_LOGON 0x01
#define PASS_DONT_CHANGE_AT_NEXT_LOGON 0x00
typedef struct sam_user_info_20
{
UNIHDR hdr_munged_dial ;
UNISTR2 uni_munged_dial ;
} SAM_USER_INFO_20;
typedef struct sam_user_info_12
{
uint8 lm_pwd[16];
uint8 nt_pwd[16];
uint8 lm_pwd_active;
uint8 nt_pwd_active;
} SAM_USER_INFO_12;
typedef struct sam_user_info_11
{
uint8 padding_0[16];
NTTIME expiry;
uint8 padding_1[24];
UNIHDR hdr_mach_acct;
uint32 padding_2;
uint32 ptr_1;
uint8 padding_3[32];
uint32 padding_4;
uint32 ptr_2;
uint32 padding_5;
uint32 ptr_3;
uint8 padding_6[32];
uint32 rid_user;
uint32 rid_group;
uint16 acct_ctrl;
uint16 unknown_3;
uint16 unknown_4;
uint16 unknown_5;
uint8 padding_7[16];
uint32 padding_8;
UNISTR2 uni_mach_acct;
uint8 padding_9[48];
} SAM_USER_INFO_11;
typedef struct sam_user_info_10
{
uint32 acb_info;
} SAM_USER_INFO_10;
typedef struct q_samr_close_hnd_info
{
POLICY_HND pol;
} SAMR_Q_CLOSE_HND;
typedef struct r_samr_close_hnd_info
{
POLICY_HND pol;
NTSTATUS status;
} SAMR_R_CLOSE_HND;
typedef struct q_samr_usrdom_pwinfo_info
{
POLICY_HND user_pol;
} SAMR_Q_GET_USRDOM_PWINFO;
typedef struct r_samr_usrdom_pwinfo_info
{
uint16 unknown_0;
uint16 unknown_1;
uint32 unknown_2;
NTSTATUS status;
} SAMR_R_GET_USRDOM_PWINFO;
typedef struct q_samr_set_sec_obj_info
{
POLICY_HND pol;
uint32 sec_info;
SEC_DESC_BUF *buf;
} SAMR_Q_SET_SEC_OBJ;
typedef struct r_samr_set_sec_obj_info
{
NTSTATUS status;
} SAMR_R_SET_SEC_OBJ;
typedef struct q_samr_query_sec_obj_info
{
POLICY_HND user_pol;
uint32 sec_info;
} SAMR_Q_QUERY_SEC_OBJ;
typedef struct r_samr_query_sec_obj_info
{
uint32 ptr;
SEC_DESC_BUF *buf;
NTSTATUS status;
} SAMR_R_QUERY_SEC_OBJ;
typedef struct q_samr_query_domain_info
{
POLICY_HND domain_pol;
uint16 switch_value;
} SAMR_Q_QUERY_DOMAIN_INFO;
typedef struct sam_unknown_info_3_info
{
NTTIME logout;
} SAM_UNK_INFO_3;
typedef struct sam_unknown_info_6_info
{
uint32 unknown_0;
uint32 ptr_0;
uint8 padding[12];
} SAM_UNK_INFO_6;
typedef struct sam_unknown_info_7_info
{
uint16 unknown_0;
} SAM_UNK_INFO_7;
typedef struct sam_unknown_info_12_inf
{
NTTIME duration;
NTTIME reset_count;
uint16 bad_attempt_lockout;
} SAM_UNK_INFO_12;
typedef struct sam_unknown_info_5_inf
{
UNIHDR hdr_server;
UNISTR2 uni_server;
} SAM_UNK_INFO_5;
typedef struct sam_unknown_info_2_inf
{
uint32 unknown_0;
uint32 unknown_1;
uint32 unknown_2;
uint32 ptr_0;
UNIHDR hdr_domain;
UNIHDR hdr_server;
uint32 seq_num;
uint32 unknown_3;
uint32 unknown_4;
uint32 unknown_5;
uint32 unknown_6;
uint32 num_domain_usrs;
uint32 num_domain_grps;
uint32 num_local_grps;
uint8 padding[12];
UNISTR2 uni_domain;
UNISTR2 uni_server;
} SAM_UNK_INFO_2;
typedef struct sam_unknown_info_1_inf
{
uint16 min_length_password;
uint16 password_history;
uint32 flag;
NTTIME expire;
NTTIME min_passwordage;
} SAM_UNK_INFO_1;
typedef struct sam_unknown_ctr_info
{
union
{
SAM_UNK_INFO_1 inf1;
SAM_UNK_INFO_2 inf2;
SAM_UNK_INFO_3 inf3;
SAM_UNK_INFO_5 inf5;
SAM_UNK_INFO_6 inf6;
SAM_UNK_INFO_7 inf7;
SAM_UNK_INFO_12 inf12;
} info;
} SAM_UNK_CTR;
typedef struct r_samr_query_domain_info
{
uint32 ptr_0;
uint16 switch_value;
SAM_UNK_CTR *ctr;
NTSTATUS status;
} SAMR_R_QUERY_DOMAIN_INFO;
typedef struct q_samr_lookup_domain_info
{
POLICY_HND connect_pol;
UNIHDR hdr_domain;
UNISTR2 uni_domain;
} SAMR_Q_LOOKUP_DOMAIN;
typedef struct r_samr_lookup_domain_info
{
uint32 ptr_sid;
DOM_SID2 dom_sid;
NTSTATUS status;
} SAMR_R_LOOKUP_DOMAIN;
typedef struct q_samr_open_domain_info
{
POLICY_HND pol;
uint32 flags;
DOM_SID2 dom_sid;
} SAMR_Q_OPEN_DOMAIN;
typedef struct r_samr_open_domain_info
{
POLICY_HND domain_pol;
NTSTATUS status;
} SAMR_R_OPEN_DOMAIN;
#define MAX_SAM_ENTRIES_W2K 0x400
#define MAX_SAM_ENTRIES_W95 50
#define MAX_SAM_ENTRIES MAX_SAM_ENTRIES_W2K
typedef struct samr_entry_info
{
uint32 rid;
UNIHDR hdr_name;
} SAM_ENTRY;
typedef struct q_samr_enum_domains_info
{
POLICY_HND pol;
uint32 start_idx;
uint32 max_size;
} SAMR_Q_ENUM_DOMAINS;
typedef struct r_samr_enum_domains_info
{
uint32 next_idx;
uint32 ptr_entries1;
uint32 num_entries2;
uint32 ptr_entries2;
uint32 num_entries3;
SAM_ENTRY *sam;
UNISTR2 *uni_dom_name;
uint32 num_entries4;
NTSTATUS status;
} SAMR_R_ENUM_DOMAINS;
typedef struct q_samr_enum_dom_users_info
{
POLICY_HND pol;
uint32 start_idx;
uint16 acb_mask;
uint16 unknown_1;
uint32 max_size;
} SAMR_Q_ENUM_DOM_USERS;
typedef struct r_samr_enum_dom_users_info
{
uint32 next_idx;
uint32 ptr_entries1;
uint32 num_entries2;
uint32 ptr_entries2;
uint32 num_entries3;
SAM_ENTRY *sam;
UNISTR2 *uni_acct_name;
uint32 num_entries4;
NTSTATUS status;
} SAMR_R_ENUM_DOM_USERS;
typedef struct q_samr_enum_dom_groups_info
{
POLICY_HND pol;
uint32 start_idx;
uint32 max_size;
} SAMR_Q_ENUM_DOM_GROUPS;
typedef struct r_samr_enum_dom_groups_info
{
uint32 next_idx;
uint32 ptr_entries1;
uint32 num_entries2;
uint32 ptr_entries2;
uint32 num_entries3;
SAM_ENTRY *sam;
UNISTR2 *uni_grp_name;
uint32 num_entries4;
NTSTATUS status;
} SAMR_R_ENUM_DOM_GROUPS;
typedef struct q_samr_enum_dom_aliases_info
{
POLICY_HND pol;
uint32 start_idx;
uint32 max_size;
} SAMR_Q_ENUM_DOM_ALIASES;
typedef struct r_samr_enum_dom_aliases_info
{
uint32 next_idx;
uint32 ptr_entries1;
uint32 num_entries2;
uint32 ptr_entries2;
uint32 num_entries3;
SAM_ENTRY *sam;
UNISTR2 *uni_grp_name;
uint32 num_entries4;
NTSTATUS status;
} SAMR_R_ENUM_DOM_ALIASES;
typedef struct samr_entry_info1
{
uint32 user_idx;
uint32 rid_user;
uint16 acb_info;
UNIHDR hdr_acct_name;
UNIHDR hdr_user_name;
UNIHDR hdr_user_desc;
} SAM_ENTRY1;
typedef struct samr_str_entry_info1
{
UNISTR2 uni_acct_name;
UNISTR2 uni_full_name;
UNISTR2 uni_acct_desc;
} SAM_STR1;
typedef struct sam_entry_info_1
{
SAM_ENTRY1 *sam;
SAM_STR1 *str;
} SAM_DISPINFO_1;
typedef struct samr_entry_info2
{
uint32 user_idx;
uint32 rid_user;
uint16 acb_info;
UNIHDR hdr_srv_name;
UNIHDR hdr_srv_desc;
} SAM_ENTRY2;
typedef struct samr_str_entry_info2
{
UNISTR2 uni_srv_name;
UNISTR2 uni_srv_desc;
} SAM_STR2;
typedef struct sam_entry_info_2
{
SAM_ENTRY2 *sam;
SAM_STR2 *str;
} SAM_DISPINFO_2;
typedef struct samr_entry_info3
{
uint32 grp_idx;
uint32 rid_grp;
uint32 attr;
UNIHDR hdr_grp_name;
UNIHDR hdr_grp_desc;
} SAM_ENTRY3;
typedef struct samr_str_entry_info3
{
UNISTR2 uni_grp_name;
UNISTR2 uni_grp_desc;
} SAM_STR3;
typedef struct sam_entry_info_3
{
SAM_ENTRY3 *sam;
SAM_STR3 *str;
} SAM_DISPINFO_3;
typedef struct samr_entry_info4
{
uint32 user_idx;
STRHDR hdr_acct_name;
} SAM_ENTRY4;
typedef struct samr_str_entry_info4
{
STRING2 acct_name;
} SAM_STR4;
typedef struct sam_entry_info_4
{
SAM_ENTRY4 *sam;
SAM_STR4 *str;
} SAM_DISPINFO_4;
typedef struct samr_entry_info5
{
uint32 grp_idx;
STRHDR hdr_grp_name;
} SAM_ENTRY5;
typedef struct samr_str_entry_info5
{
STRING2 grp_name;
} SAM_STR5;
typedef struct sam_entry_info_5
{
SAM_ENTRY5 *sam;
SAM_STR5 *str;
} SAM_DISPINFO_5;
typedef struct sam_dispinfo_ctr_info
{
union
{
SAM_DISPINFO_1 *info1;
SAM_DISPINFO_2 *info2;
SAM_DISPINFO_3 *info3;
SAM_DISPINFO_4 *info4;
SAM_DISPINFO_5 *info5;
void *info;
} sam;
} SAM_DISPINFO_CTR;
typedef struct q_samr_query_disp_info
{
POLICY_HND domain_pol;
uint16 switch_level;
uint32 start_idx;
uint32 max_entries;
uint32 max_size;
} SAMR_Q_QUERY_DISPINFO;
typedef struct r_samr_query_dispinfo_info
{
uint32 total_size;
uint32 data_size;
uint16 switch_level;
uint32 num_entries;
uint32 ptr_entries;
uint32 num_entries2;
SAM_DISPINFO_CTR *ctr;
NTSTATUS status;
} SAMR_R_QUERY_DISPINFO;
typedef struct q_samr_delete_dom_group_info
{
POLICY_HND group_pol;
} SAMR_Q_DELETE_DOM_GROUP;
typedef struct r_samr_delete_dom_group_info
{
POLICY_HND pol;
NTSTATUS status;
} SAMR_R_DELETE_DOM_GROUP;
typedef struct q_samr_create_dom_group_info
{
POLICY_HND pol;
UNIHDR hdr_acct_desc;
UNISTR2 uni_acct_desc;
uint32 access_mask;
} SAMR_Q_CREATE_DOM_GROUP;
typedef struct r_samr_create_dom_group_info
{
POLICY_HND pol;
uint32 rid;
NTSTATUS status;
} SAMR_R_CREATE_DOM_GROUP;
typedef struct q_samr_query_group_info
{
POLICY_HND pol;
uint16 switch_level;
} SAMR_Q_QUERY_GROUPINFO;
typedef struct samr_group_info1
{
UNIHDR hdr_acct_name;
uint32 unknown_1;
uint32 num_members;
UNIHDR hdr_acct_desc;
UNISTR2 uni_acct_name;
UNISTR2 uni_acct_desc;
} GROUP_INFO1;
typedef struct samr_group_info2
{
uint16 level;
UNIHDR hdr_acct_name;
UNISTR2 uni_acct_name;
} GROUP_INFO2;
typedef struct samr_group_info3
{
uint32 unknown_1;
} GROUP_INFO3;
typedef struct samr_group_info4
{
uint16 level;
UNIHDR hdr_acct_desc;
UNISTR2 uni_acct_desc;
} GROUP_INFO4;
typedef struct group_info_ctr
{
uint16 switch_value1;
union
{
GROUP_INFO1 info1;
GROUP_INFO2 info2;
GROUP_INFO3 info3;
GROUP_INFO4 info4;
} group;
} GROUP_INFO_CTR;
typedef struct r_samr_query_groupinfo_info
{
uint32 ptr;
GROUP_INFO_CTR *ctr;
NTSTATUS status;
} SAMR_R_QUERY_GROUPINFO;
typedef struct q_samr_set_group_info
{
POLICY_HND pol;
GROUP_INFO_CTR *ctr;
} SAMR_Q_SET_GROUPINFO;
typedef struct r_samr_set_group_info
{
NTSTATUS status;
} SAMR_R_SET_GROUPINFO;
typedef struct q_samr_delete_dom_alias_info
{
POLICY_HND alias_pol;
} SAMR_Q_DELETE_DOM_ALIAS;
typedef struct r_samr_delete_dom_alias_info
{
POLICY_HND pol;
NTSTATUS status;
} SAMR_R_DELETE_DOM_ALIAS;
typedef struct q_samr_create_dom_alias_info
{
POLICY_HND dom_pol;
UNIHDR hdr_acct_desc;
UNISTR2 uni_acct_desc;
uint32 access_mask;
} SAMR_Q_CREATE_DOM_ALIAS;
typedef struct r_samr_create_dom_alias_info
{
POLICY_HND alias_pol;
uint32 rid;
NTSTATUS status;
} SAMR_R_CREATE_DOM_ALIAS;
typedef struct q_samr_query_alias_info
{
POLICY_HND pol;
uint16 switch_level;
} SAMR_Q_QUERY_ALIASINFO;
typedef struct samr_alias_info1
{
UNIHDR hdr_acct_name;
UNIHDR hdr_acct_desc;
uint32 num_member;
UNISTR2 uni_acct_name;
UNISTR2 uni_acct_desc;
} ALIAS_INFO1;
typedef struct samr_alias_info3
{
UNIHDR hdr_acct_desc;
UNISTR2 uni_acct_desc;
} ALIAS_INFO3;
typedef struct alias_info_ctr
{
uint16 switch_value1;
uint16 switch_value2;
union
{
ALIAS_INFO1 info1;
ALIAS_INFO3 info3;
} alias;
} ALIAS_INFO_CTR;
typedef struct r_samr_query_aliasinfo_info
{
uint32 ptr;
ALIAS_INFO_CTR ctr;
NTSTATUS status;
} SAMR_R_QUERY_ALIASINFO;
typedef struct q_samr_set_alias_info
{
POLICY_HND alias_pol;
ALIAS_INFO_CTR ctr;
} SAMR_Q_SET_ALIASINFO;
typedef struct r_samr_set_aliasinfo_info
{
NTSTATUS status;
} SAMR_R_SET_ALIASINFO;
typedef struct q_samr_query_usergroup_info
{
POLICY_HND pol;
} SAMR_Q_QUERY_USERGROUPS;
typedef struct r_samr_query_usergroup_info
{
uint32 ptr_0;
uint32 num_entries;
uint32 ptr_1;
uint32 num_entries2;
DOM_GID *gid;
NTSTATUS status;
} SAMR_R_QUERY_USERGROUPS;
typedef struct sam_userinfo_ctr_info
{
uint16 switch_value;
union
{
SAM_USER_INFO_10 *id10;
SAM_USER_INFO_11 *id11;
SAM_USER_INFO_12 *id12;
SAM_USER_INFO_20 *id20;
SAM_USER_INFO_21 *id21;
SAM_USER_INFO_23 *id23;
SAM_USER_INFO_24 *id24;
SAM_USER_INFO_25 *id25;
void* id;
} info;
} SAM_USERINFO_CTR;
typedef struct q_samr_set_user_info2
{
POLICY_HND pol;
uint16 switch_value;
SAM_USERINFO_CTR *ctr;
} SAMR_Q_SET_USERINFO2;
typedef struct r_samr_set_user_info2
{
NTSTATUS status;
} SAMR_R_SET_USERINFO2;
typedef struct q_samr_set_user_info
{
POLICY_HND pol;
uint16 switch_value;
SAM_USERINFO_CTR *ctr;
} SAMR_Q_SET_USERINFO;
typedef struct r_samr_set_user_info
{
NTSTATUS status;
} SAMR_R_SET_USERINFO;
typedef struct q_samr_query_user_info
{
POLICY_HND pol;
uint16 switch_value;
} SAMR_Q_QUERY_USERINFO;
typedef struct r_samr_query_user_info
{
uint32 ptr;
SAM_USERINFO_CTR *ctr;
NTSTATUS status;
} SAMR_R_QUERY_USERINFO;
typedef struct q_samr_query_useraliases_info
{
POLICY_HND pol;
uint32 num_sids1;
uint32 ptr;
uint32 num_sids2;
uint32 *ptr_sid;
DOM_SID2 *sid ;
} SAMR_Q_QUERY_USERALIASES;
typedef struct r_samr_query_useraliases_info
{
uint32 num_entries;
uint32 ptr;
uint32 num_entries2;
uint32 *rid;
NTSTATUS status;
} SAMR_R_QUERY_USERALIASES;
typedef struct q_samr_lookup_names_info
{
POLICY_HND pol;
uint32 num_names1;
uint32 flags;
uint32 ptr;
uint32 num_names2;
UNIHDR *hdr_name;
UNISTR2 *uni_name;
} SAMR_Q_LOOKUP_NAMES;
typedef struct r_samr_lookup_names_info
{
uint32 num_rids1;
uint32 ptr_rids;
uint32 num_rids2;
uint32 *rids;
uint32 num_types1;
uint32 ptr_types;
uint32 num_types2;
uint32 *types;
NTSTATUS status;
} SAMR_R_LOOKUP_NAMES;
typedef struct q_samr_lookup_rids_info
{
POLICY_HND pol;
uint32 num_rids1;
uint32 flags;
uint32 ptr;
uint32 num_rids2;
uint32 *rid;
} SAMR_Q_LOOKUP_RIDS;
typedef struct r_samr_lookup_rids_info
{
uint32 num_names1;
uint32 ptr_names;
uint32 num_names2;
UNIHDR *hdr_name;
UNISTR2 *uni_name;
uint32 num_types1;
uint32 ptr_types;
uint32 num_types2;
uint32 *type;
NTSTATUS status;
} SAMR_R_LOOKUP_RIDS;
typedef struct q_samr_open_user_info
{
POLICY_HND domain_pol;
uint32 access_mask;
uint32 user_rid;
} SAMR_Q_OPEN_USER;
typedef struct r_samr_open_user_info
{
POLICY_HND user_pol;
NTSTATUS status;
} SAMR_R_OPEN_USER;
typedef struct q_samr_create_user_info
{
POLICY_HND domain_pol;
UNIHDR hdr_name;
UNISTR2 uni_name;
uint32 acb_info;
uint32 access_mask;
} SAMR_Q_CREATE_USER;
typedef struct r_samr_create_user_info
{
POLICY_HND user_pol;
uint32 access_granted;
uint32 user_rid;
NTSTATUS status;
} SAMR_R_CREATE_USER;
typedef struct q_samr_delete_dom_user_info
{
POLICY_HND user_pol;
} SAMR_Q_DELETE_DOM_USER;
typedef struct r_samr_delete_dom_user_info
{
POLICY_HND pol;
NTSTATUS status;
} SAMR_R_DELETE_DOM_USER;
typedef struct q_samr_query_groupmem_info
{
POLICY_HND group_pol;
} SAMR_Q_QUERY_GROUPMEM;
typedef struct r_samr_query_groupmem_info
{
uint32 ptr;
uint32 num_entries;
uint32 ptr_rids;
uint32 ptr_attrs;
uint32 num_rids;
uint32 *rid;
uint32 num_attrs;
uint32 *attr;
NTSTATUS status;
} SAMR_R_QUERY_GROUPMEM;
typedef struct q_samr_del_group_mem_info
{
POLICY_HND pol;
uint32 rid;
} SAMR_Q_DEL_GROUPMEM;
typedef struct r_samr_del_group_mem_info
{
NTSTATUS status;
} SAMR_R_DEL_GROUPMEM;
typedef struct q_samr_add_group_mem_info
{
POLICY_HND pol;
uint32 rid;
uint32 unknown;
} SAMR_Q_ADD_GROUPMEM;
typedef struct r_samr_add_group_mem_info
{
NTSTATUS status;
} SAMR_R_ADD_GROUPMEM;
typedef struct q_samr_open_group_info
{
POLICY_HND domain_pol;
uint32 access_mask;
uint32 rid_group;
} SAMR_Q_OPEN_GROUP;
typedef struct r_samr_open_group_info
{
POLICY_HND pol;
NTSTATUS status;
} SAMR_R_OPEN_GROUP;
typedef struct q_samr_query_aliasmem_info
{
POLICY_HND alias_pol;
} SAMR_Q_QUERY_ALIASMEM;
typedef struct r_samr_query_aliasmem_info
{
uint32 num_sids;
uint32 ptr;
uint32 num_sids1;
DOM_SID2 *sid;
NTSTATUS status;
} SAMR_R_QUERY_ALIASMEM;
typedef struct q_samr_add_alias_mem_info
{
POLICY_HND alias_pol;
DOM_SID2 sid;
} SAMR_Q_ADD_ALIASMEM;
typedef struct r_samr_add_alias_mem_info
{
NTSTATUS status;
} SAMR_R_ADD_ALIASMEM;
typedef struct q_samr_del_alias_mem_info
{
POLICY_HND alias_pol;
DOM_SID2 sid;
} SAMR_Q_DEL_ALIASMEM;
typedef struct r_samr_del_alias_mem_info
{
NTSTATUS status;
} SAMR_R_DEL_ALIASMEM;
typedef struct q_samr_open_alias_info
{
POLICY_HND dom_pol;
uint32 access_mask;
uint32 rid_alias;
} SAMR_Q_OPEN_ALIAS;
typedef struct r_samr_open_alias_info
{
POLICY_HND pol;
NTSTATUS status;
} SAMR_R_OPEN_ALIAS;
typedef struct q_samr_connect_anon_info
{
uint32 ptr;
uint16 unknown_0;
uint16 unknown_1;
uint32 access_mask;
} SAMR_Q_CONNECT_ANON;
typedef struct r_samr_connect_anon_info
{
POLICY_HND connect_pol;
NTSTATUS status;
} SAMR_R_CONNECT_ANON;
typedef struct q_samr_connect_info
{
uint32 ptr_srv_name;
UNISTR2 uni_srv_name;
uint32 access_mask;
} SAMR_Q_CONNECT;
typedef struct r_samr_connect_info
{
POLICY_HND connect_pol;
NTSTATUS status;
} SAMR_R_CONNECT;
typedef struct q_samr_connect4_info
{
uint32 ptr_srv_name;
UNISTR2 uni_srv_name;
uint32 unk_0;
uint32 access_mask;
} SAMR_Q_CONNECT4;
typedef struct r_samr_connect_info SAMR_R_CONNECT4;
typedef struct q_samr_get_dom_pwinfo
{
uint32 ptr;
UNIHDR hdr_srv_name;
UNISTR2 uni_srv_name;
} SAMR_Q_GET_DOM_PWINFO;
typedef struct r_samr_get_dom_pwinfo
{
uint16 unk_0;
uint32 unk_1;
NTSTATUS status;
} SAMR_R_GET_DOM_PWINFO;
typedef struct enc_passwd_info
{
uint32 ptr;
uint8 pass[516];
} SAMR_ENC_PASSWD;
typedef struct enc_hash_info
{
uint32 ptr;
uint8 hash[16];
} SAMR_ENC_HASH;
typedef struct q_samr_chgpasswd_user_info
{
uint32 ptr_0;
UNIHDR hdr_dest_host;
UNISTR2 uni_dest_host;
UNIHDR hdr_user_name;
UNISTR2 uni_user_name;
SAMR_ENC_PASSWD nt_newpass;
SAMR_ENC_HASH nt_oldhash;
uint32 unknown;
SAMR_ENC_PASSWD lm_newpass;
SAMR_ENC_HASH lm_oldhash;
} SAMR_Q_CHGPASSWD_USER;
typedef struct r_samr_chgpasswd_user_info
{
NTSTATUS status;
} SAMR_R_CHGPASSWD_USER;
typedef struct q_samr_remove_sid_foreign_domain_info
{
POLICY_HND dom_pol;
DOM_SID2 sid;
} SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN;
typedef struct r_samr_remove_sid_foreign_domain_info
{
NTSTATUS status;
} SAMR_R_REMOVE_SID_FOREIGN_DOMAIN;
#define MAX_SAM_SIDS 15
typedef struct sid_info_3
{
uint16 len;
DOM_SID sid;
} DOM_SID3;
typedef struct q_samr_unknown_2e_info
{
POLICY_HND domain_pol;
uint16 switch_value;
} SAMR_Q_UNKNOWN_2E;
typedef struct r_samr_unknown_2e_info
{
uint32 ptr_0;
uint16 switch_value;
SAM_UNK_CTR *ctr;
NTSTATUS status;
} SAMR_R_UNKNOWN_2E;
typedef struct q_samr_set_domain_info
{
POLICY_HND domain_pol;
uint16 switch_value0;
uint16 switch_value;
SAM_UNK_CTR *ctr;
} SAMR_Q_SET_DOMAIN_INFO;
typedef struct r_samr_set_domain_info
{
NTSTATUS status;
} SAMR_R_SET_DOMAIN_INFO;
#endif