Rémi Bernon (@rbernon) commented about dlls/windows.gaming.ui.gamebar/tests/gamebar.c:
hr = IActivationFactory_QueryInterface(factory, &IID_IAgileObject, (void **)&agile_object); ok(hr == S_OK, "got hr %#lx.\n", hr);
- hr = IActivationFactory_QueryInterface(factory, &IID_IGameBarStatics, (void **)&gamebar_statics);
- ok(hr == S_OK, "got hr %#lx.\n", hr);
- hr = IGameBarStatics_QueryInterface(gamebar_statics, &IID_IInspectable, (void **)&tmp_inspectable);
- ok(hr == S_OK, "got hr %#lx.\n", hr);
- ok(tmp_inspectable == inspectable, "got %p, expected %p.\n", tmp_inspectable, inspectable);
- IInspectable_Release(tmp_inspectable);
- hr = IGameBarStatics_QueryInterface(gamebar_statics, &IID_IAgileObject, (void **)&tmp_agile_object);
- ok(hr == S_OK, "got hr %#lx.\n", hr);
- ok(tmp_agile_object == agile_object, "got %p, expected %p.\n", tmp_agile_object, agile_object);
- IAgileObject_Release(tmp_agile_object);
I'd be okay with assuming a few things about WinRT objects, statics and factories, and just use some check_interface to validate the iface presence. I don't mind if you want to keep the detailed checks.