<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 4, 2016 at 1:26 AM, 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<br>
Hi,<br>
<br>
Some curiosities:<br>
<span class=""><br>
Am 2016-04-03 um 20:04 schrieb Aaryaman Vasishta:<br>
> +    for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i)<br>
> +    {<br>
</span><span class="">> +        hr = IDirect3DRM_CreateObject(d3drm1, tests[i].clsid, NULL, NULL, NULL);<br>
> +        todo_wine ok(hr == D3DRMERR_BADVALUE, "Test %u: expected hr == D3DRMERR_BADVALUE, got %#x.\n", i, hr);<br>
</span>What does clsid != NULL, refiid == NULL, output object != NULL do?<br>
<br>
I guess that clsid is the object you create, and iid is the interface to that object that is returned. So I guess in theory you can pass clsid = IDirect3DRMTexture3, iid = IDirect3DRMTexture and you'd get the same result as creating a d3drmtexture3 object and then calling QI(IDirect3DRMTexture). It might be worth adding explicit tests for this in future patches.<br>
<br></div></blockquote><div>The CLSID's defined in the headers are only for version 1 ones it seems. So there's only one way to get a version 2/3 object i.e. from a version 1 CLSID.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div>
<span class=""><br>
> +            ref2 = get_refcount((IUnknown *)d3drm1);<br>
> +            ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2);<br>
> +            IUnknown_Release(unknown);<br>
> +            ref2 = get_refcount((IUnknown *)d3drm1);<br>
> +            ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2);<br>
</span>So what will increment the refcount? InitFrom*?<br></div></div></div></blockquote><div>Right, InitFrom* increments the refcount. One more thing I've noticed (and you can see that in my LoadTexture patch I sent a while ago) is that the refcount is incremented even if the function fails. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div>
<span class=""><br>
> +            hr = IDirect3DRM2_CreateObject(d3drm2, tests[i].clsid, NULL, tests[i].iid, (void **)&unknown);<br>
> +            ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got %#x.\n", i, hr);<br>
> +            ref2 = get_refcount((IUnknown *)d3drm1);<br>
> +            ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2);<br>
> +            ref3 = get_refcount((IUnknown *)d3drm2);<br>
> +            ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3);<br>
</span>> ...<br>
<span class="">> +<br>
> +            hr = IDirect3DRM3_CreateObject(d3drm3, tests[i].clsid, NULL, tests[i].iid, (void **)&unknown);<br>
> +            ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got %#x.\n", i, hr);<br>
> +            ref2 = get_refcount((IUnknown *)d3drm1);<br>
> +            ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2);<br>
> +            ref3 = get_refcount((IUnknown *)d3drm3);<br>
> +            ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3);<br>
</span>Since you're testing the refcounts of 1,2 and 1,3 you might as well test the refcounts of all interfaces in all 3 versions.<br> 
<br></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div>
Cheers,<br>
Stefan<br></div></div></div></blockquote><div><br></div><div>Right, I'll add the new tests and submit a new patch.<br><br></div><div>Cheers,<br></div><div>Aaryaman <br></div></div><br></div></div>