[PATCH 09/10] d3dx9: Implement D3DXCreateBox for the case of incorrect parameters. (try 2)

Misha Koshelev misha680 at gmail.com
Sat Jul 17 14:14:22 CDT 2010


---
 dlls/d3dx9_36/mesh.c       |    9 ++++++++-
 dlls/d3dx9_36/tests/mesh.c |   10 +++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
index bfa1c23..8d1b380 100644
--- a/dlls/d3dx9_36/mesh.c
+++ b/dlls/d3dx9_36/mesh.c
@@ -331,7 +331,14 @@ BOOL WINAPI D3DXSphereBoundProbe(CONST D3DXVECTOR3 *pcenter, FLOAT radius, CONST
 HRESULT WINAPI D3DXCreateBox(LPDIRECT3DDEVICE9 device, FLOAT width, FLOAT height,
                              FLOAT depth, LPD3DXMESH* mesh, LPD3DXBUFFER* adjacency)
 {
-    FIXME("(%p, %f, %f, %f, %p, %p): stub\n", device, width, height, depth, mesh, adjacency);
+    TRACE("(%p, %f, %f, %f, %p, %p)\n", device, width, height, depth, mesh, adjacency);
+
+    if ( device == NULL || mesh == NULL )
+    {
+        return D3DERR_INVALIDCALL;
+    }
+
+    FIXME("Case of correct parameters not implemented.\n");
 
     return E_NOTIMPL;
 }
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index 80468f9..d21303d 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -514,16 +514,16 @@ static void D3DXCreateBoxTest(void)
     };
 
     hr = D3DXCreateBox(NULL, 0.0f, 0.0f, 0.0f, NULL, NULL);
-    todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
+    ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
 
     hr = D3DXCreateBox(NULL, 1.0f, 0.0f, 0.0f, NULL, NULL);
-    todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
+    ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
 
     hr = D3DXCreateBox(NULL, 0.0f, 1.0f, 0.0f, NULL, NULL);
-    todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
+    ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
 
     hr = D3DXCreateBox(NULL, 0.0f, 0.0f, 1.0f, NULL, NULL);
-    todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
+    ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
 
     wnd = CreateWindow("static", "d3dx9_test", 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
     d3d = Direct3DCreate9(D3D_SDK_VERSION);
@@ -552,7 +552,7 @@ static void D3DXCreateBoxTest(void)
     }
 
     hr = D3DXCreateBox(device, 1.0f, 1.0f, 1.0f, NULL, NULL);
-    todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
+    ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
 
     hr = D3DXCreateBox(device, 0.0f, 0.0f, 0.0f, &box, NULL);
     todo_wine ok( hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n",hr);
-- 
1.7.1







More information about the wine-patches mailing list