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 );
check_bool_async( bool_async, 0, Completed, S_OK, FALSE );
This call specifically is going to be racy. You haven't passed the completion handler to the async operation, so you cannot wait on its event yet and the async operation may or may not be completed depending on how unfortunate you are.
This is different from Windows.Gaming.Input tests, because in W.G.I. we control both ends of the test and we can block the asynchronous operation until we want it to complete.
You need to remove that call.