Commit e8f808a6 authored by Lucas Zawacki's avatar Lucas Zawacki Committed by Alexandre Julliard

dinput: Semi-stub for IDirectInputJoyConfig8_GetConfig.

parent dbc10ef9
...@@ -1142,8 +1142,44 @@ static HRESULT WINAPI JoyConfig8Impl_DeleteType(IDirectInputJoyConfig8 *iface, L ...@@ -1142,8 +1142,44 @@ static HRESULT WINAPI JoyConfig8Impl_DeleteType(IDirectInputJoyConfig8 *iface, L
static HRESULT WINAPI JoyConfig8Impl_GetConfig(IDirectInputJoyConfig8 *iface, UINT id, LPDIJOYCONFIG info, DWORD flags) static HRESULT WINAPI JoyConfig8Impl_GetConfig(IDirectInputJoyConfig8 *iface, UINT id, LPDIJOYCONFIG info, DWORD flags)
{ {
FIXME( "(%p)->(%d, %p, 0x%08x): stub!\n", iface, id, info, flags ); IDirectInputImpl *di = impl_from_IDirectInputJoyConfig8(iface);
return E_NOTIMPL; UINT found = 0;
int i, j, r;
FIXME("(%p)->(%d, %p, 0x%08x): semi-stub!\n", iface, id, info, flags);
#define X(x) if (flags & x) FIXME("\tflags |= "#x"\n");
X(DIJC_GUIDINSTANCE)
X(DIJC_REGHWCONFIGTYPE)
X(DIJC_GAIN)
X(DIJC_CALLOUT)
#undef X
/* Enumerate all joysticks in order */
for (i = 0; i < NB_DINPUT_DEVICES; i++)
{
if (!dinput_devices[i]->enum_deviceA) continue;
for (j = 0, r = -1; r != 0; j++)
{
DIDEVICEINSTANCEA dev;
dev.dwSize = sizeof(dev);
if ((r = dinput_devices[i]->enum_deviceA(DI8DEVCLASS_GAMECTRL, 0, &dev, di->dwVersion, j)))
{
/* Only take into account the chosen id */
if (found == id)
{
if (flags & DIJC_GUIDINSTANCE)
info->guidInstance = dev.guidInstance;
return DI_OK;
}
found += 1;
}
}
}
return DIERR_NOMOREITEMS;
} }
static HRESULT WINAPI JoyConfig8Impl_SetConfig(IDirectInputJoyConfig8 *iface, UINT id, LPCDIJOYCONFIG info, DWORD flags) static HRESULT WINAPI JoyConfig8Impl_SetConfig(IDirectInputJoyConfig8 *iface, UINT id, LPCDIJOYCONFIG info, DWORD flags)
......
...@@ -595,11 +595,11 @@ static void test_DirectInputJoyConfig8(void) ...@@ -595,11 +595,11 @@ static void test_DirectInputJoyConfig8(void)
{ {
hr = IDirectInputJoyConfig8_GetConfig(pDIJC, i, &info, DIJC_GUIDINSTANCE); hr = IDirectInputJoyConfig8_GetConfig(pDIJC, i, &info, DIJC_GUIDINSTANCE);
todo_wine ok (hr == DI_OK || hr == DIERR_NOMOREITEMS, ok (hr == DI_OK || hr == DIERR_NOMOREITEMS,
"IDirectInputJoyConfig8_GetConfig returned 0x%08x\n", hr); "IDirectInputJoyConfig8_GetConfig returned 0x%08x\n", hr);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
todo_wine ok (SUCCEEDED(IDirectInput_CreateDevice(pDI, &info.guidInstance, &pDID, NULL)), ok (SUCCEEDED(IDirectInput_CreateDevice(pDI, &info.guidInstance, &pDID, NULL)),
"IDirectInput_CreateDevice failed with guid from GetConfig hr = 0x%08x\n", hr); "IDirectInput_CreateDevice failed with guid from GetConfig hr = 0x%08x\n", hr);
} }
......
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