[WINESYNC] setupapi: Use lowercase device paths.

Some games are doing case sensitive matches on the device paths obtained from
Setup API and expect them to be lowercase.

This fixes Virginia not being able to discover DualShock 4.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 30a026d2454b2de93257e9eb895573ce8c56dc05 by Arkadiusz Hiler <ahiler@codeweavers.com>
This commit is contained in:
winesync 2023-09-14 21:39:42 +02:00 committed by Hermès Bélusca-Maïto
parent f8c0728e48
commit d572469aa8
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 14 additions and 1 deletions

View file

@ -1029,6 +1029,18 @@ static void test_register_device_info(void)
SetupDiDestroyDeviceInfoList(set);
}
static void check_all_lower_case(int line, const char* str)
{
const char *cur;
for (cur = str; *cur; cur++)
{
BOOL is_lower = (tolower(*cur) == *cur);
ok_(__FILE__, line)(is_lower, "Expected device path to be all lowercase but got %s.\n", str);
if (!is_lower) break;
}
}
static void check_device_iface_(int line, HDEVINFO set, SP_DEVINFO_DATA *device,
const GUID *class, int index, DWORD flags, const char *path)
{
@ -1050,6 +1062,7 @@ static void check_device_iface_(int line, HDEVINFO set, SP_DEVINFO_DATA *device,
ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, detail, sizeof(buffer), NULL, NULL);
ok_(__FILE__, line)(ret, "Failed to get interface detail, error %#x.\n", GetLastError());
ok_(__FILE__, line)(!strcasecmp(detail->DevicePath, path), "Got unexpected path %s.\n", detail->DevicePath);
check_all_lower_case(line, detail->DevicePath);
}
else
{

View file

@ -10,4 +10,4 @@ files:
dlls/setupapi/setupcab.c: dll/win32/setupapi/setupcab.c
dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable_wine.c
tags:
wine: 5030f4cf26c31bc709d6565182b51af1165953a6
wine: 30a026d2454b2de93257e9eb895573ce8c56dc05