From: Armin Novak Date: Wed, 27 Jan 2021 08:25:26 +0000 (+0100) Subject: Fixed drive hotplug path comparison. X-Git-Tag: 2.3.0~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f80ca4580accc1060d58e7b13505e35bd3b7d726;p=platform%2Fupstream%2Ffreerdp.git Fixed drive hotplug path comparison. (cherry picked from commit c7bf33aad04822eb6400459114d405031edb376a) --- diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index a1db3b9..e59bf0f 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -741,12 +741,18 @@ static BOOL device_already_plugged(rdpdrPlugin* rdpdr, const hotplug_dev* device BOOL rc = FALSE; int count, x; ULONG_PTR* keys = NULL; + WCHAR* path = NULL; + int status; if (!rdpdr || !device) return TRUE; if (!device->to_add) return TRUE; + status = ConvertToUnicode(CP_UTF8, 0, device->path, -1, &path, 0); + if (status <= 0) + return TRUE; + ListDictionary_Lock(rdpdr->devman->devices); count = ListDictionary_GetKeys(rdpdr->devman->devices, &keys); for (x = 0; x < count; x++) @@ -756,13 +762,14 @@ static BOOL device_already_plugged(rdpdrPlugin* rdpdr, const hotplug_dev* device if (!device_ext || (device_ext->device.type != RDPDR_DTYP_FILESYSTEM) || !device_ext->path) continue; - if (strcmp(device_ext->path, device->path) == 0) + if (_wcscmp(device_ext->path, path) == 0) { rc = TRUE; break; } } free(keys); + free(path); ListDictionary_Unlock(rdpdr->devman->devices); return rc; }