Added patch with workaround for Windows 3.1 apps which call LoadImage(LR_LOADFROMFILE) with a resource id.

This commit is contained in:
Sebastian Lackner 2016-05-21 15:07:54 +02:00
parent f10c1d3c42
commit 5d32e6fc71
4 changed files with 56 additions and 4 deletions

View File

@ -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:

View File

@ -0,0 +1,32 @@
From 0eda0c4092b0673e4b4e646388c53e2a8ecc2379 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
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

View File

@ -0,0 +1 @@
Fixes: [24963] Workaround for Windows 3.1 apps which call LoadImage(LR_LOADFROMFILE) with a resource id

View File

@ -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. */