@ -606,18 +606,19 @@ static
int rdp_implant_listener ( struct rdp_backend * b , freerdp_listener * instance )
{
int i , fd ;
int r count = 0 ;
void * rfd s[ MAX_FREERDP_FDS ] ;
int handle_ count = 0 ;
HANDLE handle s[ MAX_FREERDP_FDS ] ;
struct wl_event_loop * loop ;
if ( ! instance - > GetFileDescriptor ( instance , rfds , & rcount ) ) {
weston_log ( " Failed to get FreeRDP file descriptor \n " ) ;
handle_count = instance - > GetEventHandles ( instance , handles , MAX_FREERDP_FDS ) ;
if ( ! handle_count ) {
weston_log ( " Failed to get FreeRDP handles \n " ) ;
return - 1 ;
}
loop = wl_display_get_event_loop ( b - > compositor - > wl_display ) ;
for ( i = 0 ; i < r count; i + + ) {
fd = ( int ) ( long ) ( rfd s[ i ] ) ;
for ( i = 0 ; i < handle_ count; i + + ) {
fd = GetEventFileDescriptor ( handle s[ i ] ) ;
b - > listener_events [ i ] = wl_event_loop_add_fd ( loop , fd , WL_EVENT_READABLE ,
rdp_listener_activity , instance ) ;
}
@ -1472,8 +1473,8 @@ xf_suppress_output(rdpContext *context, BYTE allow, const RECTANGLE_16 *area)
static int
rdp_peer_init ( freerdp_peer * client , struct rdp_backend * b )
{
int r count = 0 ;
void * rfd s[ MAX_FREERDP_FDS + 1 ] ; /* +1 for WTSVirtualChannelManagerGetFileDescriptor. */
int handle_ count = 0 ;
HANDLE handle s[ MAX_FREERDP_FDS + 1 ] ; /* +1 for virtual channel */
int i , fd ;
struct wl_event_loop * loop ;
rdpSettings * settings ;
@ -1530,8 +1531,9 @@ rdp_peer_init(freerdp_peer *client, struct rdp_backend *b)
input - > KeyboardEvent = xf_input_keyboard_event ;
input - > UnicodeKeyboardEvent = xf_input_unicode_keyboard_event ;
if ( ! client - > GetFileDescriptor ( client , rfds , & rcount ) ) {
weston_log ( " unable to retrieve client fds \n " ) ;
handle_count = client - > GetEventHandles ( client , handles , MAX_FREERDP_FDS ) ;
if ( ! handle_count ) {
weston_log ( " unable to retrieve client handles \n " ) ;
goto error_initialize ;
}
@ -1539,14 +1541,14 @@ rdp_peer_init(freerdp_peer *client, struct rdp_backend *b)
WTSRegisterWtsApiFunctionTable ( fn ) ;
peerCtx - > vcm = WTSOpenServerA ( ( LPSTR ) peerCtx ) ;
if ( peerCtx - > vcm ) {
WTSVirtualChannelManagerGetFileDescriptor ( peerCtx - > vcm , rfds , & rcount ) ;
handles [ handle_count + + ] = WTSVirtualChannelManagerGetEventHandle ( peerCtx - > vcm ) ;
} else {
weston_log ( " WTSOpenServer is failed! continue without virtual channel. \n " ) ;
}
loop = wl_display_get_event_loop ( b - > compositor - > wl_display ) ;
for ( i = 0 ; i < r count; i + + ) {
fd = ( int ) ( long ) ( rfd s[ i ] ) ;
for ( i = 0 ; i < handle_ count; i + + ) {
fd = GetEventFileDescriptor ( handle s[ i ] ) ;
peerCtx - > events [ i ] = wl_event_loop_add_fd ( loop , fd , WL_EVENT_READABLE ,
rdp_client_activity , client ) ;