1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

win32u: Preserve rawinput device instance ID case in add_device().

In ntoskrnl.exe, when a PnP device interface is registered, the
interface path casing is retained, with only the hardware ID being upper
case. Thus, this patch looks to align the behaviour between PnP and
rawinput, particularly for games that seem to rely on these two strings
being consistent for hotplug.

This updated behaviour also seems consistent with Windows.
This commit is contained in:
Nicholas Tay 2024-01-17 20:30:33 +11:00 committed by Alexandre Julliard
parent a1129ed23b
commit 4f8939e1d9

View file

@ -229,6 +229,7 @@ static struct device *add_device( HKEY key, DWORD type )
SIZE_T size;
HANDLE file;
WCHAR *path;
unsigned int i = 0;
if (!query_reg_value( key, symbolic_linkW, value, sizeof(value_buffer) - sizeof(WCHAR) ))
{
@ -237,8 +238,12 @@ static struct device *add_device( HKEY key, DWORD type )
}
memset( value->Data + value->DataLength, 0, sizeof(WCHAR) );
/* upper case everything but the GUID */
for (path = (WCHAR *)value->Data; *path && *path != '{'; path++) *path = towupper( *path );
/* upper case everything until the instance ID */
for (path = (WCHAR *)value->Data; *path && i < 2; path++)
{
if (*path == '#') ++i;
*path = towupper( *path );
}
path = (WCHAR *)value->Data;
/* path is in DOS format and begins with \\?\ prefix */