Commit 00773fea authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

d3drm: Implement IDirect3DRMMesh_GetClassName.

parent ac5b9323
......@@ -2584,13 +2584,19 @@ static HRESULT WINAPI IDirect3DRMMeshImpl_GetName(IDirect3DRMMesh* iface,
}
static HRESULT WINAPI IDirect3DRMMeshImpl_GetClassName(IDirect3DRMMesh* iface,
LPDWORD lpdwSize, LPSTR lpName)
LPDWORD size, LPSTR name)
{
IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
TRACE("(%p)->(%p, %p)\n", This, size, name);
return E_NOTIMPL;
if (!size || *size < strlen("Mesh") || !name)
return E_INVALIDARG;
strcpy(name, "Mesh");
*size = sizeof("Mesh");
return D3DRM_OK;
}
/*** IDirect3DRMMesh methods ***/
......
......@@ -553,6 +553,38 @@ static void test_MeshBuilder3(void)
IDirect3DRM_Release(pD3DRM);
}
static void test_Mesh(void)
{
HRESULT hr;
LPDIRECT3DRM pD3DRM;
LPDIRECT3DRMMESH pMesh;
DWORD size;
CHAR cname[64] = {0};
hr = pDirect3DRMCreate(&pD3DRM);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr);
hr = IDirect3DRM_CreateMesh(pD3DRM, &pMesh);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRMMesh interface (hr = %x)\n", hr);
hr = IDirect3DRMMesh_GetClassName(pMesh, NULL, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
hr = IDirect3DRMMesh_GetClassName(pMesh, NULL, NULL);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
size = 1;
hr = IDirect3DRMMesh_GetClassName(pMesh, &size, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
size = sizeof(cname);
hr = IDirect3DRMMesh_GetClassName(pMesh, &size, cname);
ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr);
ok(size == sizeof("Mesh"), "wrong size: %u\n", size);
ok(!strcmp(cname, "Mesh"), "Expected cname to be \"Mesh\", but got \"%s\"\n", cname);
IDirect3DRMMesh_Release(pMesh);
IDirect3DRM_Release(pD3DRM);
}
static void test_Frame(void)
{
HRESULT hr;
......@@ -991,6 +1023,7 @@ START_TEST(d3drm)
test_MeshBuilder();
test_MeshBuilder3();
test_Mesh();
test_Frame();
test_Light();
test_frame_transform();
......
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