diff --git a/patches/comctl32-version_6/0001-comctl32-Bump-version-to-6.0.patch b/patches/comctl32-version_6/0001-comctl32-Bump-version-to-6.0.patch deleted file mode 100644 index f1bae62b..00000000 --- a/patches/comctl32-version_6/0001-comctl32-Bump-version-to-6.0.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 9cf09446b0bf5da7988d1ba30c24d392c7a01f4b Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Tue, 12 Nov 2019 18:13:20 +0800 -Subject: [PATCH] comctl32: Bump version to 6.0. - -An application that I have here checks comctl32.dll version information -and refuses to run, changing DLL version to 6.0 makes it run. - -Signed-off-by: Dmitry Timoshkov ---- - dlls/comctl32/comctl32.rc | 2 +- - include/commctrl.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/comctl32/comctl32.rc b/dlls/comctl32/comctl32.rc -index 2c62dbe2720..473de211c67 100644 ---- a/dlls/comctl32/comctl32.rc -+++ b/dlls/comctl32/comctl32.rc -@@ -113,7 +113,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL - - #define WINE_FILEDESCRIPTION_STR "Wine Common Controls" - #define WINE_FILENAME_STR "comctl32.dll" --#define WINE_FILEVERSION COMCTL32_VERSION,81,4704,1100 -+#define WINE_FILEVERSION COMCTL32_VERSION,0,4704,1100 - - #include "wine/wine_common_ver.rc" - -diff --git a/include/commctrl.h b/include/commctrl.h -index 235704a76dd..5a67c1284a0 100644 ---- a/include/commctrl.h -+++ b/include/commctrl.h -@@ -59,7 +59,7 @@ enum _LI_METRIC - WINCOMMCTRLAPI HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE, const WCHAR *, int, int, HICON *); - WINCOMMCTRLAPI HRESULT WINAPI LoadIconMetric(HINSTANCE, const WCHAR *, int, HICON *); - --#define COMCTL32_VERSION 5 /* dll version */ -+#define COMCTL32_VERSION 6 /* dll version */ - - #define ICC_LISTVIEW_CLASSES 0x00000001 /* listview, header */ - #define ICC_TREEVIEW_CLASSES 0x00000002 /* treeview, tooltips */ --- -2.47.2 - diff --git a/patches/d3dx11_43-D3DX11CreateTextureFromMemory/0007-d3dx10-tests-Add-tests-for-the-D3DX10_IMAGE_LOAD_INF.patch b/patches/d3dx11_43-D3DX11CreateTextureFromMemory/0007-d3dx10-tests-Add-tests-for-the-D3DX10_IMAGE_LOAD_INF.patch deleted file mode 100644 index 61710d58..00000000 --- a/patches/d3dx11_43-D3DX11CreateTextureFromMemory/0007-d3dx10-tests-Add-tests-for-the-D3DX10_IMAGE_LOAD_INF.patch +++ /dev/null @@ -1,862 +0,0 @@ -From 699fef6f9d66949b6d2f74c3785b04aab5603e2a Mon Sep 17 00:00:00 2001 -From: Connor McAdams -Date: Wed, 14 Aug 2024 10:12:24 -0400 -Subject: [PATCH] d3dx10/tests: Add tests for the D3DX10_IMAGE_LOAD_INFO - structure argument. - -Signed-off-by: Connor McAdams ---- - dlls/d3dx10_43/tests/d3dx10.c | 746 +++++++++++++++++++++++++++++++++- - 1 file changed, 741 insertions(+), 5 deletions(-) - -diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c -index 119b74c7ece..6155855713e 100644 ---- a/dlls/d3dx10_43/tests/d3dx10.c -+++ b/dlls/d3dx10_43/tests/d3dx10.c -@@ -732,6 +732,68 @@ static const BYTE test_dds_volume_data[] = - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50, - }; - -+/* -+ * 4x4x4 24-bit volume dds, 3 mipmaps. Level 0 is red, level 1 is green, level 2 is -+ * blue. -+ */ -+static const uint8_t dds_volume_24bit_4_4_4[] = -+{ -+ 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x0f,0x10,0x82,0x00,0x04,0x00,0x00,0x00, -+ 0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00, -+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00, -+ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0xff,0x00, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x40,0x00, -+ 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -+ 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, -+ 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, -+ 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, -+ 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, -+ 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, -+ 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, -+ 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, -+ 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, -+ 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0xff,0x00,0x00 -+}; -+ -+/* -+ * 8x8 24-bit dds, 4 mipmaps. Level 0 is red, level 1 is green, level 2 is -+ * blue, and level 3 is black. -+ */ -+static const uint8_t dds_24bit_8_8[] = -+{ -+ 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x0a,0x00,0x08,0x00,0x00,0x00, -+ 0x08,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00, -+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00, -+ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0xff,0x00, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x40,0x00, -+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -+ 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, -+ 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, -+ 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, -+ 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, -+ 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, -+ 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, -+ 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, -+ 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, -+ 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00, -+ 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff, -+ 0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00, -+ 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00 -+}; -+ - /* 1x1 wmp image */ - static const BYTE test_wmp[] = - { -@@ -922,6 +984,169 @@ test_image[] = - }, - }; - -+static const struct test_image_load_info -+{ -+ const uint8_t *data; -+ uint32_t size; -+ D3DX10_IMAGE_LOAD_INFO load_info; -+ HRESULT expected_hr; -+ -+ D3D10_RESOURCE_DIMENSION expected_type; -+ union -+ { -+ D3D10_TEXTURE2D_DESC desc_2d; -+ D3D10_TEXTURE3D_DESC desc_3d; -+ } expected_resource_desc; -+ D3DX10_IMAGE_INFO expected_info; -+ BOOL todo_resource_desc; -+} -+test_image_load_info[] = -+{ -+ /* -+ * FirstMipLevel set to 1 - Does not match D3DX_SKIP_DDS_MIP_LEVELS -+ * behavior from d3dx9, image info values represent mip level 0, and -+ * texture values are pulled from this. The texture data is loaded -+ * starting from the specified mip level, however. -+ */ -+ { -+ dds_volume_24bit_4_4_4, sizeof(dds_volume_24bit_4_4_4), -+ { D3DX10_FROM_FILE, D3DX10_DEFAULT, 0, 1, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT }, -+ S_OK, D3D10_RESOURCE_DIMENSION_TEXTURE3D, -+ { .desc_3d = { 4, 4, 4, 3, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, 0, 0 } }, -+ { 4, 4, 4, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE3D, D3DX10_IFF_DDS }, -+ }, -+ /* -+ * Autogen mips misc flag specified. In the case of a cube texture image, -+ * the autogen mips flag is OR'd against D3D10_RESOURCE_MISC_TEXTURECUBE, -+ * even if it isn't specified. -+ */ -+ { -+ test_dds_cube, sizeof(test_dds_cube), -+ { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, -+ (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), D3DX10_DEFAULT, D3D10_RESOURCE_MISC_GENERATE_MIPS, -+ DXGI_FORMAT_R8G8B8A8_UNORM, D3DX10_DEFAULT, D3DX10_DEFAULT }, -+ S_OK, D3D10_RESOURCE_DIMENSION_TEXTURE2D, -+ { .desc_2d = { 4, 4, 3, 6, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, -+ (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), 0, -+ (D3D10_RESOURCE_MISC_GENERATE_MIPS | D3D10_RESOURCE_MISC_TEXTURECUBE) } }, -+ { 4, 4, 1, 6, 3, DDS_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, -+ D3DX10_IFF_DDS }, .todo_resource_desc = TRUE, -+ }, -+ /* -+ * Even with the autogen mips misc flag specified, the mip levels argument -+ * of load info is respected. -+ */ -+ { -+ test_dds_cube, sizeof(test_dds_cube), -+ { D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 2, (D3D10_USAGE)D3DX10_DEFAULT, -+ (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), D3DX10_DEFAULT, D3D10_RESOURCE_MISC_GENERATE_MIPS, -+ DXGI_FORMAT_R8G8B8A8_UNORM, D3DX10_DEFAULT, D3DX10_DEFAULT }, -+ S_OK, D3D10_RESOURCE_DIMENSION_TEXTURE2D, -+ { .desc_2d = { 4, 4, 2, 6, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D10_USAGE_DEFAULT, -+ (D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET), 0, -+ (D3D10_RESOURCE_MISC_GENERATE_MIPS | D3D10_RESOURCE_MISC_TEXTURECUBE) } }, -+ { 4, 4, 1, 6, 3, DDS_RESOURCE_MISC_TEXTURECUBE, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, -+ D3DX10_IFF_DDS }, .todo_resource_desc = TRUE, -+ }, -+}; -+ -+static const struct test_invalid_image_load_info -+{ -+ const uint8_t *data; -+ uint32_t size; -+ D3DX10_IMAGE_LOAD_INFO load_info; -+ HRESULT expected_hr; -+ HRESULT expected_process_hr; -+ HRESULT expected_create_device_object_hr; -+ BOOL todo_hr; -+ BOOL todo_process_hr; -+ BOOL todo_create_device_object_hr; -+} test_invalid_image_load_info[] = -+{ -+ /* -+ * A depth value that isn't D3DX10_FROM_FILE/D3DX10_DEFAULT/0 on a 2D -+ * texture results in failure. -+ */ -+ { -+ test_dds_32bpp, sizeof(test_dds_32bpp), -+ { -+ D3DX10_DEFAULT, D3DX10_DEFAULT, 2, D3DX10_DEFAULT, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT -+ }, -+ E_FAIL, E_FAIL, .todo_hr = TRUE, .todo_process_hr = TRUE -+ }, -+ /* Invalid filter value. */ -+ { -+ test_dds_32bpp, sizeof(test_dds_32bpp), -+ { -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 7, D3DX10_DEFAULT -+ }, -+ D3DERR_INVALIDCALL, D3DERR_INVALIDCALL, .todo_hr = TRUE, .todo_process_hr = TRUE -+ }, -+ /* Invalid mipfilter value, only checked if mips are generated. */ -+ { -+ test_dds_32bpp, sizeof(test_dds_32bpp), -+ { -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, (D3D10_USAGE)D3DX10_DEFAULT, -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 7 -+ }, -+ S_OK, S_OK, S_OK -+ }, -+ /* Invalid mipfilter value. */ -+ { -+ test_dds_32bpp, sizeof(test_dds_32bpp), -+ { -+ 2, 2, D3DX10_DEFAULT, D3DX10_DEFAULT, 2, (D3D10_USAGE)D3DX10_DEFAULT, -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 7 -+ }, -+ D3DERR_INVALIDCALL, D3DERR_INVALIDCALL, .todo_hr = TRUE, .todo_process_hr = TRUE -+ }, -+ /* -+ * Usage/BindFlags/CpuAccessFlags are validated in the call to -+ * CreateDeviceObject(). -+ */ -+ { -+ test_dds_32bpp, sizeof(test_dds_32bpp), -+ { -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_CPU_ACCESS_READ, D3D10_USAGE_DYNAMIC, -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT -+ }, -+ E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, -+ }, -+ { -+ test_dds_32bpp, sizeof(test_dds_32bpp), -+ { -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_USAGE_DEFAULT, -+ D3D10_BIND_DEPTH_STENCIL, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT -+ }, -+ E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, -+ }, -+ /* -+ * D3D10_RESOURCE_MISC_GENERATE_MIPS requires binding as a shader resource -+ * and a render target. -+ */ -+ { -+ test_dds_32bpp, sizeof(test_dds_32bpp), -+ { -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_USAGE_DEFAULT, -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_RESOURCE_MISC_GENERATE_MIPS, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT -+ }, -+ E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, -+ }, -+ /* Can't set the cube texture flag if the image isn't a cube texture. */ -+ { -+ test_dds_32bpp, sizeof(test_dds_32bpp), -+ { -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_USAGE_DEFAULT, -+ D3DX10_DEFAULT, D3DX10_DEFAULT, D3D10_RESOURCE_MISC_TEXTURECUBE, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT -+ }, -+ E_INVALIDARG, S_OK, E_INVALIDARG, .todo_hr = TRUE, .todo_create_device_object_hr = TRUE, -+ }, -+}; -+ -+ - static WCHAR temp_dir[MAX_PATH]; - - static DXGI_FORMAT block_compressed_formats[] = -@@ -1373,7 +1598,99 @@ static inline void check_image_info_values_(uint32_t line, const D3DX10_IMAGE_IN - image_file_format, info->ImageFileFormat); - } - --static ID3D10Texture2D *get_texture2d_readback(ID3D10Texture2D *texture) -+#define check_texture2d_desc_values(desc, width, height, mip_levels, array_size, format, sample_count, sample_quality, \ -+ usage, bind_flags, cpu_access_flags, misc_flags, wine_todo) \ -+ check_texture2d_desc_values_(__LINE__, desc, width, height, mip_levels, array_size, format, sample_count, sample_quality, \ -+ usage, bind_flags, cpu_access_flags, misc_flags, wine_todo) -+static inline void check_texture2d_desc_values_(uint32_t line, const D3D10_TEXTURE2D_DESC *desc, uint32_t width, -+ uint32_t height, uint32_t mip_levels, uint32_t array_size, DXGI_FORMAT format, uint32_t sample_count, -+ uint32_t sample_quality, D3D10_USAGE usage, uint32_t bind_flags, uint32_t cpu_access_flags, uint32_t misc_flags, -+ BOOL wine_todo) -+{ -+ const D3D10_TEXTURE2D_DESC expected_desc = { width, height, mip_levels, array_size, format, { sample_count, sample_quality }, -+ usage, bind_flags, cpu_access_flags, misc_flags }; -+ BOOL matched; -+ -+ matched = !memcmp(&expected_desc, desc, sizeof(*desc)); -+ todo_wine_if(wine_todo) ok_(__FILE__, line)(matched, "Got unexpected 2D texture desc values.\n"); -+ if (matched) -+ return; -+ -+ todo_wine_if(wine_todo && desc->Width != width) -+ ok_(__FILE__, line)(desc->Width == width, "Expected width %u, got %u.\n", width, desc->Width); -+ todo_wine_if(wine_todo && desc->Height != height) -+ ok_(__FILE__, line)(desc->Height == height, "Expected height %u, got %u.\n", height, desc->Height); -+ todo_wine_if(wine_todo && desc->ArraySize != array_size) -+ ok_(__FILE__, line)(desc->ArraySize == array_size, "Expected array_size %u, got %u.\n", array_size, -+ desc->ArraySize); -+ todo_wine_if(wine_todo && desc->MipLevels != mip_levels) -+ ok_(__FILE__, line)(desc->MipLevels == mip_levels, "Expected mip_levels %u, got %u.\n", mip_levels, -+ desc->MipLevels); -+ todo_wine_if(wine_todo && desc->Format != format) -+ ok_(__FILE__, line)(desc->Format == format, "Expected texture format %#x, got %#x.\n", format, desc->Format); -+ todo_wine_if(wine_todo && desc->SampleDesc.Count != sample_count) -+ ok_(__FILE__, line)(desc->SampleDesc.Count == sample_count, "Expected sample_count %u, got %u.\n", sample_count, -+ desc->SampleDesc.Count); -+ todo_wine_if(wine_todo && desc->SampleDesc.Quality != sample_quality) -+ ok_(__FILE__, line)(desc->SampleDesc.Quality == sample_quality, "Expected sample_quality %u, got %u.\n", sample_quality, -+ desc->SampleDesc.Quality); -+ todo_wine_if(wine_todo && desc->Usage != usage) -+ ok_(__FILE__, line)(desc->Usage == usage, "Expected usage %u, got %u.\n", usage, -+ desc->Usage); -+ todo_wine_if(wine_todo && desc->BindFlags != bind_flags) -+ ok_(__FILE__, line)(desc->BindFlags == bind_flags, "Expected bind_flags %#x, got %#x.\n", bind_flags, -+ desc->BindFlags); -+ todo_wine_if(wine_todo && desc->CPUAccessFlags != cpu_access_flags) -+ ok_(__FILE__, line)(desc->CPUAccessFlags == cpu_access_flags, "Expected cpu_access_flags %#x, got %#x.\n", -+ cpu_access_flags, desc->CPUAccessFlags); -+ todo_wine_if(wine_todo && desc->MiscFlags != misc_flags) -+ ok_(__FILE__, line)(desc->MiscFlags == misc_flags, "Expected misc_flags %#x, got %#x.\n", misc_flags, -+ desc->MiscFlags); -+} -+ -+#define check_texture3d_desc_values(desc, width, height, depth, mip_levels, format, usage, bind_flags, cpu_access_flags, \ -+ misc_flags, wine_todo) \ -+ check_texture3d_desc_values_(__LINE__, desc, width, height, depth, mip_levels, format, usage, bind_flags, \ -+ cpu_access_flags, misc_flags, wine_todo) -+static inline void check_texture3d_desc_values_(uint32_t line, const D3D10_TEXTURE3D_DESC *desc, uint32_t width, -+ uint32_t height, uint32_t depth, uint32_t mip_levels, DXGI_FORMAT format, D3D10_USAGE usage, uint32_t bind_flags, -+ uint32_t cpu_access_flags, uint32_t misc_flags, BOOL wine_todo) -+{ -+ const D3D10_TEXTURE3D_DESC expected_desc = { width, height, depth, mip_levels, format, usage, bind_flags, -+ cpu_access_flags, misc_flags }; -+ BOOL matched; -+ -+ matched = !memcmp(&expected_desc, desc, sizeof(*desc)); -+ todo_wine_if(wine_todo) ok_(__FILE__, line)(matched, "Got unexpected 3D texture desc values.\n"); -+ if (matched) -+ return; -+ -+ todo_wine_if(wine_todo && desc->Width != width) -+ ok_(__FILE__, line)(desc->Width == width, "Expected width %u, got %u.\n", width, desc->Width); -+ todo_wine_if(wine_todo && desc->Height != height) -+ ok_(__FILE__, line)(desc->Height == height, "Expected height %u, got %u.\n", height, desc->Height); -+ todo_wine_if(wine_todo && desc->Depth != depth) -+ ok_(__FILE__, line)(desc->Depth == depth, "Expected depth %u, got %u.\n", depth, desc->Depth); -+ todo_wine_if(wine_todo && desc->MipLevels != mip_levels) -+ ok_(__FILE__, line)(desc->MipLevels == mip_levels, "Expected mip_levels %u, got %u.\n", mip_levels, -+ desc->MipLevels); -+ todo_wine_if(wine_todo && desc->Format != format) -+ ok_(__FILE__, line)(desc->Format == format, "Expected texture format %#x, got %#x.\n", format, desc->Format); -+ todo_wine_if(wine_todo && desc->Usage != usage) -+ ok_(__FILE__, line)(desc->Usage == usage, "Expected usage %u, got %u.\n", usage, -+ desc->Usage); -+ todo_wine_if(wine_todo && desc->BindFlags != bind_flags) -+ ok_(__FILE__, line)(desc->BindFlags == bind_flags, "Expected bind_flags %#x, got %#x.\n", bind_flags, -+ desc->BindFlags); -+ todo_wine_if(wine_todo && desc->CPUAccessFlags != cpu_access_flags) -+ ok_(__FILE__, line)(desc->CPUAccessFlags == cpu_access_flags, "Expected cpu_access_flags %#x, got %#x.\n", -+ cpu_access_flags, desc->CPUAccessFlags); -+ todo_wine_if(wine_todo && desc->MiscFlags != misc_flags) -+ ok_(__FILE__, line)(desc->MiscFlags == misc_flags, "Expected misc_flags %#x, got %#x.\n", misc_flags, -+ desc->MiscFlags); -+} -+ -+static ID3D10Texture2D *get_texture2d_readback_iface(ID3D10Texture2D *texture) - { - D3D10_TEXTURE2D_DESC desc; - ID3D10Texture2D *readback; -@@ -1399,7 +1716,7 @@ static ID3D10Texture2D *get_texture2d_readback(ID3D10Texture2D *texture) - return readback; - } - --static ID3D10Texture3D *get_texture3d_readback(ID3D10Texture3D *texture) -+static ID3D10Texture3D *get_texture3d_readback_iface(ID3D10Texture3D *texture) - { - D3D10_TEXTURE3D_DESC desc; - ID3D10Texture3D *readback; -@@ -1425,6 +1742,64 @@ static ID3D10Texture3D *get_texture3d_readback(ID3D10Texture3D *texture) - return readback; - } - -+#define check_test_image_load_info_resource(resource, image_load_info) \ -+ check_test_image_load_info_resource_(__LINE__, resource, image_load_info) -+static void check_test_image_load_info_resource_(uint32_t line, ID3D10Resource *resource, -+ const struct test_image_load_info *image_load_info) -+{ -+ D3D10_RESOURCE_DIMENSION resource_dimension; -+ HRESULT hr; -+ -+ ID3D10Resource_GetType(resource, &resource_dimension); -+ todo_wine_if(image_load_info->expected_type == D3D10_RESOURCE_DIMENSION_TEXTURE3D) -+ ok(resource_dimension == image_load_info->expected_type, "Got unexpected ResourceDimension %u, expected %u.\n", -+ resource_dimension, image_load_info->expected_type); -+ -+ if (resource_dimension != image_load_info->expected_type) -+ return; -+ -+ switch (resource_dimension) -+ { -+ case D3D10_RESOURCE_DIMENSION_TEXTURE2D: -+ { -+ const D3D10_TEXTURE2D_DESC *expected_desc_2d = &image_load_info->expected_resource_desc.desc_2d; -+ D3D10_TEXTURE2D_DESC desc_2d; -+ ID3D10Texture2D *tex_2d; -+ -+ hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&tex_2d); -+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); -+ ID3D10Texture2D_GetDesc(tex_2d, &desc_2d); -+ check_texture2d_desc_values_(line, &desc_2d, expected_desc_2d->Width, expected_desc_2d->Height, -+ expected_desc_2d->MipLevels, expected_desc_2d->ArraySize, expected_desc_2d->Format, -+ expected_desc_2d->SampleDesc.Count, expected_desc_2d->SampleDesc.Quality, expected_desc_2d->Usage, -+ expected_desc_2d->BindFlags, expected_desc_2d->CPUAccessFlags, expected_desc_2d->MiscFlags, -+ image_load_info->todo_resource_desc); -+ ID3D10Texture2D_Release(tex_2d); -+ break; -+ } -+ -+ case D3D10_RESOURCE_DIMENSION_TEXTURE3D: -+ { -+ const D3D10_TEXTURE3D_DESC *expected_desc_3d = &image_load_info->expected_resource_desc.desc_3d; -+ D3D10_TEXTURE3D_DESC desc_3d; -+ ID3D10Texture3D *tex_3d; -+ -+ hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture3D, (void **)&tex_3d); -+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); -+ ID3D10Texture3D_GetDesc(tex_3d, &desc_3d); -+ check_texture3d_desc_values_(line, &desc_3d, expected_desc_3d->Width, expected_desc_3d->Height, -+ expected_desc_3d->Depth, expected_desc_3d->MipLevels, expected_desc_3d->Format, expected_desc_3d->Usage, -+ expected_desc_3d->BindFlags, expected_desc_3d->CPUAccessFlags, expected_desc_3d->MiscFlags, -+ image_load_info->todo_resource_desc); -+ ID3D10Texture3D_Release(tex_3d); -+ break; -+ } -+ -+ default: -+ break; -+ } -+} -+ - static void check_resource_info(ID3D10Resource *resource, const struct test_image *image, unsigned int line) - { - unsigned int expected_mip_levels, expected_width, expected_height, max_dimension; -@@ -1549,7 +1924,7 @@ static void check_texture2d_data(ID3D10Texture2D *texture, const struct test_ima - BOOL line_match; - HRESULT hr; - -- readback = get_texture2d_readback(texture); -+ readback = get_texture2d_readback_iface(texture); - ok_(__FILE__, line)(readback != NULL, "Failed to get texture readback.\n"); - if (!readback) - return; -@@ -1603,7 +1978,7 @@ static void check_texture3d_data(ID3D10Texture3D *texture, const struct test_ima - BOOL line_match; - HRESULT hr; - -- readback = get_texture3d_readback(texture); -+ readback = get_texture3d_readback_iface(texture); - ok_(__FILE__, line)(readback != NULL, "Failed to get texture readback.\n"); - if (!readback) - return; -@@ -1661,6 +2036,172 @@ static void check_resource_data(ID3D10Resource *resource, const struct test_imag - } - } - -+/* -+ * Taken from the d3d10core tests. If there's a missing resource type or -+ * texture format checking function, check to see if it exists there first. -+ */ -+struct resource_readback -+{ -+ D3D10_RESOURCE_DIMENSION dimension; -+ ID3D10Resource *resource; -+ D3D10_MAPPED_TEXTURE3D map_desc; -+ uint32_t width, height, depth, sub_resource_idx; -+}; -+ -+static void get_texture_readback(ID3D10Texture2D *texture, uint32_t sub_resource_idx, -+ struct resource_readback *rb) -+{ -+ D3D10_TEXTURE2D_DESC texture_desc; -+ D3D10_MAPPED_TEXTURE2D map_desc; -+ uint32_t miplevel; -+ ID3D10Device *device; -+ HRESULT hr; -+ -+ memset(rb, 0, sizeof(*rb)); -+ rb->dimension = D3D10_RESOURCE_DIMENSION_TEXTURE2D; -+ -+ ID3D10Texture2D_GetDevice(texture, &device); -+ -+ ID3D10Texture2D_GetDesc(texture, &texture_desc); -+ texture_desc.Usage = D3D10_USAGE_STAGING; -+ texture_desc.BindFlags = 0; -+ texture_desc.CPUAccessFlags = D3D10_CPU_ACCESS_READ; -+ texture_desc.MiscFlags = 0; -+ if (FAILED(hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D10Texture2D **)&rb->resource))) -+ { -+ trace("Failed to create texture, hr %#lx.\n", hr); -+ ID3D10Device_Release(device); -+ return; -+ } -+ -+ miplevel = sub_resource_idx % texture_desc.MipLevels; -+ rb->width = max(1, texture_desc.Width >> miplevel); -+ rb->height = max(1, texture_desc.Height >> miplevel); -+ rb->depth = 1; -+ rb->sub_resource_idx = sub_resource_idx; -+ -+ ID3D10Device_CopyResource(device, rb->resource, (ID3D10Resource *)texture); -+ if (FAILED(hr = ID3D10Texture2D_Map((ID3D10Texture2D *)rb->resource, sub_resource_idx, -+ D3D10_MAP_READ, 0, &map_desc))) -+ { -+ trace("Failed to map sub-resource %u, hr %#lx.\n", sub_resource_idx, hr); -+ ID3D10Resource_Release(rb->resource); -+ rb->resource = NULL; -+ } -+ rb->map_desc.pData = map_desc.pData; -+ rb->map_desc.RowPitch = map_desc.RowPitch; -+ rb->map_desc.DepthPitch = 0; -+ -+ ID3D10Device_Release(device); -+} -+ -+static void *get_readback_data(struct resource_readback *rb, uint32_t x, uint32_t y, unsigned byte_width) -+{ -+ return (uint8_t *)rb->map_desc.pData + y * rb->map_desc.RowPitch + x * byte_width; -+} -+ -+static uint32_t get_readback_u32(struct resource_readback *rb, uint32_t x, uint32_t y) -+{ -+ return *(uint32_t *)get_readback_data(rb, x, y, sizeof(uint32_t)); -+} -+ -+static uint32_t get_readback_color(struct resource_readback *rb, uint32_t x, uint32_t y) -+{ -+ return get_readback_u32(rb, x, y); -+} -+ -+static void release_resource_readback(struct resource_readback *rb) -+{ -+ switch (rb->dimension) -+ { -+ case D3D10_RESOURCE_DIMENSION_BUFFER: -+ ID3D10Buffer_Unmap((ID3D10Buffer *)rb->resource); -+ break; -+ case D3D10_RESOURCE_DIMENSION_TEXTURE1D: -+ ID3D10Texture1D_Unmap((ID3D10Texture1D *)rb->resource, rb->sub_resource_idx); -+ break; -+ case D3D10_RESOURCE_DIMENSION_TEXTURE2D: -+ ID3D10Texture2D_Unmap((ID3D10Texture2D *)rb->resource, rb->sub_resource_idx); -+ break; -+ case D3D10_RESOURCE_DIMENSION_TEXTURE3D: -+ ID3D10Texture3D_Unmap((ID3D10Texture3D *)rb->resource, rb->sub_resource_idx); -+ break; -+ default: -+ trace("Unhandled resource dimension %#x.\n", rb->dimension); -+ break; -+ } -+ ID3D10Resource_Release(rb->resource); -+} -+ -+static BOOL compare_color(uint32_t c1, uint32_t c2, uint8_t max_diff) -+{ -+ return compare_uint(c1 & 0xff, c2 & 0xff, max_diff) -+ && compare_uint((c1 >> 8) & 0xff, (c2 >> 8) & 0xff, max_diff) -+ && compare_uint((c1 >> 16) & 0xff, (c2 >> 16) & 0xff, max_diff) -+ && compare_uint((c1 >> 24) & 0xff, (c2 >> 24) & 0xff, max_diff); -+} -+ -+#define check_readback_data_color(a, b, c, d) check_readback_data_color_(__LINE__, a, b, c, d) -+static void check_readback_data_color_(uint32_t line, struct resource_readback *rb, -+ const RECT *rect, uint32_t expected_color, uint8_t max_diff) -+{ -+ unsigned int x = 0, y = 0, color = 0; -+ BOOL all_match = FALSE; -+ RECT default_rect; -+ -+ if (!rect) -+ { -+ SetRect(&default_rect, 0, 0, rb->width, rb->height); -+ rect = &default_rect; -+ } -+ -+ for (y = rect->top; y < rect->bottom; ++y) -+ { -+ for (x = rect->left; x < rect->right; ++x) -+ { -+ color = get_readback_color(rb, x, y); -+ if (!compare_color(color, expected_color, max_diff)) -+ goto done; -+ } -+ } -+ all_match = TRUE; -+ -+done: -+ ok_(__FILE__, line)(all_match, -+ "Got 0x%08x, expected 0x%08x at (%u, %u), sub-resource %u.\n", -+ color, expected_color, x, y, rb->sub_resource_idx); -+} -+ -+#define check_texture_sub_resource_color(a, b, c, d, e) check_texture_sub_resource_color_(__LINE__, a, b, c, d, e) -+static void check_texture_sub_resource_color_(uint32_t line, ID3D10Texture2D *texture, -+ uint32_t sub_resource_idx, const RECT *rect, uint32_t expected_color, uint8_t max_diff) -+{ -+ struct resource_readback rb; -+ -+ get_texture_readback(texture, sub_resource_idx, &rb); -+ check_readback_data_color_(line, &rb, rect, expected_color, max_diff); -+ release_resource_readback(&rb); -+} -+ -+static void set_d3dx10_image_load_info(D3DX10_IMAGE_LOAD_INFO *info, uint32_t width, uint32_t height, uint32_t depth, -+ uint32_t first_mip_level, uint32_t mip_levels, D3D10_USAGE usage, uint32_t bind_flags, uint32_t cpu_access_flags, -+ uint32_t misc_flags, DXGI_FORMAT format, uint32_t filter, uint32_t mip_filter, D3DX10_IMAGE_INFO *src_info) -+{ -+ info->Width = width; -+ info->Height = height; -+ info->Depth = depth; -+ info->FirstMipLevel = first_mip_level; -+ info->MipLevels = mip_levels; -+ info->Usage = usage; -+ info->BindFlags = bind_flags; -+ info->CpuAccessFlags = cpu_access_flags; -+ info->MiscFlags = misc_flags; -+ info->Format = format; -+ info->Filter = filter; -+ info->MipFilter = mip_filter; -+ info->pSrcInfo = src_info; -+} -+ - static void test_D3DX10UnsetAllDeviceObjects(void) - { - static const D3D10_INPUT_ELEMENT_DESC layout_desc[] = -@@ -2480,6 +3021,35 @@ static void test_D3DX10CreateAsyncTextureProcessor(void) - winetest_pop_context(); - } - -+ for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) -+ { -+ const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; -+ D3DX10_IMAGE_LOAD_INFO load_info = test_load_info->load_info; -+ -+ winetest_push_context("Test %u", i); -+ -+ hr = D3DX10CreateAsyncTextureProcessor(device, &load_info, &dp); -+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); -+ -+ hr = ID3DX10DataProcessor_Process(dp, (void *)test_load_info->data, test_load_info->size); -+ todo_wine_if(test_load_info->todo_process_hr) -+ ok(hr == test_load_info->expected_process_hr, "Got unexpected hr %#lx.\n", hr); -+ if (hr == S_OK) -+ { -+ resource = NULL; -+ hr = ID3DX10DataProcessor_CreateDeviceObject(dp, (void **)&resource); -+ todo_wine_if(test_load_info->todo_create_device_object_hr) -+ ok(hr == test_load_info->expected_create_device_object_hr, "Got unexpected hr %#lx.\n", hr); -+ if (SUCCEEDED(hr)) -+ ID3D10Resource_Release(resource); -+ } -+ -+ hr = ID3DX10DataProcessor_Destroy(dp); -+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); -+ -+ winetest_pop_context(); -+ } -+ - CoUninitialize(); - - ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); -@@ -3485,14 +4055,19 @@ static void test_get_image_info(void) - - static void test_create_texture(void) - { -+ static const uint32_t dds_24bit_8_8_mip_level_expected[] = { 0xff0000ff, 0xff00ff00, 0xffff0000, 0xff000000 }; - static const WCHAR test_resource_name[] = L"resource.data"; - static const WCHAR test_filename[] = L"image.data"; -+ D3D10_TEXTURE2D_DESC tex_2d_desc; -+ D3DX10_IMAGE_LOAD_INFO load_info; -+ D3DX10_IMAGE_INFO img_info; - ID3D10Resource *resource; -+ ID3D10Texture2D *tex_2d; - HMODULE resource_module; - ID3D10Device *device; - WCHAR path[MAX_PATH]; -+ uint32_t i, mip_level; - HRESULT hr, hr2; -- unsigned int i; - - device = create_device(); - if (!device) -@@ -3559,6 +4134,114 @@ static void test_create_texture(void) - winetest_pop_context(); - } - -+ for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) -+ { -+ const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; -+ -+ winetest_push_context("Test %u", i); -+ -+ hr2 = 0xdeadbeef; -+ load_info = test_load_info->load_info; -+ hr = D3DX10CreateTextureFromMemory(device, test_load_info->data, test_load_info->size, &load_info, NULL, &resource, &hr2); -+ ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); -+ todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); -+ if (SUCCEEDED(hr)) -+ ID3D10Resource_Release(resource); -+ -+ winetest_pop_context(); -+ } -+ -+ for (i = 0; i < ARRAY_SIZE(test_image_load_info); ++i) -+ { -+ const struct test_image_load_info *test_load_info = &test_image_load_info[i]; -+ -+ winetest_push_context("Test %u", i); -+ -+ load_info = test_load_info->load_info; -+ load_info.pSrcInfo = &img_info; -+ -+ resource = NULL; -+ hr2 = 0xdeadbeef; -+ hr = D3DX10CreateTextureFromMemory(device, test_load_info->data, test_load_info->size, &load_info, NULL, &resource, &hr2); -+ ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); -+ ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); -+ if (SUCCEEDED(hr)) -+ { -+ check_test_image_load_info_resource(resource, test_load_info); -+ ID3D10Resource_Release(resource); -+ } -+ -+ winetest_pop_context(); -+ } -+ -+ /* Check behavior of the FirstMipLevel argument. */ -+ for (i = 0; i < 2; ++i) -+ { -+ winetest_push_context("FirstMipLevel %u", i); -+ memset(&img_info, 0, sizeof(img_info)); -+ set_d3dx10_image_load_info(&load_info, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, i, D3DX10_FROM_FILE, -+ D3D10_USAGE_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, -+ D3DX10_DEFAULT, &img_info); -+ -+ resource = NULL; -+ hr2 = 0xdeadbeef; -+ hr = D3DX10CreateTextureFromMemory(device, dds_24bit_8_8, sizeof(dds_24bit_8_8), &load_info, NULL, &resource, &hr2); -+ ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); -+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); -+ check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, -+ D3DX10_IFF_DDS, FALSE); -+ -+ hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&tex_2d); -+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); -+ -+ ID3D10Texture2D_GetDesc(tex_2d, &tex_2d_desc); -+ check_texture2d_desc_values(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, -+ D3D10_BIND_SHADER_RESOURCE, 0, 0, FALSE); -+ for (mip_level = 0; mip_level < 4; ++mip_level) -+ { -+ winetest_push_context("MipLevel %u", mip_level); -+ todo_wine_if(i && mip_level != 3) check_texture_sub_resource_color(tex_2d, mip_level, NULL, -+ dds_24bit_8_8_mip_level_expected[min(3, mip_level + i)], 0); -+ winetest_pop_context(); -+ } -+ -+ ID3D10Texture2D_Release(tex_2d); -+ ID3D10Resource_Release(resource); -+ winetest_pop_context(); -+ } -+ -+ /* -+ * If FirstMipLevel is set to a value that is larger than the total number -+ * of mip levels in the image, it falls back to 0. -+ */ -+ memset(&img_info, 0, sizeof(img_info)); -+ set_d3dx10_image_load_info(&load_info, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, 5, D3DX10_FROM_FILE, -+ D3D10_USAGE_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, D3DX10_DEFAULT, -+ D3DX10_DEFAULT, &img_info); -+ -+ resource = NULL; -+ hr2 = 0xdeadbeef; -+ hr = D3DX10CreateTextureFromMemory(device, dds_24bit_8_8, sizeof(dds_24bit_8_8), &load_info, NULL, &resource, &hr2); -+ ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); -+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); -+ check_image_info_values(&img_info, 8, 8, 1, 1, 4, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, -+ D3DX10_IFF_DDS, FALSE); -+ -+ hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&tex_2d); -+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); -+ ID3D10Texture2D_GetDesc(tex_2d, &tex_2d_desc); -+ check_texture2d_desc_values(&tex_2d_desc, 8, 8, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_USAGE_DEFAULT, -+ D3D10_BIND_SHADER_RESOURCE, 0, 0, FALSE); -+ for (mip_level = 0; mip_level < 4; ++mip_level) -+ { -+ winetest_push_context("MipLevel %u", mip_level); -+ check_texture_sub_resource_color(tex_2d, mip_level, NULL, dds_24bit_8_8_mip_level_expected[mip_level], 0); -+ winetest_pop_context(); -+ } -+ -+ ID3D10Texture2D_Release(tex_2d); -+ ID3D10Resource_Release(resource); -+ - hr2 = 0xdeadbeef; - add_work_item_count = 0; - hr = D3DX10CreateTextureFromMemory(device, test_image[0].data, test_image[0].size, -@@ -3622,6 +4305,31 @@ static void test_create_texture(void) - winetest_pop_context(); - } - -+ for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) -+ { -+ const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; -+ -+ winetest_push_context("Test %u", i); -+ create_file(test_filename, test_image[i].data, test_image[i].size, path); -+ load_info = test_load_info->load_info; -+ -+ hr2 = 0xdeadbeef; -+ hr = D3DX10CreateTextureFromFileW(device, path, &load_info, NULL, &resource, &hr2); -+ ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); -+ todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); -+ if (SUCCEEDED(hr)) -+ ID3D10Resource_Release(resource); -+ -+ hr = D3DX10CreateTextureFromFileA(device, get_str_a(path), &load_info, NULL, &resource, &hr2); -+ ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); -+ todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); -+ if (SUCCEEDED(hr)) -+ ID3D10Resource_Release(resource); -+ -+ delete_file(test_filename); -+ winetest_pop_context(); -+ } -+ - /* D3DX10CreateTextureFromResource tests */ - - hr2 = 0xdeadbeef; -@@ -3681,6 +4389,34 @@ static void test_create_texture(void) - winetest_pop_context(); - } - -+ for (i = 0; i < ARRAY_SIZE(test_invalid_image_load_info); ++i) -+ { -+ const struct test_invalid_image_load_info *test_load_info = &test_invalid_image_load_info[i]; -+ -+ winetest_push_context("Test %u", i); -+ resource_module = create_resource_module(test_resource_name, test_load_info->data, test_load_info->size); -+ load_info = test_load_info->load_info; -+ -+ hr2 = 0xdeadbeef; -+ hr = D3DX10CreateTextureFromResourceW(device, resource_module, -+ test_resource_name, &load_info, NULL, &resource, &hr2); -+ ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); -+ todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); -+ if (SUCCEEDED(hr)) -+ ID3D10Resource_Release(resource); -+ -+ hr2 = 0xdeadbeef; -+ hr = D3DX10CreateTextureFromResourceA(device, resource_module, -+ get_str_a(test_resource_name), &load_info, NULL, &resource, &hr2); -+ ok(hr == hr2, "Got unexpected hr2 %#lx.\n", hr2); -+ todo_wine_if(test_load_info->todo_hr) ok(hr == test_load_info->expected_hr, "Got unexpected hr %#lx.\n", hr); -+ if (SUCCEEDED(hr)) -+ ID3D10Resource_Release(resource); -+ -+ delete_resource_module(test_resource_name, resource_module); -+ winetest_pop_context(); -+ } -+ - CoUninitialize(); - - ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); --- -2.51.0 - diff --git a/patches/d3dx11_43-D3DX11CreateTextureFromMemory/0009-d3dx10-Create-3D-textures-for-images-representing-3D.patch b/patches/d3dx11_43-D3DX11CreateTextureFromMemory/0009-d3dx10-Create-3D-textures-for-images-representing-3D.patch deleted file mode 100644 index a0cafa07..00000000 --- a/patches/d3dx11_43-D3DX11CreateTextureFromMemory/0009-d3dx10-Create-3D-textures-for-images-representing-3D.patch +++ /dev/null @@ -1,234 +0,0 @@ -From da45b8dd00ab02ba03d8608afdf32085f5d28603 Mon Sep 17 00:00:00 2001 -From: Connor McAdams -Date: Wed, 17 Sep 2025 15:26:50 -0400 -Subject: [PATCH] d3dx10: Create 3D textures for images representing 3D - textures. - -Signed-off-by: Connor McAdams ---- - dlls/d3dx10_43/async.c | 11 +++++- - dlls/d3dx10_43/tests/d3dx10.c | 35 ++++++++++++------ - dlls/d3dx10_43/texture.c | 69 +++++++++++++++++++++++++++-------- - 3 files changed, 86 insertions(+), 29 deletions(-) - -diff --git a/dlls/d3dx10_43/async.c b/dlls/d3dx10_43/async.c -index 62627886804..e2cd14a7736 100644 ---- a/dlls/d3dx10_43/async.c -+++ b/dlls/d3dx10_43/async.c -@@ -322,6 +322,8 @@ struct texture_processor - { - ID3DX10DataProcessor ID3DX10DataProcessor_iface; - ID3D10Device *device; -+ D3DX10_IMAGE_INFO img_info; -+ D3DX10_IMAGE_INFO *img_info_out; - D3DX10_IMAGE_LOAD_INFO load_info; - D3D10_SUBRESOURCE_DATA *resource_data; - }; -@@ -334,6 +336,7 @@ static inline struct texture_processor *texture_processor_from_ID3DX10DataProces - static HRESULT WINAPI texture_processor_Process(ID3DX10DataProcessor *iface, void *data, SIZE_T size) - { - struct texture_processor *processor = texture_processor_from_ID3DX10DataProcessor(iface); -+ HRESULT hr; - - TRACE("iface %p, data %p, size %Iu.\n", iface, data, size); - -@@ -343,7 +346,10 @@ static HRESULT WINAPI texture_processor_Process(ID3DX10DataProcessor *iface, voi - free(processor->resource_data); - processor->resource_data = NULL; - } -- return load_texture_data(data, size, &processor->load_info, &processor->resource_data); -+ hr = load_texture_data(data, size, &processor->load_info, &processor->resource_data); -+ if (SUCCEEDED(hr) && processor->img_info_out) -+ *processor->img_info_out = processor->img_info; -+ return hr; - } - - static HRESULT WINAPI texture_processor_CreateDeviceObject(ID3DX10DataProcessor *iface, void **object) -@@ -594,7 +600,10 @@ HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *device, - object->ID3DX10DataProcessor_iface.lpVtbl = &texture_processor_vtbl; - object->device = device; - ID3D10Device_AddRef(device); -+ if (load_info) -+ object->img_info_out = load_info->pSrcInfo; - init_load_info(load_info, &object->load_info); -+ object->load_info.pSrcInfo = &object->img_info; - - *processor = &object->ID3DX10DataProcessor_iface; - return S_OK; -diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c -index f660b9a2953..818889138a5 100644 ---- a/dlls/d3dx10_43/tests/d3dx10.c -+++ b/dlls/d3dx10_43/tests/d3dx10.c -@@ -20,6 +20,7 @@ - #include "initguid.h" - #include "d3d10_1.h" - #include "d3dx10.h" -+#include "wine/wined3d.h" - #include "wine/test.h" - #include - -@@ -69,6 +70,8 @@ - #define DDS_PF_BUMPLUMINANCE 0x00040000 - #define DDS_PF_BUMPDUDV 0x00080000 - -+static bool wined3d_opengl; -+ - struct dds_pixel_format - { - DWORD size; -@@ -1751,13 +1754,8 @@ static void check_test_image_load_info_resource_(uint32_t line, ID3D10Resource * - HRESULT hr; - - ID3D10Resource_GetType(resource, &resource_dimension); -- todo_wine_if(image_load_info->expected_type == D3D10_RESOURCE_DIMENSION_TEXTURE3D) -- ok(resource_dimension == image_load_info->expected_type, "Got unexpected ResourceDimension %u, expected %u.\n", -- resource_dimension, image_load_info->expected_type); -- -- if (resource_dimension != image_load_info->expected_type) -- return; -- -+ ok(resource_dimension == image_load_info->expected_type, "Got unexpected ResourceDimension %u, expected %u.\n", -+ resource_dimension, image_load_info->expected_type); - switch (resource_dimension) - { - case D3D10_RESOURCE_DIMENSION_TEXTURE2D: -@@ -1826,10 +1824,9 @@ static void check_resource_info(ID3D10Resource *resource, const struct test_imag - } - - ID3D10Resource_GetType(resource, &resource_dimension); -- todo_wine_if (image->expected_info.ResourceDimension == D3D10_RESOURCE_DIMENSION_TEXTURE3D) -- ok(resource_dimension == image->expected_info.ResourceDimension, -- "Got unexpected ResourceDimension %u, expected %u.\n", -- resource_dimension, image->expected_info.ResourceDimension); -+ ok(resource_dimension == image->expected_info.ResourceDimension, -+ "Got unexpected ResourceDimension %u, expected %u.\n", -+ resource_dimension, image->expected_info.ResourceDimension); - - switch (resource_dimension) - { -@@ -2022,7 +2019,10 @@ static void check_resource_data(ID3D10Resource *resource, const struct test_imag - - if (SUCCEEDED(ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture3D, (void **)&texture3d))) - { -- check_texture3d_data(texture3d, image, line); -+ if (wined3d_opengl && is_block_compressed(image->expected_info.Format)) -+ skip("Skipping compressed format 3D texture readback test.\n"); -+ else -+ check_texture3d_data(texture3d, image, line); - ID3D10Texture3D_Release(texture3d); - } - else if (SUCCEEDED(ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&texture2d))) -@@ -5992,6 +5992,17 @@ static void test_preprocess_shader(void) - - START_TEST(d3dx10) - { -+ HMODULE wined3d; -+ -+ if ((wined3d = GetModuleHandleA("wined3d.dll"))) -+ { -+ enum wined3d_renderer (CDECL *p_wined3d_get_renderer)(void); -+ -+ if ((p_wined3d_get_renderer = (void *)GetProcAddress(wined3d, "wined3d_get_renderer")) -+ && p_wined3d_get_renderer() == WINED3D_RENDERER_OPENGL) -+ wined3d_opengl = true; -+ } -+ - test_D3DX10UnsetAllDeviceObjects(); - test_D3DX10CreateAsyncMemoryLoader(); - test_D3DX10CreateAsyncFileLoader(); -diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c -index 4d279bccbd5..a21ce7ff139 100644 ---- a/dlls/d3dx10_43/texture.c -+++ b/dlls/d3dx10_43/texture.c -@@ -439,9 +439,12 @@ static HRESULT create_texture(ID3D10Device *device, const void *data, SIZE_T siz - { - D3D10_SUBRESOURCE_DATA *resource_data; - D3DX10_IMAGE_LOAD_INFO load_info_copy; -+ D3DX10_IMAGE_INFO img_info; - HRESULT hr; - - init_load_info(load_info, &load_info_copy); -+ if (!load_info_copy.pSrcInfo) -+ load_info_copy.pSrcInfo = &img_info; - - if (FAILED((hr = load_texture_data(data, size, &load_info_copy, &resource_data)))) - return hr; -@@ -774,25 +777,59 @@ end: - HRESULT create_d3d_texture(ID3D10Device *device, D3DX10_IMAGE_LOAD_INFO *load_info, - D3D10_SUBRESOURCE_DATA *resource_data, ID3D10Resource **texture) - { -- D3D10_TEXTURE2D_DESC texture_2d_desc; -- ID3D10Texture2D *texture_2d; - HRESULT hr; - -- memset(&texture_2d_desc, 0, sizeof(texture_2d_desc)); -- texture_2d_desc.Width = load_info->Width; -- texture_2d_desc.Height = load_info->Height; -- texture_2d_desc.MipLevels = load_info->MipLevels; -- texture_2d_desc.ArraySize = load_info->MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE ? 6 : 1; -- texture_2d_desc.Format = load_info->Format; -- texture_2d_desc.SampleDesc.Count = 1; -- texture_2d_desc.Usage = load_info->Usage; -- texture_2d_desc.BindFlags = load_info->BindFlags; -- texture_2d_desc.MiscFlags = load_info->MiscFlags; -- -- if (FAILED(hr = ID3D10Device_CreateTexture2D(device, &texture_2d_desc, resource_data, &texture_2d))) -- return hr; -+ *texture = NULL; -+ switch (load_info->pSrcInfo->ResourceDimension) -+ { -+ case D3D10_RESOURCE_DIMENSION_TEXTURE2D: -+ { -+ D3D10_TEXTURE2D_DESC texture_2d_desc = { 0 }; -+ ID3D10Texture2D *texture_2d; -+ -+ texture_2d_desc.Width = load_info->Width; -+ texture_2d_desc.Height = load_info->Height; -+ texture_2d_desc.MipLevels = load_info->MipLevels; -+ texture_2d_desc.ArraySize = load_info->pSrcInfo->ArraySize; -+ texture_2d_desc.Format = load_info->Format; -+ texture_2d_desc.SampleDesc.Count = 1; -+ texture_2d_desc.Usage = load_info->Usage; -+ texture_2d_desc.BindFlags = load_info->BindFlags; -+ texture_2d_desc.CPUAccessFlags = load_info->CpuAccessFlags; -+ texture_2d_desc.MiscFlags = load_info->MiscFlags; -+ -+ if (FAILED(hr = ID3D10Device_CreateTexture2D(device, &texture_2d_desc, resource_data, &texture_2d))) -+ return hr; -+ *texture = (ID3D10Resource *)texture_2d; -+ break; -+ } -+ -+ case D3D10_RESOURCE_DIMENSION_TEXTURE3D: -+ { -+ D3D10_TEXTURE3D_DESC texture_3d_desc = { 0 }; -+ ID3D10Texture3D *texture_3d; -+ -+ texture_3d_desc.Width = load_info->Width; -+ texture_3d_desc.Height = load_info->Height; -+ texture_3d_desc.Depth = load_info->Depth; -+ texture_3d_desc.MipLevels = load_info->MipLevels; -+ texture_3d_desc.Format = load_info->Format; -+ texture_3d_desc.Usage = load_info->Usage; -+ texture_3d_desc.BindFlags = load_info->BindFlags; -+ texture_3d_desc.CPUAccessFlags = load_info->CpuAccessFlags; -+ texture_3d_desc.MiscFlags = load_info->MiscFlags; -+ -+ if (FAILED(hr = ID3D10Device_CreateTexture3D(device, &texture_3d_desc, resource_data, &texture_3d))) -+ return hr; -+ *texture = (ID3D10Resource *)texture_3d; -+ break; -+ } -+ -+ default: -+ FIXME("Unhandled resource dimension %d.\n", load_info->pSrcInfo->ResourceDimension); -+ return E_NOTIMPL; -+ } - -- *texture = (ID3D10Resource *)texture_2d; - return S_OK; - } - --- -2.51.0 - diff --git a/patches/shell32-SHGetStockIconInfo/0001-shell32-Improve-semi-stub-SHGetStockIconInfo-try-fin.patch b/patches/shell32-SHGetStockIconInfo/0001-shell32-Improve-semi-stub-SHGetStockIconInfo-try-fin.patch deleted file mode 100644 index e0077f8f..00000000 --- a/patches/shell32-SHGetStockIconInfo/0001-shell32-Improve-semi-stub-SHGetStockIconInfo-try-fin.patch +++ /dev/null @@ -1,234 +0,0 @@ -From 0d5690ffe44182224aef5488508a8eeb2750e757 Mon Sep 17 00:00:00 2001 -From: Louis Lenders -Date: Fri, 12 Oct 2018 11:57:18 +0200 -Subject: [PATCH] shell32: Improve semi-stub SHGetStockIconInfo, try find - existing iconhandle - -v3: try find handle to existing icon - -this is the best I can come up with for now, on windows afaict all these icons mostly come from imegares.dll -so the attached patch is not really how windows does it - -Fix for bug https://bugs.winehq.org/show_bug.cgi?id=45868 - -Signed-off-by: Louis Lenders ---- - dlls/shell32/iconcache.c | 156 +++++++++++++++++++++++++++++++-- - dlls/shell32/tests/shelllink.c | 15 ++++ - 2 files changed, 164 insertions(+), 7 deletions(-) - -diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c -index 03eea049d0c..4a84b2055fe 100644 ---- a/dlls/shell32/iconcache.c -+++ b/dlls/shell32/iconcache.c -@@ -1021,6 +1021,119 @@ INT WINAPI SHGetIconOverlayIndexW(LPCWSTR pszIconPath, INT iIconIndex) - return -1; - } - -+/**************************************************************************** -+ * For SHGetStockIconInfo -+ */ -+typedef struct { -+ SHSTOCKICONID id; -+ DWORD iconid; -+} SI_ENTRY; -+ -+static const SI_ENTRY si_table[] = -+{ -+ [0] = { SIID_DOCNOASSOC, IDI_SHELL_FILE}, -+ [1] = { SIID_DOCASSOC, IDI_SHELL_DOCUMENT}, -+ [2] = { SIID_APPLICATION, IDI_SHELL_WINDOW}, -+ [3] = { SIID_FOLDER, IDI_SHELL_FOLDER}, -+ [4] = { SIID_FOLDEROPEN, IDI_SHELL_FOLDER_OPEN}, -+ [5] = { SIID_DRIVE525, 0}, -+ [6] = { SIID_DRIVE35, 0}, -+ [7] = { SIID_DRIVERREMOVE, 0}, -+ [8] = { SIID_DRIVERFIXED, IDI_SHELL_DRIVE}, -+ [9] = { SIID_DRIVERNET, IDI_SHELL_NETDRIVE}, -+ [10] = { SIID_DRIVERNETDISABLE, IDI_SHELL_NETDRIVE2}, -+ [11] = { SIID_DRIVERCD, IDI_SHELL_OPTICAL_DRIVE}, -+ [12] = { SIID_DRIVERRAM, IDI_SHELL_RAMDISK}, -+ [13] = { SIID_WORLD, 0}, -+ /* Missing: 14 */ -+ [15] = { SIID_SERVER, 0}, -+ [16] = { SIID_PRINTER, IDI_SHELL_PRINT}, -+ [17] = { SIID_MYNETWORK, 0}, -+ /* Missing: 18 - 21 */ -+ [22] = { SIID_FIND, 0}, -+ [23] = { SIID_HELP, IDI_SHELL_HELP}, -+ /* Missing: 24 - 27 */ -+ [28] = {SIID_SHARE, 0}, -+ [29] = {SIID_LINK, 0}, -+ [30] = {SIID_SLOWFILE, 0}, -+ [31] = {SIID_RECYCLER, IDI_SHELL_TRASH_FOLDER}, -+ [32] = {SIID_RECYCLERFULL, IDI_SHELL_FULL_RECYCLE_BIN}, -+ /* Missing: 33 - 39 */ -+ [40] = {SIID_MEDIACDAUDIO, 0}, -+ /* Missing: 41 - 46 */ -+ [47] = {SIID_LOCK, IDI_SHELL_PASSWORDS}, -+ /* Missing: 48 */ -+ [49] = {SIID_AUTOLIST, 0}, -+ [50] = {SIID_PRINTERNET, 0}, -+ [51] = {SIID_SERVERSHARE, 0}, -+ [52] = {SIID_PRINTERFAX, 0}, -+ [53] = {SIID_PRINTERFAXNET, 0}, -+ [54] = {SIID_PRINTERFILE, 0}, -+ [55] = {SIID_STACK, 0}, -+ [56] = {SIID_MEDIASVCD, 0}, -+ [57] = {SIID_STUFFEDFOLDER, 0}, -+ [58] = {SIID_DRIVEUNKNOWN, 0}, -+ [59] = {SIID_DRIVEDVD, 0}, -+ [60] = {SIID_MEDIADVD, 0}, -+ [61] = {SIID_MEDIADVDRAM, 0}, -+ [62] = {SIID_MEDIADVDRW, 0}, -+ [63] = {SIID_MEDIADVDR, 0}, -+ [64] = {SIID_MEDIADVDROM, 0}, -+ [65] = {SIID_MEDIACDAUDIOPLUS, 0}, -+ [66] = {SIID_MEDIACDRW, 0}, -+ [67] = {SIID_MEDIACDR, 0}, -+ [68] = {SIID_MEDIACDBURN, 0}, -+ [69] = {SIID_MEDIABLANKCD, 0}, -+ [70] = {SIID_MEDIACDROM, 0}, -+ [71] = {SIID_AUDIOFILES, IDI_SHELL_AUDIO_FILE}, -+ [72] = {SIID_IMAGEFILES, IDI_SHELL_IMAGE_FILE}, -+ [73] = {SIID_VIDEOFILES, IDI_SHELL_VIDEO_FILE}, -+ [74] = {SIID_MIXEDFILES, 0}, -+ [75] = {SIID_FOLDERBACK, 0}, -+ [76] = {SIID_FOLDERFRONT, 0}, -+ [77] = {SIID_SHIELD, 0}, -+ [78] = {SIID_WARNING, 0}, -+ [79] = {SIID_INFO, 0}, -+ [80] = {SIID_ERROR, 0}, -+ [81] = {SIID_KEY, 0}, -+ [82] = {SIID_SOFTWARE, 0}, -+ [83] = {SIID_RENAME, IDI_SHELL_RENAME}, -+ [84] = {SIID_DELETE, IDI_SHELL_CONFIRM_DELETE}, -+ [85] = {SIID_MEDIAAUDIODVD, 0}, -+ [86] = {SIID_MEDIAMOVIEDVD, 0}, -+ [87] = {SIID_MEDIAENHANCEDCD, 0}, -+ [88] = {SIID_MEDIAENHANCEDDVD, 0}, -+ [89] = {SIID_MEDIAHDDVD, 0}, -+ [90] = {SIID_MEDIABLUERAY, 0}, -+ [91] = {SIID_MEDIAVCD, 0}, -+ [92] = {SIID_MEDIADVDPLUSR, 0}, -+ [93] = {SIID_MEDIADVDPLUSRW, 0}, -+ [94] = {SIID_DESKTOPPC, IDI_SHELL_MY_COMPUTER}, -+ [95] = {SIID_MOBILEPC, 0}, -+ [96] = {SIID_USERS, IDI_SHELL_USERS}, -+ [97] = {SIID_MEDIASMARTMEDIA, 0}, -+ [98] = {SIID_MEDIACOMPACTFLASH, 0}, -+ [99] = {SIID_DEVICECELLPHONE, 0}, -+ [100] = {SIID_DEVICECAMERA, 0}, -+ [101] = {SIID_DEVICEVIDEOCAMERA, 0}, -+ [102] = {SIID_DEVICEAUDIOPLAYER, 0}, -+ [103] = {SIID_NETWORKCONNECT, 0}, -+ [104] = {SIID_INTERNET, IDI_SHELL_WEB_BROWSER}, -+ [105] = {SIID_ZIPFILE, 0}, -+ [106] = {SIID_SETTINGS, IDI_SHELL_SETTINGS}, -+ /* Missing: 107 - 131 */ -+ [132] = {SIID_DRIVEHDDVD, 0}, -+ [133] = {SIID_DRIVEBD, 0}, -+ [134] = {SIID_MEDIAHDDVDROM, 0}, -+ [135] = {SIID_MEDIAHDDVDR, 0}, -+ [136] = {SIID_MEDIAHDDVDRAM, 0}, -+ [137] = {SIID_MEDIABDROM, 0}, -+ [138] = {SIID_MEDIABDR, 0}, -+ [139] = {SIID_MEDIABDRE, 0}, -+ [140] = {SIID_CLUSTEREDDRIVE, 0} -+ /* Missing: 141 - 180 and SIID_MAX_ICONS = 181*/ -+ }; -+ - /**************************************************************************** - * SHGetStockIconInfo [SHELL32.@] - * -@@ -1038,25 +1151,54 @@ INT WINAPI SHGetIconOverlayIndexW(LPCWSTR pszIconPath, INT iIconIndex) - */ - HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO *sii) - { -- FIXME("(%d, 0x%x, %p) semi-stub\n", id, flags, sii); -+ HMODULE hmod; -+ -+ TRACE("(%d, 0x%x, %p)\n", id, flags, sii); -+ - if ((id < 0) || (id >= SIID_MAX_ICONS) || !sii || (sii->cbSize != sizeof(SHSTOCKICONINFO))) { - return E_INVALIDARG; - } - - GetSystemDirectoryW(sii->szPath, MAX_PATH); -- -- /* no icons defined: use default */ -- sii->iIcon = -IDI_SHELL_FILE; - lstrcatW(sii->szPath, L"\\shell32.dll"); - -- if (flags) -- FIXME("flags 0x%x not implemented\n", flags); -- - sii->hIcon = NULL; - if (flags & SHGSI_ICON) - sii->hIcon = LoadIconW(GetModuleHandleW(sii->szPath), MAKEINTRESOURCEW(sii->iIcon)); - sii->iSysImageIndex = -1; - -+ /* this is not how windows does it, on windows picked mostly from imageres.dll !*/ -+ if (si_table[id].iconid) -+ sii->iIcon = sii->iSysImageIndex - si_table[id].id; -+ else -+ { -+ FIXME("Couldn`t find SIID %d, returning default values (IDI_SHELL_FILE)\n", id); -+ sii->iIcon = sii->iSysImageIndex - IDI_SHELL_FILE; -+ } -+ -+ if (flags & SHGSI_ICON) -+ { -+ flags &= ~SHGSI_ICON; -+ -+ hmod = GetModuleHandleW(L"shell32.dll"); -+ if (hmod) -+ { -+ if (si_table[id].iconid) -+ sii->hIcon = LoadIconW(hmod, MAKEINTRESOURCEW(si_table[id].iconid)); -+ else -+ sii->hIcon = LoadIconW(hmod, MAKEINTRESOURCEW(IDI_SHELL_FILE)); -+ } -+ -+ if (!sii->hIcon) -+ { -+ ERR("failed to get an icon handle\n"); -+ return E_INVALIDARG; -+ } -+ } -+ -+ if (flags) -+ FIXME("flags 0x%x not implemented\n", flags); -+ - TRACE("%3d: returning %s (%d)\n", id, debugstr_w(sii->szPath), sii->iIcon); - - return S_OK; -diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c -index f13155ade2f..c70bc9d5946 100644 ---- a/dlls/shell32/tests/shelllink.c -+++ b/dlls/shell32/tests/shelllink.c -@@ -1119,6 +1119,21 @@ static void test_SHGetStockIconInfo(void) - /* there is a NULL check for the struct */ - hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, NULL); - ok(hr == E_INVALIDARG, "NULL: got 0x%lx\n", hr); -+ -+ for(i = 0; i < 140; i++) /* highest on wvista, i > 140 gives E_INVALIDARG, win7 can go higher */ -+ { -+ memset(buffer, 0, sizeof(buffer)); -+ sii->cbSize = sizeof(SHSTOCKICONINFO); -+ hr = pSHGetStockIconInfo(i, SHGSI_ICON | SHGSI_SMALLICON, sii); -+ ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr); -+ ok(sii->hIcon != NULL, "got NULL, expected an icon handle\n"); -+ ok(sii->iIcon != 0, "got unexpected 0 for SIID %d\n", i); /* howto find out exact sii->iIcon value??? */ -+ ok(sii->iSysImageIndex == -1, "got %d (expected -1)\n", sii->iSysImageIndex); -+ ok(DestroyIcon(sii->hIcon), "DestroyIcon failed\n"); -+ if (winetest_debug > 1) -+ trace("%3d: got iSysImageIndex %3d, iIcon %3d and %s\n", i, sii->iSysImageIndex, -+ sii->iIcon, wine_dbgstr_w(sii->szPath)); -+ } - } - - static void test_SHExtractIcons(void) --- -2.43.0 - diff --git a/patches/shell32-SHGetStockIconInfo/definition b/patches/shell32-SHGetStockIconInfo/definition deleted file mode 100644 index eb4ab237..00000000 --- a/patches/shell32-SHGetStockIconInfo/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [45868] Improve semi-stub SHGetStockIconInfo diff --git a/staging/upstream-commit b/staging/upstream-commit index 147bc223..ae476728 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -c1bafaa02329442df1aba576e2884c0ab699f76e +2827471c57299793d8e0868679184f8d762a5309