<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 12, 2015 at 4:49 PM, Stefan Dösinger <span dir="ltr"><<a href="mailto:stefandoesinger@gmail.com" target="_blank">stefandoesinger@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Hi,<br>
<br>
You aren't returning the version 1 interface from QueryInterface.<br>
<span><br>
Am 2015-07-11 um 14:40 schrieb Aaryaman Vasishta:<br>
>      if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3))<br>
>          *out = (IUnknown*)&object->IDirect3DRMDevice3_iface;<br>
> -    else<br>
> +    else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice2))<br>
>          *out = (IUnknown*)&object->IDirect3DRMDevice2_iface;<br>
> +    else<br>
> +        *out = (IUnknown*)&object->IDirect3DRMDevice_iface;<br>
</span>You can call QueryInterface instead of doing GUID checks like this. Just<br>
initialize ref = 0, then call QI and you'll return a ref = 1 device.<br>
<br>
Another option, if you like this better, is to always return e.g. a<br>
IDirect3DRMDevice3 from Direct3DRMDevice_create, remove the riid<br>
parameter and do the QueryInterface in the caller. In this case init the<br>
refcount to 1 and call device3_Release in the caller after calling QI to<br>
obtain the right interface. <br></blockquote><div>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?<br><br><br></div><div>Jam <br></div></div></div></div>