Commit afb09525 authored by Jeff Smith's avatar Jeff Smith Committed by Alexandre Julliard

d3drm: Return D3DRMERR_BADOBJECT from d3drm_viewport2_SetProjection() for uninitialised viewports.

parent f4bdc438
...@@ -2165,7 +2165,7 @@ static void test_Viewport(void) ...@@ -2165,7 +2165,7 @@ static void test_Viewport(void)
hr = IDirect3DRMViewport_SetBack(viewport, 100.0f); hr = IDirect3DRMViewport_SetBack(viewport, 100.0f);
ok(hr == D3DRMERR_BADOBJECT, "Got unexpected hr %#x.\n", hr); ok(hr == D3DRMERR_BADOBJECT, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DRMViewport_SetProjection(viewport, D3DRMPROJECT_PERSPECTIVE); hr = IDirect3DRMViewport_SetProjection(viewport, D3DRMPROJECT_PERSPECTIVE);
todo_wine ok(hr == D3DRMERR_BADOBJECT, "Got unexpected hr %#x.\n", hr); ok(hr == D3DRMERR_BADOBJECT, "Got unexpected hr %#x.\n", hr);
/* Test all failures together */ /* Test all failures together */
hr = IDirect3DRMViewport_Init(viewport, NULL, frame, rc.left, rc.top, rc.right, rc.bottom); hr = IDirect3DRMViewport_Init(viewport, NULL, frame, rc.left, rc.top, rc.right, rc.bottom);
...@@ -2358,7 +2358,7 @@ static void test_Viewport(void) ...@@ -2358,7 +2358,7 @@ static void test_Viewport(void)
hr = IDirect3DRMViewport2_SetBack(viewport2, 100.0f); hr = IDirect3DRMViewport2_SetBack(viewport2, 100.0f);
ok(hr == D3DRMERR_BADOBJECT, "Got unexpected hr %#x.\n", hr); ok(hr == D3DRMERR_BADOBJECT, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DRMViewport2_SetProjection(viewport2, D3DRMPROJECT_PERSPECTIVE); hr = IDirect3DRMViewport2_SetProjection(viewport2, D3DRMPROJECT_PERSPECTIVE);
todo_wine ok(hr == D3DRMERR_BADOBJECT, "Got unexpected hr %#x.\n", hr); ok(hr == D3DRMERR_BADOBJECT, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DRMViewport2_Init(viewport2, NULL, frame3, rc.left, rc.top, rc.right, rc.bottom); hr = IDirect3DRMViewport2_Init(viewport2, NULL, frame3, rc.left, rc.top, rc.right, rc.bottom);
ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
......
...@@ -613,6 +613,9 @@ static HRESULT WINAPI d3drm_viewport2_SetProjection(IDirect3DRMViewport2 *iface, ...@@ -613,6 +613,9 @@ static HRESULT WINAPI d3drm_viewport2_SetProjection(IDirect3DRMViewport2 *iface,
TRACE("iface %p, type %#x.\n", iface, type); TRACE("iface %p, type %#x.\n", iface, type);
if (!viewport->d3d_viewport)
return D3DRMERR_BADOBJECT;
viewport->projection = type; viewport->projection = type;
return D3DRM_OK; return D3DRM_OK;
......
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