dinput: Limit number of supported axis and buttons.

This commit is contained in:
Vitaliy Margolen 2008-04-24 09:04:11 -06:00 committed by Alexandre Julliard
parent 9b560b5de8
commit f51e0e2d26
1 changed files with 13 additions and 0 deletions

View File

@ -422,6 +422,19 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
}
#endif
if (newDevice->axes > 16)
{
/* There are 24 more axes for velocity that we can use */
FIXME("Can't support %d axes. Clamping down to 16\n", newDevice->axes);
newDevice->axes = 16;
}
if (newDevice->buttons > 128)
{
WARN("Can't support %d buttons. Clamping down to 128\n", newDevice->buttons);
newDevice->buttons = 128;
}
newDevice->base.lpVtbl = jvt;
newDevice->base.ref = 1;
newDevice->base.dinput = dinput;