Commit 4f8939e1 authored by Nicholas Tay's avatar Nicholas Tay Committed by Alexandre Julliard

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.
parent a1129ed2
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment