Added patch to use CONTAINING_RECORD in user.exe16 instead of reimplementing it.

This commit is contained in:
Sebastian Lackner 2016-03-25 23:18:46 +01:00
parent 980743ad37
commit 450495f319
2 changed files with 44 additions and 0 deletions

View File

@ -322,6 +322,7 @@ patch_enable_all ()
enable_stdole32_tlb_SLTG_Typelib="$1"
enable_taskmgr_Memory_Usage="$1"
enable_ucrtbase_Functions="$1"
enable_user_exe16_CONTAINING_RECORD="$1"
enable_user_exe16_DlgDirList="$1"
enable_user32_DeferWindowPos="$1"
enable_user32_Dialog_Paint_Event="$1"
@ -1141,6 +1142,9 @@ patch_enable ()
ucrtbase-Functions)
enable_ucrtbase_Functions="$2"
;;
user.exe16-CONTAINING_RECORD)
enable_user_exe16_CONTAINING_RECORD="$2"
;;
user.exe16-DlgDirList)
enable_user_exe16_DlgDirList="$2"
;;
@ -6641,6 +6645,18 @@ if test "$enable_ucrtbase_Functions" -eq 1; then
) >> "$patchlist"
fi
# Patchset user.exe16-CONTAINING_RECORD
# |
# | Modified files:
# | * dlls/user.exe16/user.c
# |
if test "$enable_user_exe16_CONTAINING_RECORD" -eq 1; then
patch_apply user.exe16-CONTAINING_RECORD/0001-user.exe16-Don-t-open-code-CONTAINING_RECORD.patch
(
echo '+ { "Sebastian Lackner", "user.exe16: Don'\''t open code CONTAINING_RECORD.", 1 },';
) >> "$patchlist"
fi
# Patchset user.exe16-DlgDirList
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,28 @@
From b5e42836311fa14c38917f63e8c18a7cf245344f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 25 Mar 2016 23:15:28 +0100
Subject: user.exe16: Don't open code CONTAINING_RECORD.
---
dlls/user.exe16/user.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/user.exe16/user.c b/dlls/user.exe16/user.c
index aba797d..376c521 100644
--- a/dlls/user.exe16/user.c
+++ b/dlls/user.exe16/user.c
@@ -87,10 +87,7 @@ static BOOL CALLBACK gray_string_callback( HDC hdc, LPARAM param, INT len )
/* callback for 16-bit gray string proc with string pointer */
static BOOL CALLBACK gray_string_callback_ptr( HDC hdc, LPARAM param, INT len )
{
- const struct gray_string_info *info;
- char *str = (char *)param;
-
- info = (struct gray_string_info *)(str - offsetof( struct gray_string_info, str ));
+ const struct gray_string_info *info = CONTAINING_RECORD( (void *)param, struct gray_string_info, str );
return gray_string_callback( hdc, (LPARAM)info, len );
}
--
2.7.1