#include <freerdp/config.h>
#include <winpr/assert.h>
#include <winpr/sspicli.h>
#include <float.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/XKBlib.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <unistd.h>
#include <string.h>
#include <termios.h>
#include <pthread.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/select.h>
#include <freerdp/freerdp.h>
#include <freerdp/constants.h>
#include <freerdp/codec/nsc.h>
#include <freerdp/codec/rfx.h>
#include <freerdp/codec/color.h>
#include <freerdp/codec/bitmap.h>
#include <freerdp/utils/signal.h>
#include <freerdp/utils/passphrase.h>
#include <freerdp/client/cliprdr.h>
#include <freerdp/client/channels.h>
#include <freerdp/client/file.h>
#include <freerdp/client/cmdline.h>
#include <winpr/crt.h>
#include <winpr/synch.h>
#include <winpr/file.h>
#include <winpr/print.h>
#include <winpr/sysinfo.h>
#include "xf_gdi.h"
#include "xf_rail.h"
#include "xf_event.h"
#include "xf_input.h"
#include "xf_cliprdr.h"
#include "xf_disp.h"
#include "xf_video.h"
#include "xf_monitor.h"
#include "xf_graphics.h"
#include "xf_keyboard.h"
#include "xf_channels.h"
#include "xfreerdp.h"
#include <freerdp/log.h>
|
static int | xf_map_error_to_exit_code (DWORD error) |
|
static int | _xf_error_handler (Display *d, XErrorEvent *ev) |
|
static void | xf_check_extensions (xfContext *context) |
|
static void | xf_window_free (xfContext *xfc) |
|
static BOOL | xf_get_pixmap_info (xfContext *xfc) |
|
void | xf_draw_screen_ (xfContext *xfc, int x, int y, int w, int h, const char *fkt, const char *file, int line) |
|
static BOOL | xf_desktop_resize (rdpContext *context) |
|
static BOOL | xf_sw_end_paint (rdpContext *context) |
|
static BOOL | xf_sw_desktop_resize (rdpContext *context) |
|
static BOOL | xf_hw_end_paint (rdpContext *context) |
|
static BOOL | xf_hw_desktop_resize (rdpContext *context) |
|
static BOOL | xf_process_x_events (freerdp *instance) |
|
static char * | xf_window_get_title (rdpSettings *settings) |
|
BOOL | xf_create_window (xfContext *xfc) |
|
void | xf_toggle_fullscreen (xfContext *xfc) |
|
BOOL | xf_toggle_control (xfContext *xfc) |
|
static UINT | xf_encomsp_participant_created (EncomspClientContext *context, const ENCOMSP_PARTICIPANT_CREATED_PDU *participantCreated) |
|
void | xf_encomsp_init (xfContext *xfc, EncomspClientContext *encomsp) |
|
void | xf_encomsp_uninit (xfContext *xfc, EncomspClientContext *encomsp) |
|
void | xf_lock_x11_ (xfContext *xfc, const char *fkt) |
|
void | xf_unlock_x11_ (xfContext *xfc, const char *fkt) |
|
static int | xf_error_handler (Display *d, XErrorEvent *ev) |
|
static BOOL | xf_play_sound (rdpContext *context, const PLAY_SOUND_UPDATE *play_sound) |
|
static void | xf_get_x11_button_map (xfContext *xfc, unsigned char *x11_map) |
|
static UINT16 | get_flags_for_button (int button) |
|
static void | xf_button_map_init (xfContext *xfc) |
|
static BOOL | xf_pre_connect (freerdp *instance) |
|
static BOOL | xf_post_connect (freerdp *instance) |
|
static void | xf_post_disconnect (freerdp *instance) |
|
static int | xf_logon_error_info (freerdp *instance, UINT32 data, UINT32 type) |
|
static BOOL | handle_window_events (freerdp *instance) |
|
static DWORD WINAPI | xf_client_thread (LPVOID param) |
|
DWORD | xf_exit_code_from_disconnect_reason (DWORD reason) |
|
static void | xf_TerminateEventHandler (void *context, const TerminateEventArgs *e) |
|
static BOOL | xfreerdp_client_global_init () |
|
static void | xfreerdp_client_global_uninit () |
|
static int | xfreerdp_client_start (rdpContext *context) |
|
static Atom | get_supported_atom (xfContext *xfc, const char *atomName) |
|
static BOOL | xfreerdp_client_new (freerdp *instance, rdpContext *context) |
|
static void | xfreerdp_client_free (freerdp *instance, rdpContext *context) |
|
int | RdpClientEntry (RDP_CLIENT_ENTRY_POINTS *pEntryPoints) |
|
◆ MIN_PIXEL_DIFF
#define MIN_PIXEL_DIFF 0.001 |
◆ TAG
◆ _xf_error_handler()
static int _xf_error_handler |
( |
Display * |
d, |
|
|
XErrorEvent * |
ev |
|
) |
| |
|
static |
◆ get_flags_for_button()
static UINT16 get_flags_for_button |
( |
int |
button | ) |
|
|
static |
◆ get_supported_atom()
static Atom get_supported_atom |
( |
xfContext * |
xfc, |
|
|
const char * |
atomName |
|
) |
| |
|
static |
◆ handle_window_events()
static BOOL handle_window_events |
( |
freerdp * |
instance | ) |
|
|
static |
◆ RdpClientEntry()
◆ xf_button_map_init()
static void xf_button_map_init |
( |
xfContext * |
xfc | ) |
|
|
static |
◆ xf_check_extensions()
static void xf_check_extensions |
( |
xfContext * |
context | ) |
|
|
static |
◆ xf_client_thread()
static DWORD WINAPI xf_client_thread |
( |
LPVOID |
param | ) |
|
|
static |
Main loop for the rdp connection. It will be run from the thread's entry point (thread_func()). It initiates the connection, and will continue to run until the session ends, processing events as they are received.
- Parameters
-
param | - pointer to the rdp_freerdp structure that contains the session's settings |
- Returns
- A code from the enum XF_EXIT_CODE (0 if successful)
◆ xf_create_window()
BOOL xf_create_window |
( |
xfContext * |
xfc | ) |
|
◆ xf_desktop_resize()
static BOOL xf_desktop_resize |
( |
rdpContext * |
context | ) |
|
|
static |
◆ xf_draw_screen_()
void xf_draw_screen_ |
( |
xfContext * |
xfc, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
const char * |
fkt, |
|
|
const char * |
file, |
|
|
int |
line |
|
) |
| |
◆ xf_encomsp_init()
void xf_encomsp_init |
( |
xfContext * |
xfc, |
|
|
EncomspClientContext * |
encomsp |
|
) |
| |
◆ xf_encomsp_participant_created()
Function description
- Returns
- 0 on success, otherwise a Win32 error code
◆ xf_encomsp_uninit()
void xf_encomsp_uninit |
( |
xfContext * |
xfc, |
|
|
EncomspClientContext * |
encomsp |
|
) |
| |
◆ xf_error_handler()
static int xf_error_handler |
( |
Display * |
d, |
|
|
XErrorEvent * |
ev |
|
) |
| |
|
static |
◆ xf_exit_code_from_disconnect_reason()
DWORD xf_exit_code_from_disconnect_reason |
( |
DWORD |
reason | ) |
|
◆ xf_get_pixmap_info()
static BOOL xf_get_pixmap_info |
( |
xfContext * |
xfc | ) |
|
|
static |
◆ xf_get_x11_button_map()
static void xf_get_x11_button_map |
( |
xfContext * |
xfc, |
|
|
unsigned char * |
x11_map |
|
) |
| |
|
static |
◆ xf_hw_desktop_resize()
static BOOL xf_hw_desktop_resize |
( |
rdpContext * |
context | ) |
|
|
static |
◆ xf_hw_end_paint()
static BOOL xf_hw_end_paint |
( |
rdpContext * |
context | ) |
|
|
static |
◆ xf_lock_x11_()
void xf_lock_x11_ |
( |
xfContext * |
xfc, |
|
|
const char * |
fkt |
|
) |
| |
◆ xf_logon_error_info()
static int xf_logon_error_info |
( |
freerdp * |
instance, |
|
|
UINT32 |
data, |
|
|
UINT32 |
type |
|
) |
| |
|
static |
◆ xf_map_error_to_exit_code()
static int xf_map_error_to_exit_code |
( |
DWORD |
error | ) |
|
|
static |
◆ xf_play_sound()
static BOOL xf_play_sound |
( |
rdpContext * |
context, |
|
|
const PLAY_SOUND_UPDATE * |
play_sound |
|
) |
| |
|
static |
◆ xf_post_connect()
static BOOL xf_post_connect |
( |
freerdp * |
instance | ) |
|
|
static |
Callback given to freerdp_connect() to perform post-connection operations. It will be called only if the connection was initialized properly, and will continue the initialization based on the newly created connection.
◆ xf_post_disconnect()
static void xf_post_disconnect |
( |
freerdp * |
instance | ) |
|
|
static |
◆ xf_pre_connect()
static BOOL xf_pre_connect |
( |
freerdp * |
instance | ) |
|
|
static |
Callback given to freerdp_connect() to process the pre-connect operations. It will fill the rdp_freerdp structure (instance) with the appropriate options to use for the connection.
- Parameters
-
instance | - pointer to the rdp_freerdp structure that contains the connection's parameters, and will be filled with the appropriate informations. |
- Returns
- TRUE if successful. FALSE otherwise. Can exit with error code XF_EXIT_PARSE_ARGUMENTS if there is an error in the parameters.
◆ xf_process_x_events()
static BOOL xf_process_x_events |
( |
freerdp * |
instance | ) |
|
|
static |
◆ xf_sw_desktop_resize()
static BOOL xf_sw_desktop_resize |
( |
rdpContext * |
context | ) |
|
|
static |
◆ xf_sw_end_paint()
static BOOL xf_sw_end_paint |
( |
rdpContext * |
context | ) |
|
|
static |
◆ xf_TerminateEventHandler()
static void xf_TerminateEventHandler |
( |
void * |
context, |
|
|
const TerminateEventArgs * |
e |
|
) |
| |
|
static |
◆ xf_toggle_control()
BOOL xf_toggle_control |
( |
xfContext * |
xfc | ) |
|
◆ xf_toggle_fullscreen()
void xf_toggle_fullscreen |
( |
xfContext * |
xfc | ) |
|
◆ xf_unlock_x11_()
void xf_unlock_x11_ |
( |
xfContext * |
xfc, |
|
|
const char * |
fkt |
|
) |
| |
◆ xf_window_free()
static void xf_window_free |
( |
xfContext * |
xfc | ) |
|
|
static |
◆ xf_window_get_title()
static char* xf_window_get_title |
( |
rdpSettings * |
settings | ) |
|
|
static |
◆ xfreerdp_client_free()
static void xfreerdp_client_free |
( |
freerdp * |
instance, |
|
|
rdpContext * |
context |
|
) |
| |
|
static |
◆ xfreerdp_client_global_init()
static BOOL xfreerdp_client_global_init |
( |
| ) |
|
|
static |
◆ xfreerdp_client_global_uninit()
static void xfreerdp_client_global_uninit |
( |
| ) |
|
|
static |
◆ xfreerdp_client_new()
static BOOL xfreerdp_client_new |
( |
freerdp * |
instance, |
|
|
rdpContext * |
context |
|
) |
| |
|
static |
◆ xfreerdp_client_start()
static int xfreerdp_client_start |
( |
rdpContext * |
context | ) |
|
|
static |
◆ _def_error_handler
int(* _def_error_handler) (Display *, XErrorEvent *) |
|
static |
◆ xf_button_flags
◆ xf_exit_code_map
const struct xf_exit_code_map_t xf_exit_code_map[] |
|
static |
#define FREERDP_ERROR_CONNECT_PASSWORD_CERTAINLY_EXPIRED
Definition: include/freerdp/error.h:327
#define FREERDP_ERROR_CONNECT_LOGON_FAILURE
Definition: include/freerdp/error.h:332
@ XF_EXIT_TLS_CONNECT_FAILED
Definition: xfreerdp.h:358
#define FREERDP_ERROR_INSUFFICIENT_PRIVILEGES
Definition: include/freerdp/error.h:304
@ XF_EXIT_DNS_ERROR
Definition: xfreerdp.h:354
@ XF_EXIT_LOGON_FAILURE
Definition: xfreerdp.h:349
#define FREERDP_ERROR_PRE_CONNECT_FAILED
Definition: include/freerdp/error.h:283
#define FREERDP_ERROR_CONNECT_ACCESS_DENIED
Definition: include/freerdp/error.h:336
#define FREERDP_ERROR_CONNECT_CLIENT_REVOKED
Definition: include/freerdp/error.h:330
#define FREERDP_ERROR_MCS_CONNECT_INITIAL_ERROR
Definition: include/freerdp/error.h:296
@ XF_EXIT_CONNECT_ACCOUNT_DISABLED
Definition: xfreerdp.h:366
@ XF_EXIT_CONNECT_PASSWORD_CERTAINLY_EXPIRED
Definition: xfreerdp.h:367
#define FREERDP_ERROR_TLS_CONNECT_FAILED
Definition: include/freerdp/error.h:299
#define FREERDP_ERROR_CONNECT_PASSWORD_MUST_CHANGE
Definition: include/freerdp/error.h:318
#define FREERDP_ERROR_SECURITY_NEGO_CONNECT_FAILED
Definition: include/freerdp/error.h:309
#define FREERDP_ERROR_CONNECT_PASSWORD_EXPIRED
Definition: include/freerdp/error.h:315
#define FREERDP_ERROR_CONNECT_TRANSPORT_FAILED
Definition: include/freerdp/error.h:312
@ XF_EXIT_CONNECT_NO_OR_MISSING_CREDENTIALS
Definition: xfreerdp.h:374
@ XF_EXIT_AUTH_FAILURE
Definition: xfreerdp.h:347
#define FREERDP_ERROR_CONNECT_FAILED
Definition: include/freerdp/error.h:294
@ XF_EXIT_DNS_NAME_NOT_FOUND
Definition: xfreerdp.h:355
@ XF_EXIT_ACCOUNT_LOCKED_OUT
Definition: xfreerdp.h:350
#define FREERDP_ERROR_CONNECT_KDC_UNREACHABLE
Definition: include/freerdp/error.h:321
@ XF_EXIT_CONNECT_LOGON_TYPE_NOT_GRANTED
Definition: xfreerdp.h:373
#define FREERDP_ERROR_CONNECT_UNDEFINED
Definition: include/freerdp/error.h:285
@ XF_EXIT_CONNECT_PASSWORD_EXPIRED
Definition: xfreerdp.h:363
@ XF_EXIT_CONNECT_WRONG_PASSWORD
Definition: xfreerdp.h:369
@ XF_EXIT_CONNECT_CANCELLED
Definition: xfreerdp.h:360
@ XF_EXIT_CONNECT_UNDEFINED
Definition: xfreerdp.h:352
#define FREERDP_ERROR_CONNECT_ACCOUNT_RESTRICTION
Definition: include/freerdp/error.h:338
@ XF_EXIT_POST_CONNECT_FAILED
Definition: xfreerdp.h:353
#define FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS
Definition: include/freerdp/error.h:350
#define FREERDP_ERROR_CONNECT_CANCELLED
Definition: include/freerdp/error.h:307
#define FREERDP_ERROR_POST_CONNECT_FAILED
Definition: include/freerdp/error.h:287
@ XF_EXIT_CONNECT_CLIENT_REVOKED
Definition: xfreerdp.h:368
#define FREERDP_ERROR_CONNECT_ACCOUNT_DISABLED
Definition: include/freerdp/error.h:324
@ XF_EXIT_CONNECT_KDC_UNREACHABLE
Definition: xfreerdp.h:365
#define FREERDP_ERROR_CONNECT_WRONG_PASSWORD
Definition: include/freerdp/error.h:334
#define FREERDP_ERROR_CONNECT_LOGON_TYPE_NOT_GRANTED
Definition: include/freerdp/error.h:347
@ XF_EXIT_PRE_CONNECT_FAILED
Definition: xfreerdp.h:351
@ XF_EXIT_CONNECT_PASSWORD_MUST_CHANGE
Definition: xfreerdp.h:364
@ XF_EXIT_INSUFFICIENT_PRIVILEGES
Definition: xfreerdp.h:359
@ XF_EXIT_CONNECT_ACCOUNT_EXPIRED
Definition: xfreerdp.h:372
@ XF_EXIT_NEGO_FAILURE
Definition: xfreerdp.h:348
#define FREERDP_ERROR_CONNECT_ACCOUNT_LOCKED_OUT
Definition: include/freerdp/error.h:341
@ XF_EXIT_CONNECT_TRANSPORT_FAILED
Definition: xfreerdp.h:362
@ XF_EXIT_MCS_CONNECT_INITIAL_ERROR
Definition: xfreerdp.h:357
#define FREERDP_ERROR_AUTHENTICATION_FAILED
Definition: include/freerdp/error.h:301
#define FREERDP_ERROR_DNS_ERROR
Definition: include/freerdp/error.h:290
#define FREERDP_ERROR_DNS_NAME_NOT_FOUND
Definition: include/freerdp/error.h:292
@ XF_EXIT_CONNECT_FAILED
Definition: xfreerdp.h:356
@ XF_EXIT_CONNECT_ACCOUNT_RESTRICTION
Definition: xfreerdp.h:371
#define FREERDP_ERROR_CONNECT_ACCOUNT_EXPIRED
Definition: include/freerdp/error.h:344
@ XF_EXIT_CONNECT_ACCESS_DENIED
Definition: xfreerdp.h:370