From: Connor McAdams <cmcadams@codeweavers.com> Signed-off-by: Connor McAdams <cmcadams@codeweavers.com> --- dlls/d3dx11_43/tests/d3dx11.c | 7 ---- dlls/d3dx11_43/texture.c | 60 ++++++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 25 deletions(-) diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index b759c932053..fcffbd095d5 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -3674,13 +3674,6 @@ static void test_get_image_info(void) check_dds_dxt10_format(DXGI_FORMAT_B8G8R8X8_UNORM, DXGI_FORMAT_B8G8R8X8_UNORM, FALSE); check_dds_dxt10_format(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, FALSE); - if (!strcmp(winetest_platform, "wine")) - { - skip("Skipping D3DX11GetImageInfoFromResource() tests.\n"); - CoUninitialize(); - return; - } - /* D3DX11GetImageInfoFromResource tests */ hr2 = 0xdeadbeef; diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c index 3be99465f8a..400fd828501 100644 --- a/dlls/d3dx11_43/texture.c +++ b/dlls/d3dx11_43/texture.c @@ -223,6 +223,48 @@ HRESULT WINAPI D3DX11GetImageInfoFromFileW(const WCHAR *src_file, ID3DX11ThreadP return hr; } +HRESULT WINAPI D3DX11GetImageInfoFromResourceA(HMODULE module, const char *resource, ID3DX11ThreadPump *pump, + D3DX11_IMAGE_INFO *info, HRESULT *result) +{ + uint32_t size; + void *buffer; + HRESULT hr; + + TRACE("module %p, resource %s, pump %p, info %p, result %p.\n", + module, debugstr_a(resource), pump, info, result); + + if (pump) + FIXME("D3DX11 thread pump is currently unimplemented.\n"); + + if (FAILED((hr = d3dx_load_resource_a(module, resource, &buffer, &size)))) + return hr; + hr = get_image_info(buffer, size, info); + if (result) + *result = hr; + return hr; +} + +HRESULT WINAPI D3DX11GetImageInfoFromResourceW(HMODULE module, const WCHAR *resource, ID3DX11ThreadPump *pump, + D3DX11_IMAGE_INFO *info, HRESULT *result) +{ + uint32_t size; + void *buffer; + HRESULT hr; + + TRACE("module %p, resource %s, pump %p, info %p, result %p.\n", + module, debugstr_w(resource), pump, info, result); + + if (pump) + FIXME("D3DX11 thread pump is currently unimplemented.\n"); + + if (FAILED((hr = d3dx_load_resource_w(module, resource, &buffer, &size)))) + return hr; + hr = get_image_info(buffer, size, info); + if (result) + *result = hr; + return hr; +} + static HRESULT d3dx11_image_info_from_d3dx_image(D3DX11_IMAGE_INFO *info, struct d3dx_image *image) { D3DX11_IMAGE_FILE_FORMAT iff = d3dx11_image_file_format_from_d3dx_image_file_format(image->image_file_format); @@ -702,21 +744,3 @@ HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_dat *hresult = hr; return hr; } - -HRESULT WINAPI D3DX11GetImageInfoFromResourceA(HMODULE module, const char *resource, ID3DX11ThreadPump *pump, - D3DX11_IMAGE_INFO *info, HRESULT *result) -{ - FIXME("module %p, resource %s, pump %p, info %p, result %p stub!.\n", module, debugstr_a(resource), pump, info, - result); - - return E_NOTIMPL; -} - -HRESULT WINAPI D3DX11GetImageInfoFromResourceW(HMODULE module, const WCHAR *resource, ID3DX11ThreadPump *pump, - D3DX11_IMAGE_INFO *info, HRESULT *result) -{ - FIXME("module %p, resource %s, pump %p, info %p, result %p stub!.\n", module, debugstr_w(resource), pump, info, - result); - - return E_NOTIMPL; -} -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9901