On Thu Sep 7 13:49:19 2023 +0000, Rémi Bernon wrote:
> I missed this before, but I think the check_interface check is a bit
> pointless as it will always succeed on Windows.
> Something like that would be better (using `check_interface_broken` only
> where it is needed):
> ```suggestion:-14+0
> #define check_interface_broken( obj, iid, supported ) check_interface_(
> __LINE__, obj, iid, supported, TRUE )
> #define check_interface( obj, iid, supported ) check_interface_(
> __LINE__, obj, iid, supported, FALSE )
> static void check_interface_( unsigned int line, void *obj, const IID
> *iid, BOOL supported, BOOL is_broken )
> {
> HRESULT hr, expected_hr, broken_hr;
> IUnknown *iface = obj;
> IUnknown *unk;
> expected_hr = supported ? S_OK : E_NOINTERFACE;
> broken_hr = supported ? E_NOINTERFACE : S_OK;
> hr = IUnknown_QueryInterface( iface, iid, (void **)&unk );
> ok_(__FILE__, line)( hr == expected_hr || broken( is_broken && hr ==
> broken_hr ), "got hr %#lx.\n", hr );
> if (SUCCEEDED(hr)) IUnknown_Release( unk );
> }
> ```
> Or, maybe even better, use the basic `check_interface`, without the
> broken result and remove the broken check for IAgileObject interface
> which probably doesn't really matter on the factory.
I've removed it, seems like it's not really necessary to test for it. Though, I don't understand why Office queries for `IAgileObject`. It's a Microsoft program so they should know it's not supported. Minecraft also queries for an interface that returns `E_NOINTERFACE`, it seems bizarre.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3672#note_44663