mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
160 lines
5.4 KiB
Diff
160 lines
5.4 KiB
Diff
From 17818a1676a5b177795d6509314f5d75f11b6def Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
|
Date: Tue, 13 Oct 2020 17:58:14 +0200
|
|
Subject: [PATCH] windows.gaming.input: Implement IGamepadStatics::Gamepads
|
|
stubs.
|
|
|
|
---
|
|
.../windows.gaming.input_main.c | 113 +++++++++++++++++-
|
|
1 file changed, 112 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
|
index a910f9bf40e..444eb687175 100644
|
|
--- a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
|
+++ b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
|
@@ -31,6 +31,7 @@ struct windows_gaming_input
|
|
{
|
|
IActivationFactory IActivationFactory_iface;
|
|
IGamepadStatics IGamepadStatics_iface;
|
|
+ IVectorView_Gamepad IVectorView_Gamepad_iface;
|
|
LONG ref;
|
|
};
|
|
|
|
@@ -44,6 +45,113 @@ static inline struct windows_gaming_input *impl_from_IGamepadStatics(IGamepadSta
|
|
return CONTAINING_RECORD(iface, struct windows_gaming_input, IGamepadStatics_iface);
|
|
}
|
|
|
|
+static inline struct windows_gaming_input *impl_from_IVectorView_Gamepad(IVectorView_Gamepad *iface)
|
|
+{
|
|
+ return CONTAINING_RECORD(iface, struct windows_gaming_input, IVectorView_Gamepad_iface);
|
|
+}
|
|
+
|
|
+static HRESULT STDMETHODCALLTYPE vector_view_gamepad_QueryInterface(
|
|
+ IVectorView_Gamepad *iface, REFIID iid, void **out)
|
|
+{
|
|
+ TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
|
|
+
|
|
+ if (IsEqualGUID(iid, &IID_IUnknown) ||
|
|
+ IsEqualGUID(iid, &IID_IInspectable) ||
|
|
+ IsEqualGUID(iid, &IID_IVectorView_Gamepad))
|
|
+ {
|
|
+ IUnknown_AddRef(iface);
|
|
+ *out = iface;
|
|
+ return S_OK;
|
|
+ }
|
|
+
|
|
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
|
|
+ *out = NULL;
|
|
+ return E_NOINTERFACE;
|
|
+}
|
|
+
|
|
+static ULONG STDMETHODCALLTYPE vector_view_gamepad_AddRef(
|
|
+ IVectorView_Gamepad *iface)
|
|
+{
|
|
+ struct windows_gaming_input *impl = impl_from_IVectorView_Gamepad(iface);
|
|
+ ULONG ref = InterlockedIncrement(&impl->ref);
|
|
+ TRACE("iface %p, ref %u.\n", iface, ref);
|
|
+ return ref;
|
|
+}
|
|
+
|
|
+static ULONG STDMETHODCALLTYPE vector_view_gamepad_Release(
|
|
+ IVectorView_Gamepad *iface)
|
|
+{
|
|
+ struct windows_gaming_input *impl = impl_from_IVectorView_Gamepad(iface);
|
|
+ ULONG ref = InterlockedDecrement(&impl->ref);
|
|
+ TRACE("iface %p, ref %u.\n", iface, ref);
|
|
+ return ref;
|
|
+}
|
|
+
|
|
+static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetIids(
|
|
+ IVectorView_Gamepad *iface, ULONG *iid_count, IID **iids)
|
|
+{
|
|
+ FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids);
|
|
+ return E_NOTIMPL;
|
|
+}
|
|
+
|
|
+static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetRuntimeClassName(
|
|
+ IVectorView_Gamepad *iface, HSTRING *class_name)
|
|
+{
|
|
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
|
|
+ return E_NOTIMPL;
|
|
+}
|
|
+
|
|
+static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetTrustLevel(
|
|
+ IVectorView_Gamepad *iface, TrustLevel *trust_level)
|
|
+{
|
|
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
|
|
+ return E_NOTIMPL;
|
|
+}
|
|
+
|
|
+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;
|
|
+}
|
|
+
|
|
+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;
|
|
+}
|
|
+
|
|
+static HRESULT STDMETHODCALLTYPE vector_view_gamepad_IndexOf(
|
|
+ IVectorView_Gamepad *iface, IGamepad *element, ULONG *index, BOOLEAN *value)
|
|
+{
|
|
+ FIXME("iface %p, element %p, index %p, value %p stub!\n", iface, element, index, value);
|
|
+ return E_NOTIMPL;
|
|
+}
|
|
+
|
|
+static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetMany(
|
|
+ IVectorView_Gamepad *iface, ULONG start_index, IGamepad **items, UINT *value)
|
|
+{
|
|
+ FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value);
|
|
+ return E_NOTIMPL;
|
|
+}
|
|
+
|
|
+static const struct IVectorView_GamepadVtbl vector_view_gamepad_vtbl =
|
|
+{
|
|
+ vector_view_gamepad_QueryInterface,
|
|
+ vector_view_gamepad_AddRef,
|
|
+ vector_view_gamepad_Release,
|
|
+ /* IInspectable methods */
|
|
+ vector_view_gamepad_GetIids,
|
|
+ vector_view_gamepad_GetRuntimeClassName,
|
|
+ vector_view_gamepad_GetTrustLevel,
|
|
+ /* IVectorView<Gamepad> methods */
|
|
+ vector_view_gamepad_GetAt,
|
|
+ vector_view_gamepad_get_Size,
|
|
+ vector_view_gamepad_IndexOf,
|
|
+ vector_view_gamepad_GetMany,
|
|
+};
|
|
+
|
|
static HRESULT STDMETHODCALLTYPE gamepad_statics_QueryInterface(
|
|
IGamepadStatics *iface, REFIID iid, void **out)
|
|
{
|
|
@@ -131,8 +239,10 @@ static HRESULT STDMETHODCALLTYPE gamepad_statics_remove_GamepadRemoved(
|
|
static HRESULT STDMETHODCALLTYPE gamepad_statics_get_Gamepads(
|
|
IGamepadStatics *iface, IVectorView_Gamepad **value)
|
|
{
|
|
+ struct windows_gaming_input *impl = impl_from_IGamepadStatics(iface);
|
|
FIXME("iface %p, value %p stub!\n", iface, value);
|
|
- return E_NOTIMPL;
|
|
+ *value = &impl->IVectorView_Gamepad_iface;
|
|
+ return S_OK;
|
|
}
|
|
|
|
static const struct IGamepadStaticsVtbl gamepad_statics_vtbl =
|
|
@@ -242,6 +352,7 @@ static struct windows_gaming_input windows_gaming_input =
|
|
{
|
|
{&activation_factory_vtbl},
|
|
{&gamepad_statics_vtbl},
|
|
+ {&vector_view_gamepad_vtbl},
|
|
0
|
|
};
|
|
|
|
--
|
|
2.20.1
|
|
|