mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 03:30:58 +00:00
windows.gaming.input: Stub ICustomGameControllerFactory for RawGameController.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0d3c026bdb
commit
5adbc011d9
|
@ -27,6 +27,7 @@ struct controller_statics
|
|||
{
|
||||
IActivationFactory IActivationFactory_iface;
|
||||
IRawGameControllerStatics IRawGameControllerStatics_iface;
|
||||
ICustomGameControllerFactory ICustomGameControllerFactory_iface;
|
||||
LONG ref;
|
||||
};
|
||||
|
||||
|
@ -56,6 +57,12 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
if (IsEqualGUID( iid, &IID_ICustomGameControllerFactory ))
|
||||
{
|
||||
IInspectable_AddRef( (*out = &impl->ICustomGameControllerFactory_iface) );
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) );
|
||||
*out = NULL;
|
||||
return E_NOINTERFACE;
|
||||
|
@ -189,11 +196,48 @@ static const struct IRawGameControllerStaticsVtbl statics_vtbl =
|
|||
statics_FromGameController,
|
||||
};
|
||||
|
||||
DEFINE_IINSPECTABLE( controller_factory, ICustomGameControllerFactory, struct controller_statics, IActivationFactory_iface )
|
||||
|
||||
static HRESULT WINAPI controller_factory_CreateGameController( ICustomGameControllerFactory *iface, IGameControllerProvider *provider,
|
||||
IInspectable **value )
|
||||
{
|
||||
FIXME( "iface %p, provider %p, value %p stub!\n", iface, provider, value );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI controller_factory_OnGameControllerAdded( ICustomGameControllerFactory *iface, IGameController *value )
|
||||
{
|
||||
FIXME( "iface %p, value %p stub!\n", iface, value );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI controller_factory_OnGameControllerRemoved( ICustomGameControllerFactory *iface, IGameController *value )
|
||||
{
|
||||
FIXME( "iface %p, value %p stub!\n", iface, value );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static const struct ICustomGameControllerFactoryVtbl controller_factory_vtbl =
|
||||
{
|
||||
controller_factory_QueryInterface,
|
||||
controller_factory_AddRef,
|
||||
controller_factory_Release,
|
||||
/* IInspectable methods */
|
||||
controller_factory_GetIids,
|
||||
controller_factory_GetRuntimeClassName,
|
||||
controller_factory_GetTrustLevel,
|
||||
/* ICustomGameControllerFactory methods */
|
||||
controller_factory_CreateGameController,
|
||||
controller_factory_OnGameControllerAdded,
|
||||
controller_factory_OnGameControllerRemoved,
|
||||
};
|
||||
|
||||
static struct controller_statics controller_statics =
|
||||
{
|
||||
{&factory_vtbl},
|
||||
{&statics_vtbl},
|
||||
{&controller_factory_vtbl},
|
||||
1,
|
||||
};
|
||||
|
||||
IActivationFactory *controller_factory = &controller_statics.IActivationFactory_iface;
|
||||
ICustomGameControllerFactory *controller_factory = &controller_statics.ICustomGameControllerFactory_iface;
|
||||
|
|
|
@ -169,6 +169,7 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING class_str, IActivationFactory **
|
|||
{
|
||||
static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT;
|
||||
const WCHAR *buffer = WindowsGetStringRawBuffer( class_str, NULL );
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
TRACE( "class %s, factory %p.\n", debugstr_w(buffer), factory );
|
||||
|
||||
|
@ -177,13 +178,13 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING class_str, IActivationFactory **
|
|||
*factory = NULL;
|
||||
|
||||
if (!wcscmp( buffer, RuntimeClass_Windows_Gaming_Input_RawGameController ))
|
||||
IActivationFactory_AddRef( (*factory = controller_factory) );
|
||||
hr = ICustomGameControllerFactory_QueryInterface( controller_factory, &IID_IActivationFactory, (void **)factory );
|
||||
if (!wcscmp( buffer, RuntimeClass_Windows_Gaming_Input_Gamepad ))
|
||||
IActivationFactory_AddRef( (*factory = gamepad_factory) );
|
||||
if (!wcscmp( buffer, RuntimeClass_Windows_Gaming_Input_Custom_GameControllerFactoryManager ))
|
||||
IActivationFactory_AddRef( (*factory = manager_factory) );
|
||||
|
||||
if (*factory) return S_OK;
|
||||
if (SUCCEEDED(hr) && *factory) return S_OK;
|
||||
return REGDB_E_CLASSNOTREG;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#include "windows.gaming.input.custom.h"
|
||||
|
||||
extern HINSTANCE windows_gaming_input;
|
||||
extern IActivationFactory *controller_factory;
|
||||
extern ICustomGameControllerFactory *controller_factory;
|
||||
extern IActivationFactory *gamepad_factory;
|
||||
extern IActivationFactory *manager_factory;
|
||||
|
||||
|
|
Loading…
Reference in a new issue