=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: d3drm: Implement IDirect3DRMLight_GetClassName.

Alexandre Julliard julliard at winehq.org
Fri Jun 15 13:34:39 CDT 2012


Module: wine
Branch: master
Commit: 546a3dcffcdf40134c72478f3fb6b081471ffab9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=546a3dcffcdf40134c72478f3fb6b081471ffab9

Author: André Hentschel <nerv at dawncrow.de>
Date:   Thu Jun 14 20:30:07 2012 +0200

d3drm: Implement IDirect3DRMLight_GetClassName.

---

 dlls/d3drm/light.c       |   10 ++++++++--
 dlls/d3drm/tests/d3drm.c |   11 ++++++++---
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/dlls/d3drm/light.c b/dlls/d3drm/light.c
index 67baaa7..558d836 100644
--- a/dlls/d3drm/light.c
+++ b/dlls/d3drm/light.c
@@ -172,9 +172,15 @@ static HRESULT WINAPI IDirect3DRMLightImpl_GetClassName(IDirect3DRMLight* iface,
 {
     IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(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("Light") || !name)
+        return E_INVALIDARG;
+
+    strcpy(name, "Light");
+    *size = sizeof("Light");
+
+    return D3DRM_OK;
 }
 
 /*** IDirect3DRMLight methods ***/
diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c
index 9444756..bbe2da3 100644
--- a/dlls/d3drm/tests/d3drm.c
+++ b/dlls/d3drm/tests/d3drm.c
@@ -879,13 +879,18 @@ static void test_Light(void)
     hr = IDirect3DRM_CreateLightRGB(pD3DRM, D3DRMLIGHT_SPOT, 0.5, 0.5, 0.5, &pLight);
     ok(hr == D3DRM_OK, "Cannot get IDirect3DRMLight interface (hr = %x)\n", hr);
 
+    hr = IDirect3DRMLight_GetClassName(pLight, NULL, cname);
+    ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
+    hr = IDirect3DRMLight_GetClassName(pLight, NULL, NULL);
+    ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
+    size = 1;
+    hr = IDirect3DRMLight_GetClassName(pLight, &size, cname);
+    ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
     size = sizeof(cname);
     hr = IDirect3DRMLight_GetClassName(pLight, &size, cname);
-    todo_wine {
     ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr);
-    ok(size != sizeof(cname), "size didn't change: %u\n", size);
+    ok(size == sizeof("Light"), "wrong strlen: %u\n", size);
     ok(!strcmp(cname, "Light"), "Expected cname to be \"Light\", but got \"%s\"\n", cname);
-    }
 
     type = IDirect3DRMLight_GetType(pLight);
     ok(type == D3DRMLIGHT_SPOT, "wrong type (%u)\n", type);




More information about the wine-cvs mailing list