d3drm: Implement IDirect3DRMLight_GetClassName.

This commit is contained in:
André Hentschel 2012-06-14 20:30:07 +02:00 committed by Alexandre Julliard
parent 9014211796
commit 546a3dcffc
2 changed files with 16 additions and 5 deletions

View File

@ -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 ***/

View File

@ -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);