From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/windows.gaming.input/gamepad.c | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
diff --git a/dlls/windows.gaming.input/gamepad.c b/dlls/windows.gaming.input/gamepad.c index 5efc9f13ea8..112ec49a1d3 100644 --- a/dlls/windows.gaming.input/gamepad.c +++ b/dlls/windows.gaming.input/gamepad.c @@ -61,6 +61,7 @@ struct gamepad IGameControllerImpl IGameControllerImpl_iface; IGameControllerInputSink IGameControllerInputSink_iface; IGamepad IGamepad_iface; + IGamepad2 IGamepad2_iface; IGameController *IGameController_outer; LONG ref;
@@ -99,6 +100,12 @@ static HRESULT WINAPI controller_QueryInterface( IGameControllerImpl *iface, REF return S_OK; }
+ if (IsEqualGUID( iid, &IID_IGamepad2 )) + { + IInspectable_AddRef( (*out = &impl->IGamepad2_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -330,6 +337,28 @@ static const struct IGamepadVtbl gamepad_vtbl = gamepad_GetCurrentReading, };
+DEFINE_IINSPECTABLE_OUTER( gamepad2, IGamepad2, struct gamepad, IGameController_outer ) + +static HRESULT WINAPI gamepad2_GetButtonLabel( IGamepad2 *iface, GamepadButtons button, GameControllerButtonLabel *value ) +{ + FIXME( "iface %p, button %#x, value %p stub!\n", iface, button, value ); + *value = GameControllerButtonLabel_None; + return S_OK; +} + +static const struct IGamepad2Vtbl gamepad2_vtbl = +{ + gamepad2_QueryInterface, + gamepad2_AddRef, + gamepad2_Release, + /* IInspectable methods */ + gamepad2_GetIids, + gamepad2_GetRuntimeClassName, + gamepad2_GetTrustLevel, + /* IGamepad2 methods */ + gamepad2_GetButtonLabel, +}; + struct gamepad_statics { IActivationFactory IActivationFactory_iface; @@ -542,6 +571,7 @@ static HRESULT WINAPI controller_factory_CreateGameController( ICustomGameContro impl->IGameControllerImpl_iface.lpVtbl = &controller_vtbl; impl->IGameControllerInputSink_iface.lpVtbl = &input_sink_vtbl; impl->IGamepad_iface.lpVtbl = &gamepad_vtbl; + impl->IGamepad2_iface.lpVtbl = &gamepad2_vtbl; impl->ref = 1;
TRACE( "created Gamepad %p\n", impl );