From c83e83b91102db484a6085a94c107fbe377e0e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 7 Sep 2014 20:26:44 +0200 Subject: [PATCH] Add patch for GetMenuItemInfo. --- README.md | 3 +- patches/Makefile | 19 ++++++++++++ ...cch-member-in-GetMenuItemInfo-when-p.patch | 31 +++++++++++++++++++ patches/user32-GetMenuItemInfo/definition | 4 +++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 patches/user32-GetMenuItemInfo/0001-user32-Also-set-cch-member-in-GetMenuItemInfo-when-p.patch create mode 100644 patches/user32-GetMenuItemInfo/definition diff --git a/README.md b/README.md index a427adcc..16d39573 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,10 @@ Wine. All those differences are also documented on the Included bugfixes and improvements ================================== -**Bugfixes and features included in the next upcoming release [5]:** +**Bugfixes and features included in the next upcoming release [6]:** * Fix unintentional leaks with ntdll internals +* Fix unitialized cch value when calling GetMenuItemInfo with a null pointer ([Wine Bug #34642](http://bugs.winehq.org/show_bug.cgi?id=34642 "Adobe Premiere Pro 2.0 exits silently on startup ('GetMenuItemInfo' must zero out 'cch' if mask doesn't specify 'MIIM_TYPE')")) * Improvement for heap allocation performance * Support for DOS hidden/system file attributes ([Wine Bug #9158](http://bugs.winehq.org/show_bug.cgi?id=9158 "Multiple Microsoft development tools online/web installers fail to skip \"$shtdwn$.req\" with FILE_ATTRIBUTE_HIDDEN (Visual Studio Express Editions, .NET Framework 3.0)")) * Support for setcap on wine-preloader ([Wine Bug #26256](http://bugs.winehq.org/show_bug.cgi?id=26256 "wine64-preloader can't handle setcap cap_net_raw+epi")) diff --git a/patches/Makefile b/patches/Makefile index 663839f6..3c0cdb43 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -63,6 +63,7 @@ PATCHLIST := \ shell32-RunDLL_CallEntry16.ok \ shell32-SHCreateSessionKey.ok \ shlwapi-UrlCombine.ok \ + user32-GetMenuItemInfo.ok \ user32-GetSystemMetrics.ok \ user32-GetTipText.ok \ user32-WndProc.ok \ @@ -991,6 +992,24 @@ shlwapi-UrlCombine.ok: echo '+ { "shlwapi-UrlCombine", "Sebastian Lackner", "Workaround for broken implementation of shlwapi url functions." },'; \ ) > shlwapi-UrlCombine.ok +# Patchset user32-GetMenuItemInfo +# | +# | Included patches: +# | * Also set cch member in GetMenuItemInfo when passing a null pointer. [by Michael Müller] +# | +# | This patchset fixes the following Wine bugs: +# | * [#34642] Fix unitialized cch value when calling GetMenuItemInfo with a null pointer +# | +# | Modified files: +# | * dlls/user32/menu.c +# | +.INTERMEDIATE: user32-GetMenuItemInfo.ok +user32-GetMenuItemInfo.ok: + $(call APPLY_FILE,user32-GetMenuItemInfo/0001-user32-Also-set-cch-member-in-GetMenuItemInfo-when-p.patch) + @( \ + echo '+ { "user32-GetMenuItemInfo", "Michael Müller", "Also set cch member in GetMenuItemInfo when passing a null pointer." },'; \ + ) > user32-GetMenuItemInfo.ok + # Patchset user32-GetSystemMetrics # | # | Included patches: diff --git a/patches/user32-GetMenuItemInfo/0001-user32-Also-set-cch-member-in-GetMenuItemInfo-when-p.patch b/patches/user32-GetMenuItemInfo/0001-user32-Also-set-cch-member-in-GetMenuItemInfo-when-p.patch new file mode 100644 index 00000000..0d345444 --- /dev/null +++ b/patches/user32-GetMenuItemInfo/0001-user32-Also-set-cch-member-in-GetMenuItemInfo-when-p.patch @@ -0,0 +1,31 @@ +From c91c8456d92e0761f0b6df345c4547b54db63d86 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sun, 7 Sep 2014 20:14:36 +0200 +Subject: user32: Also set cch member in GetMenuItemInfo when passing a null + pointer. + +--- + dlls/user32/menu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c +index 93bee49..9e05dd4 100644 +--- a/dlls/user32/menu.c ++++ b/dlls/user32/menu.c +@@ -4583,12 +4583,12 @@ static BOOL GetMenuItemInfo_common ( HMENU hmenu, UINT item, BOOL bypos, + if ((lpmii->fMask & (MIIM_TYPE|MIIM_STRING))) { + if( !menu->text ) { + if(lpmii->dwTypeData && lpmii->cch) { +- lpmii->cch = 0; + if( unicode) + *((WCHAR *)lpmii->dwTypeData) = 0; + else + *((CHAR *)lpmii->dwTypeData) = 0; + } ++ lpmii->cch = 0; + } else { + int len; + if (unicode) +-- +1.9.1 + diff --git a/patches/user32-GetMenuItemInfo/definition b/patches/user32-GetMenuItemInfo/definition new file mode 100644 index 00000000..09f2a6ab --- /dev/null +++ b/patches/user32-GetMenuItemInfo/definition @@ -0,0 +1,4 @@ +Author: Michael Müller +Subject: Also set cch member in GetMenuItemInfo when passing a null pointer. +Revision: 1 +Fixes: [34642] Fix unitialized cch value when calling GetMenuItemInfo with a null pointer