dinput: Add DirectInput8 device type names to debug.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Bruno Jesus 2016-08-14 13:30:53 -03:00 committed by Alexandre Julliard
parent e2039d8e1d
commit e3b783174d
1 changed files with 23 additions and 12 deletions

View File

@ -181,8 +181,9 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateW(HINSTANCE hinst, DWORD dwVer
return DirectInputCreateEx(hinst, dwVersion, &IID_IDirectInput7W, (LPVOID *)ppDI, punkOuter);
}
static const char *_dump_DIDEVTYPE_value(DWORD dwDevType)
static const char *_dump_DIDEVTYPE_value(DWORD dwDevType, DWORD dwVersion)
{
if (dwVersion < 0x0800) {
switch (dwDevType) {
case 0: return "All devices";
case DIDEVTYPE_MOUSE: return "DIDEVTYPE_MOUSE";
@ -191,6 +192,16 @@ static const char *_dump_DIDEVTYPE_value(DWORD dwDevType)
case DIDEVTYPE_DEVICE: return "DIDEVTYPE_DEVICE";
default: return "Unknown";
}
} else {
switch (dwDevType) {
case DI8DEVCLASS_ALL: return "All devices";
case DI8DEVCLASS_POINTER : return "DI8DEVCLASS_POINTER ";
case DI8DEVCLASS_KEYBOARD: return "DI8DEVCLASS_KEYBOARD";
case DI8DEVCLASS_DEVICE: return "DI8DEVCLASS_DEVICE";
case DI8DEVCLASS_GAMECTRL: return "DI8DEVCLASS_GAMECTRL";
default: return "Unknown";
}
}
}
static void _dump_EnumDevices_dwFlags(DWORD dwFlags)
@ -384,8 +395,8 @@ static HRESULT WINAPI IDirectInputAImpl_EnumDevices(
unsigned int i;
int j, r;
TRACE("(this=%p,0x%04x '%s',%p,%p,%04x)\n",
This, dwDevType, _dump_DIDEVTYPE_value(dwDevType),
TRACE("(this=%p,0x%04x '%s',%p,%p,0x%04x)\n",
This, dwDevType, _dump_DIDEVTYPE_value(dwDevType, This->dwVersion),
lpCallback, pvRef, dwFlags);
_dump_EnumDevices_dwFlags(dwFlags);
@ -424,8 +435,8 @@ static HRESULT WINAPI IDirectInputWImpl_EnumDevices(
int j;
HRESULT r;
TRACE("(this=%p,0x%04x '%s',%p,%p,%04x)\n",
This, dwDevType, _dump_DIDEVTYPE_value(dwDevType),
TRACE("(this=%p,0x%04x '%s',%p,%p,0x%04x)\n",
This, dwDevType, _dump_DIDEVTYPE_value(dwDevType, This->dwVersion),
lpCallback, pvRef, dwFlags);
_dump_EnumDevices_dwFlags(dwFlags);