Commit e3b78317 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

dinput: Add DirectInput8 device type names to debug.

parent e2039d8e
......@@ -181,15 +181,26 @@ 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)
{
switch (dwDevType) {
case 0: return "All devices";
case DIDEVTYPE_MOUSE: return "DIDEVTYPE_MOUSE";
case DIDEVTYPE_KEYBOARD: return "DIDEVTYPE_KEYBOARD";
case DIDEVTYPE_JOYSTICK: return "DIDEVTYPE_JOYSTICK";
case DIDEVTYPE_DEVICE: return "DIDEVTYPE_DEVICE";
default: return "Unknown";
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";
case DIDEVTYPE_KEYBOARD: return "DIDEVTYPE_KEYBOARD";
case DIDEVTYPE_JOYSTICK: return "DIDEVTYPE_JOYSTICK";
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";
}
}
}
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment