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

800 lines
33 KiB
Diff

From b875ea79f656a5192b8214f2598cd62866b9fbee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Mon, 12 Oct 2020 12:50:32 +0200
Subject: [PATCH] windows.gaming.input: Implement IRawGameControllerStatics
stubs.
---
.../windows.gaming.input_main.c | 130 ++++++++++++
include/Makefile.in | 3 +
include/asyncinfo.idl | 45 ++++
include/windows.foundation.collections.idl | 21 +-
include/windows.foundation.idl | 11 +-
.../windows.gaming.input.forcefeedback.idl | 111 ++++++++++
include/windows.gaming.input.idl | 195 ++++++++++++++++++
include/windows.system.idl | 70 +++++++
loader/wine.inf.in | 1 +
9 files changed, 585 insertions(+), 2 deletions(-)
create mode 100644 include/asyncinfo.idl
create mode 100644 include/windows.gaming.input.forcefeedback.idl
create mode 100644 include/windows.system.idl
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 dec9d39e7a3..1a40a8ddc35 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;
+ IRawGameControllerStatics IRawGameControllerStatics_iface;
IVectorView_Gamepad IVectorView_Gamepad_iface;
LONG ref;
};
@@ -45,6 +46,11 @@ 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_IRawGameControllerStatics(IRawGameControllerStatics *iface)
+{
+ return CONTAINING_RECORD(iface, struct windows_gaming_input, IRawGameControllerStatics_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);
@@ -265,6 +271,122 @@ static const struct IGamepadStaticsVtbl gamepad_statics_vtbl =
gamepad_statics_get_Gamepads,
};
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_QueryInterface(
+ IRawGameControllerStatics *iface, REFIID iid, void **out)
+{
+ TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
+
+ if (IsEqualGUID(iid, &IID_IAgileObject))
+ {
+ 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 raw_game_controller_statics_AddRef(
+ IRawGameControllerStatics *iface)
+{
+ struct windows_gaming_input *impl = impl_from_IRawGameControllerStatics(iface);
+ ULONG ref = InterlockedIncrement(&impl->ref);
+ TRACE("iface %p, ref %u.\n", iface, ref);
+ return ref;
+}
+
+static ULONG STDMETHODCALLTYPE raw_game_controller_statics_Release(
+ IRawGameControllerStatics *iface)
+{
+ struct windows_gaming_input *impl = impl_from_IRawGameControllerStatics(iface);
+ ULONG ref = InterlockedDecrement(&impl->ref);
+ TRACE("iface %p, ref %u.\n", iface, ref);
+ return ref;
+}
+
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_GetIids(
+ IRawGameControllerStatics *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 raw_game_controller_statics_GetRuntimeClassName(
+ IRawGameControllerStatics *iface, HSTRING *class_name)
+{
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_GetTrustLevel(
+ IRawGameControllerStatics *iface, TrustLevel *trust_level)
+{
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_add_RawGameControllerAdded(
+ IRawGameControllerStatics *iface, IEventHandler_RawGameController *value, EventRegistrationToken* token)
+{
+ FIXME("iface %p, value %p, token %p stub!\n", iface, value, token);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_remove_RawGameControllerAdded(
+ IRawGameControllerStatics *iface, EventRegistrationToken token)
+{
+ FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_add_RawGameControllerRemoved(
+ IRawGameControllerStatics *iface, IEventHandler_RawGameController *value, EventRegistrationToken* token)
+{
+ FIXME("iface %p, value %p, token %p stub!\n", iface, value, token);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_remove_RawGameControllerRemoved(
+ IRawGameControllerStatics *iface, EventRegistrationToken token)
+{
+ FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_get_RawGameControllers(
+ IRawGameControllerStatics *iface, IVectorView_RawGameController **value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_FromGameController(
+ IRawGameControllerStatics *iface, IGameController *game_controller, IRawGameController **value)
+{
+ FIXME("iface %p, game_controller %p, value %p stub!\n", iface, game_controller, value);
+ return E_NOTIMPL;
+}
+
+static const struct IRawGameControllerStaticsVtbl raw_game_controller_statics_vtbl =
+{
+ raw_game_controller_statics_QueryInterface,
+ raw_game_controller_statics_AddRef,
+ raw_game_controller_statics_Release,
+ /* IInspectable methods */
+ raw_game_controller_statics_GetIids,
+ raw_game_controller_statics_GetRuntimeClassName,
+ raw_game_controller_statics_GetTrustLevel,
+ /* IRawGameControllerStatics methods */
+ raw_game_controller_statics_add_RawGameControllerAdded,
+ raw_game_controller_statics_remove_RawGameControllerAdded,
+ raw_game_controller_statics_add_RawGameControllerRemoved,
+ raw_game_controller_statics_remove_RawGameControllerRemoved,
+ raw_game_controller_statics_get_RawGameControllers,
+ raw_game_controller_statics_FromGameController,
+};
+
static HRESULT STDMETHODCALLTYPE windows_gaming_input_QueryInterface(
IActivationFactory *iface, REFIID iid, void **out)
{
@@ -287,6 +409,13 @@ static HRESULT STDMETHODCALLTYPE windows_gaming_input_QueryInterface(
return S_OK;
}
+ if (IsEqualGUID(iid, &IID_IRawGameControllerStatics))
+ {
+ IUnknown_AddRef(iface);
+ *out = &impl->IRawGameControllerStatics_iface;
+ return S_OK;
+ }
+
FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
*out = NULL;
return E_NOINTERFACE;
@@ -355,6 +484,7 @@ static struct windows_gaming_input windows_gaming_input =
{
{&activation_factory_vtbl},
{&gamepad_statics_vtbl},
+ {&raw_game_controller_statics_vtbl},
{&vector_view_gamepad_vtbl},
0
};
diff --git a/include/Makefile.in b/include/Makefile.in
index ac403a78a4d..90e9b660633 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -20,6 +20,7 @@ SOURCES = \
appmodel.h \
asferr.h \
asptlb.idl \
+ asyncinfo.idl \
asynot.idl \
asysta.idl \
atlbase.h \
@@ -749,8 +750,10 @@ SOURCES = \
windows.foundation.collections.idl \
windows.foundation.idl \
windows.gaming.input.idl \
+ windows.gaming.input.forcefeedback.idl \
windows.h \
windows.media.speechsynthesis.idl \
+ windows.system.idl \
windowscontracts.idl \
windowsx.h \
wine/debug.h \
diff --git a/include/asyncinfo.idl b/include/asyncinfo.idl
new file mode 100644
index 00000000000..61784bc65ac
--- /dev/null
+++ b/include/asyncinfo.idl
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2020 RĂ©mi Bernon for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef __WIDL__
+#pragma winrt ns_prefix
+#endif
+
+import "inspectable.idl";
+
+typedef [v1_enum] enum AsyncStatus
+{
+ Started = 0,
+ Completed,
+ Canceled,
+ Error,
+} AsyncStatus;
+
+[
+ object,
+ uuid(00000036-0000-0000-c000-000000000046),
+ pointer_default(unique)
+]
+interface IAsyncInfo : IInspectable
+{
+ [propget] HRESULT Id([out, retval] unsigned __int32 *id);
+ [propget] HRESULT Status([out, retval] AsyncStatus *status);
+ [propget] HRESULT ErrorCode([out, retval] HRESULT *errorCode);
+ HRESULT Cancel();
+ HRESULT Close();
+}
diff --git a/include/windows.foundation.collections.idl b/include/windows.foundation.collections.idl
index ba860a1e82e..2562d34791f 100644
--- a/include/windows.foundation.collections.idl
+++ b/include/windows.foundation.collections.idl
@@ -21,7 +21,7 @@
#endif
import "inspectable.idl";
-/* import "asyncinfo.idl"; */
+import "asyncinfo.idl";
import "windowscontracts.idl";
/* import "eventtoken.idl"; */
@@ -53,6 +53,25 @@ cpp_quote("#endif")
]
delegate HRESULT TypedEventHandler<TSender, TArgs>([in] TSender sender, [in] TArgs args);
+ interface IAsyncOperation<TResult>;
+
+ [
+ contract(Windows.Foundation.FoundationContract, 1.0),
+ uuid(fcdcf02c-e5d8-4478-915a-4d90b74b83a5)
+ ]
+ delegate HRESULT AsyncOperationCompletedHandler<TResult>([in] IAsyncOperation<TResult> *info, [in] AsyncStatus status);
+
+ [
+ contract(Windows.Foundation.FoundationContract, 1.0),
+ uuid(9fc2b0bb-e446-44e2-aa61-9cab8f636af2)
+ ]
+ interface IAsyncOperation<TResult> : IInspectable
+ {
+ [propput] HRESULT Completed([in] AsyncOperationCompletedHandler<TResult> *handler);
+ [propget] HRESULT Completed([out, retval] AsyncOperationCompletedHandler<TResult> **handler);
+ HRESULT GetResults([out, retval] TResult **results);
+ }
+
namespace Collections
{
[
diff --git a/include/windows.foundation.idl b/include/windows.foundation.idl
index 90bbc876339..2bed3d54cda 100644
--- a/include/windows.foundation.idl
+++ b/include/windows.foundation.idl
@@ -21,7 +21,7 @@
#endif
import "inspectable.idl";
-/* import "asyncinfo.idl"; */
+import "asyncinfo.idl";
import "windowscontracts.idl";
/* import "eventtoken.idl"; */
/* import "ivectorchangedeventargs.idl"; */
@@ -119,3 +119,12 @@ namespace Windows {
}
}
}
+
+namespace Windows {
+ namespace Foundation {
+ declare {
+ interface Windows.Foundation.AsyncOperationCompletedHandler<boolean>;
+ interface Windows.Foundation.IAsyncOperation<boolean>;
+ }
+ }
+}
diff --git a/include/windows.gaming.input.forcefeedback.idl b/include/windows.gaming.input.forcefeedback.idl
new file mode 100644
index 00000000000..fa9da2f7656
--- /dev/null
+++ b/include/windows.gaming.input.forcefeedback.idl
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2020 RĂ©mi Bernon for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef __WIDL__
+#pragma winrt ns_prefix
+#endif
+
+import "inspectable.idl";
+import "windows.foundation.idl";
+
+namespace Windows {
+ namespace Gaming {
+ namespace Input {
+ namespace ForceFeedback {
+ typedef enum ForceFeedbackEffectAxes ForceFeedbackEffectAxes;
+ typedef enum ForceFeedbackLoadEffectResult ForceFeedbackLoadEffectResult;
+ interface IForceFeedbackEffect;
+ runtimeclass ForceFeedbackMotor;
+ }
+ }
+ }
+}
+
+namespace Windows {
+ namespace Gaming {
+ namespace Input {
+ namespace ForceFeedback {
+ declare {
+ interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>;
+ interface Windows.Foundation.IAsyncOperation<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>;
+ interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor*>;
+ }
+ }
+ }
+ }
+}
+
+namespace Windows {
+ namespace Gaming {
+ namespace Input {
+ namespace ForceFeedback {
+ [
+ contract(Windows.Foundation.UniversalApiContract, 3.0),
+ flags
+ ]
+ enum ForceFeedbackEffectAxes
+ {
+ None = 0x0,
+ X = 0x1,
+ Y = 0x2,
+ Z = 0x4
+ };
+
+ [contract(Windows.Foundation.UniversalApiContract, 3.0)]
+ enum ForceFeedbackLoadEffectResult
+ {
+ Succeeded = 0,
+ EffectStorageFull = 1,
+ EffectNotSupported = 2
+ };
+
+ [
+ contract(Windows.Foundation.UniversalApiContract, 3.0),
+ exclusiveto(Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor),
+ uuid(8d3d417c-a5ea-4516-8026-2b00f74ef6e5)
+ ]
+ interface IForceFeedbackMotor : IInspectable
+ {
+ [propget] HRESULT AreEffectsPaused([out, retval] boolean* value);
+ [propget] HRESULT MasterGain([out, retval] DOUBLE* value);
+ [propput] HRESULT MasterGain([in] DOUBLE value);
+ [propget] HRESULT IsEnabled([out, retval] boolean* value);
+ [propget] HRESULT SupportedAxes([out, retval] Windows.Gaming.Input.ForceFeedback.ForceFeedbackEffectAxes* value);
+ HRESULT LoadEffectAsync([in] Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect* effect, [out, retval] Windows.Foundation.IAsyncOperation<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>** asyncOperation);
+ HRESULT PauseAllEffects();
+ HRESULT ResumeAllEffects();
+ HRESULT StopAllEffects();
+ HRESULT TryDisableAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean>** asyncOperation);
+ HRESULT TryEnableAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean>** asyncOperation);
+ HRESULT TryResetAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean>** asyncOperation);
+ HRESULT TryUnloadEffectAsync([in] Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect* effect, [out, retval] Windows.Foundation.IAsyncOperation<boolean>** asyncOperation);
+ }
+
+ [
+ contract(Windows.Foundation.UniversalApiContract, 3.0),
+ marshaling_behavior(agile),
+ threading(both)
+ ]
+ runtimeclass ForceFeedbackMotor
+ {
+ [default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackMotor;
+ }
+ }
+ }
+ }
+}
diff --git a/include/windows.gaming.input.idl b/include/windows.gaming.input.idl
index b5af4e24a66..36d4038ed1f 100644
--- a/include/windows.gaming.input.idl
+++ b/include/windows.gaming.input.idl
@@ -22,11 +22,16 @@
import "inspectable.idl";
import "windows.foundation.idl";
+import "windows.system.idl";
+import "windows.gaming.input.forcefeedback.idl";
namespace Windows {
namespace Gaming {
namespace Input {
typedef enum GamepadButtons GamepadButtons;
+ typedef enum GameControllerButtonLabel GameControllerButtonLabel;
+ typedef enum GameControllerSwitchKind GameControllerSwitchKind;
+ typedef enum GameControllerSwitchPosition GameControllerSwitchPosition;
typedef struct GamepadReading GamepadReading;
typedef struct GamepadVibration GamepadVibration;
interface IGameController;
@@ -35,7 +40,11 @@ namespace Windows {
interface IGamepad2;
interface IGamepadStatics;
interface IGamepadStatics2;
+ interface IRawGameController;
+ interface IRawGameController2;
runtimeclass Gamepad;
+ runtimeclass Headset;
+ runtimeclass RawGameController;
}
}
}
@@ -45,7 +54,11 @@ namespace Windows {
namespace Input {
declare {
interface Windows.Foundation.EventHandler<Windows.Gaming.Input.Gamepad*>;
+ interface Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController*>;
+ interface Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController*, Windows.Gaming.Input.Headset*>;
+ interface Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController*, Windows.System.UserChangedEventArgs*>;
interface Windows.Foundation.Collections.IVectorView<Gamepad*>;
+ interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.RawGameController*>;
}
}
}
@@ -85,6 +98,102 @@ namespace Windows {
Paddle4 = 0x20000
};
+ [contract(Windows.Foundation.UniversalApiContract, 3.0)]
+ enum GameControllerButtonLabel
+ {
+ None = 0,
+ XboxBack = 1,
+ XboxStart = 2,
+ XboxMenu = 3,
+ XboxView = 4,
+ XboxUp = 5,
+ XboxDown = 6,
+ XboxLeft = 7,
+ XboxRight = 8,
+ XboxA = 9,
+ XboxB = 10,
+ XboxX = 11,
+ XboxY = 12,
+ XboxLeftBumper = 13,
+ XboxLeftTrigger = 14,
+ XboxLeftStickButton = 15,
+ XboxRightBumper = 16,
+ XboxRightTrigger = 17,
+ XboxRightStickButton = 18,
+ XboxPaddle1 = 19,
+ XboxPaddle2 = 20,
+ XboxPaddle3 = 21,
+ XboxPaddle4 = 22,
+ Mode = 23,
+ Select = 24,
+ Menu = 25,
+ View = 26,
+ Back = 27,
+ Start = 28,
+ Options = 29,
+ Share = 30,
+ Up = 31,
+ Down = 32,
+ Left = 33,
+ Right = 34,
+ LetterA = 35,
+ LetterB = 36,
+ LetterC = 37,
+ LetterL = 38,
+ LetterR = 39,
+ LetterX = 40,
+ LetterY = 41,
+ LetterZ = 42,
+ Cross = 43,
+ Circle = 44,
+ Square = 45,
+ Triangle = 46,
+ LeftBumper = 47,
+ LeftTrigger = 48,
+ LeftStickButton = 49,
+ Left1 = 50,
+ Left2 = 51,
+ Left3 = 52,
+ RightBumper = 53,
+ RightTrigger = 54,
+ RightStickButton = 55,
+ Right1 = 56,
+ Right2 = 57,
+ Right3 = 58,
+ Paddle1 = 59,
+ Paddle2 = 60,
+ Paddle3 = 61,
+ Paddle4 = 62,
+ Plus = 63,
+ Minus = 64,
+ DownLeftArrow = 65,
+ DialLeft = 66,
+ DialRight = 67,
+ Suspension = 68
+ };
+
+ [contract(Windows.Foundation.UniversalApiContract, 4.0)]
+ enum GameControllerSwitchKind
+ {
+ TwoWay = 0,
+ FourWay = 1,
+ EightWay = 2
+ };
+
+ [contract(Windows.Foundation.UniversalApiContract, 4.0)]
+ enum GameControllerSwitchPosition
+ {
+ Center = 0,
+ Up = 1,
+ UpRight = 2,
+ Right = 3,
+ DownRight = 4,
+ Down = 5,
+ DownLeft = 6,
+ Left = 7,
+ UpLeft = 8
+ };
+
[contract(Windows.Foundation.UniversalApiContract, 1.0)]
struct GamepadReading
{
@@ -107,6 +216,23 @@ namespace Windows {
DOUBLE RightTrigger;
};
+ [
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
+ uuid(1baf6522-5f64-42c5-8267-b9fe2215bfbd)
+ ]
+ interface IGameController : IInspectable
+ {
+ [eventadd] HRESULT HeadsetConnected([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController*, Windows.Gaming.Input.Headset*>* value, [out, retval] EventRegistrationToken* token);
+ [eventremove] HRESULT HeadsetConnected([in] EventRegistrationToken token);
+ [eventadd] HRESULT HeadsetDisconnected([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController*, Windows.Gaming.Input.Headset*>* value, [out, retval] EventRegistrationToken* token);
+ [eventremove] HRESULT HeadsetDisconnected([in] EventRegistrationToken token);
+ [eventadd] HRESULT UserChanged([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController*, Windows.System.UserChangedEventArgs*>* value, [out, retval] EventRegistrationToken* token);
+ [eventremove] HRESULT UserChanged([in] EventRegistrationToken token);
+ [propget] HRESULT Headset([out, retval] Windows.Gaming.Input.Headset** value);
+ [propget] HRESULT IsWireless([out, retval] boolean* value);
+ [propget] HRESULT User([out, retval] Windows.System.User** value);
+ }
+
[
contract(Windows.Foundation.UniversalApiContract, 1.0),
exclusiveto(Windows.Gaming.Input.Gamepad),
@@ -120,6 +246,25 @@ namespace Windows {
HRESULT GetCurrentReading([out, retval] Windows.Gaming.Input.GamepadReading* value);
}
+ [
+ contract(Windows.Foundation.UniversalApiContract, 4.0),
+ exclusiveto(Windows.Gaming.Input.RawGameController),
+ uuid(7cad6d91-a7e1-4f71-9a78-33e9c5dfea62)
+ ]
+ interface IRawGameController : IInspectable
+ requires Windows.Gaming.Input.IGameController
+ {
+ [propget] HRESULT AxisCount([out] [retval] INT32* value);
+ [propget] HRESULT ButtonCount([out] [retval] INT32* value);
+ [propget] HRESULT ForceFeedbackMotors([out] [retval] Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor*>** value);
+ [propget] HRESULT HardwareProductId([out] [retval] UINT16* value);
+ [propget] HRESULT HardwareVendorId([out] [retval] UINT16* value);
+ [propget] HRESULT SwitchCount([out] [retval] INT32* value);
+ HRESULT GetButtonLabel([in] INT32 buttonIndex, [out] [retval] Windows.Gaming.Input.GameControllerButtonLabel* value);
+ HRESULT GetCurrentReading([in] UINT32 __buttonArraySize, [out] [size_is(__buttonArraySize)] boolean* buttonArray, [in] UINT32 __switchArraySize, [out] [size_is(__switchArraySize)] Windows.Gaming.Input.GameControllerSwitchPosition* switchArray, [in] UINT32 __axisArraySize, [out] [size_is(__axisArraySize)] DOUBLE* axisArray, [out] [retval] UINT64* timestamp);
+ HRESULT GetSwitchKind([in] INT32 switchIndex, [out] [retval] Windows.Gaming.Input.GameControllerSwitchKind* value);
+ }
+
[
object,
uuid(8bbce529-d49c-39e9-9560-e47dde96b7c8)
@@ -133,6 +278,31 @@ namespace Windows {
[propget] HRESULT Gamepads([out, retval] Windows.Foundation.Collections.IVectorView<Gamepad*> **value);
}
+ [
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
+ exclusiveto(Windows.Gaming.Input.Headset),
+ uuid(3fd156ef-6925-3fa8-9181-029c5223ae3b)
+ ]
+ interface IHeadset : IInspectable
+ {
+ [propget] HRESULT CaptureDeviceId([out, retval] HSTRING* value);
+ [propget] HRESULT RenderDeviceId([out, retval] HSTRING* value);
+ }
+
+ [
+ object,
+ uuid(eb8d0792-e95a-4b19-afc7-0a59f8bf759e)
+ ]
+ interface IRawGameControllerStatics : IInspectable
+ {
+ [eventadd] HRESULT RawGameControllerAdded([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController*> *value, [out, retval] EventRegistrationToken* token);
+ [eventremove] HRESULT RawGameControllerAdded([in] EventRegistrationToken token);
+ [eventadd] HRESULT RawGameControllerRemoved([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController*> *value, [out, retval] EventRegistrationToken* token);
+ [eventremove] HRESULT RawGameControllerRemoved([in] EventRegistrationToken token);
+ [propget] HRESULT RawGameControllers([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.RawGameController*> **value);
+ HRESULT FromGameController([in] Windows.Gaming.Input.IGameController *game_controller, [out, retval] Windows.Gaming.Input.RawGameController **value);
+ }
+
[
contract(Windows.Foundation.UniversalApiContract, 1.0),
marshaling_behavior(agile),
@@ -147,6 +317,31 @@ namespace Windows {
[contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Gaming.Input.IGamepad2;
[contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
}
+
+ [
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
+ marshaling_behavior(agile),
+ threading(both)
+ ]
+ runtimeclass Headset
+ {
+ [default] interface Windows.Gaming.Input.IHeadset;
+ [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
+ }
+
+ [
+ contract(Windows.Foundation.UniversalApiContract, 4.0),
+ marshaling_behavior(agile),
+ static(Windows.Gaming.Input.IRawGameControllerStatics, Windows.Foundation.UniversalApiContract, 4.0),
+ threading(both)
+ ]
+ runtimeclass RawGameController
+ {
+ [default] interface Windows.Gaming.Input.IRawGameController;
+ interface Windows.Gaming.Input.IGameController;
+ interface Windows.Gaming.Input.IGameControllerBatteryInfo;
+ [contract(Windows.Foundation.UniversalApiContract, 5.0)] interface Windows.Gaming.Input.IRawGameController2;
+ }
}
}
}
diff --git a/include/windows.system.idl b/include/windows.system.idl
new file mode 100644
index 00000000000..824441eaff9
--- /dev/null
+++ b/include/windows.system.idl
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2020 RĂ©mi Bernon for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef __WIDL__
+#pragma winrt ns_prefix
+#endif
+
+import "inspectable.idl";
+import "windows.foundation.idl";
+
+namespace Windows {
+ namespace System {
+ interface IUser;
+ interface IUserStatics;
+ interface IUserChangedEventArgs;
+ interface IUserChangedEventArgs2;
+ runtimeclass User;
+ runtimeclass UserChangedEventArgs;
+ }
+}
+
+namespace Windows {
+ namespace System {
+ [
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
+ exclusiveto(Windows.System.UserChangedEventArgs),
+ uuid(086459dc-18c6-48db-bc99-724fb9203ccc)
+ ]
+ interface IUserChangedEventArgs : IInspectable
+ {
+ [propget] HRESULT User([out, retval] Windows.System.User** value);
+ }
+
+ [
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
+ marshaling_behavior(agile),
+ static(Windows.System.IUserStatics, Windows.Foundation.UniversalApiContract, 1.0),
+ threading(both),
+ ]
+ runtimeclass User
+ {
+ [default] interface Windows.System.IUser;
+ }
+
+ [
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
+ marshaling_behavior(agile)
+ ]
+ runtimeclass UserChangedEventArgs
+ {
+ [default] interface Windows.System.IUserChangedEventArgs;
+ [contract(Windows.Foundation.UniversalApiContract, 10.0)] interface Windows.System.IUserChangedEventArgs2;
+ }
+ }
+}
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 79a7b2c0503..71c6cac0366 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -714,6 +714,7 @@ HKLM,%MciExtStr%,"wvx",,"MPEGVideo"
[Misc]
HKLM,Software\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.Input.Gamepad,"DllPath",2,"Windows.Gaming.Input.dll"
+HKLM,Software\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.Input.RawGameController,"DllPath",2,"Windows.Gaming.Input.dll"
HKLM,Software\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Media.SpeechSynthesis.SpeechSynthesizer,"DllPath",2,"Windows.Media.Speech.dll"
HKLM,Software\Borland\Database Engine\Settings\SYSTEM\INIT,SHAREDMEMLOCATION,,9000
HKLM,Software\Clients\Mail,,2,"Native Mail Client"
--
2.20.1