dinput: Improve returned flags in Mouse GetObjectInfo.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
099b05ce6f
commit
c4debff5db
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue