Commit 546a3dcf authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

d3drm: Implement IDirect3DRMLight_GetClassName.

parent 90142117
......@@ -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 ***/
......
......@@ -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);
......
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