Rémi Bernon : windows.gaming.input: Implement stub IGamepad2 interface.

Alexandre Julliard julliard at winehq.org
Wed Jun 8 15:56:05 CDT 2022


Module: wine
Branch: master
Commit: 2692e59f46196c31684f12d5d3b5f1ca17abca81
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2692e59f46196c31684f12d5d3b5f1ca17abca81

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Wed Jun  8 13:44:13 2022 +0200

windows.gaming.input: Implement stub IGamepad2 interface.

Signed-off-by: Rémi Bernon <rbernon at 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 );




More information about the wine-cvs mailing list