2012-03-26 10:45:01 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2012-03-26 20:20:38 +04:00
|
|
|
* RPC over HTTP
|
2012-03-26 10:45:01 +04:00
|
|
|
*
|
2012-03-26 20:20:38 +04:00
|
|
|
* Copyright 2012 Fujitsu Technology Solutions GmbH
|
|
|
|
* Copyright 2012 Dmitrij Jasnov <dmitrij.jasnov@ts.fujitsu.com>
|
2012-11-01 04:38:48 +04:00
|
|
|
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2012-03-26 10:45:01 +04:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2012-04-14 22:19:31 +04:00
|
|
|
#ifndef FREERDP_CORE_RPC_H
|
|
|
|
#define FREERDP_CORE_RPC_H
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-11-28 07:26:57 +04:00
|
|
|
#include <winpr/wtypes.h>
|
2012-12-10 23:23:27 +04:00
|
|
|
#include <winpr/stream.h>
|
2012-12-06 01:04:01 +04:00
|
|
|
#include <winpr/collections.h>
|
2012-11-29 06:25:01 +04:00
|
|
|
#include <winpr/interlocked.h>
|
2012-11-28 07:26:57 +04:00
|
|
|
|
2012-04-18 09:53:12 +04:00
|
|
|
typedef struct rdp_rpc rdpRpc;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-11-16 01:25:22 +04:00
|
|
|
#define DEFINE_RPC_COMMON_FIELDS() \
|
|
|
|
BYTE rpc_vers; \
|
|
|
|
BYTE rpc_vers_minor; \
|
|
|
|
BYTE ptype; \
|
|
|
|
BYTE pfc_flags; \
|
|
|
|
BYTE packed_drep[4]; \
|
|
|
|
UINT16 frag_length; \
|
|
|
|
UINT16 auth_length; \
|
|
|
|
UINT32 call_id
|
|
|
|
|
2012-11-16 22:31:16 +04:00
|
|
|
#define RPC_COMMON_FIELDS_LENGTH 16
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
|
|
|
|
|
|
|
UINT16 Flags;
|
|
|
|
UINT16 NumberOfCommands;
|
|
|
|
} rpcconn_rts_hdr_t;
|
|
|
|
|
|
|
|
#define RTS_PDU_HEADER_LENGTH 20
|
2012-11-16 01:25:22 +04:00
|
|
|
|
2012-11-29 06:25:01 +04:00
|
|
|
#define RPC_PDU_FLAG_STUB 0x00000001
|
|
|
|
|
|
|
|
typedef struct _RPC_PDU
|
|
|
|
{
|
|
|
|
BYTE* Buffer;
|
|
|
|
UINT32 Size;
|
|
|
|
UINT32 Length;
|
|
|
|
DWORD Flags;
|
2012-12-08 06:09:55 +04:00
|
|
|
DWORD CallId;
|
2012-11-29 06:25:01 +04:00
|
|
|
} RPC_PDU, *PRPC_PDU;
|
|
|
|
|
2012-03-26 10:45:01 +04:00
|
|
|
#include "tcp.h"
|
2012-04-19 22:09:27 +04:00
|
|
|
#include "rts.h"
|
2012-04-17 00:21:46 +04:00
|
|
|
#include "http.h"
|
2012-11-15 19:00:07 +04:00
|
|
|
#include "ntlm.h"
|
2012-04-24 00:33:18 +04:00
|
|
|
#include "transport.h"
|
2012-03-26 10:45:01 +04:00
|
|
|
|
|
|
|
#include <time.h>
|
2012-11-17 13:47:13 +04:00
|
|
|
|
2012-05-05 03:48:53 +04:00
|
|
|
#include <winpr/sspi.h>
|
2012-11-17 13:47:13 +04:00
|
|
|
#include <winpr/interlocked.h>
|
|
|
|
|
2012-03-26 10:45:01 +04:00
|
|
|
#include <freerdp/types.h>
|
|
|
|
#include <freerdp/settings.h>
|
|
|
|
#include <freerdp/crypto/tls.h>
|
|
|
|
#include <freerdp/crypto/crypto.h>
|
|
|
|
#include <freerdp/utils/sleep.h>
|
|
|
|
#include <freerdp/utils/debug.h>
|
|
|
|
#include <freerdp/utils/stream.h>
|
|
|
|
#include <freerdp/utils/hexdump.h>
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
/**
|
|
|
|
* CAE Specification
|
|
|
|
* DCE 1.1: Remote Procedure Call
|
|
|
|
* Document Number: C706
|
|
|
|
* http://pubs.opengroup.org/onlinepubs/9629399/
|
|
|
|
*/
|
|
|
|
|
2012-11-16 01:25:22 +04:00
|
|
|
#define PTYPE_REQUEST 0x00
|
|
|
|
#define PTYPE_PING 0x01
|
|
|
|
#define PTYPE_RESPONSE 0x02
|
|
|
|
#define PTYPE_FAULT 0x03
|
|
|
|
#define PTYPE_WORKING 0x04
|
|
|
|
#define PTYPE_NOCALL 0x05
|
|
|
|
#define PTYPE_REJECT 0x06
|
|
|
|
#define PTYPE_ACK 0x07
|
|
|
|
#define PTYPE_CL_CANCEL 0x08
|
|
|
|
#define PTYPE_FACK 0x09
|
|
|
|
#define PTYPE_CANCEL_ACK 0x0A
|
|
|
|
#define PTYPE_BIND 0x0B
|
|
|
|
#define PTYPE_BIND_ACK 0x0C
|
|
|
|
#define PTYPE_BIND_NAK 0x0D
|
|
|
|
#define PTYPE_ALTER_CONTEXT 0x0E
|
|
|
|
#define PTYPE_ALTER_CONTEXT_RESP 0x0F
|
|
|
|
#define PTYPE_RPC_AUTH_3 0x10
|
|
|
|
#define PTYPE_SHUTDOWN 0x11
|
|
|
|
#define PTYPE_CO_CANCEL 0x12
|
|
|
|
#define PTYPE_ORPHANED 0x13
|
|
|
|
#define PTYPE_RTS 0x14
|
|
|
|
|
|
|
|
#define PFC_FIRST_FRAG 0x01
|
|
|
|
#define PFC_LAST_FRAG 0x02
|
|
|
|
#define PFC_PENDING_CANCEL 0x04
|
2012-11-28 09:32:12 +04:00
|
|
|
#define PFC_SUPPORT_HEADER_SIGN 0x04
|
2012-11-16 01:25:22 +04:00
|
|
|
#define PFC_RESERVED_1 0x08
|
|
|
|
#define PFC_CONC_MPX 0x10
|
|
|
|
#define PFC_DID_NOT_EXECUTE 0x20
|
|
|
|
#define PFC_MAYBE 0x40
|
|
|
|
#define PFC_OBJECT_UUID 0x80
|
|
|
|
|
|
|
|
/* Minimum fragment sizes */
|
|
|
|
#define RPC_CO_MUST_RECV_FRAG_SIZE 1432
|
|
|
|
#define RPC_CL_MUST_RECV_FRAG_SIZE 1464
|
2012-11-15 03:51:40 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The PDU maximum header length is enough
|
|
|
|
* to contain either the RPC common fields
|
|
|
|
* or all fields up to the stub data in PDUs
|
|
|
|
* that use it (request, response, fault)
|
|
|
|
*/
|
|
|
|
#define RPC_PDU_HEADER_MAX_LENGTH 32
|
|
|
|
|
2012-11-16 01:25:22 +04:00
|
|
|
typedef struct
|
2012-04-22 00:18:07 +04:00
|
|
|
{
|
2012-10-29 23:02:35 +04:00
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
2012-11-16 01:25:22 +04:00
|
|
|
} rpcconn_common_hdr_t;
|
2012-04-22 00:18:07 +04:00
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef UINT16 p_context_id_t;
|
|
|
|
typedef UINT16 p_reject_reason_t;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
2012-10-30 00:41:20 +04:00
|
|
|
UINT32 time_low;
|
|
|
|
UINT16 time_mid;
|
|
|
|
UINT16 time_hi_and_version;
|
|
|
|
BYTE clock_seq_hi_and_reserved;
|
|
|
|
BYTE clock_seq_low;
|
|
|
|
BYTE node[6];
|
2012-10-31 01:20:21 +04:00
|
|
|
} p_uuid_t;
|
2012-10-30 00:41:20 +04:00
|
|
|
|
2012-11-09 21:52:34 +04:00
|
|
|
#define ndr_c_int_big_endian 0
|
|
|
|
#define ndr_c_int_little_endian 1
|
|
|
|
#define ndr_c_float_ieee 0
|
|
|
|
#define ndr_c_float_vax 1
|
|
|
|
#define ndr_c_float_cray 2
|
|
|
|
#define ndr_c_float_ibm 3
|
|
|
|
#define ndr_c_char_ascii 0
|
|
|
|
#define ndr_c_char_ebcdic 1
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BYTE int_rep;
|
|
|
|
BYTE char_rep;
|
|
|
|
BYTE float_rep;
|
|
|
|
BYTE reserved;
|
|
|
|
} ndr_format_t, *ndr_format_p_t;
|
|
|
|
|
|
|
|
typedef struct ndr_context_handle
|
|
|
|
{
|
|
|
|
UINT32 context_handle_attributes;
|
|
|
|
p_uuid_t context_handle_uuid;
|
|
|
|
} ndr_context_handle;
|
|
|
|
|
2012-10-30 00:41:20 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
2012-10-31 01:20:21 +04:00
|
|
|
p_uuid_t if_uuid;
|
2012-10-29 23:02:35 +04:00
|
|
|
UINT32 if_version;
|
2012-03-26 10:45:01 +04:00
|
|
|
} p_syntax_id_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
p_context_id_t p_cont_id;
|
|
|
|
BYTE n_transfer_syn; /* number of items */
|
|
|
|
BYTE reserved; /* alignment pad, m.b.z. */
|
|
|
|
p_syntax_id_t abstract_syntax; /* transfer syntax list */
|
|
|
|
p_syntax_id_t* transfer_syntaxes; /* size_is(n_transfer_syn) */
|
2012-03-26 10:45:01 +04:00
|
|
|
} p_cont_elem_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BYTE n_context_elem; /* number of items */
|
|
|
|
BYTE reserved; /* alignment pad, m.b.z. */
|
|
|
|
UINT16 reserved2; /* alignment pad, m.b.z. */
|
|
|
|
p_cont_elem_t* p_cont_elem; /* size_is(n_cont_elem) */
|
2012-03-26 10:45:01 +04:00
|
|
|
} p_cont_list_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
acceptance,
|
|
|
|
user_rejection,
|
|
|
|
provider_rejection
|
2012-03-26 10:45:01 +04:00
|
|
|
} p_cont_def_result_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef enum
|
|
|
|
{
|
2012-03-26 10:45:01 +04:00
|
|
|
reason_not_specified,
|
|
|
|
abstract_syntax_not_supported,
|
|
|
|
proposed_transfer_syntaxes_not_supported,
|
|
|
|
local_limit_exceeded
|
|
|
|
} p_provider_reason_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
p_cont_def_result_t result;
|
|
|
|
p_provider_reason_t reason;
|
|
|
|
p_syntax_id_t transfer_syntax;
|
2012-03-26 10:45:01 +04:00
|
|
|
} p_result_t;
|
|
|
|
|
|
|
|
/* Same order and number of elements as in bind request */
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BYTE n_results; /* count */
|
|
|
|
BYTE reserved; /* alignment pad, m.b.z. */
|
|
|
|
UINT16 reserved2; /* alignment pad, m.b.z. */
|
|
|
|
p_result_t* p_results; /* size_is(n_results) */
|
2012-03-26 10:45:01 +04:00
|
|
|
} p_result_list_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BYTE major;
|
|
|
|
BYTE minor;
|
2012-03-26 10:45:01 +04:00
|
|
|
} version_t;
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef version_t p_rt_version_t;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BYTE n_protocols; /* count */
|
|
|
|
p_rt_version_t* p_protocols; /* size_is(n_protocols) */
|
2012-03-26 10:45:01 +04:00
|
|
|
} p_rt_versions_supported_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
UINT16 length;
|
|
|
|
char* port_spec; /* port string spec; size_is(length) */
|
2012-03-26 10:45:01 +04:00
|
|
|
} port_any_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
#define REASON_NOT_SPECIFIED 0
|
|
|
|
#define TEMPORARY_CONGESTION 1
|
|
|
|
#define LOCAL_LIMIT_EXCEEDED 2
|
|
|
|
#define CALLED_PADDR_UNKNOWN 3
|
|
|
|
#define PROTOCOL_VERSION_NOT_SUPPORTED 4
|
|
|
|
#define DEFAULT_CONTEXT_NOT_SUPPORTED 5
|
|
|
|
#define USER_DATA_NOT_READABLE 6
|
|
|
|
#define NO_PSAP_AVAILABLE 7
|
|
|
|
|
|
|
|
typedef UINT16 rpcrt_reason_code_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BYTE rpc_vers;
|
|
|
|
BYTE rpc_vers_minor;
|
2012-12-08 02:41:12 +04:00
|
|
|
BYTE reserved[2];
|
2012-10-29 23:02:35 +04:00
|
|
|
BYTE packed_drep[4];
|
|
|
|
UINT32 reject_status;
|
|
|
|
BYTE reserved2[4];
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcrt_optional_data_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
2012-12-08 02:41:12 +04:00
|
|
|
rpcrt_reason_code_t reason_code;
|
|
|
|
rpcrt_optional_data_t rpc_info;
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_reject_optional_data_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
2012-12-08 02:41:12 +04:00
|
|
|
rpcrt_reason_code_t reason_code;
|
|
|
|
rpcrt_optional_data_t rpc_info;
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_disc_optional_data_t;
|
|
|
|
|
2012-11-18 01:46:30 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BYTE signature[8];
|
|
|
|
} rpc_sec_verification_trailer;
|
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
struct auth_verifier_co_s
|
2012-10-29 23:02:35 +04:00
|
|
|
{
|
2012-10-30 00:41:20 +04:00
|
|
|
/* restore 4-byte alignment */
|
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
BYTE auth_type;
|
|
|
|
BYTE auth_level;
|
|
|
|
BYTE auth_pad_length;
|
|
|
|
BYTE auth_reserved;
|
|
|
|
UINT32 auth_context_id;
|
2012-10-30 00:41:20 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
BYTE* auth_value;
|
|
|
|
};
|
2012-10-30 00:41:20 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
typedef struct auth_verifier_co_s rpc_sec_trailer;
|
|
|
|
typedef struct auth_verifier_co_s auth_verifier_co_t;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
|
|
|
/* Connection-oriented PDU Definitions */
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
UINT16 max_xmit_frag;
|
|
|
|
UINT16 max_recv_frag;
|
|
|
|
UINT32 assoc_group_id;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
p_cont_list_t p_context_elem;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
auth_verifier_co_t auth_verifier;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
} rpcconn_alter_context_hdr_t;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
UINT16 max_xmit_frag;
|
|
|
|
UINT16 max_recv_frag;
|
|
|
|
UINT32 assoc_group_id;
|
|
|
|
port_any_t sec_addr;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
|
|
|
/* restore 4-octet alignment */
|
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
p_result_list_t p_result_list;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
auth_verifier_co_t auth_verifier;
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_alter_context_response_hdr_t;
|
|
|
|
|
|
|
|
/* bind header */
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
UINT16 max_xmit_frag;
|
|
|
|
UINT16 max_recv_frag;
|
|
|
|
UINT32 assoc_group_id;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
p_cont_list_t p_context_elem;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
auth_verifier_co_t auth_verifier;
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_bind_hdr_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
UINT16 max_xmit_frag;
|
|
|
|
UINT16 max_recv_frag;
|
|
|
|
UINT32 assoc_group_id;
|
2012-10-30 00:41:20 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
port_any_t sec_addr;
|
2012-10-29 23:02:35 +04:00
|
|
|
|
2012-03-26 10:45:01 +04:00
|
|
|
/* restore 4-octet alignment */
|
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
p_result_list_t p_result_list;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
auth_verifier_co_t auth_verifier;
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_bind_ack_hdr_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
UINT16 max_xmit_frag;
|
|
|
|
UINT16 max_recv_frag;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
auth_verifier_co_t auth_verifier;
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_rpc_auth_3_hdr_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
p_reject_reason_t provider_reject_reason;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
p_rt_versions_supported_t versions;
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_bind_nak_hdr_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-08 02:41:12 +04:00
|
|
|
auth_verifier_co_t auth_verifier;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
|
|
|
} rpcconn_cancel_hdr_t;
|
|
|
|
|
2012-10-31 00:40:47 +04:00
|
|
|
/* fault codes */
|
|
|
|
|
2012-10-31 18:52:04 +04:00
|
|
|
struct _RPC_FAULT_CODE
|
|
|
|
{
|
|
|
|
UINT32 code;
|
|
|
|
char* name;
|
|
|
|
};
|
|
|
|
typedef struct _RPC_FAULT_CODE RPC_FAULT_CODE;
|
|
|
|
|
|
|
|
#define DEFINE_RPC_FAULT_CODE(_code) { _code , #_code },
|
|
|
|
|
2012-12-08 03:33:52 +04:00
|
|
|
#define nca_s_comm_failure 0x1C010001
|
|
|
|
#define nca_s_op_rng_error 0x1C010002
|
|
|
|
#define nca_s_unk_if 0x1C010003
|
|
|
|
#define nca_s_wrong_boot_time 0x1C010006
|
|
|
|
#define nca_s_you_crashed 0x1C010009
|
|
|
|
#define nca_s_proto_error 0x1C01000B
|
|
|
|
#define nca_s_out_args_too_big 0x1C010013
|
|
|
|
#define nca_s_server_too_busy 0x1C010014
|
|
|
|
#define nca_s_fault_string_too_long 0x1C010015
|
|
|
|
#define nca_s_unsupported_type 0x1C010017
|
|
|
|
#define nca_s_fault_int_div_by_zero 0x1C000001
|
2012-10-31 00:40:47 +04:00
|
|
|
#define nca_s_fault_addr_error 0x1C000002
|
|
|
|
#define nca_s_fault_fp_div_zero 0x1C000003
|
|
|
|
#define nca_s_fault_fp_underflow 0x1C000004
|
2012-12-08 03:33:52 +04:00
|
|
|
#define nca_s_fault_fp_overflow 0x1C000005
|
|
|
|
#define nca_s_fault_invalid_tag 0x1C000006
|
|
|
|
#define nca_s_fault_invalid_bound 0x1C000007
|
|
|
|
#define nca_s_rpc_version_mismatch 0x1C000008
|
|
|
|
#define nca_s_unspec_reject 0x1C000009
|
|
|
|
#define nca_s_bad_actid 0x1C00000A
|
|
|
|
#define nca_s_who_are_you_failed 0x1C00000B
|
|
|
|
#define nca_s_manager_not_entered 0x1C00000C
|
|
|
|
#define nca_s_fault_cancel 0x1C00000D
|
2012-10-31 00:40:47 +04:00
|
|
|
#define nca_s_fault_ill_inst 0x1C00000E
|
2012-12-08 03:33:52 +04:00
|
|
|
#define nca_s_fault_fp_error 0x1C00000F
|
2012-10-31 00:40:47 +04:00
|
|
|
#define nca_s_fault_int_overflow 0x1C000010
|
2012-12-08 03:33:52 +04:00
|
|
|
#define nca_s_fault_unspec 0x1C000012
|
|
|
|
#define nca_s_fault_remote_comm_failure 0x1C000013
|
|
|
|
#define nca_s_fault_pipe_empty 0x1C000014
|
2012-10-31 00:40:47 +04:00
|
|
|
#define nca_s_fault_pipe_closed 0x1C000015
|
2012-12-08 03:33:52 +04:00
|
|
|
#define nca_s_fault_pipe_order 0x1C000016
|
2012-10-31 00:40:47 +04:00
|
|
|
#define nca_s_fault_pipe_discipline 0x1C000017
|
2012-12-08 03:33:52 +04:00
|
|
|
#define nca_s_fault_pipe_comm_error 0x1C000018
|
2012-10-31 00:40:47 +04:00
|
|
|
#define nca_s_fault_pipe_memory 0x1C000019
|
2012-12-08 03:33:52 +04:00
|
|
|
#define nca_s_fault_context_mismatch 0x1C00001A
|
2012-10-31 00:40:47 +04:00
|
|
|
#define nca_s_fault_remote_no_memory 0x1C00001B
|
2012-12-08 03:33:52 +04:00
|
|
|
#define nca_s_invalid_pres_context_id 0x1C00001C
|
|
|
|
#define nca_s_unsupported_authn_level 0x1C00001D
|
|
|
|
#define nca_s_invalid_checksum 0x1C00001F
|
|
|
|
#define nca_s_invalid_crc 0x1C000020
|
2012-10-31 18:52:04 +04:00
|
|
|
#define nca_s_fault_user_defined 0x1C000021
|
2012-10-31 00:40:47 +04:00
|
|
|
#define nca_s_fault_tx_open_failed 0x1C000022
|
|
|
|
#define nca_s_fault_codeset_conv_error 0x1C000023
|
2012-12-08 03:33:52 +04:00
|
|
|
#define nca_s_fault_object_not_found 0x1C000024
|
2012-10-31 00:40:47 +04:00
|
|
|
#define nca_s_fault_no_client_stub 0x1C000025
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
UINT32 alloc_hint;
|
|
|
|
p_context_id_t p_cont_id;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
BYTE cancel_count;
|
|
|
|
BYTE reserved;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
UINT32 status;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
/* align(8) */
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE* stub_data;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
auth_verifier_co_t auth_verifier;
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_fault_hdr_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
auth_verifier_co_t auth_verifier;
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_orphaned_hdr_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
UINT32 alloc_hint;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
p_context_id_t p_cont_id;
|
|
|
|
UINT16 opnum;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
/* optional field for request, only present if the PFC_OBJECT_UUID field is non-zero */
|
2012-12-12 08:34:51 +04:00
|
|
|
p_uuid_t object;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
/* align(8) */
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
BYTE* stub_data;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
auth_verifier_co_t auth_verifier;
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_request_hdr_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
UINT32 alloc_hint;
|
|
|
|
p_context_id_t p_cont_id;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
BYTE cancel_count;
|
|
|
|
BYTE reserved;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
/* align(8) */
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE* stub_data;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
auth_verifier_co_t auth_verifier;
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_response_hdr_t;
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DEFINE_RPC_COMMON_FIELDS();
|
2012-03-26 10:45:01 +04:00
|
|
|
} rpcconn_shutdown_hdr_t;
|
|
|
|
|
2012-11-16 01:25:22 +04:00
|
|
|
typedef union
|
|
|
|
{
|
|
|
|
rpcconn_common_hdr_t common;
|
|
|
|
rpcconn_alter_context_hdr_t alter_context;
|
|
|
|
rpcconn_alter_context_response_hdr_t alter_context_response;
|
|
|
|
rpcconn_bind_hdr_t bind;
|
|
|
|
rpcconn_bind_ack_hdr_t bind_ack;
|
|
|
|
rpcconn_rpc_auth_3_hdr_t rpc_auth_3;
|
|
|
|
rpcconn_bind_nak_hdr_t bind_nak;
|
|
|
|
rpcconn_cancel_hdr_t cancel;
|
|
|
|
rpcconn_fault_hdr_t fault;
|
|
|
|
rpcconn_orphaned_hdr_t orphaned;
|
|
|
|
rpcconn_request_hdr_t request;
|
|
|
|
rpcconn_response_hdr_t response;
|
|
|
|
rpcconn_shutdown_hdr_t shutdown;
|
2012-11-16 02:58:40 +04:00
|
|
|
rpcconn_rts_hdr_t rts;
|
2012-11-16 01:25:22 +04:00
|
|
|
} rpcconn_hdr_t;
|
|
|
|
|
2012-11-28 09:32:12 +04:00
|
|
|
struct _RPC_SECURITY_PROVIDER_INFO
|
|
|
|
{
|
|
|
|
UINT32 Id;
|
|
|
|
LONG EvenLegs;
|
|
|
|
LONG NumLegs;
|
|
|
|
};
|
|
|
|
typedef struct _RPC_SECURITY_PROVIDER_INFO RPC_SECURITY_PROVIDER_INFO;
|
|
|
|
|
|
|
|
enum _RPC_CLIENT_STATE
|
|
|
|
{
|
|
|
|
RPC_CLIENT_STATE_INITIAL,
|
|
|
|
RPC_CLIENT_STATE_ESTABLISHED,
|
|
|
|
RPC_CLIENT_STATE_WAIT_SECURE_BIND_ACK,
|
|
|
|
RPC_CLIENT_STATE_WAIT_UNSECURE_BIND_ACK,
|
|
|
|
RPC_CLIENT_STATE_WAIT_SECURE_ALTER_CONTEXT_RESPONSE,
|
|
|
|
RPC_CLIENT_STATE_CONTEXT_NEGOTIATED,
|
|
|
|
RPC_CLIENT_STATE_WAIT_RESPONSE,
|
|
|
|
RPC_CLIENT_STATE_FINAL
|
|
|
|
};
|
|
|
|
typedef enum _RPC_CLIENT_STATE RPC_CLIENT_STATE;
|
|
|
|
|
|
|
|
enum _RPC_CLIENT_CALL_STATE
|
|
|
|
{
|
|
|
|
RPC_CLIENT_CALL_STATE_INITIAL,
|
|
|
|
RPC_CLIENT_CALL_STATE_SEND_PDUS,
|
|
|
|
RPC_CLIENT_CALL_STATE_DISPATCHED,
|
|
|
|
RPC_CLIENT_CALL_STATE_RECEIVE_PDU,
|
|
|
|
RPC_CLIENT_CALL_STATE_COMPLETE,
|
|
|
|
RPC_CLIENT_CALL_STATE_FAULT,
|
|
|
|
RPC_CLIENT_CALL_STATE_FINAL
|
|
|
|
};
|
|
|
|
typedef enum _RPC_CLIENT_CALL_STATE RPC_CLIENT_CALL_STATE;
|
|
|
|
|
2012-12-08 06:09:55 +04:00
|
|
|
struct rpc_client_call
|
|
|
|
{
|
|
|
|
UINT32 CallId;
|
|
|
|
UINT32 OpNum;
|
|
|
|
RPC_CLIENT_CALL_STATE State;
|
|
|
|
};
|
|
|
|
typedef struct rpc_client_call RpcClientCall;
|
|
|
|
|
2012-04-24 00:33:18 +04:00
|
|
|
enum _TSG_CHANNEL
|
|
|
|
{
|
|
|
|
TSG_CHANNEL_IN,
|
|
|
|
TSG_CHANNEL_OUT
|
|
|
|
};
|
|
|
|
typedef enum _TSG_CHANNEL TSG_CHANNEL;
|
|
|
|
|
2012-04-21 21:28:20 +04:00
|
|
|
/* Ping Originator */
|
|
|
|
|
|
|
|
struct rpc_ping_originator
|
|
|
|
{
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 ConnectionTimeout;
|
|
|
|
UINT32 LastPacketSentTimestamp;
|
|
|
|
UINT32 KeepAliveInterval;
|
2012-04-21 21:28:20 +04:00
|
|
|
};
|
|
|
|
typedef struct rpc_ping_originator RpcPingOriginator;
|
|
|
|
|
|
|
|
/* Client In Channel */
|
|
|
|
|
2012-11-17 03:30:53 +04:00
|
|
|
enum _CLIENT_IN_CHANNEL_STATE
|
|
|
|
{
|
|
|
|
CLIENT_IN_CHANNEL_STATE_INITIAL,
|
|
|
|
CLIENT_IN_CHANNEL_STATE_OPENED,
|
|
|
|
CLIENT_IN_CHANNEL_STATE_OPENED_A4W,
|
|
|
|
CLIENT_IN_CHANNEL_STATE_FINAL
|
|
|
|
};
|
|
|
|
typedef enum _CLIENT_IN_CHANNEL_STATE CLIENT_IN_CHANNEL_STATE;
|
|
|
|
|
2012-04-21 21:28:20 +04:00
|
|
|
struct rpc_in_channel
|
|
|
|
{
|
|
|
|
/* Sending Channel */
|
|
|
|
|
2012-11-17 03:30:53 +04:00
|
|
|
CLIENT_IN_CHANNEL_STATE State;
|
|
|
|
|
2012-11-29 05:30:03 +04:00
|
|
|
HANDLE Mutex;
|
|
|
|
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 PlugState;
|
2012-04-21 21:28:20 +04:00
|
|
|
void* SendQueue;
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 BytesSent;
|
|
|
|
UINT32 SenderAvailableWindow;
|
|
|
|
UINT32 PeerReceiveWindow;
|
2012-04-21 21:28:20 +04:00
|
|
|
|
|
|
|
/* Ping Originator */
|
|
|
|
|
|
|
|
RpcPingOriginator PingOriginator;
|
|
|
|
};
|
|
|
|
typedef struct rpc_in_channel RpcInChannel;
|
|
|
|
|
|
|
|
/* Client Out Channel */
|
|
|
|
|
2012-11-17 03:30:53 +04:00
|
|
|
enum _CLIENT_OUT_CHANNEL_STATE
|
|
|
|
{
|
|
|
|
CLIENT_OUT_CHANNEL_STATE_INITIAL,
|
|
|
|
CLIENT_OUT_CHANNEL_STATE_OPENED,
|
|
|
|
CLIENT_OUT_CHANNEL_STATE_OPENED_A6W,
|
|
|
|
CLIENT_OUT_CHANNEL_STATE_OPENED_A10W,
|
|
|
|
CLIENT_OUT_CHANNEL_STATE_OPENED_B3W,
|
|
|
|
CLIENT_OUT_CHANNEL_STATE_FINAL
|
|
|
|
};
|
|
|
|
typedef enum _CLIENT_OUT_CHANNEL_STATE CLIENT_OUT_CHANNEL_STATE;
|
|
|
|
|
2012-04-21 21:28:20 +04:00
|
|
|
struct rpc_out_channel
|
|
|
|
{
|
|
|
|
/* Receiving Channel */
|
|
|
|
|
2012-11-17 03:30:53 +04:00
|
|
|
CLIENT_OUT_CHANNEL_STATE State;
|
|
|
|
|
2012-11-29 05:30:03 +04:00
|
|
|
HANDLE Mutex;
|
|
|
|
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 ReceiveWindow;
|
|
|
|
UINT32 ReceiveWindowSize;
|
|
|
|
UINT32 ReceiverAvailableWindow;
|
|
|
|
UINT32 BytesReceived;
|
|
|
|
UINT32 AvailableWindowAdvertised;
|
2012-04-21 21:28:20 +04:00
|
|
|
};
|
|
|
|
typedef struct rpc_out_channel RpcOutChannel;
|
|
|
|
|
|
|
|
/* Client Virtual Connection */
|
|
|
|
|
2012-04-22 00:18:07 +04:00
|
|
|
enum _VIRTUAL_CONNECTION_STATE
|
|
|
|
{
|
|
|
|
VIRTUAL_CONNECTION_STATE_INITIAL,
|
|
|
|
VIRTUAL_CONNECTION_STATE_OUT_CHANNEL_WAIT,
|
|
|
|
VIRTUAL_CONNECTION_STATE_WAIT_A3W,
|
|
|
|
VIRTUAL_CONNECTION_STATE_WAIT_C2,
|
|
|
|
VIRTUAL_CONNECTION_STATE_OPENED,
|
|
|
|
VIRTUAL_CONNECTION_STATE_FINAL
|
|
|
|
};
|
|
|
|
typedef enum _VIRTUAL_CONNECTION_STATE VIRTUAL_CONNECTION_STATE;
|
|
|
|
|
2012-04-21 21:28:20 +04:00
|
|
|
struct rpc_virtual_connection
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE Cookie[16]; /* Virtual Connection Cookie */
|
2012-04-22 00:18:07 +04:00
|
|
|
VIRTUAL_CONNECTION_STATE State; /* Virtual Connection State */
|
2012-04-21 21:28:20 +04:00
|
|
|
RpcInChannel* DefaultInChannel; /* Default IN Channel */
|
|
|
|
RpcInChannel* NonDefaultInChannel; /* Non-Default IN Channel */
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE DefaultInChannelCookie[16]; /* Default IN Channel Cookie */
|
|
|
|
BYTE NonDefaultInChannelCookie[16]; /* Non-Default Default IN Channel Cookie */
|
2012-04-21 21:28:20 +04:00
|
|
|
RpcOutChannel* DefaultOutChannel; /* Default OUT Channel */
|
|
|
|
RpcOutChannel* NonDefaultOutChannel; /* Non-Default OUT Channel */
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE DefaultOutChannelCookie[16]; /* Default OUT Channel Cookie */
|
|
|
|
BYTE NonDefaultOutChannelCookie[16]; /* Non-Default Default OUT Channel Cookie */
|
|
|
|
BYTE AssociationGroupId[16]; /* AssociationGroupId */
|
2012-04-21 21:28:20 +04:00
|
|
|
};
|
|
|
|
typedef struct rpc_virtual_connection RpcVirtualConnection;
|
|
|
|
|
2012-11-16 20:25:10 +04:00
|
|
|
/* Virtual Connection Cookie Table */
|
|
|
|
|
2012-11-17 12:45:15 +04:00
|
|
|
#define RPC_UUID_FORMAT_STRING "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
|
|
|
|
#define RPC_UUID_FORMAT_ARGUMENTS(_rpc_uuid) \
|
|
|
|
_rpc_uuid[0], _rpc_uuid[1], _rpc_uuid[2], _rpc_uuid[3], _rpc_uuid[4], _rpc_uuid[5], _rpc_uuid[6], _rpc_uuid[7], \
|
|
|
|
_rpc_uuid[8], _rpc_uuid[9], _rpc_uuid[10], _rpc_uuid[11], _rpc_uuid[12], _rpc_uuid[13], _rpc_uuid[14], _rpc_uuid[15]
|
|
|
|
|
2012-11-16 20:25:10 +04:00
|
|
|
struct rpc_virtual_connection_cookie_entry
|
|
|
|
{
|
|
|
|
BYTE Cookie[16];
|
|
|
|
UINT32 ReferenceCount;
|
|
|
|
RpcVirtualConnection* Reference;
|
|
|
|
};
|
|
|
|
typedef struct rpc_virtual_connection_cookie_entry RpcVirtualConnectionCookieEntry;
|
|
|
|
|
2012-11-28 21:47:04 +04:00
|
|
|
struct rpc_client
|
|
|
|
{
|
|
|
|
HANDLE Thread;
|
|
|
|
HANDLE StopEvent;
|
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
wQueue* SendQueue;
|
2012-12-12 09:49:15 +04:00
|
|
|
|
|
|
|
wQueue* ReceivePool;
|
2012-12-12 08:34:51 +04:00
|
|
|
wQueue* ReceiveQueue;
|
|
|
|
|
2012-12-12 04:17:57 +04:00
|
|
|
wQueue* FragmentPool;
|
2012-12-11 03:56:53 +04:00
|
|
|
wQueue* FragmentQueue;
|
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
wArrayList* ClientCallList;
|
|
|
|
|
2012-11-28 22:38:01 +04:00
|
|
|
HANDLE PduSentEvent;
|
2012-11-29 05:30:03 +04:00
|
|
|
|
2012-12-11 03:56:53 +04:00
|
|
|
BOOL SynchronousSend;
|
2012-11-29 05:30:03 +04:00
|
|
|
BOOL SynchronousReceive;
|
2012-11-28 21:47:04 +04:00
|
|
|
};
|
|
|
|
typedef struct rpc_client RpcClient;
|
|
|
|
|
2012-04-18 09:53:12 +04:00
|
|
|
struct rdp_rpc
|
2012-03-26 10:45:01 +04:00
|
|
|
{
|
2012-11-28 09:32:12 +04:00
|
|
|
RPC_CLIENT_STATE State;
|
|
|
|
|
2012-11-15 19:00:07 +04:00
|
|
|
rdpTls* TlsIn;
|
|
|
|
rdpTls* TlsOut;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-03-27 07:20:25 +04:00
|
|
|
rdpNtlm* ntlm;
|
2012-12-12 08:34:51 +04:00
|
|
|
int SendSeqNum;
|
2012-04-24 00:33:18 +04:00
|
|
|
|
2012-11-28 21:47:04 +04:00
|
|
|
RpcClient* client;
|
|
|
|
|
2012-11-15 19:00:07 +04:00
|
|
|
rdpNtlmHttp* NtlmHttpIn;
|
|
|
|
rdpNtlmHttp* NtlmHttpOut;
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-03-27 07:20:25 +04:00
|
|
|
rdpSettings* settings;
|
2012-04-24 00:33:18 +04:00
|
|
|
rdpTransport* transport;
|
2012-03-27 07:20:25 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
UINT32 CallId;
|
2012-12-08 06:09:55 +04:00
|
|
|
UINT32 PipeCallId;
|
2012-04-24 00:33:18 +04:00
|
|
|
|
2012-11-29 05:30:03 +04:00
|
|
|
RPC_PDU* pdu;
|
|
|
|
|
2012-11-27 11:49:44 +04:00
|
|
|
BYTE* StubBuffer;
|
2012-11-29 05:30:03 +04:00
|
|
|
UINT32 StubBufferSize;
|
2012-11-27 11:49:44 +04:00
|
|
|
UINT32 StubLength;
|
|
|
|
UINT32 StubOffset;
|
|
|
|
UINT32 StubFragCount;
|
2012-12-08 06:09:55 +04:00
|
|
|
UINT32 StubCallId;
|
2012-11-27 11:49:44 +04:00
|
|
|
|
2012-10-30 00:41:20 +04:00
|
|
|
BYTE rpc_vers;
|
|
|
|
BYTE rpc_vers_minor;
|
|
|
|
BYTE packed_drep[4];
|
|
|
|
|
2012-11-16 01:25:22 +04:00
|
|
|
UINT16 max_xmit_frag;
|
|
|
|
UINT16 max_recv_frag;
|
|
|
|
|
2012-12-11 00:43:07 +04:00
|
|
|
wStream* RecvFrag;
|
|
|
|
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 ReceiveWindow;
|
2012-04-21 21:28:20 +04:00
|
|
|
|
2012-11-17 03:30:53 +04:00
|
|
|
UINT32 ChannelLifetime;
|
|
|
|
UINT32 ChannelLifetimeSet;
|
|
|
|
|
2012-11-16 20:25:10 +04:00
|
|
|
UINT32 KeepAliveInterval;
|
|
|
|
UINT32 CurrentKeepAliveTime;
|
|
|
|
UINT32 CurrentKeepAliveInterval;
|
|
|
|
|
2012-04-21 21:28:20 +04:00
|
|
|
RpcVirtualConnection* VirtualConnection;
|
2012-12-12 08:34:51 +04:00
|
|
|
|
|
|
|
wArrayList* VirtualConnectionCookieTable;
|
2012-03-26 10:45:01 +04:00
|
|
|
};
|
|
|
|
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL rpc_connect(rdpRpc* rpc);
|
2012-03-26 20:20:38 +04:00
|
|
|
|
2012-12-12 08:34:51 +04:00
|
|
|
void rpc_pdu_header_print(rpcconn_hdr_t* header);
|
2012-11-16 01:25:22 +04:00
|
|
|
void rpc_pdu_header_init(rdpRpc* rpc, rpcconn_hdr_t* header);
|
2012-04-22 00:18:07 +04:00
|
|
|
|
2012-10-31 17:22:32 +04:00
|
|
|
UINT32 rpc_offset_align(UINT32* offset, UINT32 alignment);
|
|
|
|
UINT32 rpc_offset_pad(UINT32* offset, UINT32 pad);
|
|
|
|
|
2012-12-11 00:43:07 +04:00
|
|
|
int rpc_out_read(rdpRpc* rpc, BYTE* data, int length);
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
int rpc_out_write(rdpRpc* rpc, BYTE* data, int length);
|
|
|
|
int rpc_in_write(rdpRpc* rpc, BYTE* data, int length);
|
2012-04-22 00:18:07 +04:00
|
|
|
|
2012-11-15 04:51:45 +04:00
|
|
|
BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* header, UINT32* offset, UINT32* length);
|
2012-11-15 03:51:40 +04:00
|
|
|
|
2012-11-29 05:30:03 +04:00
|
|
|
int rpc_write(rdpRpc* rpc, BYTE* data, int length, UINT16 opnum);
|
2012-03-26 10:45:01 +04:00
|
|
|
|
2012-04-24 00:33:18 +04:00
|
|
|
rdpRpc* rpc_new(rdpTransport* transport);
|
|
|
|
void rpc_free(rdpRpc* rpc);
|
2012-03-26 20:20:38 +04:00
|
|
|
|
|
|
|
#ifdef WITH_DEBUG_TSG
|
2012-04-18 09:53:12 +04:00
|
|
|
#define WITH_DEBUG_RPC
|
2012-03-26 20:20:38 +04:00
|
|
|
#endif
|
|
|
|
|
2012-04-18 09:53:12 +04:00
|
|
|
#ifdef WITH_DEBUG_RPC
|
|
|
|
#define DEBUG_RPC(fmt, ...) DEBUG_CLASS(RPC, fmt, ## __VA_ARGS__)
|
2012-03-26 10:45:01 +04:00
|
|
|
#else
|
2012-04-18 09:53:12 +04:00
|
|
|
#define DEBUG_RPC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
2012-03-26 10:45:01 +04:00
|
|
|
#endif
|
|
|
|
|
2012-04-14 22:19:31 +04:00
|
|
|
#endif /* FREERDP_CORE_RPC_H */
|