dinput: Add more traces. Prevent some traces from dereferencing NULL pointer.

This commit is contained in:
Vitaliy Margolen 2008-07-05 22:24:37 -06:00 committed by Alexandre Julliard
parent fa25f187c3
commit 85e2aa1d8a
3 changed files with 6 additions and 4 deletions

View File

@ -179,7 +179,7 @@ const char *_dump_dinput_GUID(const GUID *guid) {
return guids[i].name;
}
}
return "Unknown GUID";
return debugstr_guid(guid);
}
void _dump_DIDATAFORMAT(const DIDATAFORMAT *df) {

View File

@ -191,7 +191,7 @@ static void _dump_DIEFFECT(LPCDIEFFECT eff, REFGUID guid)
TRACE(" - dwTriggerRepeatInterval: %d\n", eff->dwTriggerRepeatInterval);
TRACE(" - cAxes: %d\n", eff->cAxes);
TRACE(" - rgdwAxes: %p\n", eff->rgdwAxes);
if (TRACE_ON(dinput)) {
if (TRACE_ON(dinput) && eff->rgdwAxes) {
TRACE(" ");
for (i = 0; i < eff->cAxes; ++i)
TRACE("%d ", eff->rgdwAxes[i]);
@ -261,7 +261,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_Download(
if (errno == ENOMEM) {
return DIERR_DEVICEFULL;
} else {
FIXME("Could not upload effect. Assuming a disconnected device.\n");
FIXME("Could not upload effect. Assuming a disconnected device %d \"%s\".\n", *This->fd, strerror(errno));
return DIERR_INPUTLOST;
}
}
@ -824,7 +824,7 @@ HRESULT linuxinput_create_effect(
HeapFree(GetProcessHeap(), 0, newEffect);
return DIERR_INVALIDPARAM;
default:
FIXME("Unknown force type.\n");
FIXME("Unknown force type 0x%x.\n", type);
HeapFree(GetProcessHeap(), 0, newEffect);
return DIERR_INVALIDPARAM;
}

View File

@ -637,6 +637,8 @@ static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
}
}
}
else
WARN("Failed to acquire: %x\n", res);
return res;
}