d3drm: Support IDirect3DRMObject in viewport QI.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-03-03 11:10:20 +03:00 committed by Alexandre Julliard
parent 9af841ea39
commit b54afbc3a1
2 changed files with 18 additions and 0 deletions

View File

@ -1221,6 +1221,7 @@ static void test_Viewport(void)
IDirect3DRMFrame *frame;
IDirect3DRMViewport *viewport;
IDirect3DRMViewport2 *viewport2;
IDirect3DRMObject *obj, *obj2;
GUID driver;
HWND window;
RECT rc;
@ -1249,6 +1250,22 @@ static void test_Viewport(void)
hr = IDirect3DRM_CreateViewport(d3drm, device, frame, rc.left, rc.top, rc.right, rc.bottom, &viewport);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRMViewport interface (hr = %x)\n", hr);
hr = IDirect3DRMViewport_QueryInterface(viewport, &IID_IDirect3DRMObject, (void**)&obj);
ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr);
ok((IDirect3DRMObject*)viewport == obj, "got object pointer %p, expected %p\n", obj, viewport);
hr = IDirect3DRMViewport_QueryInterface(viewport, &IID_IDirect3DRMViewport2, (void**)&viewport2);
ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr);
hr = IDirect3DRMViewport2_QueryInterface(viewport2, &IID_IDirect3DRMObject, (void**)&obj2);
ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr);
ok(obj == obj2, "got object pointer %p, expected %p\n", obj2, obj);
ok((IUnknown*)viewport != (IUnknown*)viewport2, "got viewport1 %p, viewport2 %p\n", viewport, viewport2);
IDirect3DRMViewport2_Release(viewport2);
IDirect3DRMObject_Release(obj);
IDirect3DRMObject_Release(obj2);
hr = IDirect3DRMViewport_GetClassName(viewport, NULL, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
hr = IDirect3DRMViewport_GetClassName(viewport, NULL, NULL);

View File

@ -57,6 +57,7 @@ static HRESULT WINAPI d3drm_viewport1_QueryInterface(IDirect3DRMViewport *iface,
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
if (IsEqualGUID(riid, &IID_IDirect3DRMViewport)
|| IsEqualGUID(riid, &IID_IDirect3DRMObject)
|| IsEqualGUID(riid, &IID_IUnknown))
{
*out = &viewport->IDirect3DRMViewport_iface;