Commit ae690924 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

windows.gaming.input: Fake empty IGamepadStatics::Gamepads vector.

parent d6b67604
......@@ -120,21 +120,25 @@ static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetAt(
IVectorView_Gamepad *iface, ULONG index, IGamepad **value)
{
FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value);
return E_NOTIMPL;
*value = NULL;
return E_BOUNDS;
}
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_get_Size(
IVectorView_Gamepad *iface, ULONG *value)
{
FIXME("iface %p, value %p stub!\n", iface, value);
return E_NOTIMPL;
*value = 0;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_IndexOf(
IVectorView_Gamepad *iface, IGamepad *element, ULONG *index, BOOLEAN *value)
IVectorView_Gamepad *iface, IGamepad *element, ULONG *index, BOOLEAN *found)
{
FIXME("iface %p, element %p, index %p, value %p stub!\n", iface, element, index, value);
return E_NOTIMPL;
FIXME("iface %p, element %p, index %p, found %p stub!\n", iface, element, index, found);
*index = 0;
*found = FALSE;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetMany(
......
......@@ -111,6 +111,8 @@ static void test_Gamepad(void)
IGamepadStatics *gamepad_statics = NULL;
IInspectable *inspectable = NULL, *tmp_inspectable = NULL;
IAgileObject *agile_object = NULL, *tmp_agile_object = NULL;
IGamepad *gamepad;
BOOLEAN found;
HSTRING str;
HRESULT hr;
ULONG size;
......@@ -165,8 +167,20 @@ static void test_Gamepad(void)
size = 0xdeadbeef;
hr = IVectorView_Gamepad_get_Size(gamepads, &size);
todo_wine ok(hr == S_OK, "IVectorView_Gamepad_get_Size failed, hr %#x\n", hr);
todo_wine ok(size != 0xdeadbeef, "IVectorView_Gamepad_get_Size returned %u\n", size);
ok(hr == S_OK, "IVectorView_Gamepad_get_Size failed, hr %#x\n", hr);
ok(size != 0xdeadbeef, "IVectorView_Gamepad_get_Size returned %u\n", size);
gamepad = (IGamepad *)0xdeadbeef;
hr = IVectorView_Gamepad_GetAt(gamepads, size, &gamepad);
ok(hr == E_BOUNDS, "IVectorView_Gamepad_GetAt failed, hr %#x\n", hr);
ok(gamepad == NULL, "IVectorView_Gamepad_GetAt returned %p\n", gamepad);
size = 0xdeadbeef;
found = TRUE;
gamepad = (IGamepad *)0xdeadbeef;
hr = IVectorView_Gamepad_IndexOf(gamepads, gamepad, &size, &found);
ok(hr == S_OK, "IVectorView_Gamepad_IndexOf failed, hr %#x\n", hr);
ok(size == 0 && found == FALSE, "IVectorView_Gamepad_IndexOf returned size %d, found %d\n", size, found);
IVectorView_Gamepad_Release(gamepads);
......
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