Commit ab5d9e43 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

dinput: Support DIDEVICEINSTANCE_DX3 for keyboard GetDeviceInfo.

parent d8ef6db1
...@@ -526,11 +526,6 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceInfo( ...@@ -526,11 +526,6 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceInfo(
SysKeyboardImpl *This = impl_from_IDirectInputDevice8A(iface); SysKeyboardImpl *This = impl_from_IDirectInputDevice8A(iface);
TRACE("(this=%p,%p)\n", This, pdidi); TRACE("(this=%p,%p)\n", This, pdidi);
if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA)) {
WARN(" dinput3 not supported yet...\n");
return DI_OK;
}
fill_keyboard_dideviceinstanceA(pdidi, This->base.dinput->dwVersion, This->subtype); fill_keyboard_dideviceinstanceA(pdidi, This->base.dinput->dwVersion, This->subtype);
return DI_OK; return DI_OK;
......
...@@ -453,6 +453,35 @@ fail: ...@@ -453,6 +453,35 @@ fail:
IUnknown_Release(device); IUnknown_Release(device);
} }
static void test_GetDeviceInfo(IDirectInputA *pDI)
{
HRESULT hr;
IDirectInputDeviceA *pKey = NULL;
DIDEVICEINSTANCEA instA;
DIDEVICEINSTANCE_DX3A inst3A;
hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKey, NULL);
ok(SUCCEEDED(hr), "IDirectInput_CreateDevice() failed: %08x\n", hr);
if (FAILED(hr)) return;
instA.dwSize = sizeof(instA);
hr = IDirectInputDevice_GetDeviceInfo(pKey, &instA);
ok(SUCCEEDED(hr), "got %08x\n", hr);
inst3A.dwSize = sizeof(inst3A);
hr = IDirectInputDevice_GetDeviceInfo(pKey, (DIDEVICEINSTANCEA *)&inst3A);
ok(SUCCEEDED(hr), "got %08x\n", hr);
ok(instA.dwSize != inst3A.dwSize, "got %d, %d \n", instA.dwSize, inst3A.dwSize);
ok(IsEqualGUID(&instA.guidInstance, &inst3A.guidInstance), "got %s, %s\n",
wine_dbgstr_guid(&instA.guidInstance), wine_dbgstr_guid(&inst3A.guidInstance) );
ok(IsEqualGUID(&instA.guidProduct, &inst3A.guidProduct), "got %s, %s\n",
wine_dbgstr_guid(&instA.guidProduct), wine_dbgstr_guid(&inst3A.guidProduct) );
ok(instA.dwDevType == inst3A.dwDevType, "got %d, %d\n", instA.dwDevType, inst3A.dwDevType);
if (pKey) IUnknown_Release(pKey);
}
static void keyboard_tests(DWORD version) static void keyboard_tests(DWORD version)
{ {
HRESULT hr; HRESULT hr;
...@@ -483,6 +512,7 @@ static void keyboard_tests(DWORD version) ...@@ -483,6 +512,7 @@ static void keyboard_tests(DWORD version)
test_set_coop(pDI, hwnd); test_set_coop(pDI, hwnd);
test_get_prop(pDI, hwnd); test_get_prop(pDI, hwnd);
test_capabilities(pDI, hwnd); test_capabilities(pDI, hwnd);
test_GetDeviceInfo(pDI);
test_dik_codes(pDI, hwnd, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT)); test_dik_codes(pDI, hwnd, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT));
test_dik_codes(pDI, hwnd, MAKELANGID(LANG_FRENCH, SUBLANG_FRENCH)); test_dik_codes(pDI, hwnd, MAKELANGID(LANG_FRENCH, SUBLANG_FRENCH));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment