Commit b54afbc3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3drm: Support IDirect3DRMObject in viewport QI.

parent 9af841ea
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment