20#ifndef FREERDP_CLIENT_H
21#define FREERDP_CLIENT_H
23#include <winpr/cmdline.h>
24#include <freerdp/client/cmdline.h>
26#include <freerdp/config.h>
27#include <freerdp/api.h>
28#include <freerdp/types.h>
29#include <freerdp/event.h>
30#include <freerdp/freerdp.h>
32#if defined(CHANNEL_AINPUT_CLIENT)
33#include <freerdp/client/ainput.h>
36#if defined(CHANNEL_RDPEI_CLIENT)
37#include <freerdp/client/rdpei.h>
40#if defined(CHANNEL_ENCOMSP_CLIENT)
41#include <freerdp/client/encomsp.h>
53 typedef BOOL (*pRdpGlobalInit)(void);
54 typedef void (*pRdpGlobalUninit)(void);
56 typedef BOOL (*pRdpClientNew)(freerdp* instance, rdpContext* context);
57 typedef void (*pRdpClientFree)(freerdp* instance, rdpContext* context);
59 typedef int (*pRdpClientStart)(rdpContext* context);
60 typedef int (*pRdpClientStop)(rdpContext* context);
67 rdpSettings* settings;
69 pRdpGlobalInit GlobalInit;
70 pRdpGlobalUninit GlobalUninit;
73 pRdpClientNew ClientNew;
74 pRdpClientFree ClientFree;
76 pRdpClientStart ClientStart;
77 pRdpClientStop ClientStop;
80#define RDP_CLIENT_INTERFACE_VERSION 1
81#define RDP_CLIENT_ENTRY_POINT_NAME "RdpClientEntry"
83 typedef int (*pRdpClientEntry)(RDP_CLIENT_ENTRY_POINTS* pEntryPoints);
86#define FREERDP_MAX_TOUCH_CONTACTS 10
95 ALIGN64 UINT32 pressure;
98#define FREERDP_MAX_PEN_DEVICES 10
100 typedef struct pen_device
102 ALIGN64 INT32 deviceid;
103 ALIGN64 UINT32 flags;
104 ALIGN64
double max_pressure;
105 ALIGN64 BOOL hovering;
106 ALIGN64 BOOL pressed;
107 ALIGN64 INT32 last_x;
108 ALIGN64 INT32 last_y;
100 typedef struct pen_device {
…};
115#if defined(CHANNEL_AINPUT_CLIENT)
116 ALIGN64 AInputClientContext* ainput;
121#if defined(CHANNEL_RDPEI_CLIENT)
122 ALIGN64 RdpeiClientContext* rdpei;
129 ALIGN64 BOOL mouse_grabbed;
131#if defined(CHANNEL_ENCOMSP_CLIENT)
132 ALIGN64 EncomspClientContext* encomsp;
133 ALIGN64 BOOL controlToggle;
144 FREERDP_API
void freerdp_client_context_free(rdpContext* context);
146 WINPR_ATTR_MALLOC(freerdp_client_context_free, 1)
147 FREERDP_API rdpContext* freerdp_client_context_new(const RDP_CLIENT_ENTRY_POINTS* pEntryPoints);
149 FREERDP_API
int freerdp_client_start(rdpContext* context);
150 FREERDP_API
int freerdp_client_stop(rdpContext* context);
152 FREERDP_API freerdp* freerdp_client_get_instance(rdpContext* context);
153 FREERDP_API HANDLE freerdp_client_get_thread(rdpContext* context);
155 FREERDP_API
int freerdp_client_settings_parse_command_line(rdpSettings* settings,
int argc,
156 char** argv, BOOL allowUnknown);
171 FREERDP_API
int freerdp_client_settings_parse_command_line_ex(
172 rdpSettings* settings,
int argc,
char** argv, BOOL allowUnknown,
174 freerdp_command_line_handle_option_t handle_option,
void* handle_userdata);
176 FREERDP_API
int freerdp_client_settings_parse_connection_file(rdpSettings* settings,
177 const
char* filename);
178 FREERDP_API
int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings,
181 FREERDP_API
int freerdp_client_settings_write_connection_file(const rdpSettings* settings,
182 const
char* filename,
185 FREERDP_API
int freerdp_client_settings_parse_assistance_file(rdpSettings* settings,
int argc,
188 FREERDP_API BOOL client_cli_authenticate_ex(freerdp* instance,
char** username,
char** password,
189 char** domain, rdp_auth_reason reason);
191 FREERDP_API BOOL client_cli_choose_smartcard(freerdp* instance,
SmartcardCertInfo** cert_list,
192 DWORD count, DWORD* choice, BOOL gateway);
194 FREERDP_API
int client_cli_logon_error_info(freerdp* instance, UINT32 data, UINT32 type);
196 FREERDP_API BOOL client_cli_get_access_token(freerdp* instance, AccessTokenType tokenType,
197 char** token,
size_t count, ...);
198 FREERDP_API BOOL client_common_get_access_token(freerdp* instance, const
char* request,
201 FREERDP_API SSIZE_T client_common_retry_dialog(freerdp* instance, const
char* what,
202 size_t current,
void* userarg);
205 freerdp_client_OnChannelConnectedEventHandler(
void* context,
206 const ChannelConnectedEventArgs* e);
208 freerdp_client_OnChannelDisconnectedEventHandler(
void* context,
209 const ChannelDisconnectedEventArgs* e);
211#if defined(WITH_FREERDP_DEPRECATED)
212 WINPR_DEPRECATED_VAR(
"Use client_cli_authenticate_ex",
213 FREERDP_API BOOL client_cli_authenticate(freerdp* instance,
214 char** username,
char** password,
216 WINPR_DEPRECATED_VAR(
"Use client_cli_authenticate_ex",
217 FREERDP_API BOOL client_cli_gw_authenticate(
218 freerdp* instance,
char** username,
char** password,
char** domain));
220 WINPR_DEPRECATED_VAR(
"Use client_cli_verify_certificate_ex",
221 FREERDP_API DWORD client_cli_verify_certificate(
222 freerdp* instance,
const char* common_name,
const char* subject,
223 const char* issuer,
const char* fingerprint, BOOL host_mismatch));
226 FREERDP_API DWORD client_cli_verify_certificate_ex(freerdp* instance,
const char* host,
227 UINT16 port,
const char* common_name,
228 const char* subject,
const char* issuer,
229 const char* fingerprint, DWORD flags);
231#if defined(WITH_FREERDP_DEPRECATED)
232 WINPR_DEPRECATED_VAR(
"Use client_cli_verify_changed_certificate_ex",
233 FREERDP_API DWORD client_cli_verify_changed_certificate(
234 freerdp* instance,
const char* common_name,
const char* subject,
235 const char* issuer,
const char* fingerprint,
const char* old_subject,
236 const char* old_issuer,
const char* old_fingerprint));
239 FREERDP_API DWORD client_cli_verify_changed_certificate_ex(
240 freerdp* instance,
const char* host, UINT16 port,
const char* common_name,
241 const char* subject,
const char* issuer,
const char* fingerprint,
const char* old_subject,
242 const char* old_issuer,
const char* old_fingerprint, DWORD flags);
244 FREERDP_API BOOL client_cli_present_gateway_message(freerdp* instance, UINT32 type,
245 BOOL isDisplayMandatory,
246 BOOL isConsentMandatory,
size_t length,
247 const WCHAR* message);
249 FREERDP_API BOOL client_auto_reconnect(freerdp* instance);
250 FREERDP_API BOOL client_auto_reconnect_ex(freerdp* instance,
251 BOOL (*window_events)(freerdp* instance));
255 FREERDP_TOUCH_DOWN = 0x01,
256 FREERDP_TOUCH_UP = 0x02,
257 FREERDP_TOUCH_MOTION = 0x04,
258 FREERDP_TOUCH_HAS_PRESSURE = 0x100
259 } FreeRDPTouchEventType;
261 FREERDP_API BOOL freerdp_client_handle_touch(rdpClientContext* cctx, UINT32 flags, INT32 finger,
262 UINT32 pressure, INT32 x, INT32 y);
266 FREERDP_PEN_REGISTER = 0x01,
267 FREERDP_PEN_ERASER_PRESSED = 0x02,
268 FREERDP_PEN_PRESS = 0x04,
269 FREERDP_PEN_MOTION = 0x08,
270 FREERDP_PEN_RELEASE = 0x10,
271 FREERDP_PEN_BARREL_PRESSED = 0x20,
272 FREERDP_PEN_HAS_PRESSURE = 0x40,
273 FREERDP_PEN_HAS_ROTATION = 0x80,
274 FREERDP_PEN_HAS_TILTX = 0x100,
275 FREERDP_PEN_HAS_TILTY = 0x200,
276 FREERDP_PEN_IS_INVERTED = 0x400
277 } FreeRDPPenEventType;
279 FREERDP_API BOOL freerdp_client_handle_pen(rdpClientContext* cctx, UINT32 flags, INT32 deviceid,
281 FREERDP_API BOOL freerdp_client_is_pen(rdpClientContext* cctx, INT32 deviceid);
283 FREERDP_API BOOL freerdp_client_pen_cancel_all(rdpClientContext* cctx);
285 FREERDP_API BOOL freerdp_client_send_wheel_event(rdpClientContext* cctx, UINT16 mflags);
287 FREERDP_API BOOL freerdp_client_send_mouse_event(rdpClientContext* cctx, UINT64 mflags, INT32 x,
297 FREERDP_API BOOL freerdp_client_use_relative_mouse_events(rdpClientContext* cctx);
299 FREERDP_API BOOL freerdp_client_send_button_event(rdpClientContext* cctx, BOOL relative,
300 UINT16 mflags, INT32 x, INT32 y);
302 FREERDP_API BOOL freerdp_client_send_extended_button_event(rdpClientContext* cctx,
303 BOOL relative, UINT16 mflags,
306 FREERDP_API
int freerdp_client_common_stop(rdpContext* context);
308 FREERDP_API BOOL freerdp_client_load_channels(freerdp* instance);
310#if defined(CHANNEL_ENCOMSP_CLIENT)
311 FREERDP_API BOOL freerdp_client_encomsp_toggle_control(EncomspClientContext* encomsp);
312 FREERDP_API BOOL freerdp_client_encomsp_set_control(EncomspClientContext* encomsp,
ALIGN64 FreeRDP_TouchContact contacts[FREERDP_MAX_TOUCH_CONTACTS]
ALIGN64 FreeRDP_PenDevice pens[FREERDP_MAX_PEN_DEVICES]