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

167 lines
6.3 KiB
Diff

From 0386aec8078e9f75e1841db486a187bc9d07249d 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] windows.gaming.input: Implement
IRawGameControllerStatics::RawGameControllers 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 1a40a8ddc35..b56a2a5962f 100644
--- a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
+++ b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
@@ -33,6 +33,7 @@ struct windows_gaming_input
IGamepadStatics IGamepadStatics_iface;
IRawGameControllerStatics IRawGameControllerStatics_iface;
IVectorView_Gamepad IVectorView_Gamepad_iface;
+ IVectorView_RawGameController IVectorView_RawGameController_iface;
LONG ref;
};
@@ -56,6 +57,11 @@ static inline struct windows_gaming_input *impl_from_IVectorView_Gamepad(IVector
return CONTAINING_RECORD(iface, struct windows_gaming_input, IVectorView_Gamepad_iface);
}
+static inline struct windows_gaming_input *impl_from_IVectorView_RawGameController(IVectorView_RawGameController *iface)
+{
+ return CONTAINING_RECORD(iface, struct windows_gaming_input, IVectorView_RawGameController_iface);
+}
+
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_QueryInterface(
IVectorView_Gamepad *iface, REFIID iid, void **out)
{
@@ -161,6 +167,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)
{
@@ -358,8 +466,10 @@ static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_remove_RawGameContr
static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_get_RawGameControllers(
IRawGameControllerStatics *iface, IVectorView_RawGameController **value)
{
+ 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(
@@ -486,6 +596,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.20.1