Module: wine Branch: master Commit: 45b8d865b46d1083dc65731c9e33623559e5fa06 URL: http://source.winehq.org/git/wine.git/?a=commit;h=45b8d865b46d1083dc65731c9e...
Author: Vitaliy Margolen wine-patches@kievinfo.com Date: Fri Feb 2 00:49:55 2007 -0700
dinput: Don't reset user specified range in SetDataFormat. With tests.
---
dlls/dinput/joystick_linux.c | 2 -- dlls/dinput/tests/joystick.c | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index ba63d9c..4c542ad 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -664,8 +664,6 @@ static HRESULT WINAPI JoystickAImpl_SetD
for (i = 0; i < This->base.data_format.wine_df->dwNumObjs; i++) { - This->props[i].lMin = 0; - This->props[i].lMax = 0xffff; This->props[i].lDeadZone = 1000; This->props[i].lSaturation = 0; } diff --git a/dlls/dinput/tests/joystick.c b/dlls/dinput/tests/joystick.c index 05be5d6..7ca690a 100644 --- a/dlls/dinput/tests/joystick.c +++ b/dlls/dinput/tests/joystick.c @@ -258,6 +258,14 @@ static BOOL CALLBACK EnumJoysticks( ok(caps.dwButtons == info.button, "Number of enumerated buttons doesn't match capabilities\n"); ok(caps.dwPOVs == info.pov, "Number of enumerated POVs doesn't match capabilities\n");
+ /* Set format and check limits again */ + hr = IDirectInputDevice_SetDataFormat(pJoystick, &c_dfDIJoystick2); + ok(hr==DI_OK,"IDirectInputDevice_SetDataFormat() failed: %s\n", DXGetErrorString8(hr)); + info.lMin = -2000; + info.lMax = +2000; + hr = IDirectInputDevice_EnumObjects(pJoystick, EnumAxes, (VOID*)&info, DIDFT_ALL); + ok(hr==DI_OK,"IDirectInputDevice_EnumObjects() failed: %s\n", DXGetErrorString8(hr)); + hr = IDirectInputDevice_GetDeviceInfo(pJoystick, 0); ok(hr==E_POINTER, "IDirectInputDevice_GetDeviceInfo() " "should have returned E_POINTER, returned: %s\n",