Commit 99e0442a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3drm: Fix IDirect3DRMMeshBuilder::QueryInterface to support IDirect3DRMObject…

d3drm: Fix IDirect3DRMMeshBuilder::QueryInterface to support IDirect3DRMObject and IDirect3DRMVisual. Signed-off-by: 's avatarNikolay Sivov <nsivov@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent c75c8e7f
...@@ -361,6 +361,8 @@ static HRESULT WINAPI d3drm_mesh_builder2_QueryInterface(IDirect3DRMMeshBuilder2 ...@@ -361,6 +361,8 @@ static HRESULT WINAPI d3drm_mesh_builder2_QueryInterface(IDirect3DRMMeshBuilder2
if (IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder2) if (IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder2)
|| IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder) || IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder)
|| IsEqualGUID(riid, &IID_IDirect3DRMVisual)
|| IsEqualGUID(riid, &IID_IDirect3DRMObject)
|| IsEqualGUID(riid, &IID_IUnknown)) || IsEqualGUID(riid, &IID_IUnknown))
{ {
*out = &mesh_builder->IDirect3DRMMeshBuilder2_iface; *out = &mesh_builder->IDirect3DRMMeshBuilder2_iface;
......
...@@ -203,6 +203,7 @@ static void test_MeshBuilder(void) ...@@ -203,6 +203,7 @@ static void test_MeshBuilder(void)
HRESULT hr; HRESULT hr;
IDirect3DRM *d3drm; IDirect3DRM *d3drm;
IDirect3DRMMeshBuilder *pMeshBuilder; IDirect3DRMMeshBuilder *pMeshBuilder;
IDirect3DRMMeshBuilder3 *meshbuilder3;
IDirect3DRMMesh *mesh; IDirect3DRMMesh *mesh;
D3DRMLOADMEMORY info; D3DRMLOADMEMORY info;
int val; int val;
...@@ -215,6 +216,7 @@ static void test_MeshBuilder(void) ...@@ -215,6 +216,7 @@ static void test_MeshBuilder(void)
DWORD size; DWORD size;
D3DCOLOR color; D3DCOLOR color;
CHAR cname[64] = {0}; CHAR cname[64] = {0};
IUnknown *unk;
hr = Direct3DRMCreate(&d3drm); hr = Direct3DRMCreate(&d3drm);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr);
...@@ -222,6 +224,31 @@ static void test_MeshBuilder(void) ...@@ -222,6 +224,31 @@ static void test_MeshBuilder(void)
hr = IDirect3DRM_CreateMeshBuilder(d3drm, &pMeshBuilder); hr = IDirect3DRM_CreateMeshBuilder(d3drm, &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_QueryInterface(pMeshBuilder, &IID_IDirect3DRMObject, (void **)&unk);
ok(SUCCEEDED(hr), "Failed to get IDirect3DRMObject, %#x.\n", hr);
ok(unk == (IUnknown *)pMeshBuilder, "Unexpected interface pointer.\n");
IUnknown_Release(unk);
hr = IDirect3DRMMeshBuilder_QueryInterface(pMeshBuilder, &IID_IDirect3DRMVisual, (void **)&unk);
ok(SUCCEEDED(hr), "Failed to get IDirect3DRMVisual, %#x.\n", hr);
ok(unk == (IUnknown *)pMeshBuilder, "Unexpected interface pointer.\n");
IUnknown_Release(unk);
hr = IDirect3DRMMeshBuilder_QueryInterface(pMeshBuilder, &IID_IDirect3DRMMeshBuilder3, (void **)&meshbuilder3);
ok(SUCCEEDED(hr), "Failed to get IDirect3DRMMeshBuilder3, %#x.\n", hr);
hr = IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder3, &IID_IDirect3DRMObject, (void **)&unk);
ok(SUCCEEDED(hr), "Failed to get IDirect3DRMObject, %#x.\n", hr);
ok(unk == (IUnknown *)pMeshBuilder, "Unexpected interface pointer.\n");
IUnknown_Release(unk);
hr = IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder3, &IID_IDirect3DRMVisual, (void **)&unk);
ok(SUCCEEDED(hr), "Failed to get IDirect3DRMVisual, %#x.\n", hr);
ok(unk == (IUnknown *)pMeshBuilder, "Unexpected interface pointer.\n");
IUnknown_Release(unk);
IDirect3DRMMeshBuilder3_Release(meshbuilder3);
hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, NULL, cname); hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, NULL, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr); ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, NULL, NULL); hr = IDirect3DRMMeshBuilder_GetClassName(pMeshBuilder, NULL, NULL);
......
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