dinput: Use the same GUID for Instance and Product.

Signed-off-by: Brendan McGrath <brendan@redmandi.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Brendan McGrath 2018-10-31 21:01:41 +11:00 committed by Alexandre Julliard
parent c357f3670f
commit 3a2834b3a4
6 changed files with 8 additions and 25 deletions

View File

@ -114,9 +114,6 @@ typedef struct
LPDIRECTINPUTEFFECT ref; LPDIRECTINPUTEFFECT ref;
} effect_list_item; } effect_list_item;
extern const GUID DInput_Wine_Keyboard_GUID DECLSPEC_HIDDEN;
extern const GUID DInput_Wine_Mouse_GUID DECLSPEC_HIDDEN;
/* Various debug tools */ /* Various debug tools */
extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph) DECLSPEC_HIDDEN; extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph) DECLSPEC_HIDDEN;
extern void _dump_OBJECTINSTANCEA(const DIDEVICEOBJECTINSTANCEA *ddoi) DECLSPEC_HIDDEN; extern void _dump_OBJECTINSTANCEA(const DIDEVICEOBJECTINSTANCEA *ddoi) DECLSPEC_HIDDEN;

View File

@ -1747,12 +1747,10 @@ static DWORD WINAPI hook_thread_proc(void *param)
{ {
if (!dev->acquired || !dev->event_proc) continue; if (!dev->acquired || !dev->event_proc) continue;
if (IsEqualGUID( &dev->guid, &GUID_SysKeyboard ) || if (IsEqualGUID( &dev->guid, &GUID_SysKeyboard ))
IsEqualGUID( &dev->guid, &DInput_Wine_Keyboard_GUID ))
kbd_cnt++; kbd_cnt++;
else else
if (IsEqualGUID( &dev->guid, &GUID_SysMouse ) || if (IsEqualGUID( &dev->guid, &GUID_SysMouse ))
IsEqualGUID( &dev->guid, &DInput_Wine_Mouse_GUID ))
mice_cnt++; mice_cnt++;
} }
LeaveCriticalSection( &dinput->crit ); LeaveCriticalSection( &dinput->crit );

View File

