From c37593d9fc84f6344381cbfcf0631d3798d169b0 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 9 Mar 2021 12:23:37 +0100 Subject: [PATCH 21/36] Filter RDPDR types other than drives on windows hotplug (cherry picked from commit 6f599eabbedace4adc215186783deec680057003) --- channels/rdpdr/client/rdpdr_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index e59bf0f64..617ea4287 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -129,7 +129,7 @@ static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) #elif _WIN32 -BOOL check_path(char* path) +BOOL check_path(const char* path) { UINT type = GetDriveTypeA(path); @@ -244,6 +244,9 @@ LRESULT CALLBACK hotplug_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) device_ext = (DEVICE_DRIVE_EXT*)ListDictionary_GetItemValue( rdpdr->devman->devices, (void*)keys[j]); + if (device_ext->device.type != RDPDR_DTYP_FILESYSTEM) + continue; + if (device_ext->path[0] == drive_name_upper || device_ext->path[0] == drive_name_lower) { -- 2.30.2