2003-11-21 16:14:17 +03:00
#include "idl_types.h"
2003-11-15 09:00:21 +03:00
/*
samr interface definition
2003-11-19 01:35:39 +03:00
*/
2006-11-07 01:54:49 +03:00
import "misc.idl", "lsa.idl", "security.idl";
2003-11-19 01:35:39 +03:00
/*
Thanks to Todd Sabin for some information from his samr.idl in acltools
2003-11-15 09:00:21 +03:00
*/
2004-10-27 08:48:41 +04:00
[ uuid("12345778-1234-abcd-ef00-0123456789ac"),
2003-11-15 09:00:21 +03:00
version(1.0),
2004-10-24 18:57:16 +04:00
endpoint("ncacn_np:[\\pipe\\samr]","ncacn_ip_tcp:", "ncalrpc:"),
2008-02-02 00:11:43 +03:00
pointer_default(unique)
2003-11-18 08:01:10 +03:00
] interface samr
2003-11-15 09:00:21 +03:00
{
2008-01-12 03:18:53 +03:00
typedef bitmap security_secinfo security_secinfo;
2005-08-24 15:01:10 +04:00
2008-11-26 20:20:51 +03:00
/* SAM database types */
typedef [public,v1_enum] enum {
SAM_DATABASE_DOMAIN = 0, /* Domain users and groups */
SAM_DATABASE_BUILTIN = 1, /* BUILTIN users and groups */
SAM_DATABASE_PRIVS = 2 /* Privileges */
} netr_SamDatabaseID;
2004-05-09 13:39:47 +04:00
/* account control (acct_flags) bits */
2005-01-26 07:34:16 +03:00
typedef [public,bitmap32bit] bitmap {
2006-02-22 16:52:00 +03:00
ACB_DISABLED = 0x00000001, /* 1 = User account disabled */
ACB_HOMDIRREQ = 0x00000002, /* 1 = Home directory required */
ACB_PWNOTREQ = 0x00000004, /* 1 = User password not required */
ACB_TEMPDUP = 0x00000008, /* 1 = Temporary duplicate account */
ACB_NORMAL = 0x00000010, /* 1 = Normal user account */
ACB_MNS = 0x00000020, /* 1 = MNS logon user account */
ACB_DOMTRUST = 0x00000040, /* 1 = Interdomain trust account */
ACB_WSTRUST = 0x00000080, /* 1 = Workstation trust account */
ACB_SVRTRUST = 0x00000100, /* 1 = Server trust account */
ACB_PWNOEXP = 0x00000200, /* 1 = User password does not expire */
ACB_AUTOLOCK = 0x00000400, /* 1 = Account auto locked */
ACB_ENC_TXT_PWD_ALLOWED = 0x00000800, /* 1 = Encryped text password is allowed */
ACB_SMARTCARD_REQUIRED = 0x00001000, /* 1 = Smart Card required */
ACB_TRUSTED_FOR_DELEGATION = 0x00002000, /* 1 = Trusted for Delegation */
ACB_NOT_DELEGATED = 0x00004000, /* 1 = Not delegated */
ACB_USE_DES_KEY_ONLY = 0x00008000, /* 1 = Use DES key only */
2006-03-07 06:24:29 +03:00
ACB_DONT_REQUIRE_PREAUTH = 0x00010000, /* 1 = Preauth not required */
2006-03-09 00:36:20 +03:00
ACB_PW_EXPIRED = 0x00020000, /* 1 = Password Expired */
2010-09-28 03:10:57 +04:00
ACB_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = 0x00040000,
ACB_NO_AUTH_DATA_REQD = 0x00080000, /* 1 = No authorization data required */
ACB_PARTIAL_SECRETS_ACCOUNT = 0x00100000,
ACB_USE_AES_KEYS = 0x00200000
2005-01-05 19:54:51 +03:00
} samr_AcctFlags;
2004-05-09 13:39:47 +04:00
2008-10-23 21:00:21 +04:00
/* SAM server specific access rights */
2007-08-29 15:04:49 +04:00
typedef [bitmap32bit] bitmap {
SAMR_ACCESS_CONNECT_TO_SERVER = 0x00000001,
SAMR_ACCESS_SHUTDOWN_SERVER = 0x00000002,
SAMR_ACCESS_INITIALIZE_SERVER = 0x00000004,
SAMR_ACCESS_CREATE_DOMAIN = 0x00000008,
SAMR_ACCESS_ENUM_DOMAINS = 0x00000010,
2009-04-16 02:40:00 +04:00
SAMR_ACCESS_LOOKUP_DOMAIN = 0x00000020
2007-08-29 15:04:49 +04:00
} samr_ConnectAccessMask;
2008-10-23 21:00:21 +04:00
const int SAMR_ACCESS_ALL_ACCESS = 0x0000003F;
const int GENERIC_RIGHTS_SAM_ALL_ACCESS =
(STANDARD_RIGHTS_REQUIRED_ACCESS |
SAMR_ACCESS_ALL_ACCESS);
const int GENERIC_RIGHTS_SAM_READ =
(STANDARD_RIGHTS_READ_ACCESS |
SAMR_ACCESS_ENUM_DOMAINS);
const int GENERIC_RIGHTS_SAM_WRITE =
(STANDARD_RIGHTS_WRITE_ACCESS |
SAMR_ACCESS_CREATE_DOMAIN |
SAMR_ACCESS_INITIALIZE_SERVER |
SAMR_ACCESS_SHUTDOWN_SERVER);
const int GENERIC_RIGHTS_SAM_EXECUTE =
(STANDARD_RIGHTS_EXECUTE_ACCESS |
2009-04-16 02:40:00 +04:00
SAMR_ACCESS_LOOKUP_DOMAIN |
2008-10-23 21:00:21 +04:00
SAMR_ACCESS_CONNECT_TO_SERVER);
2008-10-23 21:23:43 +04:00
/* User Object specific access rights */
2007-08-29 16:51:46 +04:00
typedef [bitmap32bit] bitmap {
2008-01-25 01:52:16 +03:00
SAMR_USER_ACCESS_GET_NAME_ETC = 0x00000001,
SAMR_USER_ACCESS_GET_LOCALE = 0x00000002,
SAMR_USER_ACCESS_SET_LOC_COM = 0x00000004,
SAMR_USER_ACCESS_GET_LOGONINFO = 0x00000008,
SAMR_USER_ACCESS_GET_ATTRIBUTES = 0x00000010,
SAMR_USER_ACCESS_SET_ATTRIBUTES = 0x00000020,
SAMR_USER_ACCESS_CHANGE_PASSWORD = 0x00000040,
SAMR_USER_ACCESS_SET_PASSWORD = 0x00000080,
SAMR_USER_ACCESS_GET_GROUPS = 0x00000100,
SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP = 0x00000200,
SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP = 0x00000400
2007-08-29 16:51:46 +04:00
} samr_UserAccessMask;
2008-10-23 21:23:43 +04:00
const int SAMR_USER_ACCESS_ALL_ACCESS = 0x000007FF;
const int GENERIC_RIGHTS_USER_ALL_ACCESS =
(STANDARD_RIGHTS_REQUIRED_ACCESS |
SAMR_USER_ACCESS_ALL_ACCESS); /* 0x000f07ff */
const int GENERIC_RIGHTS_USER_READ =
(STANDARD_RIGHTS_READ_ACCESS |
SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP |
SAMR_USER_ACCESS_GET_GROUPS |
SAMR_USER_ACCESS_GET_ATTRIBUTES |
SAMR_USER_ACCESS_GET_LOGONINFO |
SAMR_USER_ACCESS_GET_LOCALE); /* 0x0002031a */
const int GENERIC_RIGHTS_USER_WRITE =
(STANDARD_RIGHTS_WRITE_ACCESS |
SAMR_USER_ACCESS_CHANGE_PASSWORD |
SAMR_USER_ACCESS_SET_LOC_COM |
SAMR_USER_ACCESS_SET_ATTRIBUTES |
SAMR_USER_ACCESS_SET_PASSWORD |
SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP); /* 0x000204e4 */
const int GENERIC_RIGHTS_USER_EXECUTE =
(STANDARD_RIGHTS_EXECUTE_ACCESS |
SAMR_USER_ACCESS_CHANGE_PASSWORD |
SAMR_USER_ACCESS_GET_NAME_ETC); /* 0x00020041 */
2008-10-23 21:38:21 +04:00
/* Domain Object specific access rights */
2007-08-29 16:39:58 +04:00
typedef [bitmap32bit] bitmap {
2008-01-25 01:52:16 +03:00
SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1 = 0x00000001,
SAMR_DOMAIN_ACCESS_SET_INFO_1 = 0x00000002,
SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2 = 0x00000004,
SAMR_DOMAIN_ACCESS_SET_INFO_2 = 0x00000008,
SAMR_DOMAIN_ACCESS_CREATE_USER = 0x00000010,
SAMR_DOMAIN_ACCESS_CREATE_GROUP = 0x00000020,
SAMR_DOMAIN_ACCESS_CREATE_ALIAS = 0x00000040,
SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS = 0x00000080,
SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS = 0x00000100,
SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT = 0x00000200,
SAMR_DOMAIN_ACCESS_SET_INFO_3 = 0x00000400
2007-08-29 16:39:58 +04:00
} samr_DomainAccessMask;
2008-10-23 21:38:21 +04:00
const int SAMR_DOMAIN_ACCESS_ALL_ACCESS = 0x000007FF;
const int GENERIC_RIGHTS_DOMAIN_ALL_ACCESS =
(STANDARD_RIGHTS_REQUIRED_ACCESS |
SAMR_DOMAIN_ACCESS_ALL_ACCESS);
const int GENERIC_RIGHTS_DOMAIN_READ =
(STANDARD_RIGHTS_READ_ACCESS |
SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS |
SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2);
const int GENERIC_RIGHTS_DOMAIN_WRITE =
(STANDARD_RIGHTS_WRITE_ACCESS |
SAMR_DOMAIN_ACCESS_SET_INFO_3 |
SAMR_DOMAIN_ACCESS_CREATE_ALIAS |
SAMR_DOMAIN_ACCESS_CREATE_GROUP |
SAMR_DOMAIN_ACCESS_CREATE_USER |
SAMR_DOMAIN_ACCESS_SET_INFO_2 |
SAMR_DOMAIN_ACCESS_SET_INFO_1);
const int GENERIC_RIGHTS_DOMAIN_EXECUTE =
(STANDARD_RIGHTS_EXECUTE_ACCESS |
SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT |
SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS |
SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1);
2008-10-23 21:45:17 +04:00
/* Group Object specific access rights */
2007-08-29 16:22:15 +04:00
typedef [bitmap32bit] bitmap {
2008-01-25 01:52:16 +03:00
SAMR_GROUP_ACCESS_LOOKUP_INFO = 0x00000001,
SAMR_GROUP_ACCESS_SET_INFO = 0x00000002,
SAMR_GROUP_ACCESS_ADD_MEMBER = 0x00000004,
SAMR_GROUP_ACCESS_REMOVE_MEMBER = 0x00000008,
SAMR_GROUP_ACCESS_GET_MEMBERS = 0x00000010
2007-08-29 16:22:15 +04:00
} samr_GroupAccessMask;
2008-10-23 21:45:17 +04:00
const int SAMR_GROUP_ACCESS_ALL_ACCESS = 0x0000001F;
const int GENERIC_RIGHTS_GROUP_ALL_ACCESS =
(STANDARD_RIGHTS_REQUIRED_ACCESS |
SAMR_GROUP_ACCESS_ALL_ACCESS); /* 0x000f001f */
const int GENERIC_RIGHTS_GROUP_READ =
(STANDARD_RIGHTS_READ_ACCESS |
SAMR_GROUP_ACCESS_GET_MEMBERS); /* 0x00020010 */
const int GENERIC_RIGHTS_GROUP_WRITE =
(STANDARD_RIGHTS_WRITE_ACCESS |
SAMR_GROUP_ACCESS_REMOVE_MEMBER |
SAMR_GROUP_ACCESS_ADD_MEMBER |
SAMR_GROUP_ACCESS_SET_INFO); /* 0x0002000e */
const int GENERIC_RIGHTS_GROUP_EXECUTE =
(STANDARD_RIGHTS_EXECUTE_ACCESS |
SAMR_GROUP_ACCESS_LOOKUP_INFO); /* 0x00020001 */
2008-10-23 21:52:34 +04:00
/* Alias Object specific access rights */
2007-08-29 15:54:23 +04:00
typedef [bitmap32bit] bitmap {
2008-01-25 01:52:16 +03:00
SAMR_ALIAS_ACCESS_ADD_MEMBER = 0x00000001,
SAMR_ALIAS_ACCESS_REMOVE_MEMBER = 0x00000002,
SAMR_ALIAS_ACCESS_GET_MEMBERS = 0x00000004,
SAMR_ALIAS_ACCESS_LOOKUP_INFO = 0x00000008,
SAMR_ALIAS_ACCESS_SET_INFO = 0x00000010
2007-08-29 15:54:23 +04:00
} samr_AliasAccessMask;
2008-10-23 21:52:34 +04:00
const int SAMR_ALIAS_ACCESS_ALL_ACCESS = 0x0000001F;
const int GENERIC_RIGHTS_ALIAS_ALL_ACCESS =
(STANDARD_RIGHTS_REQUIRED_ACCESS |
SAMR_ALIAS_ACCESS_ALL_ACCESS); /* 0x000f001f */
const int GENERIC_RIGHTS_ALIAS_READ =
(STANDARD_RIGHTS_READ_ACCESS |
SAMR_ALIAS_ACCESS_GET_MEMBERS); /* 0x00020004 */
const int GENERIC_RIGHTS_ALIAS_WRITE =
(STANDARD_RIGHTS_WRITE_ACCESS |
SAMR_ALIAS_ACCESS_REMOVE_MEMBER |
SAMR_ALIAS_ACCESS_ADD_MEMBER |
SAMR_ALIAS_ACCESS_SET_INFO); /* 0x00020013 */
const int GENERIC_RIGHTS_ALIAS_EXECUTE =
(STANDARD_RIGHTS_EXECUTE_ACCESS |
SAMR_ALIAS_ACCESS_LOOKUP_INFO); /* 0x00020008 */
2003-11-15 09:00:21 +03:00
/******************/
/* Function: 0x00 */
NTSTATUS samr_Connect (
/* notice the lack of [string] */
2008-02-02 00:11:43 +03:00
[in,unique] uint16 *system_name,
2007-08-29 15:04:49 +04:00
[in] samr_ConnectAccessMask access_mask,
2004-09-21 07:51:38 +04:00
[out,ref] policy_handle *connect_handle
2003-11-15 09:00:21 +03:00
);
/******************/
/* Function: 0x01 */
2007-03-02 22:13:58 +03:00
[public] NTSTATUS samr_Close (
2003-11-15 23:47:59 +03:00
[in,out,ref] policy_handle *handle
);
2003-11-15 09:00:21 +03:00
/******************/
/* Function: 0x02 */
2003-11-19 07:44:47 +03:00
2003-12-20 02:44:26 +03:00
NTSTATUS samr_SetSecurity (
[in,ref] policy_handle *handle,
2005-08-24 15:01:10 +04:00
[in] security_secinfo sec_info,
2004-11-20 03:29:04 +03:00
[in,ref] sec_desc_buf *sdbuf
2003-12-20 02:44:26 +03:00
);
/******************/
/* Function: 0x03 */
2003-11-18 08:20:54 +03:00
NTSTATUS samr_QuerySecurity (
[in,ref] policy_handle *handle,
2005-08-24 15:01:10 +04:00
[in] security_secinfo sec_info,
2008-10-28 00:57:51 +03:00
[out,ref] sec_desc_buf **sdbuf
2003-11-18 08:20:54 +03:00
);
2003-11-15 09:00:21 +03:00
/******************/
/* Function: 0x04 */
2004-04-23 08:21:22 +04:00
/*
shutdown the SAM - once you call this the SAM will be dead
*/
NTSTATUS samr_Shutdown (
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *connect_handle
2004-04-23 08:21:22 +04:00
);
2003-11-15 09:00:21 +03:00
/******************/
/* Function: 0x05 */
2003-11-15 10:51:19 +03:00
NTSTATUS samr_LookupDomain (
2008-11-10 17:53:19 +03:00
[in,ref] policy_handle *connect_handle,
2005-07-08 12:09:02 +04:00
[in,ref] lsa_String *domain_name,
2008-11-07 04:42:45 +03:00
[out,ref] dom_sid2 **sid
2003-11-15 10:51:19 +03:00
);
/******************/
/* Function: 0x06 */
2003-11-15 09:00:21 +03:00
typedef struct {
2003-11-15 10:51:19 +03:00
uint32 idx;
2005-07-08 12:09:02 +04:00
lsa_String name;
2003-11-15 09:00:21 +03:00
} samr_SamEntry;
typedef struct {
uint32 count;
2005-05-27 19:49:15 +04:00
[size_is(count)] samr_SamEntry *entries;
2003-11-15 09:00:21 +03:00
} samr_SamArray;
NTSTATUS samr_EnumDomains (
2009-04-21 17:14:02 +04:00
[in,ref] policy_handle *connect_handle,
2003-11-15 09:00:21 +03:00
[in,out,ref] uint32 *resume_handle,
2008-11-07 04:57:58 +03:00
[out,ref] samr_SamArray **sam,
2003-11-15 09:00:21 +03:00
[in] uint32 buf_size,
2008-11-07 04:57:58 +03:00
[out,ref] uint32 *num_entries
2003-11-15 09:00:21 +03:00
);
/************************/
/* Function 0x07 */
2007-03-02 21:01:43 +03:00
[public] NTSTATUS samr_OpenDomain(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *connect_handle,
2007-08-29 16:39:58 +04:00
[in] samr_DomainAccessMask access_mask,
2003-11-15 11:06:39 +03:00
[in,ref] dom_sid2 *sid,
[out,ref] policy_handle *domain_handle
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x08 */
2009-06-23 12:55:05 +04:00
typedef enum {
DomainPasswordInformation = 1,
DomainGeneralInformation = 2,
DomainLogoffInformation = 3,
DomainOemInformation = 4,
DomainNameInformation = 5,
DomainReplicationInformation = 6,
DomainServerRoleInformation = 7,
DomainModifiedInformation = 8,
DomainStateInformation = 9,
DomainUasInformation = 10,
DomainGeneralInformation2 = 11,
DomainLockoutInformation = 12,
DomainModifiedInformation2 = 13
} samr_DomainInfoClass;
2005-01-10 20:28:36 +03:00
/* server roles */
typedef [v1_enum] enum {
2006-12-13 14:19:51 +03:00
SAMR_ROLE_STANDALONE = 0,
SAMR_ROLE_DOMAIN_MEMBER = 1,
SAMR_ROLE_DOMAIN_BDC = 2,
SAMR_ROLE_DOMAIN_PDC = 3
2005-01-10 20:28:36 +03:00
} samr_Role;
2003-11-15 11:06:39 +03:00
2006-02-22 16:56:46 +03:00
/* password properties flags */
typedef [public,bitmap32bit] bitmap {
DOMAIN_PASSWORD_COMPLEX = 0x00000001,
DOMAIN_PASSWORD_NO_ANON_CHANGE = 0x00000002,
DOMAIN_PASSWORD_NO_CLEAR_CHANGE = 0x00000004,
DOMAIN_PASSWORD_LOCKOUT_ADMINS = 0x00000008,
DOMAIN_PASSWORD_STORE_CLEARTEXT = 0x00000010,
DOMAIN_REFUSE_PASSWORD_CHANGE = 0x00000020
} samr_PasswordProperties;
2008-12-01 14:53:59 +03:00
typedef [v1_enum] enum {
DOMAIN_SERVER_ENABLED = 1,
DOMAIN_SERVER_DISABLED = 2
} samr_DomainServerState;
2003-11-15 11:06:39 +03:00
typedef struct {
2004-11-17 14:56:13 +03:00
uint16 min_password_length;
uint16 password_history_length;
2006-02-22 16:56:46 +03:00
samr_PasswordProperties password_properties;
2004-05-25 17:57:39 +04:00
/* yes, these are signed. They are in negative 100ns */
2005-01-27 09:16:59 +03:00
dlong max_password_age;
dlong min_password_age;
2003-11-15 11:06:39 +03:00
} samr_DomInfo1;
2003-11-15 12:18:02 +03:00
typedef struct {
2004-11-17 14:56:13 +03:00
NTTIME force_logoff_time;
2008-07-21 07:42:07 +04:00
lsa_String oem_information; /* comment */
2005-07-08 12:09:02 +04:00
lsa_String domain_name;
lsa_String primary; /* PDC name if this is a BDC */
2005-01-27 09:16:59 +03:00
udlong sequence_num;
2008-12-01 14:53:59 +03:00
samr_DomainServerState domain_server_state;
2005-01-10 20:28:36 +03:00
samr_Role role;
2003-11-15 14:34:01 +03:00
uint32 unknown3;
2003-11-15 12:18:02 +03:00
uint32 num_users;
uint32 num_groups;
uint32 num_aliases;
2008-07-21 07:42:07 +04:00
} samr_DomGeneralInformation;
2003-11-15 12:18:02 +03:00
typedef struct {
2004-11-17 14:56:13 +03:00
NTTIME force_logoff_time;
2003-11-15 12:18:02 +03:00
} samr_DomInfo3;
typedef struct {
2008-07-21 07:42:07 +04:00
lsa_String oem_information; /* comment */
} samr_DomOEMInformation;
2003-11-15 12:18:02 +03:00
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String domain_name;
2003-11-15 12:18:02 +03:00
} samr_DomInfo5;
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String primary;
2003-11-15 12:18:02 +03:00
} samr_DomInfo6;
typedef struct {
2005-01-10 20:28:36 +03:00
samr_Role role;
2003-11-15 12:18:02 +03:00
} samr_DomInfo7;
typedef struct {
2005-01-27 09:33:07 +03:00
hyper sequence_num;
2004-11-17 14:56:13 +03:00
NTTIME domain_create_time;
2003-11-15 12:18:02 +03:00
} samr_DomInfo8;
typedef struct {
2008-12-01 14:53:59 +03:00
samr_DomainServerState domain_server_state;
2003-11-15 12:18:02 +03:00
} samr_DomInfo9;
typedef struct {
2008-07-21 07:42:07 +04:00
samr_DomGeneralInformation general;
2005-01-27 09:33:07 +03:00
hyper lockout_duration;
hyper lockout_window;
2003-11-15 12:18:02 +03:00
uint16 lockout_threshold;
2008-07-21 07:42:07 +04:00
} samr_DomGeneralInformation2;
2003-11-15 12:18:02 +03:00
typedef struct {
2005-01-27 09:33:07 +03:00
hyper lockout_duration;
hyper lockout_window;
2003-11-15 12:18:02 +03:00
uint16 lockout_threshold;
} samr_DomInfo12;
typedef struct {
2005-01-27 09:33:07 +03:00
hyper sequence_num;
2004-11-17 14:56:13 +03:00
NTTIME domain_create_time;
2008-12-03 01:25:16 +03:00
hyper modified_count_at_last_promotion;
2003-11-15 12:18:02 +03:00
} samr_DomInfo13;
2005-03-06 20:02:14 +03:00
typedef [switch_type(uint16)] union {
2003-11-20 03:57:59 +03:00
[case(1)] samr_DomInfo1 info1;
2008-07-21 07:42:07 +04:00
[case(2)] samr_DomGeneralInformation general;
2003-11-20 03:57:59 +03:00
[case(3)] samr_DomInfo3 info3;
2008-07-21 07:42:07 +04:00
[case(4)] samr_DomOEMInformation oem;
2003-11-20 03:57:59 +03:00
[case(5)] samr_DomInfo5 info5;
[case(6)] samr_DomInfo6 info6;
[case(7)] samr_DomInfo7 info7;
[case(8)] samr_DomInfo8 info8;
[case(9)] samr_DomInfo9 info9;
2008-07-21 07:42:07 +04:00
[case(11)] samr_DomGeneralInformation2 general2;
2003-11-20 03:57:59 +03:00
[case(12)] samr_DomInfo12 info12;
[case(13)] samr_DomInfo13 info13;
2003-11-15 11:06:39 +03:00
} samr_DomainInfo;
NTSTATUS samr_QueryDomainInfo(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2009-06-23 12:55:05 +04:00
[in] samr_DomainInfoClass level,
2008-11-05 04:59:51 +03:00
[out,ref,switch_is(level)] samr_DomainInfo **info
2003-11-15 11:06:39 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x09 */
2004-04-17 09:25:49 +04:00
/*
2008-11-10 17:53:19 +03:00
only levels 1, 3, 4, 6, 7, 9, 12 are valid for this
2004-04-17 09:25:49 +04:00
call in w2k3
*/
NTSTATUS samr_SetDomainInfo(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2009-06-23 12:55:05 +04:00
[in] samr_DomainInfoClass level,
2004-04-17 09:25:49 +04:00
[in,switch_is(level),ref] samr_DomainInfo *info
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x0a */
2004-04-17 09:54:55 +04:00
NTSTATUS samr_CreateDomainGroup(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2005-07-08 12:09:02 +04:00
[in,ref] lsa_String *name,
2007-08-29 16:22:15 +04:00
[in] samr_GroupAccessMask access_mask,
2004-04-17 09:54:55 +04:00
[out,ref] policy_handle *group_handle,
[out,ref] uint32 *rid
);
2008-11-10 17:53:19 +03:00
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x0b */
2003-11-15 12:39:48 +03:00
NTSTATUS samr_EnumDomainGroups(
2008-11-07 16:51:21 +03:00
[in] policy_handle *domain_handle,
2003-11-15 12:39:48 +03:00
[in,out,ref] uint32 *resume_handle,
2008-11-07 16:51:21 +03:00
[out,ref] samr_SamArray **sam,
2003-11-15 12:39:48 +03:00
[in] uint32 max_size,
2008-11-07 16:51:21 +03:00
[out,ref] uint32 *num_entries
2003-11-15 12:39:48 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x0c */
2003-11-18 11:03:06 +03:00
NTSTATUS samr_CreateUser(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2005-07-08 12:09:02 +04:00
[in,ref] lsa_String *account_name,
2007-08-29 16:51:46 +04:00
[in] samr_UserAccessMask access_mask,
2004-09-21 07:51:38 +04:00
[out,ref] policy_handle *user_handle,
2003-11-18 13:21:05 +03:00
[out,ref] uint32 *rid
2003-11-18 11:03:06 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x0d */
2004-05-08 18:42:45 +04:00
2004-05-09 13:39:47 +04:00
2004-05-08 18:42:45 +04:00
/* w2k3 treats max_size as max_users*54 and sets the
resume_handle as the rid of the last user sent
*/
2004-05-09 04:40:45 +04:00
const int SAMR_ENUM_USERS_MULTIPLIER = 54;
2003-11-15 12:39:48 +03:00
NTSTATUS samr_EnumDomainUsers(
2008-11-07 13:25:01 +03:00
[in] policy_handle *domain_handle,
2003-11-15 12:39:48 +03:00
[in,out,ref] uint32 *resume_handle,
2005-01-05 19:54:51 +03:00
[in] samr_AcctFlags acct_flags,
2008-11-07 13:25:01 +03:00
[out,ref] samr_SamArray **sam,
2003-11-15 12:39:48 +03:00
[in] uint32 max_size,
2008-11-07 13:25:01 +03:00
[out,ref] uint32 *num_entries
2003-11-15 12:39:48 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x0e */
2003-12-19 06:59:27 +03:00
NTSTATUS samr_CreateDomAlias(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2005-07-08 12:09:02 +04:00
[in,ref] lsa_String *alias_name,
2007-08-29 15:54:23 +04:00
[in] samr_AliasAccessMask access_mask,
2004-09-21 07:51:38 +04:00
[out,ref] policy_handle *alias_handle,
2003-12-19 06:59:27 +03:00
[out,ref] uint32 *rid
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x0f */
2003-11-15 13:03:12 +03:00
NTSTATUS samr_EnumDomainAliases(
2008-11-05 15:37:49 +03:00
[in] policy_handle *domain_handle,
2003-11-15 13:03:12 +03:00
[in,out,ref] uint32 *resume_handle,
2008-11-05 15:37:49 +03:00
[out,ref] samr_SamArray **sam,
[in] uint32 max_size,
[out,ref] uint32 *num_entries
2003-11-15 13:03:12 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x10 */
2003-11-18 11:03:06 +03:00
typedef struct {
2004-10-13 17:00:57 +04:00
[range(0,1024)] uint32 count;
2005-05-27 19:49:15 +04:00
[size_is(count)] uint32 *ids;
2003-11-20 06:09:19 +03:00
} samr_Ids;
2003-11-18 11:03:06 +03:00
NTSTATUS samr_GetAliasMembership(
2004-12-29 16:20:17 +03:00
[in,ref] policy_handle *domain_handle,
2004-04-18 08:06:15 +04:00
[in,ref] lsa_SidArray *sids,
2004-12-29 16:20:17 +03:00
[out,ref] samr_Ids *rids
2003-11-18 11:03:06 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x11 */
2003-11-20 06:09:19 +03:00
2007-03-02 21:01:43 +03:00
[public] NTSTATUS samr_LookupNames(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2004-10-13 17:00:57 +04:00
[in,range(0,1000)] uint32 num_names,
2005-07-08 12:09:02 +04:00
[in,size_is(1000),length_is(num_names)] lsa_String names[],
2008-11-05 16:28:17 +03:00
[out,ref] samr_Ids *rids,
[out,ref] samr_Ids *types
2003-11-20 06:09:19 +03:00
);
2003-11-15 09:00:21 +03:00
2003-11-20 06:18:07 +03:00
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x12 */
2003-11-20 06:18:07 +03:00
NTSTATUS samr_LookupRids(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2004-10-13 17:00:57 +04:00
[in,range(0,1000)] uint32 num_rids,
2005-03-05 21:34:18 +03:00
[in,size_is(1000),length_is(num_rids)] uint32 rids[],
2008-11-05 04:12:38 +03:00
[out,ref] lsa_Strings *names,
[out,ref] samr_Ids *types
2003-11-20 06:18:07 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x13 */
2003-11-15 15:14:22 +03:00
NTSTATUS samr_OpenGroup(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2007-08-29 16:22:15 +04:00
[in] samr_GroupAccessMask access_mask,
2003-11-15 15:14:22 +03:00
[in] uint32 rid,
2004-09-21 07:51:38 +04:00
[out,ref] policy_handle *group_handle
2003-11-15 15:14:22 +03:00
);
2003-11-15 09:00:21 +03:00
2005-06-29 17:55:09 +04:00
/* Group attributes */
2006-02-22 17:05:49 +03:00
typedef [public,bitmap32bit] bitmap {
SE_GROUP_MANDATORY = 0x00000001,
SE_GROUP_ENABLED_BY_DEFAULT = 0x00000002,
SE_GROUP_ENABLED = 0x00000004,
SE_GROUP_OWNER = 0x00000008,
SE_GROUP_USE_FOR_DENY_ONLY = 0x00000010,
SE_GROUP_RESOURCE = 0x20000000,
SE_GROUP_LOGON_ID = 0xC0000000
} samr_GroupAttrs;
2003-11-15 15:38:06 +03:00
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x14 */
2003-11-15 15:14:22 +03:00
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String name;
2006-02-22 17:05:49 +03:00
samr_GroupAttrs attributes;
2003-11-15 15:38:06 +03:00
uint32 num_members;
2005-07-08 12:09:02 +04:00
lsa_String description;
2003-11-15 15:14:22 +03:00
} samr_GroupInfoAll;
typedef struct {
2006-07-03 08:00:10 +04:00
samr_GroupAttrs attributes;
} samr_GroupInfoAttributes;
2003-11-15 15:14:22 +03:00
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String description;
2006-02-22 17:07:04 +03:00
} samr_GroupInfoDescription;
2003-11-15 15:14:22 +03:00
2003-11-23 01:53:08 +03:00
typedef enum {
2005-01-29 05:46:37 +03:00
GROUPINFOALL = 1,
GROUPINFONAME = 2,
2006-07-03 08:00:10 +04:00
GROUPINFOATTRIBUTES = 3,
2005-01-29 05:46:37 +03:00
GROUPINFODESCRIPTION = 4,
GROUPINFOALL2 = 5
} samr_GroupInfoEnum;
2003-11-23 01:53:08 +03:00
2005-03-06 20:02:14 +03:00
typedef [switch_type(samr_GroupInfoEnum)] union {
2006-07-03 08:00:10 +04:00
[case(GROUPINFOALL)] samr_GroupInfoAll all;
[case(GROUPINFONAME)] lsa_String name;
[case(GROUPINFOATTRIBUTES)] samr_GroupInfoAttributes attributes;
[case(GROUPINFODESCRIPTION)] lsa_String description;
[case(GROUPINFOALL2)] samr_GroupInfoAll all2;
2003-11-15 15:14:22 +03:00
} samr_GroupInfo;
NTSTATUS samr_QueryGroupInfo(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *group_handle,
2005-01-29 05:46:37 +03:00
[in] samr_GroupInfoEnum level,
2008-11-10 16:15:33 +03:00
[out,ref,switch_is(level)] samr_GroupInfo **info
2003-11-15 15:14:22 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x15 */
2004-04-17 10:19:51 +04:00
NTSTATUS samr_SetGroupInfo(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *group_handle,
2005-01-29 05:46:37 +03:00
[in] samr_GroupInfoEnum level,
2004-04-17 10:19:51 +04:00
[in,switch_is(level),ref] samr_GroupInfo *info
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x16 */
2004-04-17 10:40:50 +04:00
NTSTATUS samr_AddGroupMember(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *group_handle,
2004-04-17 10:40:50 +04:00
[in] uint32 rid,
[in] uint32 flags
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x17 */
2004-04-17 09:54:55 +04:00
NTSTATUS samr_DeleteDomainGroup(
2004-09-21 07:51:38 +04:00
[in,out,ref] policy_handle *group_handle
2004-04-17 09:54:55 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x18 */
2004-04-17 10:49:26 +04:00
NTSTATUS samr_DeleteGroupMember(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *group_handle,
2004-04-17 10:49:26 +04:00
[in] uint32 rid
);
2003-11-15 09:00:21 +03:00
2004-04-23 08:21:22 +04:00
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x19 */
2004-04-23 08:21:22 +04:00
typedef struct {
uint32 count;
2005-05-27 19:49:15 +04:00
[size_is(count)] uint32 *rids;
2010-10-07 15:01:29 +04:00
[size_is(count)] samr_GroupAttrs *attributes;
} samr_RidAttrArray;
2004-04-23 08:21:22 +04:00
NTSTATUS samr_QueryGroupMember(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *group_handle,
2010-10-07 15:01:29 +04:00
[out,ref] samr_RidAttrArray **rids
2004-04-23 08:21:22 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x1a */
2004-04-23 08:21:22 +04:00
/*
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(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *group_handle,
2004-04-23 08:21:22 +04:00
[in] uint32 unknown1,
[in] uint32 unknown2
);
2003-11-15 09:00:21 +03:00
2003-11-15 15:38:06 +03:00
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x1b */
2003-11-15 15:38:06 +03:00
NTSTATUS samr_OpenAlias (
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2007-08-29 15:54:23 +04:00
[in] samr_AliasAccessMask access_mask,
2003-11-15 15:38:06 +03:00
[in] uint32 rid,
2004-09-21 07:51:38 +04:00
[out,ref] policy_handle *alias_handle
2003-11-15 15:38:06 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x1c */
2003-11-15 15:38:06 +03:00
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String name;
2003-11-15 15:38:06 +03:00
uint32 num_members;
2005-07-08 12:09:02 +04:00
lsa_String description;
2003-11-15 15:38:06 +03:00
} samr_AliasInfoAll;
2004-12-27 14:27:30 +03:00
typedef enum {
2005-01-29 05:46:37 +03:00
ALIASINFOALL = 1,
ALIASINFONAME = 2,
ALIASINFODESCRIPTION = 3
} samr_AliasInfoEnum;
2004-12-27 14:27:30 +03:00
2005-03-06 20:02:14 +03:00
typedef [switch_type(samr_AliasInfoEnum)] union {
2005-01-29 05:46:37 +03:00
[case(ALIASINFOALL)] samr_AliasInfoAll all;
2005-07-08 12:09:02 +04:00
[case(ALIASINFONAME)] lsa_String name;
[case(ALIASINFODESCRIPTION)] lsa_String description;
2003-11-15 15:38:06 +03:00
} samr_AliasInfo;
NTSTATUS samr_QueryAliasInfo(
2005-01-05 03:41:49 +03:00
[in,ref] policy_handle *alias_handle,
2005-01-29 05:46:37 +03:00
[in] samr_AliasInfoEnum level,
2008-11-10 16:09:06 +03:00
[out,ref,switch_is(level)] samr_AliasInfo **info
2003-11-15 15:38:06 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x1d */
2003-12-19 06:59:27 +03:00
NTSTATUS samr_SetAliasInfo(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *alias_handle,
2005-01-29 05:46:37 +03:00
[in] samr_AliasInfoEnum level,
2005-01-05 03:41:49 +03:00
[in,switch_is(level),ref] samr_AliasInfo *info
2003-12-19 06:59:27 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x1e */
2003-12-19 06:59:27 +03:00
NTSTATUS samr_DeleteDomAlias(
2004-09-21 07:51:38 +04:00
[in,out,ref] policy_handle *alias_handle
2003-12-19 06:59:27 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x1f */
2004-04-23 08:21:22 +04:00
NTSTATUS samr_AddAliasMember(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *alias_handle,
2003-12-19 06:59:27 +03:00
[in,ref] dom_sid2 *sid
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x20 */
2004-04-23 08:21:22 +04:00
NTSTATUS samr_DeleteAliasMember(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *alias_handle,
2003-12-19 06:59:27 +03:00
[in,ref] dom_sid2 *sid
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x21 */
2003-12-19 06:59:27 +03:00
NTSTATUS samr_GetMembersInAlias(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *alias_handle,
2003-12-19 06:59:27 +03:00
[out,ref] lsa_SidArray *sids
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x22 */
2007-03-02 21:01:43 +03:00
[public] NTSTATUS samr_OpenUser(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2007-08-29 16:51:46 +04:00
[in] samr_UserAccessMask access_mask,
2003-11-15 13:03:12 +03:00
[in] uint32 rid,
2004-09-21 07:51:38 +04:00
[out,ref] policy_handle *user_handle
2003-11-15 13:03:12 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x23 */
2003-11-18 11:03:06 +03:00
NTSTATUS samr_DeleteUser(
2004-09-21 07:51:38 +04:00
[in,out,ref] policy_handle *user_handle
2003-11-18 11:03:06 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x24 */
2009-06-23 12:55:05 +04:00
typedef enum {
UserGeneralInformation = 1,
UserPreferencesInformation = 2,
UserLogonInformation = 3,
UserLogonHoursInformation = 4,
UserAccountInformation = 5,
UserNameInformation = 6,
UserAccountNameInformation = 7,
UserFullNameInformation = 8,
UserPrimaryGroupInformation = 9,
UserHomeInformation = 10,
UserScriptInformation = 11,
UserProfileInformation = 12,
UserAdminCommentInformation = 13,
UserWorkStationsInformation = 14,
UserControlInformation = 16,
UserExpiresInformation = 17,
UserInternal1Information = 18,
UserParametersInformation = 20,
UserAllInformation = 21,
UserInternal4Information = 23,
UserInternal5Information = 24,
UserInternal4InformationNew = 25,
UserInternal5InformationNew = 26
} samr_UserInfoLevel;
2003-11-15 13:03:12 +03:00
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String account_name;
lsa_String full_name;
2003-11-20 13:53:08 +03:00
uint32 primary_gid;
2005-07-08 12:09:02 +04:00
lsa_String description;
lsa_String comment;
2003-11-15 13:03:12 +03:00
} samr_UserInfo1;
2003-11-15 13:58:29 +03:00
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String comment;
2010-07-05 00:34:43 +04:00
lsa_String reserved; /* settable, but doesn't stick. probably obsolete */
2003-11-15 13:58:29 +03:00
uint16 country_code;
uint16 code_page;
} samr_UserInfo2;
2004-11-02 05:57:18 +03:00
/* this is also used in samr and netlogon */
typedef [public, flag(NDR_PAHEX)] struct {
uint16 units_per_week;
2005-05-27 19:49:15 +04:00
[size_is(1260), length_is(units_per_week/8)] uint8 *bits;
2004-11-02 05:57:18 +03:00
} samr_LogonHours;
2003-11-15 13:58:29 +03:00
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String account_name;
lsa_String full_name;
2004-05-09 13:39:47 +04:00
uint32 rid;
2003-11-20 13:53:08 +03:00
uint32 primary_gid;
2005-07-08 12:09:02 +04:00
lsa_String home_directory;
lsa_String home_drive;
lsa_String logon_script;
lsa_String profile_path;
lsa_String workstations;
2003-11-15 13:58:29 +03:00
NTTIME last_logon;
NTTIME last_logoff;
2004-06-05 07:22:10 +04:00
NTTIME last_password_change;
NTTIME allow_password_change;
NTTIME force_password_change;
2003-12-02 06:06:21 +03:00
samr_LogonHours logon_hours;
2004-06-05 07:22:10 +04:00
uint16 bad_password_count;
2004-11-13 16:45:41 +03:00
uint16 logon_count;
2005-01-05 19:54:51 +03:00
samr_AcctFlags acct_flags;
2003-11-15 13:58:29 +03:00
} samr_UserInfo3;
2003-11-15 14:13:49 +03:00
typedef struct {
2003-12-02 06:06:21 +03:00
samr_LogonHours logon_hours;
2003-11-15 14:13:49 +03:00
} samr_UserInfo4;
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String account_name;
lsa_String full_name;
2003-11-15 14:13:49 +03:00
uint32 rid;
2003-11-20 13:53:08 +03:00
uint32 primary_gid;
2005-07-08 12:09:02 +04:00
lsa_String home_directory;
lsa_String home_drive;
lsa_String logon_script;
lsa_String profile_path;
lsa_String description;
lsa_String workstations;
2003-11-15 14:13:49 +03:00
NTTIME last_logon;
NTTIME last_logoff;
2003-12-02 06:06:21 +03:00
samr_LogonHours logon_hours;
2004-06-05 07:22:10 +04:00
uint16 bad_password_count;
2004-11-13 16:45:41 +03:00
uint16 logon_count;
2004-06-05 07:22:10 +04:00
NTTIME last_password_change;
2003-11-15 14:13:49 +03:00
NTTIME acct_expiry;
2005-01-05 19:54:51 +03:00
samr_AcctFlags acct_flags;
2003-11-15 14:13:49 +03:00
} samr_UserInfo5;
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String account_name;
lsa_String full_name;
2003-11-15 14:13:49 +03:00
} samr_UserInfo6;
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String account_name;
2003-11-15 14:13:49 +03:00
} samr_UserInfo7;
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String full_name;
2003-11-15 14:13:49 +03:00
} samr_UserInfo8;
typedef struct {
2003-11-20 13:53:08 +03:00
uint32 primary_gid;
2003-11-15 14:13:49 +03:00
} samr_UserInfo9;
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String home_directory;
lsa_String home_drive;
2003-11-15 14:13:49 +03:00
} samr_UserInfo10;
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String logon_script;
2003-11-15 14:13:49 +03:00
} samr_UserInfo11;
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String profile_path;
2003-11-15 14:13:49 +03:00
} samr_UserInfo12;
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String description;
2003-11-15 14:13:49 +03:00
} samr_UserInfo13;
typedef struct {
2005-07-08 12:09:02 +04:00
lsa_String workstations;
2003-11-15 14:13:49 +03:00
} samr_UserInfo14;
typedef struct {
2005-01-05 19:54:51 +03:00
samr_AcctFlags acct_flags;
2003-11-15 14:13:49 +03:00
} samr_UserInfo16;
2008-11-10 17:53:19 +03:00
2003-11-15 14:13:49 +03:00
typedef struct {
NTTIME acct_expiry;
} samr_UserInfo17;
2008-10-15 19:42:33 +04:00
typedef [public, flag(NDR_PAHEX)] struct {
uint8 hash[16];
} samr_Password;
typedef struct {
samr_Password nt_pwd;
2008-12-05 14:40:19 +03:00
samr_Password lm_pwd;
2008-10-15 19:42:33 +04:00
boolean8 nt_pwd_active;
2008-12-05 14:40:19 +03:00
boolean8 lm_pwd_active;
2008-12-04 20:19:29 +03:00
uint8 password_expired;
2008-10-15 19:42:33 +04:00
} samr_UserInfo18;
2003-11-15 14:13:49 +03:00
typedef struct {
2008-11-07 17:04:46 +03:00
lsa_BinaryString parameters;
2003-11-15 14:13:49 +03:00
} samr_UserInfo20;
2004-04-30 07:57:48 +04:00
/* this defines the bits used for fields_present in info21 */
2005-01-26 07:34:16 +03:00
typedef [bitmap32bit] bitmap {
2007-06-28 22:08:04 +04:00
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,
2008-12-04 20:12:45 +03:00
SAMR_FIELD_NT_PASSWORD_PRESENT = 0x01000000, /* either of these */
SAMR_FIELD_LM_PASSWORD_PRESENT = 0x02000000, /* two bits seems to work */
2007-06-28 22:08:04 +04:00
SAMR_FIELD_PRIVATE_DATA = 0x04000000,
SAMR_FIELD_EXPIRED_FLAG = 0x08000000,
SAMR_FIELD_SEC_DESC = 0x10000000,
SAMR_FIELD_OWF_PWD = 0x20000000
2005-01-05 19:54:51 +03:00
} samr_FieldsPresent;
2004-04-30 07:57:48 +04:00
2008-10-15 19:42:33 +04:00
/* used for 'password_expired' in samr_UserInfo21 */
const int PASS_MUST_CHANGE_AT_NEXT_LOGON = 0x01;
const int PASS_DONT_CHANGE_AT_NEXT_LOGON = 0x00;
2003-11-15 14:34:01 +03:00
typedef struct {
NTTIME last_logon;
NTTIME last_logoff;
2004-06-05 07:22:10 +04:00
NTTIME last_password_change;
2003-11-15 14:34:01 +03:00
NTTIME acct_expiry;
2004-06-05 07:22:10 +04:00
NTTIME allow_password_change;
NTTIME force_password_change;
2005-07-08 12:09:02 +04:00
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;
2008-11-07 17:04:46 +03:00
lsa_BinaryString parameters;
2008-12-04 15:09:38 +03:00
lsa_BinaryString lm_owf_password;
lsa_BinaryString nt_owf_password;
2010-07-05 00:34:43 +04:00
lsa_String private_data;
2003-11-15 14:34:01 +03:00
uint32 buf_count;
2005-05-27 19:49:15 +04:00
[size_is(buf_count)] uint8 *buffer;
2003-11-15 14:34:01 +03:00
uint32 rid;
2003-11-20 13:53:08 +03:00
uint32 primary_gid;
2005-01-05 19:54:51 +03:00
samr_AcctFlags acct_flags;
samr_FieldsPresent fields_present;
2003-12-02 06:06:21 +03:00
samr_LogonHours logon_hours;
2004-06-05 07:22:10 +04:00
uint16 bad_password_count;
2004-11-13 16:45:41 +03:00
uint16 logon_count;
2003-11-15 14:34:01 +03:00
uint16 country_code;
uint16 code_page;
2004-06-05 07:22:10 +04:00
uint8 lm_password_set;
2008-11-29 02:29:47 +03:00
uint8 nt_password_set;
2004-11-13 16:45:41 +03:00
uint8 password_expired;
2010-07-05 00:34:43 +04:00
uint8 private_data_sensitive;
2003-11-15 14:34:01 +03:00
} samr_UserInfo21;
2005-01-12 10:22:34 +03:00
typedef [public, flag(NDR_PAHEX)] struct {
2004-04-21 09:01:31 +04:00
uint8 data[516];
} samr_CryptPassword;
2004-04-28 17:13:26 +04:00
typedef struct {
samr_UserInfo21 info;
samr_CryptPassword password;
} samr_UserInfo23;
2004-04-21 09:01:31 +04:00
typedef struct {
samr_CryptPassword password;
2008-11-24 18:31:49 +03:00
uint8 password_expired;
2004-04-21 09:01:31 +04:00
} samr_UserInfo24;
2004-04-30 07:57:48 +04:00
typedef [flag(NDR_PAHEX)] struct {
2004-04-28 17:13:26 +04:00
uint8 data[532];
} samr_CryptPasswordEx;
typedef struct {
samr_UserInfo21 info;
samr_CryptPasswordEx password;
} samr_UserInfo25;
typedef struct {
samr_CryptPasswordEx password;
2008-11-24 18:31:49 +03:00
uint8 password_expired;
2004-04-28 17:13:26 +04:00
} samr_UserInfo26;
2005-03-06 20:02:14 +03:00
typedef [switch_type(uint16)] union {
2003-11-20 03:57:59 +03:00
[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;
2008-10-15 19:42:33 +04:00
[case(18)] samr_UserInfo18 info18;
2003-11-20 03:57:59 +03:00
[case(20)] samr_UserInfo20 info20;
[case(21)] samr_UserInfo21 info21;
2004-04-28 17:13:26 +04:00
[case(23)] samr_UserInfo23 info23;
2004-04-21 09:01:31 +04:00
[case(24)] samr_UserInfo24 info24;
2004-04-28 17:13:26 +04:00
[case(25)] samr_UserInfo25 info25;
[case(26)] samr_UserInfo26 info26;
2003-11-15 13:03:12 +03:00
} samr_UserInfo;
2007-03-02 22:13:58 +03:00
[public] NTSTATUS samr_QueryUserInfo(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *user_handle,
2009-06-23 12:55:05 +04:00
[in] samr_UserInfoLevel level,
2008-11-10 16:42:27 +03:00
[out,ref,switch_is(level)] samr_UserInfo **info
2003-11-15 13:03:12 +03:00
);
2003-11-15 09:00:21 +03:00
2003-11-20 10:20:59 +03:00
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x25 */
2007-03-02 22:13:58 +03:00
[public] NTSTATUS samr_SetUserInfo(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *user_handle,
2009-06-23 12:55:05 +04:00
[in] samr_UserInfoLevel level,
2003-11-20 10:20:59 +03:00
[in,ref,switch_is(level)] samr_UserInfo *info
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x26 */
2004-04-18 08:06:15 +04:00
/*
2004-04-26 07:07:46 +04:00
this is a password change interface that doesn't give
the server the plaintext password. Depricated.
2004-04-18 08:06:15 +04:00
*/
NTSTATUS samr_ChangePasswordUser(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *user_handle,
2006-05-17 03:51:01 +04:00
[in] boolean8 lm_present,
2008-02-02 00:11:43 +03:00
[in,unique] samr_Password *old_lm_crypted,
[in,unique] samr_Password *new_lm_crypted,
2006-05-17 03:51:01 +04:00
[in] boolean8 nt_present,
2008-02-02 00:11:43 +03:00
[in,unique] samr_Password *old_nt_crypted,
[in,unique] samr_Password *new_nt_crypted,
2006-05-17 03:51:01 +04:00
[in] boolean8 cross1_present,
2008-02-02 00:11:43 +03:00
[in,unique] samr_Password *nt_cross,
2006-05-17 03:51:01 +04:00
[in] boolean8 cross2_present,
2008-02-02 00:11:43 +03:00
[in,unique] samr_Password *lm_cross
2004-04-18 08:06:15 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x27 */
2003-12-19 06:59:27 +03:00
2005-05-01 12:05:17 +04:00
typedef [public] struct {
2003-12-19 06:59:27 +03:00
uint32 rid;
2006-02-22 17:05:49 +03:00
samr_GroupAttrs attributes;
2005-06-29 17:55:09 +04:00
} samr_RidWithAttribute;
2003-12-19 06:59:27 +03:00
2005-05-01 12:05:17 +04:00
typedef [public] struct {
2003-12-19 06:59:27 +03:00
uint32 count;
2005-06-29 17:55:09 +04:00
[size_is(count)] samr_RidWithAttribute *rids;
} samr_RidWithAttributeArray;
2003-12-19 06:59:27 +03:00
NTSTATUS samr_GetGroupsForUser(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *user_handle,
2008-11-05 12:58:35 +03:00
[out,ref] samr_RidWithAttributeArray **rids
2003-12-19 06:59:27 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x28 */
2003-11-20 15:10:41 +03:00
typedef struct {
uint32 idx;
uint32 rid;
2005-01-05 19:54:51 +03:00
samr_AcctFlags acct_flags;
2005-07-08 12:09:02 +04:00
lsa_String account_name;
lsa_String description;
2007-07-26 07:50:24 +04:00
lsa_String full_name;
2003-11-21 05:19:47 +03:00
} samr_DispEntryGeneral;
typedef struct {
uint32 count;
2005-05-27 19:49:15 +04:00
[size_is(count)] samr_DispEntryGeneral *entries;
2003-11-21 05:19:47 +03:00
} samr_DispInfoGeneral;
typedef struct {
uint32 idx;
uint32 rid;
2005-01-05 19:54:51 +03:00
samr_AcctFlags acct_flags;
2005-07-08 12:09:02 +04:00
lsa_String account_name;
lsa_String description;
2003-11-21 05:19:47 +03:00
} samr_DispEntryFull;
typedef struct {
uint32 count;
2005-05-27 19:49:15 +04:00
[size_is(count)] samr_DispEntryFull *entries;
2003-11-21 05:19:47 +03:00
} samr_DispInfoFull;
2006-09-19 00:56:54 +04:00
typedef struct {
uint32 idx;
uint32 rid;
samr_GroupAttrs acct_flags;
lsa_String account_name;
lsa_String description;
} samr_DispEntryFullGroup;
typedef struct {
uint32 count;
[size_is(count)] samr_DispEntryFullGroup *entries;
} samr_DispInfoFullGroups;
2003-11-21 05:19:47 +03:00
typedef struct {
uint32 idx;
2008-02-15 16:56:35 +03:00
lsa_AsciiStringLarge account_name;
2003-11-21 05:19:47 +03:00
} samr_DispEntryAscii;
2003-11-20 15:10:41 +03:00
typedef struct {
uint32 count;
2005-05-27 19:49:15 +04:00
[size_is(count)] samr_DispEntryAscii *entries;
2003-11-21 05:19:47 +03:00
} samr_DispInfoAscii;
2003-11-20 15:10:41 +03:00
2005-03-06 20:02:14 +03:00
typedef [switch_type(uint16)] union {
2003-11-21 05:19:47 +03:00
[case(1)] samr_DispInfoGeneral info1;/* users */
[case(2)] samr_DispInfoFull info2; /* trust accounts? */
2006-09-19 00:56:54 +04:00
[case(3)] samr_DispInfoFullGroups info3; /* groups */
2003-11-21 05:19:47 +03:00
[case(4)] samr_DispInfoAscii info4; /* users */
[case(5)] samr_DispInfoAscii info5; /* groups */
2003-11-20 15:10:41 +03:00
} samr_DispInfo;
NTSTATUS samr_QueryDisplayInfo(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2003-11-20 15:10:41 +03:00
[in] uint16 level,
[in] uint32 start_idx,
[in] uint32 max_entries,
[in] uint32 buf_size,
2008-11-05 14:32:24 +03:00
[out,ref] uint32 *total_size,
[out,ref] uint32 *returned_size,
[out,ref,switch_is(level)] samr_DispInfo *info
2003-11-20 15:10:41 +03:00
);
2003-11-15 09:00:21 +03:00
2004-04-18 08:06:15 +04:00
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x29 */
2004-04-18 08:06:15 +04:00
/*
this seems to be an alphabetic search function. The returned index
is the index for samr_QueryDisplayInfo needed to get names occurring
after the specified name. The supplied name does not need to exist
2008-11-10 17:53:19 +03:00
in the database (for example you can supply just a first letter for
2004-04-18 08:06:15 +04:00
searching starting at that letter)
The level corresponds to the samr_QueryDisplayInfo level
*/
NTSTATUS samr_GetDisplayEnumerationIndex(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2004-04-18 08:06:15 +04:00
[in] uint16 level,
2008-11-04 21:46:24 +03:00
[in,ref] lsa_String *name,
[out,ref] uint32 *idx
2004-04-18 08:06:15 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x2a */
2004-04-18 08:06:15 +04:00
/*
2004-04-22 11:28:18 +04:00
w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this
2004-04-18 08:06:15 +04:00
*/
NTSTATUS samr_TestPrivateFunctionsDomain(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle
2004-04-18 08:06:15 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x2b */
2004-04-18 08:06:15 +04:00
/*
2004-04-22 11:28:18 +04:00
w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this
2004-04-18 08:06:15 +04:00
*/
NTSTATUS samr_TestPrivateFunctionsUser(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *user_handle
2004-04-18 08:06:15 +04:00
);
2003-11-15 09:00:21 +03:00
2003-11-21 16:14:17 +03:00
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x2c */
2003-11-21 16:14:17 +03:00
typedef struct {
2004-11-17 14:56:13 +03:00
uint16 min_password_length;
2006-02-22 16:56:46 +03:00
samr_PasswordProperties password_properties;
2003-11-21 16:14:17 +03:00
} samr_PwInfo;
2007-03-02 22:13:58 +03:00
[public] NTSTATUS samr_GetUserPwInfo(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *user_handle,
2008-11-05 03:28:49 +03:00
[out,ref] samr_PwInfo *info
2003-11-21 16:14:17 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x2d */
2004-04-18 08:06:15 +04:00
NTSTATUS samr_RemoveMemberFromForeignDomain(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2004-04-18 08:06:15 +04:00
[in,ref] dom_sid2 *sid
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x2e */
2004-04-18 08:32:04 +04:00
/*
how is this different from QueryDomainInfo ??
*/
NTSTATUS samr_QueryDomainInfo2(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2009-06-23 12:55:05 +04:00
[in] samr_DomainInfoClass level,
2008-11-05 05:02:37 +03:00
[out,ref,switch_is(level)] samr_DomainInfo **info
2004-04-18 08:32:04 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x2f */
2004-04-18 08:32:04 +04:00
/*
how is this different from QueryUserInfo ??
*/
NTSTATUS samr_QueryUserInfo2(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *user_handle,
2009-06-23 12:55:05 +04:00
[in] samr_UserInfoLevel level,
2008-11-10 16:42:27 +03:00
[out,ref,switch_is(level)] samr_UserInfo **info
2004-04-18 08:32:04 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x30 */
2004-04-18 08:32:04 +04:00
/*
how is this different from QueryDisplayInfo??
*/
NTSTATUS samr_QueryDisplayInfo2(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2004-04-18 08:32:04 +04:00
[in] uint16 level,
[in] uint32 start_idx,
[in] uint32 max_entries,
[in] uint32 buf_size,
2008-11-05 13:17:22 +03:00
[out,ref] uint32 *total_size,
[out,ref] uint32 *returned_size,
[out,ref,switch_is(level)] samr_DispInfo *info
2004-04-18 08:32:04 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x31 */
2004-04-18 08:32:04 +04:00
/*
how is this different from GetDisplayEnumerationIndex ??
*/
NTSTATUS samr_GetDisplayEnumerationIndex2(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2004-04-18 08:32:04 +04:00
[in] uint16 level,
2008-11-04 21:46:43 +03:00
[in,ref] lsa_String *name,
[out,ref] uint32 *idx
2004-04-18 08:32:04 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x32 */
2003-12-03 06:10:10 +03:00
NTSTATUS samr_CreateUser2(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2005-07-08 12:09:02 +04:00
[in,ref] lsa_String *account_name,
2005-01-05 19:54:51 +03:00
[in] samr_AcctFlags acct_flags,
2007-08-29 16:51:46 +04:00
[in] samr_UserAccessMask access_mask,
2004-09-21 07:51:38 +04:00
[out,ref] policy_handle *user_handle,
2003-12-03 06:10:10 +03:00
[out,ref] uint32 *access_granted,
[out,ref] uint32 *rid
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x33 */
2004-04-19 09:48:03 +04:00
/*
another duplicate. There must be a reason ....
*/
NTSTATUS samr_QueryDisplayInfo3(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2004-04-19 09:48:03 +04:00
[in] uint16 level,
[in] uint32 start_idx,
[in] uint32 max_entries,
[in] uint32 buf_size,
2008-11-05 13:15:08 +03:00
[out,ref] uint32 *total_size,
[out,ref] uint32 *returned_size,
[out,ref,switch_is(level)] samr_DispInfo *info
2004-04-19 09:48:03 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x34 */
2004-04-19 09:48:03 +04:00
NTSTATUS samr_AddMultipleMembersToAlias(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *alias_handle,
2004-04-19 09:48:03 +04:00
[in,ref] lsa_SidArray *sids
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x35 */
2004-04-19 09:48:03 +04:00
NTSTATUS samr_RemoveMultipleMembersFromAlias(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *alias_handle,
2004-04-19 09:48:03 +04:00
[in,ref] lsa_SidArray *sids
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x36 */
2004-04-19 09:48:03 +04:00
NTSTATUS samr_OemChangePasswordUser2(
2008-02-02 00:11:43 +03:00
[in,unique] lsa_AsciiString *server,
2005-07-08 12:09:02 +04:00
[in,ref] lsa_AsciiString *account,
2008-02-02 00:11:43 +03:00
[in,unique] samr_CryptPassword *password,
[in,unique] samr_Password *hash
2004-04-19 09:48:03 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x37 */
2004-04-19 09:48:03 +04:00
NTSTATUS samr_ChangePasswordUser2(
2008-02-02 00:11:43 +03:00
[in,unique] lsa_String *server,
2005-07-08 12:09:02 +04:00
[in,ref] lsa_String *account,
2008-02-02 00:11:43 +03:00
[in,unique] samr_CryptPassword *nt_password,
[in,unique] samr_Password *nt_verifier,
2006-05-17 03:51:01 +04:00
[in] boolean8 lm_change,
2008-02-02 00:11:43 +03:00
[in,unique] samr_CryptPassword *lm_password,
[in,unique] samr_Password *lm_verifier
2004-04-19 09:48:03 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x38 */
2004-04-21 10:23:29 +04:00
NTSTATUS samr_GetDomPwInfo(
2008-02-02 00:11:43 +03:00
[in,unique] lsa_String *domain_name,
2008-11-05 03:34:55 +03:00
[out,ref] samr_PwInfo *info
2004-04-21 10:23:29 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x39 */
2003-11-24 00:51:24 +03:00
NTSTATUS samr_Connect2(
2008-02-02 00:11:43 +03:00
[in,unique,string,charset(UTF16)] uint16 *system_name,
2007-08-29 15:04:49 +04:00
[in] samr_ConnectAccessMask access_mask,
2004-09-21 07:51:38 +04:00
[out,ref] policy_handle *connect_handle
2003-11-24 00:51:24 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x3a */
2004-04-21 10:23:29 +04:00
/*
2008-11-10 17:53:19 +03:00
seems to be an exact alias for samr_SetUserInfo()
2004-04-21 10:23:29 +04:00
*/
2007-03-02 22:13:58 +03:00
[public] NTSTATUS samr_SetUserInfo2(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *user_handle,
2009-06-23 12:55:05 +04:00
[in] samr_UserInfoLevel level,
2004-04-21 10:23:29 +04:00
[in,ref,switch_is(level)] samr_UserInfo *info
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x3b */
2004-04-21 10:23:29 +04:00
/*
this one is mysterious. I have a few guesses, but nothing working yet
*/
NTSTATUS samr_SetBootKeyInformation(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *connect_handle,
2004-04-21 10:23:29 +04:00
[in] uint32 unknown1,
[in] uint32 unknown2,
[in] uint32 unknown3
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x3c */
2004-04-21 10:23:29 +04:00
NTSTATUS samr_GetBootKeyInformation(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2008-11-05 03:39:39 +03:00
[out,ref] uint32 *unknown
2004-04-21 10:23:29 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x3d */
2004-04-21 10:23:29 +04:00
NTSTATUS samr_Connect3(
2008-02-02 00:11:43 +03:00
[in,unique,string,charset(UTF16)] uint16 *system_name,
2004-04-26 07:52:44 +04:00
/* this unknown value seems to be completely ignored by w2k3 */
2004-04-21 10:23:29 +04:00
[in] uint32 unknown,
2007-08-29 15:04:49 +04:00
[in] samr_ConnectAccessMask access_mask,
2004-09-21 07:51:38 +04:00
[out,ref] policy_handle *connect_handle
2004-04-21 10:23:29 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x3e */
2008-10-15 19:42:33 +04:00
2009-04-29 03:55:09 +04:00
typedef [v1_enum] enum {
2008-10-15 19:42:33 +04:00
SAMR_CONNECT_PRE_W2K = 1,
SAMR_CONNECT_W2K = 2,
SAMR_CONNECT_AFTER_W2K = 3
} samr_ConnectVersion;
2003-11-15 10:51:19 +03:00
NTSTATUS samr_Connect4(
2008-02-02 00:11:43 +03:00
[in,unique,string,charset(UTF16)] uint16 *system_name,
2008-10-15 19:42:33 +04:00
[in] samr_ConnectVersion client_version,
2007-08-29 15:04:49 +04:00
[in] samr_ConnectAccessMask access_mask,
2004-09-21 07:51:38 +04:00
[out,ref] policy_handle *connect_handle
2003-11-15 09:00:21 +03:00
);
/************************/
/* Function 0x3f */
2004-05-04 17:42:32 +04:00
2009-09-26 00:41:14 +04:00
typedef [public,v1_enum] enum {
SAM_PWD_CHANGE_NO_ERROR = 0,
SAM_PWD_CHANGE_PASSWORD_TOO_SHORT = 1,
SAM_PWD_CHANGE_PWD_IN_HISTORY = 2,
SAM_PWD_CHANGE_USERNAME_IN_PASSWORD = 3,
SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD = 4,
SAM_PWD_CHANGE_NOT_COMPLEX = 5,
SAM_PWD_CHANGE_MACHINE_NOT_DEFAULT = 6,
SAM_PWD_CHANGE_FAILED_BY_FILTER = 7,
SAM_PWD_CHANGE_PASSWORD_TOO_LONG = 8
} samPwdChangeReason;
2004-05-25 17:57:39 +04:00
2004-05-04 17:42:32 +04:00
typedef struct {
2009-09-26 00:41:14 +04:00
samPwdChangeReason extendedFailureReason;
[string,charset(UTF16)] uint16 *filterModuleName;
} userPwdChangeFailureInformation;
2004-05-04 17:42:32 +04:00
2011-01-31 16:19:25 +03:00
[public] NTSTATUS samr_ChangePasswordUser3(
2008-02-02 00:11:43 +03:00
[in,unique] lsa_String *server,
2005-07-08 12:09:02 +04:00
[in,ref] lsa_String *account,
2008-02-02 00:11:43 +03:00
[in,unique] samr_CryptPassword *nt_password,
[in,unique] samr_Password *nt_verifier,
2006-05-17 03:51:01 +04:00
[in] boolean8 lm_change,
2008-02-02 00:11:43 +03:00
[in,unique] samr_CryptPassword *lm_password,
[in,unique] samr_Password *lm_verifier,
[in,unique] samr_CryptPassword *password3,
2008-11-04 21:40:24 +03:00
[out,ref] samr_DomInfo1 **dominfo,
2009-09-26 00:41:14 +04:00
[out,ref] userPwdChangeFailureInformation **reject
2004-04-22 10:19:48 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x40 */
2004-04-26 07:52:44 +04:00
typedef struct {
2008-10-15 19:42:33 +04:00
samr_ConnectVersion client_version; /* w2k3 gives 3 */
2004-04-26 07:52:44 +04:00
uint32 unknown2; /* w2k3 gives 0 */
} samr_ConnectInfo1;
typedef union {
[case(1)] samr_ConnectInfo1 info1;
} samr_ConnectInfo;
2007-03-02 21:01:43 +03:00
[public] NTSTATUS samr_Connect5(
2008-02-02 00:11:43 +03:00
[in,unique,string,charset(UTF16)] uint16 *system_name,
2007-08-29 15:04:49 +04:00
[in] samr_ConnectAccessMask access_mask,
2008-11-05 03:51:51 +03:00
[in] uint32 level_in,
[in,ref,switch_is(level_in)] samr_ConnectInfo *info_in,
[out,ref] uint32 *level_out,
[out,ref,switch_is(*level_out)] samr_ConnectInfo *info_out,
2004-09-21 07:51:38 +04:00
[out,ref] policy_handle *connect_handle
2003-12-19 06:59:27 +03:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x41 */
2004-04-21 09:01:31 +04:00
NTSTATUS samr_RidToSid(
2004-09-21 07:51:38 +04:00
[in,ref] policy_handle *domain_handle,
2004-04-21 09:01:31 +04:00
[in] uint32 rid,
2008-10-28 02:03:28 +03:00
[out,ref] dom_sid2 **sid
2004-04-21 09:01:31 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x42 */
2004-04-23 09:40:18 +04:00
/*
this should set the DSRM password for the server, which is used
when booting into Directory Services Recovery Mode on a DC. Win2003
gives me NT_STATUS_NOT_SUPPORTED
*/
NTSTATUS samr_SetDsrmPassword(
2008-02-02 00:11:43 +03:00
[in,unique] lsa_String *name,
2004-04-23 09:40:18 +04:00
[in] uint32 unknown,
2008-02-02 00:11:43 +03:00
[in,unique] samr_Password *hash
2004-04-23 09:40:18 +04:00
);
2003-11-15 09:00:21 +03:00
/************************/
/* Function 0x43 */
2007-12-07 13:36:32 +03:00
/************************/
typedef [bitmap32bit] bitmap {
SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET = 0x00000001,
SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME = 0x00000002,
SAMR_VALIDATE_FIELD_LOCKOUT_TIME = 0x00000004,
SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT = 0x00000008,
SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH = 0x00000010,
SAMR_VALIDATE_FIELD_PASSWORD_HISTORY = 0x00000020
} samr_ValidateFieldsPresent;
typedef enum {
NetValidateAuthentication = 1,
NetValidatePasswordChange= 2,
NetValidatePasswordReset = 3
} samr_ValidatePasswordLevel;
2007-12-07 13:45:17 +03:00
/* NetApi maps samr_ValidationStatus errors to WERRORs. Haven't
* identified the mapping of
* - NERR_PasswordFilterError
* - NERR_PasswordExpired and
* - NERR_PasswordCantChange
* yet - Guenther
*/
typedef enum {
SAMR_VALIDATION_STATUS_SUCCESS = 0,
SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE = 1,
SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT = 2,
2009-07-14 00:46:51 +04:00
SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED = 3,
2007-12-07 13:45:17 +03:00
SAMR_VALIDATION_STATUS_BAD_PASSWORD = 4,
SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT = 5,
SAMR_VALIDATION_STATUS_PWD_TOO_SHORT = 6,
SAMR_VALIDATION_STATUS_PWD_TOO_LONG = 7,
SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH = 8,
2009-07-14 00:46:51 +04:00
SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT = 9,
SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR = 10
2007-12-07 13:45:17 +03:00
} samr_ValidationStatus;
2007-12-07 13:36:32 +03:00
typedef struct {
uint32 length;
[size_is(length)] uint8 *data;
} samr_ValidationBlob;
typedef struct {
samr_ValidateFieldsPresent fields_present;
NTTIME_hyper last_password_change;
NTTIME_hyper bad_password_time;
NTTIME_hyper lockout_time;
uint32 bad_pwd_count;
uint32 pwd_history_len;
[size_is(pwd_history_len)] samr_ValidationBlob *pwd_history;
} samr_ValidatePasswordInfo;
typedef struct {
samr_ValidatePasswordInfo info;
2007-12-07 13:45:17 +03:00
samr_ValidationStatus status;
2007-12-07 13:36:32 +03:00
} samr_ValidatePasswordRepCtr;
typedef [switch_type(uint16)] union {
[case(1)] samr_ValidatePasswordRepCtr ctr1;
[case(2)] samr_ValidatePasswordRepCtr ctr2;
[case(3)] samr_ValidatePasswordRepCtr ctr3;
} samr_ValidatePasswordRep;
typedef struct {
samr_ValidatePasswordInfo info;
lsa_StringLarge password;
lsa_StringLarge account;
samr_ValidationBlob hash;
boolean8 pwd_must_change_at_next_logon;
boolean8 clear_lockout;
} samr_ValidatePasswordReq3;
typedef struct {
samr_ValidatePasswordInfo info;
lsa_StringLarge password;
lsa_StringLarge account;
samr_ValidationBlob hash;
boolean8 password_matched;
} samr_ValidatePasswordReq2;
typedef struct {
samr_ValidatePasswordInfo info;
boolean8 password_matched;
} samr_ValidatePasswordReq1;
typedef [switch_type(uint16)] union {
[case(1)] samr_ValidatePasswordReq1 req1;
[case(2)] samr_ValidatePasswordReq2 req2;
[case(3)] samr_ValidatePasswordReq3 req3;
} samr_ValidatePasswordReq;
NTSTATUS samr_ValidatePassword(
[in] samr_ValidatePasswordLevel level,
2008-11-05 04:04:39 +03:00
[in,switch_is(level)] samr_ValidatePasswordReq *req,
[out,ref,switch_is(level)] samr_ValidatePasswordRep **rep
2007-12-07 13:36:32 +03:00
);
2003-11-15 09:00:21 +03:00
}