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:
parent
a1129ed23b
commit
4f8939e1d9
1 changed files with 7 additions and 2 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue