From 2d85128b03b2ddffe633d94cd0a955c6f79b06ae Mon Sep 17 00:00:00 2001 From: Derrick Renaud Date: Sun, 19 Apr 2009 23:07:14 +0000 Subject: [PATCH] Fixed verbose output of RAW device names for XP. --- src/osd/windows/input.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c index 378b25ae344..958257f9d75 100644 --- a/src/osd/windows/input.c +++ b/src/osd/windows/input.c @@ -1770,7 +1770,7 @@ static void rawinput_device_release(device_info *devinfo) //============================================================ -// rawinput_device_name +// rawinput_device_improve_name //============================================================ static TCHAR *rawinput_device_improve_name(TCHAR *name) @@ -1786,8 +1786,13 @@ static TCHAR *rawinput_device_improve_name(TCHAR *name) TCHAR *chdst; LONG result; + // The RAW name received is formatted as: + // \??\type-id#hardware-id#instance-id#{DeviceClasses-id} + // XP starts with \??\ + // Vista64 starts with \\?\ + // ensure the name is something we can handle - if (_tcsncmp(name, TEXT("\\\\?\\"), 4) != 0) + if (_tcsncmp(name, TEXT("\\\\?\\"), 4) != 0 && _tcsncmp(name, TEXT("\\??\\"), 4) != 0) return name; // allocate a temporary string and concatenate the base path plus the name