From 731e1f183d56d0f5ddaef0f89c39d9ff6dcd7ffd Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 6 Dec 2023 14:33:37 +0100 Subject: [PATCH] [channel,rdpds] ignore XPS device messages if FreeRDP_IgnoreInvalidDevices is set ignore XPS messages for unknown devices --- channels/rdpdr/client/rdpdr_main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 2b9a263a4..76ce472c7 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -1559,7 +1559,7 @@ static UINT rdpdr_process_component(rdpdrPlugin* rdpdr, UINT16 component, UINT16 device = devman_get_device_by_type(rdpdr->devman, type); if (!device) - return ERROR_INVALID_PARAMETER; + return ERROR_DEV_NOT_EXIST; return IFCALLRESULT(ERROR_INVALID_PARAMETER, device->CustomComponentRequest, device, component, packetId, s); @@ -1829,7 +1829,16 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) if (error != CHANNEL_RC_OK) { - WLog_Print(rdpdr->log, WLOG_ERROR, + DWORD level = WLOG_ERROR; + if (rdpdr->ignoreInvalidDevices) + { + if (error == ERROR_DEV_NOT_EXIST) + { + level = WLOG_WARN; + error = CHANNEL_RC_OK; + } + } + WLog_Print(rdpdr->log, level, "Unknown message: Component: %s [0x%04" PRIX16 "] PacketId: %s [0x%04" PRIX16 "]", rdpdr_component_string(component), component,