Vitaliy Margolen : dinput: Limit number of supported axis and buttons.
Alexandre Julliard
julliard at winehq.org
Fri Apr 25 08:11:21 CDT 2008
Module: wine
Branch: master
Commit: f51e0e2d26eb7909137c7c4b20a71a1993a81138
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f51e0e2d26eb7909137c7c4b20a71a1993a81138
Author: Vitaliy Margolen <wine-patches at kievinfo.com>
Date: Thu Apr 24 09:04:11 2008 -0600
dinput: Limit number of supported axis and buttons.
---
dlls/dinput/joystick_linux.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index 5e87a02..46ce4ce 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -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;
More information about the wine-cvs
mailing list