On Tuesday 15 November 2011 20:53:43 Henri Verbeet wrote:
It's probably ok to ignore the more obscure cases of getting an earlier interface through QI on a newer interface, but I think we should at least test version differences for interfaces originally created with a particular version.
Keep in mind that IDirectDrawSurface is created by IDirectDraw and IDirectDraw2. IDirectDrawSurface2 and IDirectDrawSurface3 are only available via QueryInterface. One would expect that apps create them via IDirectDraw2, but nothing in the API suggests that, other than that IDirectDraw2 was available by the time IDirectDrawSurface2 was introduced.
Even with just one test copy per IDirectDraw*X interface it'll probably triple the size of overlay.c, ddrawmodes.c and dsurface.c by creating essentially copypasted versions of all tests(excluding those that exist in higher interfaces only).
The IDirect3D and IDirect3DDevice tests can only be handled by cloning the tests because the API differences between the IDirect3DDevice versions are too big. You can't even QI the IDirect3DDevice interfaces from each other(needs fixing in Wine).
My idea to systematically test all IDirectDraw and IDirectDrawSurface versions was writing wrapper functions around their methods that take an IUnknown * pointer and find out which interface version it is via QueryInterface or with an extra parameter and call the correct method. But I have doubt that this will work because of structure size differences and because most surface tests have to create the surfaces themselves.