wine-staging/patches/windows.gaming.input-dll/0007-windows.gaming.input-Implement-IRawGameControllerSta.patch

153 lines
5.6 KiB
Diff
Raw Normal View History

From 655ea5abd545db3990caf7c79909cb4993b52cef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 18:02:39 +0200
Subject: [PATCH 7/9] windows.gaming.input: Implement
IRawGameControllerStatics::RawGameControllers stubs.
---
.../windows.gaming.input_main.c | 107 +++++++++++++++++-
1 file changed, 106 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 078043b0963..c73f08b248d 100644
--- a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
+++ b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
@@ -40,6 +40,7 @@ struct windows_gaming_input
IGamepadStatics IGamepadStatics_iface;
IRawGameControllerStatics IRawGameControllerStatics_iface;
IVectorView_Gamepad IVectorView_Gamepad_iface;
+ IVectorView_RawGameController IVectorView_RawGameController_iface;
LONG ref;
};
@@ -173,6 +174,108 @@ static const struct IVectorView_GamepadVtbl vector_view_gamepad_vtbl =
vector_view_gamepad_GetMany,
};
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_QueryInterface(
+ IVectorView_RawGameController *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_RawGameController))
+ {
+ 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_raw_game_controller_AddRef(
+ IVectorView_RawGameController *iface)
+{
+ struct windows_gaming_input *impl = impl_from_IVectorView_RawGameController(iface);
+ ULONG ref = InterlockedIncrement(&impl->ref);
+ TRACE("iface %p, ref %u.\n", iface, ref);
+ return ref;
+}
+
+static ULONG STDMETHODCALLTYPE vector_view_raw_game_controller_Release(
+ IVectorView_RawGameController *iface)
+{
+ struct windows_gaming_input *impl = impl_from_IVectorView_RawGameController(iface);
+ ULONG ref = InterlockedDecrement(&impl->ref);
+ TRACE("iface %p, ref %u.\n", iface, ref);
+ return ref;
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetIids(
+ IVectorView_RawGameController *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_raw_game_controller_GetRuntimeClassName(
+ IVectorView_RawGameController *iface, HSTRING *class_name)
+{
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetTrustLevel(
+ IVectorView_RawGameController *iface, TrustLevel *trust_level)
+{
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetAt(
+ IVectorView_RawGameController *iface, ULONG index, IRawGameController **value)
+{
+ FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_get_Size(
+ IVectorView_RawGameController *iface, ULONG *value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_IndexOf(
+ IVectorView_RawGameController *iface, IRawGameController *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_raw_game_controller_GetMany(
+ IVectorView_RawGameController *iface, ULONG start_index, IRawGameController **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_RawGameControllerVtbl vector_view_raw_game_controller_vtbl =
+{
+ vector_view_raw_game_controller_QueryInterface,
+ vector_view_raw_game_controller_AddRef,
+ vector_view_raw_game_controller_Release,
+ /* IInspectable methods */
+ vector_view_raw_game_controller_GetIids,
+ vector_view_raw_game_controller_GetRuntimeClassName,
+ vector_view_raw_game_controller_GetTrustLevel,
+ /* IVectorView<RawGameController> methods */
+ vector_view_raw_game_controller_GetAt,
+ vector_view_raw_game_controller_get_Size,
+ vector_view_raw_game_controller_IndexOf,
+ vector_view_raw_game_controller_GetMany,
+};
+
static HRESULT STDMETHODCALLTYPE gamepad_statics_QueryInterface(
IGamepadStatics *iface, REFIID iid, void **out)
{
@@ -372,7 +475,8 @@ static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_get_RawGameControll
{
struct windows_gaming_input *impl = impl_from_IRawGameControllerStatics(iface);
FIXME("iface %p, value %p stub!\n", iface, value);
- return E_NOTIMPL;
+ *value = &impl->IVectorView_RawGameController_iface;
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_FromGameController(
@@ -499,6 +603,7 @@ static struct windows_gaming_input windows_gaming_input =
{&gamepad_statics_vtbl},
{&raw_game_controller_statics_vtbl},
{&vector_view_gamepad_vtbl},
+ {&vector_view_raw_game_controller_vtbl},
0
};
--
2.28.0