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

d3drm: Implement IDirect3DRMMeshBuilderX_GetClassName.

parent 546a3dcf
......@@ -454,13 +454,13 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetName(IDirect3DRMMeshBuilder
}
static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetClassName(IDirect3DRMMeshBuilder2* iface,
LPDWORD lpdwSize, LPSTR lpName)
LPDWORD size, LPSTR name)
{
IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
TRACE("(%p)->(%p, %p)\n", This, size, name);
return E_NOTIMPL;
return IDirect3DRMMeshBuilder3_GetClassName(&This->IDirect3DRMMeshBuilder3_iface, size, name);
}
/*** IDirect3DRMMeshBuilder2 methods ***/
......@@ -1080,13 +1080,19 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetName(IDirect3DRMMeshBuilder
}
static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetClassName(IDirect3DRMMeshBuilder3* iface,
LPDWORD lpdwSize, LPSTR lpName)
LPDWORD size, LPSTR name)
{
IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(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("Builder") || !name)
return E_INVALIDARG;
strcpy(name, "Builder");
*size = sizeof("Builder");
return D3DRM_OK;
}
HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData)
......
......@@ -198,13 +198,18 @@ static void test_MeshBuilder(void)
hr = IDirect3DRM_CreateMeshBuilder(pD3DRM, &pMeshBuilder);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRMMeshBuilder interface (hr = %x)\n", hr);
hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, NULL, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, NULL, NULL);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
size = 1;
hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, &size, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
size = sizeof(cname);
hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, &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("Builder"), "wrong strlen: %u\n", size);
ok(!strcmp(cname, "Builder"), "Expected cname to be \"Builder\", but got \"%s\"\n", cname);
}
info.lpMemory = data_bad_version;
info.dSize = strlen(data_bad_version);
......@@ -463,13 +468,18 @@ static void test_MeshBuilder3(void)
hr = IDirect3DRM3_CreateMeshBuilder(pD3DRM3, &pMeshBuilder3);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRMMeshBuilder3 interface (hr = %x)\n", hr);
hr = IDirect3DRMMeshBuilder3_GetClassName(pMeshBuilder3, NULL, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
hr = IDirect3DRMMeshBuilder3_GetClassName(pMeshBuilder3, NULL, NULL);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
size = 1;
hr = IDirect3DRMMeshBuilder3_GetClassName(pMeshBuilder3, &size, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
size = sizeof(cname);
hr = IDirect3DRMMeshBuilder3_GetClassName(pMeshBuilder3, &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("Builder"), "wrong strlen: %u\n", size);
ok(!strcmp(cname, "Builder"), "Expected cname to be \"Builder\", but got \"%s\"\n", cname);
}
info.lpMemory = data_bad_version;
info.dSize = strlen(data_bad_version);
......
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