[PATCH] dinput: Improve returned flags in Mouse GetObjectInfo.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/dinput/mouse.c | 3 +++ dlls/dinput/tests/mouse.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 199ed03..52a766b 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -730,6 +730,9 @@ static HRESULT WINAPI SysMouseWImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, else if (pdidoi->dwType & DIDFT_BUTTON) wsprintfW(pdidoi->tszName, buttonW, DIDFT_GETINSTANCE(pdidoi->dwType) - 3); + if(pdidoi->dwType & DIDFT_AXIS) + pdidoi->dwFlags |= DIDOI_ASPECTPOSITION; + _dump_OBJECTINSTANCEW(pdidoi); return res; } diff --git a/dlls/dinput/tests/mouse.c b/dlls/dinput/tests/mouse.c index c1a7ff7..c5cb684 100644 --- a/dlls/dinput/tests/mouse.c +++ b/dlls/dinput/tests/mouse.c @@ -227,6 +227,36 @@ static void test_GetDeviceInfo(IDirectInputA *pDI) if (pMouse) IUnknown_Release(pMouse); } +static BOOL CALLBACK EnumAxes(const DIDEVICEOBJECTINSTANCEA *pdidoi, void *pContext) +{ + if (IsEqualIID(&pdidoi->guidType, &GUID_XAxis) || + IsEqualIID(&pdidoi->guidType, &GUID_YAxis) || + IsEqualIID(&pdidoi->guidType, &GUID_ZAxis)) + { + ok(pdidoi->dwFlags & DIDOI_ASPECTPOSITION, "Missing DIDOI_ASPECTPOSITION, flags are 0x%x\n", + pdidoi->dwFlags); + } + else + ok(pdidoi->dwFlags == 0, "Flags are 0x%x\n", pdidoi->dwFlags); + + return DIENUM_CONTINUE; +} + +static void test_mouse_EnumObjects(IDirectInputA *pDI) +{ + HRESULT hr; + IDirectInputDeviceA *pMouse = NULL; + + hr = IDirectInput_CreateDevice(pDI, &GUID_SysMouse, &pMouse, NULL); + ok(SUCCEEDED(hr), "IDirectInput_CreateDevice() failed: %08x\n", hr); + if (FAILED(hr)) return; + + hr = IDirectInputDevice_EnumObjects(pMouse, EnumAxes, NULL, DIDFT_ALL); + ok(hr==DI_OK,"IDirectInputDevice_EnumObjects() failed: %08x\n", hr); + + if (pMouse) IUnknown_Release(pMouse); +} + static void mouse_tests(void) { HRESULT hr; @@ -254,6 +284,7 @@ static void mouse_tests(void) test_set_coop(pDI, hwnd); test_acquire(pDI, hwnd); test_GetDeviceInfo(pDI); + test_mouse_EnumObjects(pDI); DestroyWindow(hwnd); } -- 1.9.1
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=52356 Your paranoid android. === debian9 (32 bit French report) === dinput: mouse.c:173: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian9 (32 bit Japanese:Japan report) === dinput: mouse.c:173: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian9 (32 bit Chinese:China report) === dinput: mouse.c:173: Test failed: GetDeviceData() failed: 00000000 cnt:0
participants (2)
-
Alistair Leslie-Hughes -
Marvin