From: Piotr Caban piotr@codeweavers.com
Signed-off-by: Piotr Caban piotr@codeweavers.com --- dlls/d3dx10_43/texture.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 3930df3677f..c018487ae7a 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -301,7 +301,7 @@ HRESULT WINAPI D3DX10GetImageInfoFromFileA(const char *src_file, ID3DX10ThreadPu
TRACE("src_file %s, pump %p, info %p, result %p.\n", debugstr_a(src_file), pump, info, result);
- if (!src_file || !info) + if (!src_file) return E_FAIL;
str_len = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0); @@ -329,11 +329,15 @@ HRESULT WINAPI D3DX10GetImageInfoFromFileW(const WCHAR *src_file, ID3DX10ThreadP
TRACE("src_file %s, pump %p, info %p, result %p.\n", debugstr_w(src_file), pump, info, result);
- if (!src_file || !info) + if (!src_file) return E_FAIL;
if (FAILED((hr = load_file(src_file, &buffer, &size)))) + { + if (result) + *result = hr; return hr; + }
hr = D3DX10GetImageInfoFromMemory(buffer, size, pump, info, result);
@@ -352,11 +356,7 @@ HRESULT WINAPI D3DX10GetImageInfoFromResourceA(HMODULE module, const char *resou TRACE("module %p, resource %s, pump %p, info %p, result %p.\n", module, debugstr_a(resource), pump, info, result);
- if (!resource || !info) - return D3DX10_ERR_INVALID_DATA; - - hr = load_resourceA(module, resource, &buffer, &size); - if (FAILED(hr)) + if (FAILED((hr = load_resourceA(module, resource, &buffer, &size)))) return hr;
return D3DX10GetImageInfoFromMemory(buffer, size, pump, info, result); @@ -372,11 +372,7 @@ HRESULT WINAPI D3DX10GetImageInfoFromResourceW(HMODULE module, const WCHAR *reso TRACE("module %p, resource %s, pump %p, info %p, result %p.\n", module, debugstr_w(resource), pump, info, result);
- if (!resource || !info) - return D3DX10_ERR_INVALID_DATA; - - hr = load_resourceW(module, resource, &buffer, &size); - if (FAILED(hr)) + if (FAILED((hr = load_resourceW(module, resource, &buffer, &size)))) return hr;
return D3DX10GetImageInfoFromMemory(buffer, size, pump, info, result); @@ -480,6 +476,8 @@ end: HRESULT WINAPI D3DX10GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *img_info, HRESULT *result) { + HRESULT hr; + TRACE("src_data %p, src_data_size %Iu, pump %p, img_info %p, hresult %p.\n", src_data, src_data_size, pump, img_info, result);
@@ -488,7 +486,10 @@ HRESULT WINAPI D3DX10GetImageInfoFromMemory(const void *src_data, SIZE_T src_dat if (pump) FIXME("Thread pump is not supported yet.\n");
- return get_image_info(src_data, src_data_size, img_info); + hr = get_image_info(src_data, src_data_size, img_info); + if (result) + *result = hr; + return hr; }
HRESULT WINAPI D3DX10CreateTextureFromFileA(ID3D10Device *device, const char *src_file,
From: Piotr Caban piotr@codeweavers.com
--- dlls/d3dx10_43/tests/d3dx10.c | 66 ++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 17 deletions(-)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index a817f346676..fe7a118cec9 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -1922,53 +1922,73 @@ static void test_get_image_info(void) WCHAR path[MAX_PATH]; unsigned int i; DWORD dword; - HRESULT hr; + HRESULT hr, hr2;
CoInitialize(NULL);
- hr = D3DX10GetImageInfoFromMemory(test_image[0].data, 0, NULL, &image_info, NULL); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromMemory(test_image[0].data, 0, NULL, &image_info, &hr2); ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); - hr = D3DX10GetImageInfoFromMemory(NULL, test_image[0].size, NULL, &image_info, NULL); + ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromMemory(NULL, test_image[0].size, NULL, &image_info, &hr2); ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); - hr = D3DX10GetImageInfoFromMemory(&dword, sizeof(dword), NULL, &image_info, NULL); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromMemory(&dword, sizeof(dword), NULL, &image_info, &hr2); ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
for (i = 0; i < ARRAY_SIZE(test_image); ++i) { winetest_push_context("Test %u", i);
- hr = D3DX10GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &image_info, NULL); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &image_info, &hr2); ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#x.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
winetest_pop_context(); }
- hr = D3DX10GetImageInfoFromFileW(NULL, NULL, &image_info, NULL); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromFileW(NULL, NULL, &image_info, &hr2); ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); - hr = D3DX10GetImageInfoFromFileW(L"deadbeaf", NULL, &image_info, NULL); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromFileW(L"deadbeaf", NULL, &image_info, &hr2); ok(hr == D3D10_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#x.\n", hr); - hr = D3DX10GetImageInfoFromFileA(NULL, NULL, &image_info, NULL); + ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromFileA(NULL, NULL, &image_info, &hr2); ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); - hr = D3DX10GetImageInfoFromFileA("deadbeaf", NULL, &image_info, NULL); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromFileA("deadbeaf", NULL, &image_info, &hr2); ok(hr == D3D10_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#x.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
for (i = 0; i < ARRAY_SIZE(test_image); ++i) { winetest_push_context("Test %u", i); create_file(test_filename, test_image[i].data, test_image[i].size, path);
- hr = D3DX10GetImageInfoFromFileW(path, NULL, &image_info, NULL); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromFileW(path, NULL, &image_info, &hr2); ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#x.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
- hr = D3DX10GetImageInfoFromFileA(get_str_a(path), NULL, &image_info, NULL); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromFileA(get_str_a(path), NULL, &image_info, &hr2); ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), "Got unexpected hr %#x.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
@@ -1979,31 +1999,43 @@ static void test_get_image_info(void)
/* D3DX10GetImageInfoFromResource tests */
- hr = D3DX10GetImageInfoFromResourceW(NULL, NULL, NULL, &image_info, NULL); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromResourceW(NULL, NULL, NULL, &image_info, &hr2); ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr); - hr = D3DX10GetImageInfoFromResourceW(NULL, L"deadbeaf", NULL, &image_info, NULL); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromResourceW(NULL, L"deadbeaf", NULL, &image_info, &hr2); ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr); - hr = D3DX10GetImageInfoFromResourceA(NULL, NULL, NULL, &image_info, NULL); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromResourceA(NULL, NULL, NULL, &image_info, &hr2); ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr); - hr = D3DX10GetImageInfoFromResourceA(NULL, "deadbeaf", NULL, &image_info, NULL); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromResourceA(NULL, "deadbeaf", NULL, &image_info, &hr2); ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr); + ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
for (i = 0; i < ARRAY_SIZE(test_image); ++i) { winetest_push_context("Test %u", i); resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size);
- hr = D3DX10GetImageInfoFromResourceW(resource_module, test_resource_name, NULL, &image_info, NULL); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromResourceW(resource_module, test_resource_name, NULL, &image_info, &hr2); ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP) || broken(hr == D3DX10_ERR_INVALID_DATA) /* Vista */, "Got unexpected hr %#x.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
- hr = D3DX10GetImageInfoFromResourceA(resource_module, get_str_a(test_resource_name), NULL, &image_info, NULL); + hr2 = 0xdeadbeef; + hr = D3DX10GetImageInfoFromResourceA(resource_module, get_str_a(test_resource_name), NULL, &image_info, &hr2); ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP) || broken(hr == D3DX10_ERR_INVALID_DATA) /* Vista */, "Got unexpected hr %#x.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
From: Piotr Caban piotr@codeweavers.com
Signed-off-by: Piotr Caban piotr@codeweavers.com --- dlls/d3dx10_43/texture.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index c018487ae7a..3ee1eaba624 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -332,17 +332,34 @@ HRESULT WINAPI D3DX10GetImageInfoFromFileW(const WCHAR *src_file, ID3DX10ThreadP if (!src_file) return E_FAIL;
- if (FAILED((hr = load_file(src_file, &buffer, &size)))) + if (pump) { - if (result) - *result = hr; + ID3DX10DataProcessor *processor; + ID3DX10DataLoader *loader; + + if (FAILED((hr = D3DX10CreateAsyncFileLoaderW(src_file, &loader)))) + return hr; + if (FAILED((hr = D3DX10CreateAsyncTextureInfoProcessor(info, &processor)))) + { + ID3DX10DataLoader_Destroy(loader); + return hr; + } + hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, result, NULL); + if (FAILED(hr)) + { + ID3DX10DataLoader_Destroy(loader); + ID3DX10DataProcessor_Destroy(processor); + } return hr; }
- hr = D3DX10GetImageInfoFromMemory(buffer, size, pump, info, result); - - free(buffer); - + if (SUCCEEDED((hr = load_file(src_file, &buffer, &size)))) + { + hr = get_image_info(buffer, size, info); + free(buffer); + } + if (result) + *result = hr; return hr; }
From: Piotr Caban piotr@codeweavers.com
Signed-off-by: Piotr Caban piotr@codeweavers.com --- dlls/d3dx10_43/texture.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 3ee1eaba624..090d480accd 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -373,10 +373,32 @@ HRESULT WINAPI D3DX10GetImageInfoFromResourceA(HMODULE module, const char *resou TRACE("module %p, resource %s, pump %p, info %p, result %p.\n", module, debugstr_a(resource), pump, info, result);
- if (FAILED((hr = load_resourceA(module, resource, &buffer, &size)))) + if (pump) + { + ID3DX10DataProcessor *processor; + ID3DX10DataLoader *loader; + + if (FAILED((hr = D3DX10CreateAsyncResourceLoaderA(module, resource, &loader)))) + return hr; + if (FAILED((hr = D3DX10CreateAsyncTextureInfoProcessor(info, &processor)))) + { + ID3DX10DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, result, NULL)))) + { + ID3DX10DataLoader_Destroy(loader); + ID3DX10DataProcessor_Destroy(processor); + } return hr; + }
- return D3DX10GetImageInfoFromMemory(buffer, size, pump, info, result); + if (FAILED((hr = load_resourceA(module, resource, &buffer, &size)))) + return hr; + hr = get_image_info(buffer, size, info); + if (result) + *result = hr; + return hr; }
HRESULT WINAPI D3DX10GetImageInfoFromResourceW(HMODULE module, const WCHAR *resource, ID3DX10ThreadPump *pump,
From: Piotr Caban piotr@codeweavers.com
Signed-off-by: Piotr Caban piotr@codeweavers.com --- dlls/d3dx10_43/texture.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 090d480accd..52d1331d30e 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -411,10 +411,32 @@ HRESULT WINAPI D3DX10GetImageInfoFromResourceW(HMODULE module, const WCHAR *reso TRACE("module %p, resource %s, pump %p, info %p, result %p.\n", module, debugstr_w(resource), pump, info, result);
- if (FAILED((hr = load_resourceW(module, resource, &buffer, &size)))) + if (pump) + { + ID3DX10DataProcessor *processor; + ID3DX10DataLoader *loader; + + if (FAILED((hr = D3DX10CreateAsyncResourceLoaderW(module, resource, &loader)))) + return hr; + if (FAILED((hr = D3DX10CreateAsyncTextureInfoProcessor(info, &processor)))) + { + ID3DX10DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, result, NULL)))) + { + ID3DX10DataLoader_Destroy(loader); + ID3DX10DataProcessor_Destroy(processor); + } return hr; + }
- return D3DX10GetImageInfoFromMemory(buffer, size, pump, info, result); + if (FAILED((hr = load_resourceW(module, resource, &buffer, &size)))) + return hr; + hr = get_image_info(buffer, size, info); + if (result) + *result = hr; + return hr; }
HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_info)
From: Piotr Caban piotr@codeweavers.com
Signed-off-by: Piotr Caban piotr@codeweavers.com --- dlls/d3dx10_43/texture.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c index 52d1331d30e..9c7762bc617 100644 --- a/dlls/d3dx10_43/texture.c +++ b/dlls/d3dx10_43/texture.c @@ -544,8 +544,26 @@ HRESULT WINAPI D3DX10GetImageInfoFromMemory(const void *src_data, SIZE_T src_dat
if (!src_data) return E_FAIL; + if (pump) - FIXME("Thread pump is not supported yet.\n"); + { + ID3DX10DataProcessor *processor; + ID3DX10DataLoader *loader; + + if (FAILED((hr = D3DX10CreateAsyncMemoryLoader(src_data, src_data_size, &loader)))) + return hr; + if (FAILED((hr = D3DX10CreateAsyncTextureInfoProcessor(img_info, &processor)))) + { + ID3DX10DataLoader_Destroy(loader); + return hr; + } + if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, result, NULL)))) + { + ID3DX10DataLoader_Destroy(loader); + ID3DX10DataProcessor_Destroy(processor); + } + return hr; + }
hr = get_image_info(src_data, src_data_size, img_info); if (result)
From: Piotr Caban piotr@codeweavers.com
Signed-off-by: Piotr Caban piotr@codeweavers.com --- dlls/d3dx10_43/tests/d3dx10.c | 122 ++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index fe7a118cec9..7eead7deb4c 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -24,6 +24,32 @@
#define D3DERR_INVALIDCALL 0x8876086c
+#define DEFINE_EXPECT(func) \ + static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + +#define SET_EXPECT(func) \ + do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0) + +#define CHECK_EXPECT2(func) \ + do { \ + ok(expect_ ##func, "unexpected call " #func "\n"); \ + called_ ## func = TRUE; \ + }while(0) + +#define CHECK_EXPECT(func) \ + do { \ + CHECK_EXPECT2(func); \ + expect_ ## func = FALSE; \ + }while(0) + +#define CHECK_CALLED(func) \ + do { \ + ok(called_ ## func, "expected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + +DEFINE_EXPECT(D3DX10ThreadPump_AddWorkItem); + /* 1x1 1bpp bmp image */ static const BYTE test_bmp_1bpp[] = { @@ -822,6 +848,94 @@ static unsigned int get_bpp_from_format(DXGI_FORMAT format) } }
+static HRESULT WINAPI D3DX10ThreadPump_QueryInterface(ID3DX10ThreadPump *iface, REFIID riid, void **out) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static ULONG WINAPI D3DX10ThreadPump_AddRef(ID3DX10ThreadPump *iface) +{ + return 2; +} + +static ULONG WINAPI D3DX10ThreadPump_Release(ID3DX10ThreadPump *iface) +{ + return 1; +} + +static HRESULT WINAPI D3DX10ThreadPump_AddWorkItem(ID3DX10ThreadPump *iface, ID3DX10DataLoader *loader, + ID3DX10DataProcessor *processor, HRESULT *result, void **object) +{ + SIZE_T size; + void *data; + HRESULT hr; + + CHECK_EXPECT(D3DX10ThreadPump_AddWorkItem); + ok(!object, "object = %p\n", object); + + hr = ID3DX10DataLoader_Load(loader); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3DX10DataLoader_Decompress(loader, &data, &size); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3DX10DataProcessor_Process(processor, data, size); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3DX10DataProcessor_CreateDeviceObject(processor, object); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3DX10DataProcessor_Destroy(processor); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3DX10DataLoader_Destroy(loader); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + if (result) *result = S_OK; + return S_OK; +} + +static UINT WINAPI D3DX10ThreadPump_GetWorkItemCount(ID3DX10ThreadPump *iface) +{ + ok(0, "unexpected call\n"); + return 0; +} + +static HRESULT WINAPI D3DX10ThreadPump_WaitForAllItems(ID3DX10ThreadPump *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI D3DX10ThreadPump_ProcessDeviceWorkItems(ID3DX10ThreadPump *iface, UINT count) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI D3DX10ThreadPump_PurgeAllItems(ID3DX10ThreadPump *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI D3DX10ThreadPump_GetQueueStatus(ID3DX10ThreadPump *iface, UINT *queue, + UINT *processqueue, UINT *devicequeue) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static ID3DX10ThreadPumpVtbl D3DX10ThreadPumpVtbl = +{ + D3DX10ThreadPump_QueryInterface, + D3DX10ThreadPump_AddRef, + D3DX10ThreadPump_Release, + D3DX10ThreadPump_AddWorkItem, + D3DX10ThreadPump_GetWorkItemCount, + D3DX10ThreadPump_WaitForAllItems, + D3DX10ThreadPump_ProcessDeviceWorkItems, + D3DX10ThreadPump_PurgeAllItems, + D3DX10ThreadPump_GetQueueStatus +}; +static ID3DX10ThreadPump thread_pump = { &D3DX10ThreadPumpVtbl }; + static ULONG get_refcount(void *iface) { IUnknown *unknown = iface; @@ -1954,6 +2068,14 @@ static void test_get_image_info(void) winetest_pop_context(); }
+ hr2 = 0xdeadbeef; + SET_EXPECT(D3DX10ThreadPump_AddWorkItem); + hr = D3DX10GetImageInfoFromMemory(test_image[0].data, test_image[0].size, &thread_pump, &image_info, &hr2); + CHECK_CALLED(D3DX10ThreadPump_AddWorkItem); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2); + check_image_info(&image_info, test_image, __LINE__); + hr2 = 0xdeadbeef; hr = D3DX10GetImageInfoFromFileW(NULL, NULL, &image_info, &hr2); ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);