Rémi Bernon (@rbernon) commented about dlls/cryptowinrt/tests/crypto.c:
hr = IActivationFactory_QueryInterface( factory, &IID_IKeyCredentialManagerStatics, (void **)&credentials_statics ); ok( hr == S_OK, "got hr %#lx.\n", hr );
- 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, 1000 );
Waiting on the event here will never do anything useful. It's just been created, it's not set, and you haven't passed the `bool_async_handler` to anything that could set it asynchronously.
You need to pass `bool_async_handler` first to the async operation through `IAsyncOperation_boolean_put_Completed`, then wait on the event to make sure the operation has completed (and check `WaitForSingleObject` return to be sure).