From: Jan Sikorski jsikorski@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- v3: Minor formatting changes.
dlls/d3d8/vertexdeclaration.c | 4 ++++ dlls/d3d9/vertexdeclaration.c | 2 ++ dlls/wined3d/vertexdeclaration.c | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d8/vertexdeclaration.c b/dlls/d3d8/vertexdeclaration.c index 525666d680e9..d0e733b9e376 100644 --- a/dlls/d3d8/vertexdeclaration.c +++ b/dlls/d3d8/vertexdeclaration.c @@ -358,6 +358,8 @@ HRESULT d3d8_vertex_declaration_init(struct d3d8_vertex_declaration *declaration { WARN("Failed to create wined3d vertex declaration, hr %#x.\n", hr); heap_free(declaration->elements); + if (hr == E_INVALIDARG) + hr = E_FAIL; return hr; }
@@ -379,6 +381,8 @@ HRESULT d3d8_vertex_declaration_init_fvf(struct d3d8_vertex_declaration *declara if (FAILED(hr)) { WARN("Failed to create wined3d vertex declaration, hr %#x.\n", hr); + if (hr == E_INVALIDARG) + hr = E_FAIL; return hr; }
diff --git a/dlls/d3d9/vertexdeclaration.c b/dlls/d3d9/vertexdeclaration.c index c30a84313fbf..60701a9a9105 100644 --- a/dlls/d3d9/vertexdeclaration.c +++ b/dlls/d3d9/vertexdeclaration.c @@ -406,6 +406,8 @@ static HRESULT vertexdeclaration_init(struct d3d9_vertex_declaration *declaratio { heap_free(declaration->elements); WARN("Failed to create wined3d vertex declaration, hr %#x.\n", hr); + if (hr == E_INVALIDARG) + hr = E_FAIL; return hr; }
diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c index e96216db380d..b17059f5e644 100644 --- a/dlls/wined3d/vertexdeclaration.c +++ b/dlls/wined3d/vertexdeclaration.c @@ -226,10 +226,10 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara
if (!(e->format->flags[WINED3D_GL_RES_TYPE_BUFFER] & WINED3DFMT_FLAG_VERTEX_ATTRIBUTE)) { - FIXME("The application tries to use an unsupported format (%s), returning E_FAIL.\n", + FIXME("The application tries to use an unsupported format (%s).\n", debug_d3dformat(elements[i].format)); heap_free(declaration->elements); - return E_FAIL; + return E_INVALIDARG; }
if (e->offset == WINED3D_APPEND_ALIGNED_ELEMENT) @@ -254,7 +254,7 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara WARN("Declaration element %u with format %s and offset %u is not %u byte aligned.\n", i, debug_d3dformat(elements[i].format), e->offset, alignment); heap_free(declaration->elements); - return E_FAIL; + return E_INVALIDARG; } }