Skip to content

Commit 849d139

Browse files
rbernonivyl
authored andcommitted
windows.gaming.input: Implement stub IGamepad2 interface.
1 parent 1e77af0 commit 849d139

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

dlls/windows.gaming.input/gamepad.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ struct gamepad
6161
IGameControllerImpl IGameControllerImpl_iface;
6262
IGameControllerInputSink IGameControllerInputSink_iface;
6363
IGamepad IGamepad_iface;
64+
IGamepad2 IGamepad2_iface;
6465
IGameController *IGameController_outer;
6566
LONG ref;
6667

@@ -99,6 +100,12 @@ static HRESULT WINAPI controller_QueryInterface( IGameControllerImpl *iface, REF
99100
return S_OK;
100101
}
101102

103+
if (IsEqualGUID( iid, &IID_IGamepad2 ))
104+
{
105+
IInspectable_AddRef( (*out = &impl->IGamepad2_iface) );
106+
return S_OK;
107+
}
108+
102109
WARN( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) );
103110
*out = NULL;
104111
return E_NOINTERFACE;
@@ -330,6 +337,28 @@ static const struct IGamepadVtbl gamepad_vtbl =
330337
gamepad_GetCurrentReading,
331338
};
332339

340+
DEFINE_IINSPECTABLE_OUTER( gamepad2, IGamepad2, struct gamepad, IGameController_outer )
341+
342+
static HRESULT WINAPI gamepad2_GetButtonLabel(IGamepad2 *iface, GamepadButtons button, GameControllerButtonLabel *value)
343+
{
344+
FIXME( "iface %p, button %#x, value %p stub!\n", iface, button, value );
345+
*value = GameControllerButtonLabel_None;
346+
return S_OK;
347+
}
348+
349+
static const struct IGamepad2Vtbl gamepad2_vtbl =
350+
{
351+
gamepad2_QueryInterface,
352+
gamepad2_AddRef,
353+
gamepad2_Release,
354+
/* IInspectable methods */
355+
gamepad2_GetIids,
356+
gamepad2_GetRuntimeClassName,
357+
gamepad2_GetTrustLevel,
358+
/* IGamepad2 methods */
359+
gamepad2_GetButtonLabel,
360+
};
361+
333362
struct gamepad_statics
334363
{
335364
IActivationFactory IActivationFactory_iface;
@@ -542,6 +571,7 @@ static HRESULT WINAPI controller_factory_CreateGameController( ICustomGameContro
542571
impl->IGameControllerImpl_iface.lpVtbl = &controller_vtbl;
543572
impl->IGameControllerInputSink_iface.lpVtbl = &input_sink_vtbl;
544573
impl->IGamepad_iface.lpVtbl = &gamepad_vtbl;
574+
impl->IGamepad2_iface.lpVtbl = &gamepad2_vtbl;
545575
impl->ref = 1;
546576

547577
TRACE( "created Gamepad %p\n", impl );

0 commit comments

Comments
 (0)