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.
From: Nicholas Tay nick@windblume.net
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. --- dlls/win32u/rawinput.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/win32u/rawinput.c b/dlls/win32u/rawinput.c index bd2e00a31c4..e6c442c6ba6 100644 --- a/dlls/win32u/rawinput.c +++ b/dlls/win32u/rawinput.c @@ -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 */