d3drm: Implement IDirect3DRMMeshBuilderX_GetClassName.

This commit is contained in:
André Hentschel 2012-06-14 20:31:22 +02:00 committed by Alexandre Julliard
parent 546a3dcffc
commit afe616b588
2 changed files with 28 additions and 12 deletions

View File

@ -454,13 +454,13 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetName(IDirect3DRMMeshBuilder
} }
static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetClassName(IDirect3DRMMeshBuilder2* iface, static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetClassName(IDirect3DRMMeshBuilder2* iface,
LPDWORD lpdwSize, LPSTR lpName) LPDWORD size, LPSTR name)
{ {
IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface); 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 ***/ /*** IDirect3DRMMeshBuilder2 methods ***/
@ -1080,13 +1080,19 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetName(IDirect3DRMMeshBuilder
} }
static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetClassName(IDirect3DRMMeshBuilder3* iface, static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetClassName(IDirect3DRMMeshBuilder3* iface,
LPDWORD lpdwSize, LPSTR lpName) LPDWORD size, LPSTR name)
{ {
IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface); 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) HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData)

View File

@ -198,13 +198,18 @@ static void test_MeshBuilder(void)
hr = IDirect3DRM_CreateMeshBuilder(pD3DRM, &pMeshBuilder); hr = IDirect3DRM_CreateMeshBuilder(pD3DRM, &pMeshBuilder);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRMMeshBuilder interface (hr = %x)\n", hr); 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); size = sizeof(cname);
hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, &size, cname); hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, &size, cname);
todo_wine {
ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); 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); ok(!strcmp(cname, "Builder"), "Expected cname to be \"Builder\", but got \"%s\"\n", cname);
}
info.lpMemory = data_bad_version; info.lpMemory = data_bad_version;
info.dSize = strlen(data_bad_version); info.dSize = strlen(data_bad_version);
@ -463,13 +468,18 @@ static void test_MeshBuilder3(void)
hr = IDirect3DRM3_CreateMeshBuilder(pD3DRM3, &pMeshBuilder3); hr = IDirect3DRM3_CreateMeshBuilder(pD3DRM3, &pMeshBuilder3);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRMMeshBuilder3 interface (hr = %x)\n", hr); 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); size = sizeof(cname);
hr = IDirect3DRMMeshBuilder3_GetClassName(pMeshBuilder3, &size, cname); hr = IDirect3DRMMeshBuilder3_GetClassName(pMeshBuilder3, &size, cname);
todo_wine {
ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr); 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); ok(!strcmp(cname, "Builder"), "Expected cname to be \"Builder\", but got \"%s\"\n", cname);
}
info.lpMemory = data_bad_version; info.lpMemory = data_bad_version;
info.dSize = strlen(data_bad_version); info.dSize = strlen(data_bad_version);