Commit 3fdc28c7 authored by Ziqing Hui's avatar Ziqing Hui Committed by Alexandre Julliard

d3dx10: Return E_FAIL in D3DX10CreateEffectFromFile for NULL file name.

parent d4ae51e2
......@@ -107,6 +107,9 @@ HRESULT WINAPI D3DX10CreateEffectFromFileW(const WCHAR *filename, const D3D10_SH
debugstr_w(filename), defines, include, debugstr_a(profile), shader_flags, effect_flags,
device, effect_pool, pump, effect, errors, hresult);
if (!filename)
return E_FAIL;
if (pump)
FIXME("Asynchronous mode is not supported.\n");
......@@ -139,7 +142,7 @@ HRESULT WINAPI D3DX10CreateEffectFromFileA(const char *filename, const D3D10_SHA
device, effect_pool, pump, effect, errors, hresult);
if (!filename)
return E_INVALIDARG;
return E_FAIL;
len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0);
if (!(filenameW = malloc(len * sizeof(*filenameW))))
......
......@@ -4054,7 +4054,7 @@ static void test_create_effect_from_file(void)
effect = (ID3D10Effect *)0xdeadbeef;
hr = D3DX10CreateEffectFromFileW(NULL, NULL, NULL, NULL, 0x0, 0x0,
device, NULL, NULL, &effect, &errors, NULL);
todo_wine ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
ok(errors == (ID3D10Blob *)0xdeadbeef, "Got unexpected errors %p.\n", errors);
ok(effect == (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
......@@ -4062,7 +4062,7 @@ static void test_create_effect_from_file(void)
effect = (ID3D10Effect *)0xdeadbeef;
hr = D3DX10CreateEffectFromFileA(NULL, NULL, NULL, NULL, 0x0, 0x0,
device, NULL, NULL, &effect, &errors, NULL);
todo_wine ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
ok(errors == (ID3D10Blob *)0xdeadbeef, "Got unexpected errors %p.\n", errors);
ok(effect == (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
......
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