From: Rémi Bernon rbernon@codeweavers.com
--- dlls/windows.gaming.input/Makefile.in | 1 + dlls/windows.gaming.input/async.c | 119 ++++++++++---------- dlls/windows.gaming.input/async_private.idl | 46 ++++++++ dlls/windows.gaming.input/force_feedback.c | 10 +- dlls/windows.gaming.input/private.h | 2 +- dlls/windows.gaming.input/provider.idl | 15 --- 6 files changed, 114 insertions(+), 79 deletions(-) create mode 100644 dlls/windows.gaming.input/async_private.idl
diff --git a/dlls/windows.gaming.input/Makefile.in b/dlls/windows.gaming.input/Makefile.in index 1342a4f9dde..34936b79996 100644 --- a/dlls/windows.gaming.input/Makefile.in +++ b/dlls/windows.gaming.input/Makefile.in @@ -3,6 +3,7 @@ IMPORTS = combase uuid user32 dinput8 setupapi hid
SOURCES = \ async.c \ + async_private.idl \ classes.idl \ condition_effect.c \ constant_effect.c \ diff --git a/dlls/windows.gaming.input/async.c b/dlls/windows.gaming.input/async.c index d70994289f1..a916db6a90d 100644 --- a/dlls/windows.gaming.input/async.c +++ b/dlls/windows.gaming.input/async.c @@ -1,4 +1,4 @@ -/* WinRT Windows.Gaming.Input implementation +/* WinRT IAsync* implementation * * Copyright 2022 Bernhard Kölbl for CodeWeavers * Copyright 2022 Rémi Bernon for CodeWeavers @@ -18,8 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#define WIDL_using_Wine_Internal #include "private.h" -#include "provider.h" +#include "initguid.h" +#include "async_private.h"
#include "wine/debug.h"
@@ -30,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(input);
struct async_info { - IWineAsyncInfoImpl IWineAsyncInfoImpl_iface; + IAsyncInfoImpl IAsyncInfoImpl_iface; IAsyncInfo IAsyncInfo_iface; IInspectable *IInspectable_outer; LONG ref; @@ -41,29 +43,29 @@ struct async_info IUnknown *param;
CRITICAL_SECTION cs; - IWineAsyncOperationCompletedHandler *handler; + IAsyncOperationCompletedHandlerImpl *handler; PROPVARIANT result; AsyncStatus status; HRESULT hr; };
-static inline struct async_info *impl_from_IWineAsyncInfoImpl( IWineAsyncInfoImpl *iface ) +static inline struct async_info *impl_from_IAsyncInfoImpl( IAsyncInfoImpl *iface ) { - return CONTAINING_RECORD( iface, struct async_info, IWineAsyncInfoImpl_iface ); + return CONTAINING_RECORD( iface, struct async_info, IAsyncInfoImpl_iface ); }
-static HRESULT WINAPI async_impl_QueryInterface( IWineAsyncInfoImpl *iface, REFIID iid, void **out ) +static HRESULT WINAPI async_impl_QueryInterface( IAsyncInfoImpl *iface, REFIID iid, void **out ) { - struct async_info *impl = impl_from_IWineAsyncInfoImpl( iface ); + struct async_info *impl = impl_from_IAsyncInfoImpl( iface );
TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out );
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || IsEqualGUID( iid, &IID_IAgileObject ) || - IsEqualGUID( iid, &IID_IWineAsyncInfoImpl )) + IsEqualGUID( iid, &IID_IAsyncInfoImpl )) { - IInspectable_AddRef( (*out = &impl->IWineAsyncInfoImpl_iface) ); + IInspectable_AddRef( (*out = &impl->IAsyncInfoImpl_iface) ); return S_OK; }
@@ -78,26 +80,27 @@ static HRESULT WINAPI async_impl_QueryInterface( IWineAsyncInfoImpl *iface, REFI return E_NOINTERFACE; }
-static ULONG WINAPI async_impl_AddRef( IWineAsyncInfoImpl *iface ) +static ULONG WINAPI async_impl_AddRef( IAsyncInfoImpl *iface ) { - struct async_info *impl = impl_from_IWineAsyncInfoImpl( iface ); + struct async_info *impl = impl_from_IAsyncInfoImpl( iface ); ULONG ref = InterlockedIncrement( &impl->ref ); TRACE( "iface %p, ref %lu.\n", iface, ref ); return ref; }
-static ULONG WINAPI async_impl_Release( IWineAsyncInfoImpl *iface ) +static ULONG WINAPI async_impl_Release( IAsyncInfoImpl *iface ) { - struct async_info *impl = impl_from_IWineAsyncInfoImpl( iface ); + struct async_info *impl = impl_from_IAsyncInfoImpl( iface ); ULONG ref = InterlockedDecrement( &impl->ref ); TRACE( "iface %p, ref %lu.\n", iface, ref );
if (!ref) { - if (impl->handler && impl->handler != HANDLER_NOT_SET) IWineAsyncOperationCompletedHandler_Release( impl->handler ); + if (impl->handler && impl->handler != HANDLER_NOT_SET) IAsyncOperationCompletedHandlerImpl_Release( impl->handler ); IAsyncInfo_Close( &impl->IAsyncInfo_iface ); if (impl->param) IUnknown_Release( impl->param ); if (impl->invoker) IUnknown_Release( impl->invoker ); + PropVariantClear( &impl->result ); impl->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection( &impl->cs ); free( impl ); @@ -106,9 +109,9 @@ static ULONG WINAPI async_impl_Release( IWineAsyncInfoImpl *iface ) return ref; }
-static HRESULT WINAPI async_impl_put_Completed( IWineAsyncInfoImpl *iface, IWineAsyncOperationCompletedHandler *handler ) +static HRESULT WINAPI async_impl_put_Completed( IAsyncInfoImpl *iface, IAsyncOperationCompletedHandlerImpl *handler ) { - struct async_info *impl = impl_from_IWineAsyncInfoImpl( iface ); + struct async_info *impl = impl_from_IAsyncInfoImpl( iface ); HRESULT hr = S_OK;
TRACE( "iface %p, handler %p.\n", iface, handler ); @@ -118,7 +121,7 @@ static HRESULT WINAPI async_impl_put_Completed( IWineAsyncInfoImpl *iface, IWine else if (impl->handler != HANDLER_NOT_SET) hr = E_ILLEGAL_DELEGATE_ASSIGNMENT; else if ((impl->handler = handler)) { - IWineAsyncOperationCompletedHandler_AddRef( impl->handler ); + IAsyncOperationCompletedHandlerImpl_AddRef( impl->handler );
if (impl->status > Started) { @@ -127,8 +130,8 @@ static HRESULT WINAPI async_impl_put_Completed( IWineAsyncInfoImpl *iface, IWine impl->handler = NULL; /* Prevent concurrent invoke. */ LeaveCriticalSection( &impl->cs );
- IWineAsyncOperationCompletedHandler_Invoke( handler, operation, status ); - IWineAsyncOperationCompletedHandler_Release( handler ); + IAsyncOperationCompletedHandlerImpl_Invoke( handler, operation, status ); + IAsyncOperationCompletedHandlerImpl_Release( handler );
return S_OK; } @@ -138,9 +141,9 @@ static HRESULT WINAPI async_impl_put_Completed( IWineAsyncInfoImpl *iface, IWine return hr; }
-static HRESULT WINAPI async_impl_get_Completed( IWineAsyncInfoImpl *iface, IWineAsyncOperationCompletedHandler **handler ) +static HRESULT WINAPI async_impl_get_Completed( IAsyncInfoImpl *iface, IAsyncOperationCompletedHandlerImpl **handler ) { - struct async_info *impl = impl_from_IWineAsyncInfoImpl( iface ); + struct async_info *impl = impl_from_IAsyncInfoImpl( iface ); HRESULT hr = S_OK;
TRACE( "iface %p, handler %p.\n", iface, handler ); @@ -148,15 +151,15 @@ static HRESULT WINAPI async_impl_get_Completed( IWineAsyncInfoImpl *iface, IWine EnterCriticalSection( &impl->cs ); if (impl->status == Closed) hr = E_ILLEGAL_METHOD_CALL; if (impl->handler == NULL || impl->handler == HANDLER_NOT_SET) *handler = NULL; - else IWineAsyncOperationCompletedHandler_AddRef( (*handler = impl->handler) ); + else IAsyncOperationCompletedHandlerImpl_AddRef( (*handler = impl->handler) ); LeaveCriticalSection( &impl->cs );
return hr; }
-static HRESULT WINAPI async_impl_get_Result( IWineAsyncInfoImpl *iface, PROPVARIANT *result ) +static HRESULT WINAPI async_impl_get_Result( IAsyncInfoImpl *iface, PROPVARIANT *result ) { - struct async_info *impl = impl_from_IWineAsyncInfoImpl( iface ); + struct async_info *impl = impl_from_IAsyncInfoImpl( iface ); HRESULT hr = E_ILLEGAL_METHOD_CALL;
TRACE( "iface %p, result %p.\n", iface, result ); @@ -172,9 +175,9 @@ static HRESULT WINAPI async_impl_get_Result( IWineAsyncInfoImpl *iface, PROPVARI return hr; }
-static HRESULT WINAPI async_impl_Start( IWineAsyncInfoImpl *iface ) +static HRESULT WINAPI async_impl_Start( IAsyncInfoImpl *iface ) { - struct async_info *impl = impl_from_IWineAsyncInfoImpl( iface ); + struct async_info *impl = impl_from_IAsyncInfoImpl( iface );
TRACE( "iface %p.\n", iface );
@@ -185,13 +188,13 @@ static HRESULT WINAPI async_impl_Start( IWineAsyncInfoImpl *iface ) return S_OK; }
-static const struct IWineAsyncInfoImplVtbl async_impl_vtbl = +static const struct IAsyncInfoImplVtbl async_impl_vtbl = { /* IUnknown methods */ async_impl_QueryInterface, async_impl_AddRef, async_impl_Release, - /* IWineAsyncInfoImpl */ + /* IAsyncInfoImpl */ async_impl_put_Completed, async_impl_get_Completed, async_impl_get_Result, @@ -301,9 +304,9 @@ static const struct IAsyncInfoVtbl async_info_vtbl =
static void CALLBACK async_info_callback( TP_CALLBACK_INSTANCE *instance, void *iface, TP_WORK *work ) { - struct async_info *impl = impl_from_IWineAsyncInfoImpl( iface ); + struct async_info *impl = impl_from_IAsyncInfoImpl( iface ); IInspectable *operation = impl->IInspectable_outer; - PROPVARIANT result; + PROPVARIANT result = {0}; HRESULT hr;
hr = impl->callback( impl->invoker, impl->param, &result ); @@ -315,13 +318,13 @@ static void CALLBACK async_info_callback( TP_CALLBACK_INSTANCE *instance, void *
if (impl->handler != NULL && impl->handler != HANDLER_NOT_SET) { - IWineAsyncOperationCompletedHandler *handler = impl->handler; + IAsyncOperationCompletedHandlerImpl *handler = impl->handler; AsyncStatus status = impl->status; impl->handler = NULL; /* Prevent concurrent invoke. */ LeaveCriticalSection( &impl->cs );
- IWineAsyncOperationCompletedHandler_Invoke( handler, operation, status ); - IWineAsyncOperationCompletedHandler_Release( handler ); + IAsyncOperationCompletedHandlerImpl_Invoke( handler, operation, status ); + IAsyncOperationCompletedHandlerImpl_Release( handler ); } else LeaveCriticalSection( &impl->cs );
@@ -332,13 +335,13 @@ static void CALLBACK async_info_callback( TP_CALLBACK_INSTANCE *instance, void * }
static HRESULT async_info_create( IUnknown *invoker, IUnknown *param, async_operation_callback callback, - IInspectable *outer, IWineAsyncInfoImpl **out ) + IInspectable *outer, IAsyncInfoImpl **out ) { struct async_info *impl; HRESULT hr;
if (!(impl = calloc( 1, sizeof(struct async_info) ))) return E_OUTOFMEMORY; - impl->IWineAsyncInfoImpl_iface.lpVtbl = &async_impl_vtbl; + impl->IAsyncInfoImpl_iface.lpVtbl = &async_impl_vtbl; impl->IAsyncInfo_iface.lpVtbl = &async_info_vtbl; impl->IInspectable_outer = outer; impl->ref = 1; @@ -346,7 +349,7 @@ static HRESULT async_info_create( IUnknown *invoker, IUnknown *param, async_oper impl->callback = callback; impl->handler = HANDLER_NOT_SET; impl->status = Started; - if (!(impl->async_run_work = CreateThreadpoolWork( async_info_callback, &impl->IWineAsyncInfoImpl_iface, NULL ))) + if (!(impl->async_run_work = CreateThreadpoolWork( async_info_callback, &impl->IAsyncInfoImpl_iface, NULL ))) { hr = HRESULT_FROM_WIN32( GetLastError() ); free( impl ); @@ -359,14 +362,14 @@ static HRESULT async_info_create( IUnknown *invoker, IUnknown *param, async_oper InitializeCriticalSectionEx( &impl->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO ); impl->cs.DebugInfo->Spare[0] = (DWORD_PTR)( __FILE__ ": async_info.cs" );
- *out = &impl->IWineAsyncInfoImpl_iface; + *out = &impl->IAsyncInfoImpl_iface; return S_OK; }
struct async_bool { IAsyncOperation_boolean IAsyncOperation_boolean_iface; - IWineAsyncInfoImpl *IWineAsyncInfoImpl_inner; + IAsyncInfoImpl *IAsyncInfoImpl_inner; LONG ref; };
@@ -390,7 +393,7 @@ static HRESULT WINAPI async_bool_QueryInterface( IAsyncOperation_boolean *iface, return S_OK; }
- return IWineAsyncInfoImpl_QueryInterface( impl->IWineAsyncInfoImpl_inner, iid, out ); + return IAsyncInfoImpl_QueryInterface( impl->IAsyncInfoImpl_inner, iid, out ); }
static ULONG WINAPI async_bool_AddRef( IAsyncOperation_boolean *iface ) @@ -411,7 +414,7 @@ static ULONG WINAPI async_bool_Release( IAsyncOperation_boolean *iface ) { /* guard against re-entry if inner releases an outer iface */ InterlockedIncrement( &impl->ref ); - IWineAsyncInfoImpl_Release( impl->IWineAsyncInfoImpl_inner ); + IAsyncInfoImpl_Release( impl->IAsyncInfoImpl_inner ); free( impl ); }
@@ -439,18 +442,18 @@ static HRESULT WINAPI async_bool_GetTrustLevel( IAsyncOperation_boolean *iface,
static HRESULT WINAPI async_bool_put_Completed( IAsyncOperation_boolean *iface, IAsyncOperationCompletedHandler_boolean *bool_handler ) { - IWineAsyncOperationCompletedHandler *handler = (IWineAsyncOperationCompletedHandler *)bool_handler; + IAsyncOperationCompletedHandlerImpl *handler = (IAsyncOperationCompletedHandlerImpl *)bool_handler; struct async_bool *impl = impl_from_IAsyncOperation_boolean( iface ); TRACE( "iface %p, handler %p.\n", iface, handler ); - return IWineAsyncInfoImpl_put_Completed( impl->IWineAsyncInfoImpl_inner, handler ); + return IAsyncInfoImpl_put_Completed( impl->IAsyncInfoImpl_inner, handler ); }
static HRESULT WINAPI async_bool_get_Completed( IAsyncOperation_boolean *iface, IAsyncOperationCompletedHandler_boolean **bool_handler ) { - IWineAsyncOperationCompletedHandler **handler = (IWineAsyncOperationCompletedHandler **)bool_handler; + IAsyncOperationCompletedHandlerImpl **handler = (IAsyncOperationCompletedHandlerImpl **)bool_handler; struct async_bool *impl = impl_from_IAsyncOperation_boolean( iface ); TRACE( "iface %p, handler %p.\n", iface, handler ); - return IWineAsyncInfoImpl_get_Completed( impl->IWineAsyncInfoImpl_inner, handler ); + return IAsyncInfoImpl_get_Completed( impl->IAsyncInfoImpl_inner, handler ); }
static HRESULT WINAPI async_bool_GetResults( IAsyncOperation_boolean *iface, BOOLEAN *results ) @@ -461,7 +464,7 @@ static HRESULT WINAPI async_bool_GetResults( IAsyncOperation_boolean *iface, BOO
TRACE( "iface %p, results %p.\n", iface, results );
- hr = IWineAsyncInfoImpl_get_Result( impl->IWineAsyncInfoImpl_inner, &result ); + hr = IAsyncInfoImpl_get_Result( impl->IAsyncInfoImpl_inner, &result );
*results = result.boolVal; PropVariantClear( &result ); @@ -495,10 +498,10 @@ HRESULT async_operation_boolean_create( IUnknown *invoker, IUnknown *param, asyn impl->IAsyncOperation_boolean_iface.lpVtbl = &async_bool_vtbl; impl->ref = 1;
- if (FAILED(hr = async_info_create( invoker, param, callback, (IInspectable *)&impl->IAsyncOperation_boolean_iface, &impl->IWineAsyncInfoImpl_inner )) || - FAILED(hr = IWineAsyncInfoImpl_Start( impl->IWineAsyncInfoImpl_inner ))) + if (FAILED(hr = async_info_create( invoker, param, callback, (IInspectable *)&impl->IAsyncOperation_boolean_iface, &impl->IAsyncInfoImpl_inner )) || + FAILED(hr = IAsyncInfoImpl_Start( impl->IAsyncInfoImpl_inner ))) { - if (impl->IWineAsyncInfoImpl_inner) IWineAsyncInfoImpl_Release( impl->IWineAsyncInfoImpl_inner ); + if (impl->IAsyncInfoImpl_inner) IAsyncInfoImpl_Release( impl->IAsyncInfoImpl_inner ); free( impl ); return hr; } @@ -511,7 +514,7 @@ HRESULT async_operation_boolean_create( IUnknown *invoker, IUnknown *param, asyn struct async_result { IAsyncOperation_ForceFeedbackLoadEffectResult IAsyncOperation_ForceFeedbackLoadEffectResult_iface; - IWineAsyncInfoImpl *IWineAsyncInfoImpl_inner; + IAsyncInfoImpl *IAsyncInfoImpl_inner; LONG ref; };
@@ -535,7 +538,7 @@ static HRESULT WINAPI async_result_QueryInterface( IAsyncOperation_ForceFeedback return S_OK; }
- return IWineAsyncInfoImpl_QueryInterface( impl->IWineAsyncInfoImpl_inner, iid, out ); + return IAsyncInfoImpl_QueryInterface( impl->IAsyncInfoImpl_inner, iid, out ); }
static ULONG WINAPI async_result_AddRef( IAsyncOperation_ForceFeedbackLoadEffectResult *iface ) @@ -556,7 +559,7 @@ static ULONG WINAPI async_result_Release( IAsyncOperation_ForceFeedbackLoadEffec { /* guard against re-entry if inner releases an outer iface */ InterlockedIncrement( &impl->ref ); - IWineAsyncInfoImpl_Release( impl->IWineAsyncInfoImpl_inner ); + IAsyncInfoImpl_Release( impl->IAsyncInfoImpl_inner ); free( impl ); }
@@ -586,14 +589,14 @@ static HRESULT WINAPI async_result_put_Completed( IAsyncOperation_ForceFeedbackL { struct async_result *impl = impl_from_IAsyncOperation_ForceFeedbackLoadEffectResult( iface ); TRACE( "iface %p, handler %p.\n", iface, handler ); - return IWineAsyncInfoImpl_put_Completed( impl->IWineAsyncInfoImpl_inner, (IWineAsyncOperationCompletedHandler *)handler ); + return IAsyncInfoImpl_put_Completed( impl->IAsyncInfoImpl_inner, (IAsyncOperationCompletedHandlerImpl *)handler ); }
static HRESULT WINAPI async_result_get_Completed( IAsyncOperation_ForceFeedbackLoadEffectResult *iface, IAsyncOperationCompletedHandler_ForceFeedbackLoadEffectResult **handler ) { struct async_result *impl = impl_from_IAsyncOperation_ForceFeedbackLoadEffectResult( iface ); TRACE( "iface %p, handler %p.\n", iface, handler ); - return IWineAsyncInfoImpl_get_Completed( impl->IWineAsyncInfoImpl_inner, (IWineAsyncOperationCompletedHandler **)handler ); + return IAsyncInfoImpl_get_Completed( impl->IAsyncInfoImpl_inner, (IAsyncOperationCompletedHandlerImpl **)handler ); }
static HRESULT WINAPI async_result_GetResults( IAsyncOperation_ForceFeedbackLoadEffectResult *iface, ForceFeedbackLoadEffectResult *results ) @@ -604,7 +607,7 @@ static HRESULT WINAPI async_result_GetResults( IAsyncOperation_ForceFeedbackLoad
TRACE( "iface %p, results %p.\n", iface, results );
- hr = IWineAsyncInfoImpl_get_Result( impl->IWineAsyncInfoImpl_inner, &result ); + hr = IAsyncInfoImpl_get_Result( impl->IAsyncInfoImpl_inner, &result );
*results = result.ulVal; PropVariantClear( &result ); @@ -638,10 +641,10 @@ HRESULT async_operation_effect_result_create( IUnknown *invoker, IUnknown *param impl->IAsyncOperation_ForceFeedbackLoadEffectResult_iface.lpVtbl = &async_result_vtbl; impl->ref = 1;
- if (FAILED(hr = async_info_create( invoker, param, callback, (IInspectable *)&impl->IAsyncOperation_ForceFeedbackLoadEffectResult_iface, &impl->IWineAsyncInfoImpl_inner )) || - FAILED(hr = IWineAsyncInfoImpl_Start( impl->IWineAsyncInfoImpl_inner ))) + if (FAILED(hr = async_info_create( invoker, param, callback, (IInspectable *)&impl->IAsyncOperation_ForceFeedbackLoadEffectResult_iface, &impl->IAsyncInfoImpl_inner )) || + FAILED(hr = IAsyncInfoImpl_Start( impl->IAsyncInfoImpl_inner ))) { - if (impl->IWineAsyncInfoImpl_inner) IWineAsyncInfoImpl_Release( impl->IWineAsyncInfoImpl_inner ); + if (impl->IAsyncInfoImpl_inner) IAsyncInfoImpl_Release( impl->IAsyncInfoImpl_inner ); free( impl ); return hr; } diff --git a/dlls/windows.gaming.input/async_private.idl b/dlls/windows.gaming.input/async_private.idl new file mode 100644 index 00000000000..10741572601 --- /dev/null +++ b/dlls/windows.gaming.input/async_private.idl @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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 + */ + +#pragma makedep header + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "propidl.idl"; +import "inspectable.idl"; +import "asyncinfo.idl"; +import "windowscontracts.idl"; + +namespace Wine.Internal { + /* type-pruning version of AsyncOperationCompletedHandlerImpl<T> */ + delegate HRESULT AsyncOperationCompletedHandlerImpl([in] IInspectable *async, [in] AsyncStatus status); + + [ + uuid(d81ab70d-82e0-481c-983d-401225d98a2c) + ] + interface IAsyncInfoImpl : IUnknown + { + [propput] HRESULT Completed([in] AsyncOperationCompletedHandlerImpl *handler); + [propget] HRESULT Completed([out, retval] AsyncOperationCompletedHandlerImpl **handler); + [propget] HRESULT Result([out, retval] PROPVARIANT *result); + HRESULT Start(); + } + + typedef HRESULT (*async_operation_callback)( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ); +} diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index a272daee25f..a8631e60c4a 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -601,7 +601,7 @@ static HRESULT WINAPI motor_get_SupportedAxes( IForceFeedbackMotor *iface, enum return hr; }
-static HRESULT WINAPI motor_load_effect_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ) +static HRESULT motor_load_effect_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ) { struct effect *effect = impl_from_IForceFeedbackEffect( (IForceFeedbackEffect *)param ); IForceFeedbackMotor *motor = (IForceFeedbackMotor *)invoker; @@ -692,7 +692,7 @@ static HRESULT WINAPI motor_StopAllEffects( IForceFeedbackMotor *iface ) return IDirectInputDevice8_SendForceFeedbackCommand( impl->device, DISFFC_STOPALL ); }
-static HRESULT WINAPI motor_try_disable_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ) +static HRESULT motor_try_disable_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ) { struct motor *impl = impl_from_IForceFeedbackMotor( (IForceFeedbackMotor *)invoker ); HRESULT hr; @@ -710,7 +710,7 @@ static HRESULT WINAPI motor_TryDisableAsync( IForceFeedbackMotor *iface, IAsyncO return async_operation_boolean_create( (IUnknown *)iface, NULL, motor_try_disable_async, async_op ); }
-static HRESULT WINAPI motor_try_enable_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ) +static HRESULT motor_try_enable_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ) { struct motor *impl = impl_from_IForceFeedbackMotor( (IForceFeedbackMotor *)invoker ); HRESULT hr; @@ -728,7 +728,7 @@ static HRESULT WINAPI motor_TryEnableAsync( IForceFeedbackMotor *iface, IAsyncOp return async_operation_boolean_create( (IUnknown *)iface, NULL, motor_try_enable_async, async_op ); }
-static HRESULT WINAPI motor_try_reset_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ) +static HRESULT motor_try_reset_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ) { struct motor *impl = impl_from_IForceFeedbackMotor( (IForceFeedbackMotor *)invoker ); HRESULT hr; @@ -746,7 +746,7 @@ static HRESULT WINAPI motor_TryResetAsync( IForceFeedbackMotor *iface, IAsyncOpe return async_operation_boolean_create( (IUnknown *)iface, NULL, motor_try_reset_async, async_op ); }
-static HRESULT WINAPI motor_unload_effect_async( IUnknown *iface, IUnknown *param, PROPVARIANT *result ) +static HRESULT motor_unload_effect_async( IUnknown *iface, IUnknown *param, PROPVARIANT *result ) { struct effect *effect = impl_from_IForceFeedbackEffect( (IForceFeedbackEffect *)param ); IDirectInputEffect *dinput_effect; diff --git a/dlls/windows.gaming.input/private.h b/dlls/windows.gaming.input/private.h index f53d5b5bc37..e345ca425aa 100644 --- a/dlls/windows.gaming.input/private.h +++ b/dlls/windows.gaming.input/private.h @@ -43,6 +43,7 @@ #include "wine/list.h"
#include "provider.h" +#include "async_private.h"
extern HINSTANCE windows_gaming_input; extern ICustomGameControllerFactory *controller_factory; @@ -76,7 +77,6 @@ extern void event_handlers_notify( struct list *list, IInspectable *element ); extern HRESULT force_feedback_motor_create( IDirectInputDevice8W *device, IForceFeedbackMotor **out ); extern HRESULT force_feedback_effect_create( enum WineForceFeedbackEffectType type, IInspectable *outer, IWineForceFeedbackEffectImpl **out );
-typedef HRESULT (WINAPI *async_operation_callback)( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ); extern HRESULT async_operation_boolean_create( IUnknown *invoker, IUnknown *param, async_operation_callback callback, IAsyncOperation_boolean **out ); extern HRESULT async_operation_effect_result_create( IUnknown *invoker, IUnknown *param, async_operation_callback callback, diff --git a/dlls/windows.gaming.input/provider.idl b/dlls/windows.gaming.input/provider.idl index e7b6e96b8aa..039948bc0b6 100644 --- a/dlls/windows.gaming.input/provider.idl +++ b/dlls/windows.gaming.input/provider.idl @@ -24,7 +24,6 @@
import "propidl.idl"; import "inspectable.idl"; -import "asyncinfo.idl"; import "eventtoken.idl"; import "windowscontracts.idl"; import "windows.foundation.idl"; @@ -46,9 +45,6 @@ namespace Windows.Gaming.Input.Custom { interface IWineGameControllerProvider; runtimeclass WineGameControllerProvider;
- /* type-pruning version of AsyncOperationCompletedHandler<T> */ - delegate HRESULT WineAsyncOperationCompletedHandler([in] IInspectable *async, [in] AsyncStatus status); - enum WineGameControllerType { Joystick = 0, @@ -195,17 +191,6 @@ namespace Windows.Gaming.Input.Custom { [in, optional] WineForceFeedbackEffectEnvelope *envelope); }
- [ - uuid(83f377ee-c799-11ec-9d64-0242ac120002) - ] - interface IWineAsyncInfoImpl : IUnknown - { - [propput] HRESULT Completed([in] WineAsyncOperationCompletedHandler *handler); - [propget] HRESULT Completed([out, retval] WineAsyncOperationCompletedHandler **handler); - [propget] HRESULT Result([out, retval] PROPVARIANT *result); - HRESULT Start(); - } - [ marshaling_behavior(agile), threading(both)