-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi,
Some curiosities:
Am 2016-04-03 um 20:04 schrieb Aaryaman Vasishta:
> + for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i)
> + {
> + hr = IDirect3DRM_CreateObject(d3drm1, tests[i].clsid, NULL, NULL, NULL);
> + todo_wine ok(hr == D3DRMERR_BADVALUE, "Test %u: expected hr == D3DRMERR_BADVALUE, got %#x.\n", i, hr);
What does clsid != NULL, refiid == NULL, output object != NULL do?
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.
> + ref2 = get_refcount((IUnknown *)d3drm1);
> + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2);
> + IUnknown_Release(unknown);
> + ref2 = get_refcount((IUnknown *)d3drm1);
> + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2);
So what will increment the refcount? InitFrom*?
> + hr = IDirect3DRM2_CreateObject(d3drm2, tests[i].clsid, NULL, tests[i].iid, (void **)&unknown);
> + ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got %#x.\n", i, hr);
> + ref2 = get_refcount((IUnknown *)d3drm1);
> + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2);
> + ref3 = get_refcount((IUnknown *)d3drm2);
> + ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3);
> ...
> +
> + hr = IDirect3DRM3_CreateObject(d3drm3, tests[i].clsid, NULL, tests[i].iid, (void **)&unknown);
> + ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got %#x.\n", i, hr);
> + ref2 = get_refcount((IUnknown *)d3drm1);
> + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2);
> + ref3 = get_refcount((IUnknown *)d3drm3);
> + ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3);
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.
Cheers,
Stefan