windowscodecs: Add support for IMILBitmapSource interface.

Dmitry Timoshkov dmitry at baikal.ru
Mon May 20 18:37:33 CDT 2013


Charles Davis <cdavis5x at gmail.com> wrote:

> You're violating COM rules here: when you QI an object for an interface
> pointer, the QI must always return the same result no matter what. Here,
> however, you're returning this interface pointer in response to a query
> for IUnknown, when the already-existing QueryInterface method on the
> IWICBitmap interface returns *itself* for IUnknown! Now when you QI for
> IUnknown on both of these interfaces, they won't compare equal. (I suspect
> you're not convinced. After all, native might violate COM rules here, too.
> I doubt that (see below), but it might. So, write a test that QI's for
> IUnknown from both interfaces, and checks if they're equal or not. Then
> we'll see who's right.)

This patch is a result of investigation done in the bug 33384. Even if it's
probably incomplete and violates COM rules sometimes. It's hard to tell
without additional investigation, join the club at the bug 33384 :)

> > +    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID,void **) PURE;
> You know you can just use the STDMETHOD() macro (no trailing underscore), e.g.:
> 
>        STDMETHOD(QueryInterface)(THIS_ REFIID,void **) PURE;
> 
> for methods that return an HRESULT, right? Or do you prefer explicitly 
> declaring the return type like that, even if it is more typing?

I guess that I prefer the methods to be declared same way even it's more
typing.

> > +#define INTERFACE IMILUnknown1
> > +DECLARE_INTERFACE_(IMILUnknown1,IUnknown)
> > +{
> > +    /*** IUnknown methods ***/
> > +    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID,void **) PURE;
> > +    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
> > +    STDMETHOD_(ULONG,Release)(THIS) PURE;
> > +};
> > +#undef INTERFACE
> Wouldn't that just make this interface a plain old IUnknown? Or does it
> have its own IID? (Or does that not even matter, given that it's returned
> from that "UnknownMethod1" above?) If it is nothing more than a plain
> IUnknown, why did you even add this, since it doesn't really extend
> the IUnknown interface with any new methods?

Most likely this interface has other methods besides IUnknown ones, but
it's hard to tell due to limited knowledge. Feel free to send a comment
with your findings to the bug 33384.

-- 
Dmitry.



More information about the wine-devel mailing list