d3drm: Add stubs for IDirect3DRMDevice methods.

Aaryaman Vasishta jem456.vasishta at gmail.com
Sun Jul 12 06:38:17 CDT 2015


On Sun, Jul 12, 2015 at 4:49 PM, Stefan Dösinger <stefandoesinger at gmail.com>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> You aren't returning the version 1 interface from QueryInterface.
>
> Am 2015-07-11 um 14:40 schrieb Aaryaman Vasishta:
> >      if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3))
> >          *out = (IUnknown*)&object->IDirect3DRMDevice3_iface;
> > -    else
> > +    else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice2))
> >          *out = (IUnknown*)&object->IDirect3DRMDevice2_iface;
> > +    else
> > +        *out = (IUnknown*)&object->IDirect3DRMDevice_iface;
> You can call QueryInterface instead of doing GUID checks like this. Just
> initialize ref = 0, then call QI and you'll return a ref = 1 device.
>
> Another option, if you like this better, is to always return e.g. a
> IDirect3DRMDevice3 from Direct3DRMDevice_create, remove the riid
> parameter and do the QueryInterface in the caller. In this case init the
> refcount to 1 and call device3_Release in the caller after calling QI to
> obtain the right interface.
>
Actually I should make it return struct d3drm_device **, as you suggested
in the patchset mails at wine-devel, but I think I should implement the
first option and then do the return d3drm_device ** part in a seperate
patch right before sending the implementation patches (as this is called
from multiple functions). What do you think?


Jam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20150712/05b4e9eb/attachment.html>


More information about the wine-devel mailing list