<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 12:05 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"><span class="">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<br>
</span><span class="">Am 2016-07-10 um 23:14 schrieb Aaryaman Vasishta:<br>
> Anyways, the vtable qi tests tests written so far show that<br>
> querying IDirect3DRMObject from a particular interface will return<br>
> version 1 of that interface. So technically it all comes down to<br>
> calling<br>
> IDirect3DRM<Interface_name>::AddDestroyCallback(&object->version1_vtable,<br>
> ...);. In our implementation of this method (see d3drm_main.c), we<br>
> have passed version 1 of the relevant interface while calling the<br>
> destroy callbacks within d3drm_object_destroy. The tests seem to<br>
> agree with that implementation so far.<br>
</span>Well, but you can call AddDestroyCallback on the version 3 interface too:<br>
<br>
IDirect3DRMDevice *dev1;<br>
IDirect3DRMDevice3 *dev3;<br>
<br>
dev1 = create_device();<br>
dev3 = dev1->qi(IID_IDirect3DRMDevice3);<br>
<br>
dev1->AddDestroyCallback(...);<br>
dev3->AddDestroyCallback(...);<br>
<br>
The current code will always pass dev1 to the callback. It may be<br>
correct, it may be wrong.<br>
<span class=""><br></span></blockquote><div>This is where the obj == ctxt->obj test comes in. obj is the interface passed to the callback, and ctxt->obj is the one we pass into the context, which is our interface QI'd to IDirect3DRMObject.<br></div><div>Now if we consider this test + the vtable QI tests, we can (in)directly prove that the interface passed to the destroy callback is always the version 1 of that interface. The tests would have failed on wine if e.g. I passed version 2 or 3 interface into the destroy callback. I agree that there are no direct tests confirming this though, but hopefully the two tests combined should be enough to confirm this.<br><br></div><div>Cheers,<br></div><div>Aaryaman <br></div></div><br></div></div>