From 5d32e6fc714bf5f7224efcf801e66357e5b7c296 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 21 May 2016 15:07:54 +0200 Subject: [PATCH] Added patch with workaround for Windows 3.1 apps which call LoadImage(LR_LOADFROMFILE) with a resource id. --- patches/patchinstall.sh | 21 +++++++++++- ...karound-for-Windows-3.1-apps-which-c.patch | 32 +++++++++++++++++++ patches/user32-LR_LOADFROMFILE/definition | 1 + .../wined3d-CSMT_Main/9999-IfDefined.patch | 6 ++-- 4 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 patches/user32-LR_LOADFROMFILE/0001-user32-Add-a-workaround-for-Windows-3.1-apps-which-c.patch create mode 100644 patches/user32-LR_LOADFROMFILE/definition diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 78eddf37..bfe5b258 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "9a80284e1a886ff7e01d33f68715c9bfdb773459" + echo "e36a7e5da441be201ceb3b576999198998ad5b43" } # Show version information @@ -333,6 +333,7 @@ patch_enable_all () enable_user32_DrawTextExW="$1" enable_user32_GetSystemMetrics="$1" enable_user32_Invalidate_Key_State="$1" + enable_user32_LR_LOADFROMFILE="$1" enable_user32_ListBox_Size="$1" enable_user32_MessageBox_WS_EX_TOPMOST="$1" enable_user32_Mouse_Message_Hwnd="$1" @@ -1176,6 +1177,9 @@ patch_enable () user32-Invalidate_Key_State) enable_user32_Invalidate_Key_State="$2" ;; + user32-LR_LOADFROMFILE) + enable_user32_LR_LOADFROMFILE="$2" + ;; user32-ListBox_Size) enable_user32_ListBox_Size="$2" ;; @@ -6839,6 +6843,21 @@ if test "$enable_user32_Invalidate_Key_State" -eq 1; then ) >> "$patchlist" fi +# Patchset user32-LR_LOADFROMFILE +# | +# | This patchset fixes the following Wine bugs: +# | * [#24963] Workaround for Windows 3.1 apps which call LoadImage(LR_LOADFROMFILE) with a resource id +# | +# | Modified files: +# | * dlls/user32/cursoricon.c +# | +if test "$enable_user32_LR_LOADFROMFILE" -eq 1; then + patch_apply user32-LR_LOADFROMFILE/0001-user32-Add-a-workaround-for-Windows-3.1-apps-which-c.patch + ( + echo '+ { "Dmitry Timoshkov", "user32: Add a workaround for Windows 3.1 apps which call LoadImage(LR_LOADFROMFILE) with a resource id.", 2 },'; + ) >> "$patchlist" +fi + # Patchset user32-ListBox_Size # | # | This patchset fixes the following Wine bugs: diff --git a/patches/user32-LR_LOADFROMFILE/0001-user32-Add-a-workaround-for-Windows-3.1-apps-which-c.patch b/patches/user32-LR_LOADFROMFILE/0001-user32-Add-a-workaround-for-Windows-3.1-apps-which-c.patch new file mode 100644 index 00000000..5562f6ae --- /dev/null +++ b/patches/user32-LR_LOADFROMFILE/0001-user32-Add-a-workaround-for-Windows-3.1-apps-which-c.patch @@ -0,0 +1,32 @@ +From 0eda0c4092b0673e4b4e646388c53e2a8ecc2379 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Wed, 18 May 2016 18:08:24 +0800 +Subject: user32: Add a workaround for Windows 3.1 apps which call + LoadImage(LR_LOADFROMFILE) with a resource id. (v2) + +Fixes #24963. +--- + dlls/user32/cursoricon.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c +index 4f93195..95cc410 100644 +--- a/dlls/user32/cursoricon.c ++++ b/dlls/user32/cursoricon.c +@@ -1404,7 +1404,12 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name, + hInstance, debugstr_w(name), width, height, depth, fCursor, loadflags); + + if ( loadflags & LR_LOADFROMFILE ) /* Load from file */ +- return CURSORICON_LoadFromFile( name, width, height, depth, fCursor, loadflags ); ++ { ++ if (IS_INTRESOURCE(name) && GetProcessVersion(0) < 0x40000) ++ WARN("Windows 3.1 app set LR_LOADFROMFILE without a name, fallback to loading from resource\n"); ++ else ++ return CURSORICON_LoadFromFile( name, width, height, depth, fCursor, loadflags ); ++ } + + if (!hInstance) hInstance = user32_module; /* Load OEM cursor/icon */ + +-- +2.8.0 + diff --git a/patches/user32-LR_LOADFROMFILE/definition b/patches/user32-LR_LOADFROMFILE/definition new file mode 100644 index 00000000..2a5c2dde --- /dev/null +++ b/patches/user32-LR_LOADFROMFILE/definition @@ -0,0 +1 @@ +Fixes: [24963] Workaround for Windows 3.1 apps which call LoadImage(LR_LOADFROMFILE) with a resource id diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index aa954353..b1033be2 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -3865,7 +3865,7 @@ diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c -@@ -2311,7 +2311,11 @@ +@@ -2323,7 +2323,11 @@ string_buffer_free(&buffer); } @@ -3877,7 +3877,7 @@ diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c { HeapFree(GetProcessHeap(), 0, shader->output_signature.elements); HeapFree(GetProcessHeap(), 0, shader->input_signature.elements); -@@ -2580,10 +2584,16 @@ +@@ -2592,10 +2596,16 @@ if (!refcount) { @@ -3894,7 +3894,7 @@ diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c } return refcount; -@@ -2890,7 +2900,11 @@ +@@ -2902,7 +2912,11 @@ UINT i; memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */