2003-11-28 08:20:11 +03:00
/*
2003-12-01 04:41:38 +03:00
netlogon interface
much of this was derived from the ethereal sources - thanks to everyone
who contributed!
2003-11-28 08:20:11 +03:00
*/
2003-12-01 04:41:38 +03:00
#include "idl_types.h"
2003-11-28 08:20:11 +03:00
[
uuid(12345678-1234-abcd-ef00-01234567cffb),
2003-12-01 06:19:43 +03:00
version(1.0),
2004-05-28 17:23:30 +04:00
endpoints(netlogon,TCP-0),
2003-12-01 06:19:43 +03:00
pointer_default(unique)
2003-11-28 08:20:11 +03:00
]
2003-12-01 04:41:38 +03:00
2003-11-28 08:20:11 +03:00
interface netlogon
{
2003-12-01 06:19:43 +03:00
2003-11-28 08:20:11 +03:00
/*****************/
/* Function 0x00 */
2003-12-01 06:19:43 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 12:28:10 +03:00
unistr *account_name;
2003-12-01 04:41:38 +03:00
uint32 priv;
uint32 auth_flags;
uint32 logon_count;
uint32 bad_pw_count;
time_t last_logon;
time_t last_logoff;
time_t logoff_time;
time_t kickoff_time;
uint32 password_age;
time_t pw_can_change;
time_t pw_must_change;
unistr *computer;
unistr *domain;
unistr *script_path;
uint32 unknown;
} netr_UasInfo;
WERROR netr_LogonUasLogon(
[in] unistr *server_name,
2004-06-05 07:22:10 +04:00
[in] unistr account_name,
2003-12-01 04:41:38 +03:00
[in] unistr workstation,
[out] netr_UasInfo *info
);
2003-12-01 06:19:43 +03:00
/*****************/
/* Function 0x01 */
2003-12-01 04:41:38 +03:00
typedef struct {
uint32 duration;
2003-12-01 06:19:43 +03:00
uint16 logon_count;
} netr_UasLogoffInfo;
WERROR netr_LogonUasLogoff(
[in] unistr *server_name,
2004-06-05 07:22:10 +04:00
[in] unistr account_name,
2003-12-01 06:19:43 +03:00
[in] unistr workstation,
[out] netr_UasLogoffInfo info
2003-12-01 04:41:38 +03:00
);
2003-12-01 06:19:43 +03:00
/*****************/
/* Function 0x02 */
2003-12-01 15:41:54 +03:00
typedef [flag(NDR_PAHEX)] struct {
uint8 data[8];
} netr_Credential;
2003-12-01 06:19:43 +03:00
typedef struct {
2004-05-19 18:35:48 +04:00
[value(strlen_m(r->string)*2)] uint16 size;
[value(r->size)] uint16 length;
2003-12-01 12:28:10 +03:00
unistr_noterm *string;
2003-12-01 06:19:43 +03:00
} netr_String;
2004-04-20 00:49:42 +04:00
2004-04-20 12:05:59 +04:00
/* in netr_AcctLockStr size seems to be be 24, and rrenard thinks
that the structure of the bindata looks like this:
2004-05-25 17:57:39 +04:00
uint64 lockout_duration;
uint64 reset_count;
2004-04-20 00:49:42 +04:00
uint32 bad_attempt_lockout;
uint32 dummy;
2004-04-20 12:05:59 +04:00
but it doesn't look as though this structure is reflected at the
NDR level. Maybe it is left to the application to decode the bindata array.
*/
2004-04-20 00:49:42 +04:00
typedef struct {
uint16 size;
uint16 length;
2004-04-20 12:05:59 +04:00
[size_is(size/2),length_is(length/2)] uint16 *bindata;
2004-04-20 00:49:42 +04:00
} netr_AcctLockStr;
2003-12-01 06:19:43 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 12:28:10 +03:00
netr_String domain_name;
uint32 parameter_control;
uint32 logon_id_low;
uint32 logon_id_high;
2004-06-05 07:22:10 +04:00
netr_String account_name;
2003-12-01 06:19:43 +03:00
netr_String workstation;
2003-12-01 12:28:10 +03:00
} netr_IdentityInfo;
2003-12-01 06:19:43 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 12:28:10 +03:00
netr_IdentityInfo identity_info;
2004-06-04 15:58:46 +04:00
samr_Password lmpassword;
samr_Password ntpassword;
2003-12-01 12:28:10 +03:00
} netr_PasswordInfo;
2003-12-01 06:19:43 +03:00
2003-12-01 12:28:10 +03:00
typedef [flag(NDR_PAHEX)] struct {
uint16 length;
[value(r->length)] uint16 size;
[size_is(size),length_is(length)] uint8 *data;
} netr_ChallengeResponse;
2003-12-01 06:19:43 +03:00
2003-12-01 15:41:54 +03:00
typedef [flag(NDR_PAHEX)] struct {
2004-06-07 07:46:32 +04:00
netr_IdentityInfo identity_info;
2003-12-01 15:41:54 +03:00
uint8 challenge[8];
2003-12-01 12:28:10 +03:00
netr_ChallengeResponse nt;
netr_ChallengeResponse lm;
} netr_NetworkInfo;
2003-12-01 06:19:43 +03:00
typedef union {
2004-06-07 07:46:32 +04:00
[case(1)] netr_PasswordInfo *password;
2003-12-01 12:28:10 +03:00
[case(2)] netr_NetworkInfo *network;
2004-06-07 07:46:32 +04:00
[case(3)] netr_PasswordInfo *password;
2004-05-19 18:35:48 +04:00
[case(6)] netr_NetworkInfo *network;
2003-12-01 06:19:43 +03:00
} netr_LogonLevel;
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 06:19:43 +03:00
netr_Credential cred;
2003-12-01 07:13:43 +03:00
time_t timestamp;
2003-12-01 06:19:43 +03:00
} netr_Authenticator;
2003-12-01 04:41:38 +03:00
typedef struct {
uint32 user_id;
uint32 attributes;
2003-12-01 12:28:10 +03:00
} netr_GroupMembership;
2003-12-01 06:19:43 +03:00
2003-12-01 12:28:10 +03:00
typedef [flag(NDR_PAHEX)] struct {
2004-05-08 06:48:24 +04:00
uint8 key[16];
2003-12-01 12:28:10 +03:00
} netr_UserSessionKey;
2003-12-01 06:19:43 +03:00
2004-05-08 06:48:24 +04:00
typedef [flag(NDR_PAHEX)] struct {
uint8 key[8];
} netr_LMSessionKey;
2003-12-01 04:41:38 +03:00
typedef struct {
2004-06-07 07:46:32 +04:00
NTTIME last_logon;
NTTIME last_logoff;
NTTIME acct_expiry;
NTTIME last_password_change;
NTTIME allow_password_change;
NTTIME force_password_change;
2003-12-01 12:28:10 +03:00
netr_String account_name;
netr_String full_name;
netr_String logon_script;
netr_String profile_path;
2004-06-05 07:22:10 +04:00
netr_String home_directory;
2003-12-01 12:28:10 +03:00
netr_String home_drive;
uint16 logon_count;
2004-06-05 07:22:10 +04:00
uint16 bad_password_count;
uint32 rid;
uint32 primary_gid;
2003-12-01 12:28:10 +03:00
uint32 group_count;
[size_is(group_count)] netr_GroupMembership *groupids;
2004-06-07 07:46:32 +04:00
uint32 acct_flags;
2003-12-01 12:28:10 +03:00
netr_UserSessionKey key;
netr_String logon_server;
netr_String domain;
dom_sid2 *domain_sid;
2004-05-08 06:48:24 +04:00
netr_LMSessionKey LMSessKey;
uint32 AccountControl;
2004-06-07 12:54:49 +04:00
uint32 unknown1;
uint32 unknown2;
uint32 unknown3;
uint32 unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
} netr_SamInfo2;
2003-12-01 12:28:10 +03:00
typedef struct {
dom_sid2 *sid;
uint32 attribute;
} netr_SidAttr;
2003-12-01 06:19:43 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2004-06-07 07:46:32 +04:00
NTTIME last_logon;
NTTIME last_logoff;
NTTIME acct_expiry;
NTTIME last_password_change;
NTTIME allow_password_change;
NTTIME force_password_change;
2003-12-01 12:28:10 +03:00
netr_String account_name;
netr_String full_name;
netr_String logon_script;
netr_String profile_path;
2004-06-05 07:22:10 +04:00
netr_String home_directory;
2003-12-01 12:28:10 +03:00
netr_String home_drive;
uint16 logon_count;
2004-06-05 07:22:10 +04:00
uint16 bad_password_count;
uint32 rid;
uint32 primary_gid;
2003-12-01 12:28:10 +03:00
uint32 group_count;
[size_is(group_count)] netr_GroupMembership *groupids;
2004-06-07 07:46:32 +04:00
uint32 acct_flags;
2003-12-01 12:28:10 +03:00
netr_UserSessionKey key;
netr_String logon_server;
netr_String domain;
dom_sid2 *domain_sid;
2004-05-08 06:48:24 +04:00
netr_LMSessionKey LMSessKey;
uint32 AccountControl;
2004-06-07 12:54:49 +04:00
uint32 unknown1;
uint32 unknown2;
uint32 unknown3;
uint32 unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
2003-12-01 04:41:38 +03:00
uint32 sidcount;
2003-12-01 12:28:10 +03:00
[size_is(sidcount)] netr_SidAttr *sids;
2004-06-07 12:54:49 +04:00
} netr_SamInfo3;
2003-12-01 06:19:43 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 06:19:43 +03:00
uint32 pac_size;
[size_is(pac_size)] uint8 *pac;
2003-12-01 12:28:10 +03:00
netr_String logon_domain;
netr_String logon_server;
netr_String principal_name;
2003-12-01 04:41:38 +03:00
uint32 auth_size;
2003-12-01 06:19:43 +03:00
[size_is(auth_size)] uint8 *auth;
2003-12-01 12:28:10 +03:00
netr_UserSessionKey user_session_key;
2003-12-01 04:41:38 +03:00
uint32 expansionroom[10];
2003-12-01 12:28:10 +03:00
netr_String unknown1;
netr_String unknown2;
netr_String unknown3;
netr_String unknown4;
} netr_PacInfo;
2003-12-01 06:19:43 +03:00
typedef union {
2004-06-07 12:54:49 +04:00
[case(2)] netr_SamInfo2 *sam2;
[case(3)] netr_SamInfo3 *sam3;
2003-12-01 12:28:10 +03:00
[case(4)] netr_PacInfo *pac;
[case(5)] netr_PacInfo *pac2;
2003-12-01 06:19:43 +03:00
} netr_Validation;
2003-12-01 12:28:10 +03:00
NTSTATUS netr_LogonSamLogon(
2003-12-01 06:19:43 +03:00
[in] unistr *server_name,
[in] unistr *workstation,
[in] netr_Authenticator *credential,
2004-06-07 12:54:49 +04:00
[in][out] netr_Authenticator *return_authenticator,
2003-12-01 06:19:43 +03:00
[in] uint16 logon_level,
[in] [switch_is(logon_level)] netr_LogonLevel logon,
[in] uint16 validation_level,
[out] [switch_is(validation_level)] netr_Validation validation,
[out] uint32 authoritative
2003-12-01 04:41:38 +03:00
);
2003-12-01 06:19:43 +03:00
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x03 */
2003-12-02 01:13:11 +03:00
NTSTATUS netr_LogonSamLogoff(
2003-12-01 06:19:43 +03:00
[in] unistr *server_name,
[in] unistr *computer_name,
2003-12-02 01:13:11 +03:00
[in] netr_Authenticator *credential,
[in][out] netr_Authenticator *return_authenticator,
2003-12-01 06:19:43 +03:00
[in] uint16 logon_level,
[in] [switch_is(logon_level)] netr_LogonLevel logon
2003-12-01 04:41:38 +03:00
);
2003-12-01 06:19:43 +03:00
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x04 */
NTSTATUS netr_ServerReqChallenge(
2004-05-30 17:15:15 +04:00
[in] unistr *server_name,
[in] unistr computer_name,
[in,out,ref] netr_Credential *credentials
2003-12-01 04:41:38 +03:00
);
2003-12-01 06:19:43 +03:00
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x05 */
2003-12-02 07:05:05 +03:00
/* secure channel types */
const int SEC_CHAN_WKSTA = 2;
const int SEC_CHAN_DOMAIN = 4;
const int SEC_CHAN_BDC = 6;
2003-12-02 05:15:33 +03:00
NTSTATUS netr_ServerAuthenticate(
2004-05-30 17:15:15 +04:00
[in] unistr *server_name,
2004-06-05 07:22:10 +04:00
[in] unistr account_name,
2004-05-30 17:15:15 +04:00
[in] uint16 secure_channel_type,
[in] unistr computer_name,
[in,out,ref] netr_Credential *credentials
2003-12-01 04:41:38 +03:00
);
2003-12-01 06:19:43 +03:00
2003-12-02 03:31:54 +03:00
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x06 */
2003-12-02 03:31:54 +03:00
NTSTATUS netr_ServerPasswordSet(
[in] unistr *server_name,
2004-06-05 07:22:10 +04:00
[in] unistr account_name,
2003-12-02 14:43:09 +03:00
[in] uint16 secure_channel_type,
2003-12-02 03:31:54 +03:00
[in] unistr computer_name,
[in] netr_Authenticator credential,
2004-06-04 15:58:46 +04:00
[in] samr_Password new_password,
2003-12-02 03:31:54 +03:00
[out] netr_Authenticator return_authenticator
2003-12-01 04:41:38 +03:00
);
2003-12-02 03:31:54 +03:00
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x07 */
2003-12-01 04:41:38 +03:00
typedef struct {
2004-06-05 07:22:10 +04:00
unistr *account_name;
2003-12-02 05:15:33 +03:00
netr_String unknown1;
netr_String unknown2;
netr_String unknown3;
netr_String unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
uint32 unknown8;
2003-12-02 08:17:02 +03:00
} netr_DELTA_DELETE_USER;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-02 06:06:21 +03:00
bool8 SensitiveDataFlag;
2003-12-01 04:41:38 +03:00
uint32 DataLength;
2003-12-01 06:19:43 +03:00
[size_is(DataLength)] uint8 *SensitiveData;
2003-12-02 08:17:02 +03:00
} netr_USER_PRIVATE_INFO;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-02 08:37:49 +03:00
netr_String account_name;
netr_String full_name;
uint32 rid;
uint32 primary_group;
netr_String home_dir;
netr_String home_drive;
netr_String logon_script;
netr_String description;
2003-12-01 06:19:43 +03:00
netr_String workstations;
2003-12-01 04:41:38 +03:00
NTTIME LastLogon;
NTTIME LastLogoff;
2003-12-02 06:06:21 +03:00
samr_LogonHours logon_hours;
2003-12-02 08:37:49 +03:00
uint16 bad_pw_count;
uint16 logon_count;
2003-12-01 04:41:38 +03:00
NTTIME PwLastSet;
NTTIME AccountExpires;
uint32 AccountControl;
2004-06-04 15:58:46 +04:00
samr_Password lmpw;
samr_Password ntpw;
2003-12-02 06:06:21 +03:00
bool8 NTPwPresent;
bool8 LMPwPresent;
bool8 PwExpired;
2003-12-01 06:19:43 +03:00
netr_String UserComment;
netr_String Parameters;
uint16 CountryCode;
uint16 CodePage;
2003-12-02 08:17:02 +03:00
netr_USER_PRIVATE_INFO user_private_info;
2003-12-01 04:41:38 +03:00
uint32 SecurityInformation;
2003-12-02 07:33:57 +03:00
sec_desc_buf sdbuf;
2003-12-02 08:37:49 +03:00
netr_String profile_path;
2003-12-02 05:15:33 +03:00
netr_String unknown2;
netr_String unknown3;
netr_String unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
uint32 unknown8;
2003-12-02 08:17:02 +03:00
} netr_DELTA_USER;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 06:19:43 +03:00
netr_String DomainName;
netr_String OEMInfo;
2003-12-01 04:41:38 +03:00
NTTIME forcedlogoff;
2004-06-05 07:22:10 +04:00
uint16 min_password_len;
uint16 password_history_len;
uint64 password_must_change_time;
uint64 password_can_change_time;
2004-05-25 17:57:39 +04:00
uint64 sequence_num;
2003-12-01 04:41:38 +03:00
NTTIME domain_create_time;
uint32 SecurityInformation;
2003-12-02 07:33:57 +03:00
sec_desc_buf sdbuf;
2004-04-20 00:49:42 +04:00
netr_AcctLockStr account_lockout;
2003-12-02 05:15:33 +03:00
netr_String unknown2;
netr_String unknown3;
netr_String unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
uint32 unknown8;
2003-12-02 08:17:02 +03:00
} netr_DELTA_DOMAIN;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 06:19:43 +03:00
netr_String groupname;
2003-12-02 06:06:21 +03:00
netr_GroupMembership group_membership;
2003-12-01 06:19:43 +03:00
netr_String comment;
2003-12-01 04:41:38 +03:00
uint32 SecurityInformation;
2003-12-02 07:33:57 +03:00
sec_desc_buf sdbuf;
2003-12-02 05:15:33 +03:00
netr_String unknown1;
netr_String unknown2;
netr_String unknown3;
netr_String unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
uint32 unknown8;
2003-12-02 08:17:02 +03:00
} netr_DELTA_GROUP;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 06:19:43 +03:00
netr_String OldName;
netr_String NewName;
2003-12-02 05:15:33 +03:00
netr_String unknown1;
netr_String unknown2;
netr_String unknown3;
netr_String unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
uint32 unknown8;
2003-12-02 08:17:02 +03:00
} netr_DELTA_RENAME;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 06:19:43 +03:00
[size_is(num_rids)] uint32 *rids;
[size_is(num_rids)] uint32 *attribs;
2003-12-01 04:41:38 +03:00
uint32 num_rids;
2003-12-02 05:15:33 +03:00
uint32 unknown1;
uint32 unknown2;
uint32 unknown3;
uint32 unknown4;
2003-12-02 08:17:02 +03:00
} netr_DELTA_GROUP_MEMBER;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 06:19:43 +03:00
netr_String alias_name;
2003-12-01 04:41:38 +03:00
uint32 rid;
uint32 SecurityInformation;
2003-12-02 07:33:57 +03:00
sec_desc_buf sdbuf;
2003-12-02 05:15:33 +03:00
netr_String unknown1;
netr_String unknown2;
netr_String unknown3;
netr_String unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
uint32 unknown8;
2003-12-02 08:17:02 +03:00
} netr_DELTA_ALIAS;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-02 07:33:57 +03:00
lsa_SidArray sids;
2003-12-02 05:15:33 +03:00
uint32 unknown1;
uint32 unknown2;
uint32 unknown3;
uint32 unknown4;
2003-12-02 08:17:02 +03:00
} netr_DELTA_ALIAS_MEMBER;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
uint32 pagedpoollimit;
uint32 nonpagedpoollimit;
uint32 minimumworkingsetsize;
uint32 maximumworkingsetsize;
uint32 pagefilelimit;
NTTIME timelimit;
2003-12-02 08:17:02 +03:00
} netr_QUOTA_LIMITS;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
uint32 maxlogsize;
NTTIME auditretentionperiod;
2003-12-02 06:06:21 +03:00
bool8 auditingmode;
2003-12-01 04:41:38 +03:00
uint32 maxauditeventcount;
2003-12-02 07:59:18 +03:00
[size_is(maxauditeventcount+1)] uint32 *eventauditoptions;
2003-12-01 06:19:43 +03:00
netr_String primarydomainname;
2003-12-02 06:06:21 +03:00
dom_sid2 *sid;
2003-12-02 08:17:02 +03:00
netr_QUOTA_LIMITS quota_limits;
2003-12-01 04:41:38 +03:00
NTTIME db_modify_time;
NTTIME db_create_time;
uint32 SecurityInformation;
2003-12-02 07:33:57 +03:00
sec_desc_buf sdbuf;
2003-12-02 05:15:33 +03:00
netr_String unknown1;
netr_String unknown2;
netr_String unknown3;
netr_String unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
uint32 unknown8;
2003-12-02 08:17:02 +03:00
} netr_DELTA_POLICY;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 06:19:43 +03:00
netr_String DomainName;
2003-12-01 04:41:38 +03:00
uint32 num_controllers;
2003-12-01 06:19:43 +03:00
[size_is(num_controllers)] netr_String *controller_names;
2003-12-01 04:41:38 +03:00
uint32 SecurityInformation;
2003-12-02 07:33:57 +03:00
sec_desc_buf sdbuf;
2003-12-02 05:15:33 +03:00
netr_String unknown1;
netr_String unknown2;
netr_String unknown3;
netr_String unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
uint32 unknown8;
2003-12-02 08:17:02 +03:00
} netr_DELTA_TRUSTED_DOMAINS;
2003-12-02 05:15:33 +03:00
2004-04-28 18:38:42 +04:00
typedef struct {
uint16 unknown;
} netr_DELTA_DELETE_TRUST;
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-02 06:06:21 +03:00
uint32 privilege_entries;
uint32 privilege_control;
2003-12-01 06:19:43 +03:00
[size_is(privilege_entries)] uint32 *privilege_attrib;
[size_is(privilege_entries)] netr_String *privilege_name;
2003-12-02 08:17:02 +03:00
netr_QUOTA_LIMITS quotalimits;
2003-12-02 07:59:18 +03:00
uint32 system_flags;
2003-12-01 04:41:38 +03:00
uint32 SecurityInformation;
2003-12-02 07:33:57 +03:00
sec_desc_buf sdbuf;
2003-12-02 05:15:33 +03:00
netr_String unknown1;
netr_String unknown2;
netr_String unknown3;
netr_String unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
uint32 unknown8;
2003-12-02 08:17:02 +03:00
} netr_DELTA_ACCOUNTS;
2003-12-02 05:15:33 +03:00
2004-04-28 18:38:42 +04:00
typedef struct {
uint16 unknown;
} netr_DELTA_DELETE_ACCOUNT;
typedef struct {
uint16 unknown;
} netr_DELTA_DELETE_SECRET;
2003-12-01 04:41:38 +03:00
typedef struct {
uint32 len;
uint32 maxlen;
2003-12-01 06:19:43 +03:00
[size_is(maxlen)][length_is(len)] uint8 *cipher_data;
2003-12-02 08:17:02 +03:00
} netr_CIPHER_VALUE;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-02 08:17:02 +03:00
netr_CIPHER_VALUE current_cipher;
2003-12-01 04:41:38 +03:00
NTTIME current_cipher_set_time;
2003-12-02 08:17:02 +03:00
netr_CIPHER_VALUE old_cipher;
2003-12-01 04:41:38 +03:00
NTTIME old_cipher_set_time;
uint32 SecurityInformation;
2003-12-02 07:33:57 +03:00
sec_desc_buf sdbuf;
2003-12-02 05:15:33 +03:00
netr_String unknown1;
netr_String unknown2;
netr_String unknown3;
netr_String unknown4;
uint32 unknown5;
uint32 unknown6;
uint32 unknown7;
uint32 unknown8;
2003-12-02 08:17:02 +03:00
} netr_DELTA_SECRET;
2003-12-02 05:15:33 +03:00
2004-04-20 00:49:42 +04:00
typedef enum {
NETR_DELTA_DOMAIN = 1,
NETR_DELTA_GROUP = 2,
NETR_DELTA_DELETE_GROUP = 3,
NETR_DELTA_RENAME_GROUP = 4,
NETR_DELTA_USER = 5,
NETR_DELTA_DELETE_USER = 6,
NETR_DELTA_RENAME_USER = 7,
NETR_DELTA_GROUP_MEMBER = 8,
NETR_DELTA_ALIAS = 9,
NETR_DELTA_UNKNOWN1 = 10, /* maybe delete alias? */
NETR_DELTA_RENAME_ALIAS = 11,
NETR_DELTA_ALIAS_MEMBER = 12,
NETR_DELTA_POLICY = 13,
NETR_DELTA_TRUSTED_DOMAINS = 14,
2004-04-28 18:38:42 +04:00
NETR_DELTA_DELETE_TRUST = 15,
2004-04-20 00:49:42 +04:00
NETR_DELTA_ACCOUNTS = 16,
2004-04-28 18:38:42 +04:00
NETR_DELTA_DELETE_ACCOUNT = 17,
2004-04-20 00:49:42 +04:00
NETR_DELTA_SECRET = 18,
2004-04-28 18:38:42 +04:00
NETR_DELTA_DELETE_SECRET = 19,
2004-04-20 00:49:42 +04:00
NETR_DELTA_DELETE_GROUP2 = 20,
NETR_DELTA_DELETE_USER2 = 21,
NETR_DELTA_MODIFY_COUNT = 22
} netr_DeltaEnum;
2003-12-02 06:06:21 +03:00
typedef union {
2004-04-20 00:49:42 +04:00
[case(NETR_DELTA_DOMAIN)] netr_DELTA_DOMAIN *domain;
[case(NETR_DELTA_GROUP)] netr_DELTA_GROUP *group;
[case(NETR_DELTA_DELETE_GROUP)] ; /* rid only */
[case(NETR_DELTA_RENAME_GROUP)] netr_DELTA_RENAME *rename_group;
[case(NETR_DELTA_USER)] netr_DELTA_USER *user;
[case(NETR_DELTA_DELETE_USER)] ; /* rid only */
[case(NETR_DELTA_RENAME_USER)] netr_DELTA_RENAME *rename_user;
[case(NETR_DELTA_GROUP_MEMBER)] netr_DELTA_GROUP_MEMBER *group_member;
[case(NETR_DELTA_ALIAS)] netr_DELTA_ALIAS *alias;
[case(NETR_DELTA_RENAME_ALIAS)] netr_DELTA_RENAME *rename_alias;
[case(NETR_DELTA_ALIAS_MEMBER)] netr_DELTA_ALIAS_MEMBER *alias_member;
[case(NETR_DELTA_POLICY)] netr_DELTA_POLICY *policy;
[case(NETR_DELTA_TRUSTED_DOMAINS)] netr_DELTA_TRUSTED_DOMAINS *trusted_domains;
2004-04-28 18:38:42 +04:00
[case(NETR_DELTA_DELETE_TRUST)] netr_DELTA_DELETE_TRUST delete_trust;
2004-04-20 00:49:42 +04:00
[case(NETR_DELTA_ACCOUNTS)] netr_DELTA_ACCOUNTS *accounts;
2004-04-28 18:38:42 +04:00
[case(NETR_DELTA_DELETE_ACCOUNT)] netr_DELTA_DELETE_ACCOUNT delete_account;
2004-04-20 00:49:42 +04:00
[case(NETR_DELTA_SECRET)] netr_DELTA_SECRET *secret;
2004-04-28 18:38:42 +04:00
[case(NETR_DELTA_DELETE_SECRET)] netr_DELTA_DELETE_SECRET delete_secret;
2004-04-20 00:49:42 +04:00
[case(NETR_DELTA_DELETE_GROUP2)] netr_DELTA_DELETE_USER *delete_group;
[case(NETR_DELTA_DELETE_USER2)] netr_DELTA_DELETE_USER *delete_user;
2004-05-25 17:57:39 +04:00
[case(NETR_DELTA_MODIFY_COUNT)] uint64 *modified_count;
2003-12-02 08:17:02 +03:00
} netr_DELTA_UNION;
2003-12-01 04:41:38 +03:00
2003-12-02 06:06:21 +03:00
typedef union {
2004-04-20 00:49:42 +04:00
[case(NETR_DELTA_DOMAIN)] uint32 rid;
[case(NETR_DELTA_GROUP)] uint32 rid;
[case(NETR_DELTA_DELETE_GROUP)] uint32 rid;
[case(NETR_DELTA_RENAME_GROUP)] uint32 rid;
[case(NETR_DELTA_USER)] uint32 rid;
[case(NETR_DELTA_DELETE_USER)] uint32 rid;
[case(NETR_DELTA_RENAME_USER)] uint32 rid;
[case(NETR_DELTA_GROUP_MEMBER)] uint32 rid;
[case(NETR_DELTA_ALIAS)] uint32 rid;
[case(NETR_DELTA_UNKNOWN1)] uint32 rid;
[case(NETR_DELTA_RENAME_ALIAS)] uint32 rid;
[case(NETR_DELTA_ALIAS_MEMBER)] uint32 rid;
[case(NETR_DELTA_POLICY)] dom_sid2 *sid;
[case(NETR_DELTA_TRUSTED_DOMAINS)] dom_sid2 *sid;
2004-04-28 18:38:42 +04:00
[case(NETR_DELTA_DELETE_TRUST)] dom_sid2 *sid;
2004-04-20 00:49:42 +04:00
[case(NETR_DELTA_ACCOUNTS)] dom_sid2 *sid;
2004-04-28 18:38:42 +04:00
[case(NETR_DELTA_DELETE_ACCOUNT)] dom_sid2 *sid;
2004-04-20 00:49:42 +04:00
[case(NETR_DELTA_SECRET)] unistr *name;
2004-04-28 18:38:42 +04:00
[case(NETR_DELTA_DELETE_SECRET)] unistr *name;
2004-04-20 00:49:42 +04:00
[case(NETR_DELTA_DELETE_GROUP2)] unistr *name;
[case(NETR_DELTA_DELETE_USER2)] uint32 rid;
[case(NETR_DELTA_MODIFY_COUNT)] uint32 rid;
2003-12-02 08:17:02 +03:00
} netr_DELTA_ID_UNION;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
2003-12-01 06:19:43 +03:00
uint16 delta_type;
2003-12-02 08:17:02 +03:00
[switch_is(delta_type)] netr_DELTA_ID_UNION delta_id_union;
[switch_is(delta_type)] netr_DELTA_UNION delta_union;
} netr_DELTA_ENUM;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
uint32 num_deltas;
2003-12-02 08:17:02 +03:00
[size_is(num_deltas)] netr_DELTA_ENUM *delta_enum;
} netr_DELTA_ENUM_ARRAY;
2003-12-02 05:15:33 +03:00
2003-12-02 06:06:21 +03:00
NTSTATUS netr_DatabaseDeltas(
2003-12-02 13:34:06 +03:00
[in] unistr logon_server,
2003-12-02 06:06:21 +03:00
[in] unistr computername,
[in] netr_Authenticator credential,
[in,out] netr_Authenticator return_authenticator,
[in] uint32 database_id,
2004-05-25 17:57:39 +04:00
[in,out] uint64 sequence_num,
2003-12-02 06:06:21 +03:00
[in] uint32 preferredmaximumlength,
2003-12-02 08:17:02 +03:00
[out] netr_DELTA_ENUM_ARRAY *delta_enum_array
2003-12-01 04:41:38 +03:00
);
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x08 */
2003-12-02 06:06:21 +03:00
NTSTATUS netr_DatabaseSync(
2003-12-02 13:34:06 +03:00
[in] unistr logon_server,
2003-12-02 06:06:21 +03:00
[in] unistr computername,
[in] netr_Authenticator credential,
[in,out] netr_Authenticator return_authenticator,
[in] uint32 database_id,
[in,out] uint32 sync_context,
[in] uint32 preferredmaximumlength,
2003-12-02 08:17:02 +03:00
[out] netr_DELTA_ENUM_ARRAY *delta_enum_array
2003-12-01 04:41:38 +03:00
);
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x09 */
2003-12-02 12:52:15 +03:00
/* w2k3 returns NT_STATUS_NOT_IMPLEMENTED for this call */
typedef [flag(NDR_PAHEX)] struct {
2003-12-01 06:19:43 +03:00
uint8 computer_name[16];
2003-12-01 04:41:38 +03:00
uint32 timecreated;
uint32 serial_number;
2003-12-02 13:04:10 +03:00
} netr_UAS_INFO_0;
2003-12-02 05:15:33 +03:00
2003-12-02 12:52:15 +03:00
typedef struct {
[flag(NDR_REMAINING)] DATA_BLOB blob;
} netr_AccountBuffer;
2003-12-02 06:06:21 +03:00
NTSTATUS netr_AccountDeltas(
2003-12-02 13:34:06 +03:00
[in] unistr *logon_server,
2003-12-02 11:04:37 +03:00
[in] unistr computername,
[in] netr_Authenticator credential,
[in,out] netr_Authenticator return_authenticator,
2003-12-02 13:04:10 +03:00
[in] netr_UAS_INFO_0 uas,
2003-12-02 11:04:37 +03:00
[in] uint32 count,
[in] uint32 level,
2003-12-02 12:52:15 +03:00
[in] uint32 buffersize,
[out,subcontext(4)] netr_AccountBuffer buffer,
[out] uint32 count_returned,
[out] uint32 total_entries,
2003-12-02 13:04:10 +03:00
[out] netr_UAS_INFO_0 recordid
2003-12-01 04:41:38 +03:00
);
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x0A */
2003-12-02 06:06:21 +03:00
NTSTATUS netr_AccountSync(
2003-12-02 13:34:06 +03:00
[in] unistr *logon_server,
2003-12-02 13:04:10 +03:00
[in] unistr computername,
[in] netr_Authenticator credential,
[in,out] netr_Authenticator return_authenticator,
[in] uint32 reference,
[in] uint32 level,
[in] uint32 buffersize,
[out,subcontext(4)] netr_AccountBuffer buffer,
[out] uint32 count_returned,
[out] uint32 total_entries,
[out] uint32 next_reference,
[in,out] netr_UAS_INFO_0 recordid
2003-12-01 04:41:38 +03:00
);
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x0B */
2003-12-02 06:06:21 +03:00
NTSTATUS netr_GetDcName(
2003-12-02 13:08:26 +03:00
[in] unistr logon_server,
[in] unistr *domainname,
[out] unistr *dcname
);
2003-12-02 13:34:06 +03:00
/*****************/
/* Function 0x0C */
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
uint32 flags;
uint32 pdc_connection_status;
2003-12-02 13:34:06 +03:00
} netr_NETLOGON_INFO_1;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
uint32 flags;
uint32 pdc_connection_status;
2003-12-02 11:04:37 +03:00
unistr trusted_dc_name;
2003-12-01 04:41:38 +03:00
uint32 tc_connection_status;
2003-12-02 13:34:06 +03:00
} netr_NETLOGON_INFO_2;
2003-12-02 05:15:33 +03:00
2003-12-01 04:41:38 +03:00
typedef struct {
uint32 flags;
uint32 logon_attempts;
2003-12-02 13:34:06 +03:00
uint32 unknown1;
uint32 unknown2;
uint32 unknown3;
uint32 unknown4;
uint32 unknown5;
} netr_NETLOGON_INFO_3;
2003-12-02 05:15:33 +03:00
2003-12-02 13:34:06 +03:00
typedef union {
[case(1)] netr_NETLOGON_INFO_1 *info1;
[case(2)] netr_NETLOGON_INFO_2 *info2;
[case(3)] netr_NETLOGON_INFO_3 *info3;
} netr_CONTROL_QUERY_INFORMATION;
2003-12-02 14:43:09 +03:00
/* function_code values */
const int NETLOGON_CONTROL_REDISCOVER = 5;
const int NETLOGON_CONTROL_TC_QUERY = 6;
const int NETLOGON_CONTROL_TRANSPORT_NOTIFY = 7;
const int NETLOGON_CONTROL_SET_DBFLAG = 65534;
2003-12-02 13:34:06 +03:00
WERROR netr_LogonControl(
[in] unistr *logon_server,
[in] uint32 function_code,
[in] uint32 level,
[out,switch_is(level)] netr_CONTROL_QUERY_INFORMATION info
2003-12-01 04:41:38 +03:00
);
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x0D */
2003-12-02 13:34:06 +03:00
WERROR netr_GetAnyDCName(
[in] unistr *logon_server,
[in] unistr *domainname,
[out] unistr *dcname
);
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x0E */
2003-12-02 14:43:09 +03:00
typedef union {
[case(NETLOGON_CONTROL_REDISCOVER)] unistr *domain;
[case(NETLOGON_CONTROL_TC_QUERY)] unistr *domain;
[case(NETLOGON_CONTROL_TRANSPORT_NOTIFY)] unistr *domain;
[case(NETLOGON_CONTROL_SET_DBFLAG)] uint32 debug_level;
} netr_CONTROL_DATA_INFORMATION;
WERROR netr_LogonControl2(
[in] unistr *logon_server,
[in] uint32 function_code,
[in] uint32 level,
[in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION data,
[out][switch_is(level)] netr_CONTROL_QUERY_INFORMATION query
2003-12-01 04:41:38 +03:00
);
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x0F */
2003-12-02 06:06:21 +03:00
NTSTATUS netr_ServerAuthenticate2(
2003-12-02 14:43:09 +03:00
[in] unistr *server_name,
2004-06-05 07:22:10 +04:00
[in] unistr account_name,
2003-12-02 14:43:09 +03:00
[in] uint16 secure_channel_type,
[in] unistr computer_name,
2004-05-30 17:15:15 +04:00
[in,out,ref] netr_Credential *credentials,
2003-12-02 14:43:09 +03:00
[in,out,ref] uint32 *negotiate_flags
2003-12-01 04:41:38 +03:00
);
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x10 */
2003-12-02 06:06:21 +03:00
NTSTATUS netr_DatabaseSync2(
2003-12-02 15:01:10 +03:00
[in] unistr logon_server,
[in] unistr computername,
[in] netr_Authenticator credential,
[in,out] netr_Authenticator return_authenticator,
[in] uint32 database_id,
[in] uint16 restart_state,
[in,out] uint32 sync_context,
[in] uint32 preferredmaximumlength,
[out] netr_DELTA_ENUM_ARRAY *delta_enum_array
2003-12-01 04:41:38 +03:00
);
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x11 */
2003-12-02 15:16:08 +03:00
/* i'm not at all sure how this call works */
2003-12-02 06:06:21 +03:00
NTSTATUS netr_DatabaseRedo(
2003-12-02 15:16:08 +03:00
[in] unistr logon_server,
[in] unistr computername,
[in] netr_Authenticator credential,
[in,out] netr_Authenticator return_authenticator,
[in][size_is(change_log_entry_size)] uint8 *change_log_entry,
[in] uint32 change_log_entry_size,
[out] netr_DELTA_ENUM_ARRAY *delta_enum_array
2003-12-01 04:41:38 +03:00
);
2003-12-02 05:15:33 +03:00
/*****************/
/* Function 0x12 */
2003-12-02 15:16:08 +03:00
WERROR netr_LogonControl2Ex(
[in] unistr *logon_server,
[in] uint32 function_code,
[in] uint32 level,
[in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION data,
[out][switch_is(level)] netr_CONTROL_QUERY_INFORMATION query
2003-12-01 04:41:38 +03:00
);
2004-05-28 17:23:30 +04:00
/*****************/
/* Function 0x13 */
WERROR netr_NETRENUMERATETRUSTEDDOMAINS() ;
/*****************/
/* Function 0x14 */
WERROR netr_DSRGETDCNAME() ;
/*****************/
/* Function 0x15 */
WERROR netr_NETRLOGONDUMMYROUTINE1();
/****************/
/* Function 0x16 */
WERROR netr_NETRLOGONSETSERVICEBITS();
/****************/
/* Function 0x17 */
WERROR netr_NETRLOGONGETTRUSTRID();
/****************/
/* Function 0x18 */
WERROR netr_NETRLOGONCOMPUTESERVERDIGEST();
/****************/
/* Function 0x19 */
WERROR netr_NETRLOGONCOMPUTECLIENTDIGEST();
/****************/
/* Function 0x1a */
2004-05-30 17:15:15 +04:00
NTSTATUS netr_ServerAuthenticate3(
[in] unistr *server_name,
2004-06-05 07:22:10 +04:00
[in] unistr account_name,
2004-05-30 17:15:15 +04:00
[in] uint16 secure_channel_type,
[in] unistr computer_name,
[in,out,ref] netr_Credential *credentials,
[in,out,ref] uint32 *negotiate_flags,
[out,ref] uint32 *rid
);
2004-05-28 17:23:30 +04:00
/****************/
/* Function 0x1b */
WERROR netr_DSRGETDCNAMEX();
/****************/
/* Function 0x1c */
WERROR netr_DSRGETSITENAME();
/****************/
/* Function 0x1d */
2004-06-14 12:12:50 +04:00
typedef struct {
uint32 length;
[size_is(length)] uint8 *data;
} netr_Blob;
typedef [flag(NDR_PAHEX)] struct {
uint16 length;
uint16 size;
[size_is(size/2),length_is(length/2)] uint16 *data;
} netr_BinaryString;
typedef struct {
netr_Blob blob;
unistr *workstation_domain;
unistr *workstation_site;
unistr *foo2;
unistr *p1;
unistr *p2;
unistr *p3;
netr_BinaryString blob2;
netr_String product;
uint32 i1;
unistr *p4;
uint32 i2;
uint32 pp;
uint32 xx[4];
} netr_DomainQuery1;
typedef union {
[case(1)] netr_DomainQuery1 *query1;
[case(2)] netr_DomainQuery1 *query1;
} netr_DomainQuery;
typedef struct {
netr_String domainname;
netr_String fulldomainname;
netr_String forest;
GUID guid;
dom_sid2 *sid;
netr_BinaryString unknown1[4];
uint32 unknown[4];
} netr_DomainTrustInfo;
typedef struct {
netr_DomainTrustInfo domaininfo;
uint32 num_trusts;
[size_is(num_trusts)] netr_DomainTrustInfo *trusts;
uint32 unknown[14]; /* room for expansion? */
} netr_DomainInfo1;
typedef union {
[case(1)] netr_DomainInfo1 *info1;
[case(2)] netr_DomainInfo1 *info1;
} netr_DomainInfo;
NTSTATUS netr_LogonGetDomainInfo(
[in] unistr server_name,
[in] unistr *computer_name,
[in,out,ref] netr_Authenticator *credential,
[in] uint32 unknown1,
[in] uint32 *i1,
[in] uint32 level,
[in,switch_is(level)] netr_DomainQuery query,
[out,switch_is(level)] netr_DomainInfo info
);
2004-05-28 17:23:30 +04:00
/****************/
/* Function 0x1e */
WERROR netr_NETRSERVERPASSWORDSET2();
/****************/
/* Function 0x1f */
WERROR netr_NETRSERVERPASSWORDGET();
/****************/
/* Function 0x20 */
WERROR netr_NETRLOGONSENDTOSAM();
/****************/
/* Function 0x21 */
WERROR netr_DSRADDRESSTOSITENAMESW();
/****************/
/* Function 0x22 */
WERROR netr_DSRGETDCNAMEEX2();
/****************/
/* Function 0x23 */
WERROR netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN();
/****************/
/* Function 0x24 */
WERROR netr_NETRENUMERATETRUSTEDDOMAINSEX();
/****************/
/* Function 0x25 */
WERROR netr_DSRADDRESSTOSITENAMESEXW();
/****************/
/* Function 0x26 */
WERROR netr_DSRGETDCSITECOVERAGEW();
/****************/
/* Function 0x27 */
WERROR netr_NETRLOGONSAMLOGONEX();
/****************/
/* Function 0x28 */
const int NETR_TRUST_FLAG_IN_FOREST = 0x01;
const int NETR_TRUST_FLAG_OUTBOUND = 0x02;
const int NETR_TRUST_FLAG_TREEROOT = 0x04;
const int NETR_TRUST_FLAG_PRIMARY = 0x08;
const int NETR_TRUST_FLAG_NATIVE = 0x10;
const int NETR_TRUST_FLAG_INBOUND = 0x20;
typedef struct {
unistr *netbios_name;
unistr *dns_name;
uint32 trust_flags;
uint32 parent_index;
uint32 trust_type;
uint32 trust_attributes;
dom_sid2 *sid;
GUID guid;
} netr_DomainTrust;
WERROR netr_DsrEnumerateDomainTrusts(
[in] unistr *server_name,
[in] uint32 trust_flags,
[out] uint32 count,
[out,size_is(count)] netr_DomainTrust *trusts
);
/****************/
/* Function 0x29 */
WERROR netr_DSRDEREGISTERDNSHOSTRECORDS();
/****************/
/* Function 0x2a */
WERROR netr_NETRSERVERTRUSTPASSWORDSGET();
/****************/
/* Function 0x2b */
WERROR netr_DSRGETFORESTTRUSTINFORMATION();
/****************/
/* Function 0x2c */
WERROR netr_NETRGETFORESTTRUSTINFORMATION();
/****************/
/* Function 0x2d */
2004-06-14 13:31:47 +04:00
/* this is the ADS varient. I don't yet know what the "flags" are for */
NTSTATUS netr_LogonSamLogonWithFlags(
[in] unistr *server_name,
[in] unistr *workstation,
[in] netr_Authenticator *credential,
[in][out] netr_Authenticator *return_authenticator,
[in] uint16 logon_level,
[in] [switch_is(logon_level)] netr_LogonLevel logon,
[in] uint16 validation_level,
[out] [switch_is(validation_level)] netr_Validation validation,
[out] uint32 authoritative,
[in,out] uint32 flags
);
2004-05-28 17:23:30 +04:00
/****************/
/* Function 0x2e */
WERROR netr_NETRSERVERGETTRUSTINFO();
2003-11-28 08:20:11 +03:00
}