From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53176 --- dlls/cryptowinrt/credentials.c | 11 +++- dlls/cryptowinrt/tests/crypto.c | 91 ++++++++++++++++----------------- 2 files changed, 53 insertions(+), 49 deletions(-)
diff --git a/dlls/cryptowinrt/credentials.c b/dlls/cryptowinrt/credentials.c index ba375e77e0c..e23c5d94696 100644 --- a/dlls/cryptowinrt/credentials.c +++ b/dlls/cryptowinrt/credentials.c @@ -118,10 +118,17 @@ static const struct IActivationFactoryVtbl factory_vtbl =
DEFINE_IINSPECTABLE( credentials_statics, IKeyCredentialManagerStatics, struct credentials_statics, IActivationFactory_iface );
+static HRESULT WINAPI is_supported_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result ) +{ + result->vt = VT_BOOL; + result->boolVal = FALSE; + return S_OK; +} + static HRESULT WINAPI credentials_statics_IsSupportedAsync( IKeyCredentialManagerStatics *iface, IAsyncOperation_boolean **value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + TRACE( "iface %p, value %p.\n", iface, value ); + return async_operation_boolean_create( (IUnknown *)iface, NULL, is_supported_async, value ); }
static HRESULT WINAPI credentials_statics_RenewAttestationAsync( IKeyCredentialManagerStatics *iface, IAsyncAction **operation ) diff --git a/dlls/cryptowinrt/tests/crypto.c b/dlls/cryptowinrt/tests/crypto.c index b8c7aba2bc9..e78030fea1d 100644 --- a/dlls/cryptowinrt/tests/crypto.c +++ b/dlls/cryptowinrt/tests/crypto.c @@ -273,53 +273,50 @@ static void test_Credentials_Statics(void)
if (!load_combase_functions()) return;
- todo_wine - { - hr = IKeyCredentialManagerStatics_IsSupportedAsync( credentials_statics, &bool_async ); - ok( hr == S_OK, "IsSupportedAsync returned %#lx\n", hr ); - bool_async_handler.event = CreateEventW( NULL, FALSE, FALSE, NULL ); - ok( !!bool_async_handler.event, "CreateEventW failed, error %lu\n", GetLastError() ); - WaitForSingleObject( bool_async_handler.event, 500 ); - check_bool_async( bool_async, 0, Completed, S_OK, FALSE ); - - check_interface( bool_async, &IID_IUnknown ); - check_interface( bool_async, &IID_IInspectable ); - check_interface( bool_async, &IID_IAgileObject ); - check_interface( bool_async, &IID_IAsyncInfo ); - check_interface( bool_async, &IID_IAsyncOperation_boolean ); - check_runtimeclass( bool_async, L"Windows.Foundation.IAsyncOperation`1<Boolean>" ); - - hr = IAsyncOperation_boolean_get_Completed( bool_async, &tmp_handler ); - ok( hr == S_OK, "get_Completed returned %#lx\n", hr ); - ok( tmp_handler == NULL, "got handler %p\n", tmp_handler ); - bool_async_handler = default_bool_async_handler; - hr = IAsyncOperation_boolean_put_Completed( bool_async, &bool_async_handler.IAsyncOperationCompletedHandler_boolean_iface ); - ok( hr == S_OK, "put_Completed returned %#lx\n", hr ); - ok( bool_async_handler.invoked, "handler not invoked\n" ); - ok( bool_async_handler.async == bool_async, "got async %p\n", bool_async_handler.async ); - ok( bool_async_handler.status == Completed || broken( bool_async_handler.status == Error ), "got status %u\n", bool_async_handler.status ); - hr = IAsyncOperation_boolean_get_Completed( bool_async, &tmp_handler ); - ok( hr == S_OK, "get_Completed returned %#lx\n", hr ); - ok( tmp_handler == NULL, "got handler %p\n", tmp_handler ); - bool_async_handler = default_bool_async_handler; - hr = IAsyncOperation_boolean_put_Completed( bool_async, &bool_async_handler.IAsyncOperationCompletedHandler_boolean_iface ); - ok( hr == E_ILLEGAL_DELEGATE_ASSIGNMENT, "put_Completed returned %#lx\n", hr ); - ok( !bool_async_handler.invoked, "handler invoked\n" ); - ok( bool_async_handler.async == NULL, "got async %p\n", bool_async_handler.async ); - ok( bool_async_handler.status == Started, "got status %u\n", bool_async_handler.status ); - - hr = IAsyncOperation_boolean_QueryInterface( bool_async, &IID_IAsyncInfo, (void **)&async_info ); - ok( hr == S_OK, "QueryInterface returned %#lx\n", hr ); - hr = IAsyncInfo_Cancel( async_info ); - ok( hr == S_OK, "Cancel returned %#lx\n", hr ); - check_bool_async( bool_async, 0, Completed, S_OK, FALSE ); - hr = IAsyncInfo_Close( async_info ); - ok( hr == S_OK, "Close returned %#lx\n", hr ); - check_bool_async( bool_async, 0, 4, S_OK, FALSE ); - IAsyncInfo_Release( async_info ); - - IAsyncOperation_boolean_Release( bool_async ); - } + hr = IKeyCredentialManagerStatics_IsSupportedAsync( credentials_statics, &bool_async ); + ok( hr == S_OK, "IsSupportedAsync returned %#lx\n", hr ); + bool_async_handler.event = CreateEventW( NULL, FALSE, FALSE, NULL ); + ok( !!bool_async_handler.event, "CreateEventW failed, error %lu\n", GetLastError() ); + WaitForSingleObject( bool_async_handler.event, 500 ); + check_bool_async( bool_async, 0, Completed, S_OK, FALSE ); + + check_interface( bool_async, &IID_IUnknown ); + check_interface( bool_async, &IID_IInspectable ); + check_interface( bool_async, &IID_IAgileObject ); + check_interface( bool_async, &IID_IAsyncInfo ); + check_interface( bool_async, &IID_IAsyncOperation_boolean ); + check_runtimeclass( bool_async, L"Windows.Foundation.IAsyncOperation`1<Boolean>" ); + + hr = IAsyncOperation_boolean_get_Completed( bool_async, &tmp_handler ); + ok( hr == S_OK, "get_Completed returned %#lx\n", hr ); + ok( tmp_handler == NULL, "got handler %p\n", tmp_handler ); + bool_async_handler = default_bool_async_handler; + hr = IAsyncOperation_boolean_put_Completed( bool_async, &bool_async_handler.IAsyncOperationCompletedHandler_boolean_iface ); + ok( hr == S_OK, "put_Completed returned %#lx\n", hr ); + ok( bool_async_handler.invoked, "handler not invoked\n" ); + ok( bool_async_handler.async == bool_async, "got async %p\n", bool_async_handler.async ); + ok( bool_async_handler.status == Completed || broken( bool_async_handler.status == Error ), "got status %u\n", bool_async_handler.status ); + hr = IAsyncOperation_boolean_get_Completed( bool_async, &tmp_handler ); + ok( hr == S_OK, "get_Completed returned %#lx\n", hr ); + ok( tmp_handler == NULL, "got handler %p\n", tmp_handler ); + bool_async_handler = default_bool_async_handler; + hr = IAsyncOperation_boolean_put_Completed( bool_async, &bool_async_handler.IAsyncOperationCompletedHandler_boolean_iface ); + ok( hr == E_ILLEGAL_DELEGATE_ASSIGNMENT, "put_Completed returned %#lx\n", hr ); + ok( !bool_async_handler.invoked, "handler invoked\n" ); + ok( bool_async_handler.async == NULL, "got async %p\n", bool_async_handler.async ); + ok( bool_async_handler.status == Started, "got status %u\n", bool_async_handler.status ); + + hr = IAsyncOperation_boolean_QueryInterface( bool_async, &IID_IAsyncInfo, (void **)&async_info ); + ok( hr == S_OK, "QueryInterface returned %#lx\n", hr ); + hr = IAsyncInfo_Cancel( async_info ); + ok( hr == S_OK, "Cancel returned %#lx\n", hr ); + check_bool_async( bool_async, 0, Completed, S_OK, FALSE ); + hr = IAsyncInfo_Close( async_info ); + ok( hr == S_OK, "Close returned %#lx\n", hr ); + check_bool_async( bool_async, 0, 4, S_OK, FALSE ); + IAsyncInfo_Release( async_info ); + + IAsyncOperation_boolean_Release( bool_async );
ref = IKeyCredentialManagerStatics_Release( credentials_statics ); ok( ref == 2, "got ref %ld.\n", ref );