[1/3] d3drm: Implement IDirect3DRMFrameX_GetClassName

André Hentschel nerv at dawncrow.de
Thu Jun 14 13:29:21 CDT 2012


---
 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 26ebaf3..0100221 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 7ed4394..9444756 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);
-- 
1.7.4.1


-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list