From 9014211796b561abcbf90d11a545a76b71136cc4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Hentschel?= Date: Thu, 14 Jun 2012 20:29:21 +0200 Subject: [PATCH] d3drm: Implement IDirect3DRMFrameX_GetClassName. --- dlls/d3drm/frame.c | 14 ++++++++++---- dlls/d3drm/tests/d3drm.c | 11 ++++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/dlls/d3drm/frame.c b/dlls/d3drm/frame.c index 26ebaf3e107..0100221bf15 100644 --- a/dlls/d3drm/frame.c +++ b/dlls/d3drm/frame.c @@ -594,9 +594,9 @@ static HRESULT WINAPI IDirect3DRMFrame2Impl_GetClassName(IDirect3DRMFrame2* ifac { IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface); - FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name); + TRACE("(%p/%p)->(%p, %p)\n", iface, This, size, name); - return E_NOTIMPL; + return IDirect3DRMFrame3_GetClassName(&This->IDirect3DRMFrame3_iface, size, name); } /*** IDirect3DRMFrame methods ***/ @@ -1493,9 +1493,15 @@ static HRESULT WINAPI IDirect3DRMFrame3Impl_GetClassName(IDirect3DRMFrame3* ifac { IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface); - FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name); + TRACE("(%p/%p)->(%p, %p)\n", iface, This, size, name); - return E_NOTIMPL; + if (!size || *size < strlen("Frame") || !name) + return E_INVALIDARG; + + strcpy(name, "Frame"); + *size = sizeof("Frame"); + + return D3DRM_OK; } /*** IDirect3DRMFrame methods ***/ diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 7ed4394f616..94447569f29 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -569,13 +569,18 @@ static void test_Frame(void) ok(hr == D3DRM_OK, "Cannot get IDirect3DRMFrame interface (hr = %x)\n", hr); CHECK_REFCOUNT(pFrameC, 1); + hr = IDirect3DRMFrame_GetClassName(pFrameC, NULL, cname); + ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); + hr = IDirect3DRMFrame_GetClassName(pFrameC, NULL, NULL); + ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); + count = 1; + hr = IDirect3DRMFrame_GetClassName(pFrameC, &count, cname); + ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); count = sizeof(cname); hr = IDirect3DRMFrame_GetClassName(pFrameC, &count, cname); - todo_wine { ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); - ok(count != sizeof(cname), "size didn't change: %u\n", count); + ok(count == sizeof("Frame"), "wrong strlen: %u\n", count); ok(!strcmp(cname, "Frame"), "Expected cname to be \"Frame\", but got \"%s\"\n", cname); - } hr = IDirect3DRMFrame_GetParent(pFrameC, NULL); ok(hr == D3DRMERR_BADVALUE, "Should fail and return D3DRM_BADVALUE (hr = %x)\n", hr); -- 2.11.4.GIT