rdp: Stop using deprecated functions

The get file descriptor functions are being deprecated and a two step
process of getting handles and then getting the descriptors for the
handles is being used instead.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
dev
Derek Foreman 2 years ago
parent 5014eb03a3
commit 982e59a942
  1. 28
      libweston/backend-rdp/rdp.c

@ -606,18 +606,19 @@ static
int rdp_implant_listener(struct rdp_backend *b, freerdp_listener* instance)
{
int i, fd;
int rcount = 0;
void* rfds[MAX_FREERDP_FDS];
int handle_count = 0;
HANDLE handles[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 < rcount; i++) {
fd = (int)(long)(rfds[i]);
for (i = 0; i < handle_count; i++) {
fd = GetEventFileDescriptor(handles[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 rcount = 0;
void *rfds[MAX_FREERDP_FDS + 1]; /* +1 for WTSVirtualChannelManagerGetFileDescriptor. */
int handle_count = 0;
HANDLE handles[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 < rcount; i++) {
fd = (int)(long)(rfds[i]);
for (i = 0; i < handle_count; i++) {
fd = GetEventFileDescriptor(handles[i]);
peerCtx->events[i] = wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE,
rdp_client_activity, client);

Loading…
Cancel
Save