Filter RDPDR types other than drives on windows hotplug
authorArmin Novak <armin.novak@thincast.com>
Tue, 9 Mar 2021 11:23:37 +0000 (12:23 +0100)
committerakallabeth <akallabeth@users.noreply.github.com>
Tue, 9 Mar 2021 15:08:08 +0000 (16:08 +0100)
(cherry picked from commit 6f599eabbedace4adc215186783deec680057003)

channels/rdpdr/client/rdpdr_main.c

index e59bf0f..617ea42 100644 (file)
@@ -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)
                                                                        {