@ -145,10 +145,6 @@ static int KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM
return ret; return ret;
} }
const GUID DInput_Wine_Keyboard_GUID = { /* 0ab8648a-7735-11d2-8c73-71df54a96441 */
0x0ab8648a, 0x7735, 0x11d2, {0x8c, 0x73, 0x71, 0xdf, 0x54, 0xa9, 0x64, 0x41}
};
static DWORD get_keyboard_subtype(void) static DWORD get_keyboard_subtype(void)
{ {
DWORD kbd_type, kbd_subtype, dev_subtype; DWORD kbd_type, kbd_subtype, dev_subtype;
@ -179,7 +175,7 @@ static void fill_keyboard_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD ver
ddi.dwSize = dwSize; ddi.dwSize = dwSize;
ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */ ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */ ddi.guidProduct = GUID_SysKeyboard;
if (version >= 0x0800) if (version >= 0x0800)
ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8); ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8);
else else
@ -203,7 +199,7 @@ static void fill_keyboard_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD ver
ddi.dwSize = dwSize; ddi.dwSize = dwSize;
ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */ ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */ ddi.guidProduct = GUID_SysKeyboard;
if (version >= 0x0800) if (version >= 0x0800)
ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8); ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8);
else else
@ -308,8 +304,7 @@ static HRESULT keyboarddev_create_device(IDirectInputImpl *dinput, REFGUID rguid
TRACE("%p %s %s %p %i\n", dinput, debugstr_guid(rguid), debugstr_guid(riid), pdev, unicode); TRACE("%p %s %s %p %i\n", dinput, debugstr_guid(rguid), debugstr_guid(riid), pdev, unicode);
*pdev = NULL; *pdev = NULL;
if (IsEqualGUID(&GUID_SysKeyboard, rguid) || /* Generic Keyboard */ if (IsEqualGUID(&GUID_SysKeyboard, rguid)) /* Wine Keyboard */
IsEqualGUID(&DInput_Wine_Keyboard_GUID, rguid)) /* Wine Keyboard */
{ {
SysKeyboardImpl *This; SysKeyboardImpl *This;

View File

@ -93,10 +93,6 @@ static inline IDirectInputDevice8W *IDirectInputDevice8W_from_impl(SysMouseImpl
static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM lparam ); static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM lparam );
const GUID DInput_Wine_Mouse_GUID = { /* 9e573ed8-7734-11d2-8d4a-23903fb6bdf7 */
0x9e573ed8, 0x7734, 0x11d2, {0x8d, 0x4a, 0x23, 0x90, 0x3f, 0xb6, 0xbd, 0xf7}
};
static void _dump_mouse_state(const DIMOUSESTATE2 *m_state) static void _dump_mouse_state(const DIMOUSESTATE2 *m_state)
{ {
int i; int i;
@ -121,7 +117,7 @@ static void fill_mouse_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD versio
ddi.dwSize = dwSize; ddi.dwSize = dwSize;
ddi.guidInstance = GUID_SysMouse;/* DInput's GUID */ ddi.guidInstance = GUID_SysMouse;/* DInput's GUID */
ddi.guidProduct = DInput_Wine_Mouse_GUID; /* Vendor's GUID */ ddi.guidProduct = GUID_SysMouse;
if (version >= 0x0800) if (version >= 0x0800)
ddi.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8); ddi.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8);
else else
@ -145,7 +141,7 @@ static void fill_mouse_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD versio
ddi.dwSize = dwSize; ddi.dwSize = dwSize;
ddi.guidInstance = GUID_SysMouse;/* DInput's GUID */ ddi.guidInstance = GUID_SysMouse;/* DInput's GUID */
ddi.guidProduct = DInput_Wine_Mouse_GUID; /* Vendor's GUID */ ddi.guidProduct = GUID_SysMouse;
if (version >= 0x0800) if (version >= 0x0800)
ddi.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8); ddi.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8);
else else
@ -257,8 +253,7 @@ static HRESULT mousedev_create_device(IDirectInputImpl *dinput, REFGUID rguid, R
TRACE("%p %s %s %p %i\n", dinput, debugstr_guid(rguid), debugstr_guid(riid), pdev, unicode); TRACE("%p %s %s %p %i\n", dinput, debugstr_guid(rguid), debugstr_guid(riid), pdev, unicode);
*pdev = NULL; *pdev = NULL;
if (IsEqualGUID(&GUID_SysMouse, rguid) || /* Generic Mouse */ if (IsEqualGUID(&GUID_SysMouse, rguid)) /* Wine Mouse */
IsEqualGUID(&DInput_Wine_Mouse_GUID, rguid)) /* Wine Mouse */
{ {
SysMouseImpl *This; SysMouseImpl *This;

View File

@ -396,7 +396,6 @@ static BOOL CALLBACK enum_devices_callback(const DIDEVICEINSTANCEA *instance, vo
(instance->dwDevType & 0xff) == DIDEVTYPE_MOUSE) { (instance->dwDevType & 0xff) == DIDEVTYPE_MOUSE) {
const char *device = ((instance->dwDevType & 0xff) == const char *device = ((instance->dwDevType & 0xff) ==
DIDEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse"; DIDEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse";
todo_wine
ok(IsEqualGUID(&instance->guidInstance, &instance->guidProduct), ok(IsEqualGUID(&instance->guidInstance, &instance->guidProduct),
"%s guidInstance (%s) does not match guidProduct (%s)\n", "%s guidInstance (%s) does not match guidProduct (%s)\n",
device, wine_dbgstr_guid(&instance->guidInstance), device, wine_dbgstr_guid(&instance->guidInstance),

View File

@ -381,7 +381,6 @@ static BOOL CALLBACK enum_devices_callback(const DIDEVICEINSTANCEA *instance, vo
(instance->dwDevType & 0xff) == DI8DEVTYPE_MOUSE) { (instance->dwDevType & 0xff) == DI8DEVTYPE_MOUSE) {
const char *device = ((instance->dwDevType & 0xff) == const char *device = ((instance->dwDevType & 0xff) ==
DI8DEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse"; DI8DEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse";
todo_wine
ok(IsEqualGUID(&instance->guidInstance, &instance->guidProduct), ok(IsEqualGUID(&instance->guidInstance, &instance->guidProduct),
"%s guidInstance (%s) does not match guidProduct (%s)\n", "%s guidInstance (%s) does not match guidProduct (%s)\n",
device, wine_dbgstr_guid(&instance->guidInstance), device, wine_dbgstr_guid(&instance->guidInstance),