d3drm: Implement IDirect3DRMFrameX_GetClassName.

This commit is contained in:
André Hentschel 2012-06-14 20:29:21 +02:00 committed by Alexandre Julliard
parent ce5ac728ec
commit 9014211796
2 changed files with 18 additions and 7 deletions

View File

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

View File

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