From 1ff09d87c5f64d7a40f8df627ee22eb4dcfce3df Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 31 Jul 2014 11:15:26 -0600 Subject: [PATCH] Added patch to fix edge cases in TOOLTIPS_GetTipText. --- README.md | 1 + debian/changelog | 1 + patches/Makefile | 20 +++++++++++ ...TipText-when-a-resource-cannot-be-fo.patch | 34 ++++++++++++++++++ ...TipText-when-a-NULL-instance-is-used.patch | 35 +++++++++++++++++++ patches/user32-GetTipText/definition | 4 +++ 6 files changed, 95 insertions(+) create mode 100644 patches/user32-GetTipText/0001-Fix-TOOLTIPS_GetTipText-when-a-resource-cannot-be-fo.patch create mode 100644 patches/user32-GetTipText/0002-Fix-TOOLTIPS_GetTipText-when-a-NULL-instance-is-used.patch create mode 100644 patches/user32-GetTipText/definition diff --git a/README.md b/README.md index a7a6482a..0d061434 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ Wine-Compholio contains fixes for the following Wine bugs: * Support for GetSystemTimes ([Wine Bug #19813](http://bugs.winehq.org/show_bug.cgi?id=19813 "Voddler needs GetSystemTimes to run")) * Support for Junction Points ([Wine Bug #12401](http://bugs.winehq.org/show_bug.cgi?id=12401 "Support junction points, i.e. DeviceIoCtl(FSCTL_SET_REPARSE_POINT/FSCTL_GET_REPARSE_POINT)")) * Support for PulseAudio backend for audio ([Wine Bug #10495](http://bugs.winehq.org/show_bug.cgi?id=10495 "Wine should support PulseAudio")) +* Support for TOOLTIPS_GetTipText edge cases ([Wine Bug #30648](http://bugs.winehq.org/show_bug.cgi?id=30648 "SEGA Genesis / Mega Drive Classic Collection (Steam) crashes on startup")) * Support for TransmitFile ([Wine Bug #5048](http://bugs.winehq.org/show_bug.cgi?id=5048 "Multiple applications and games need support for ws2_32 SIO_GET_EXTENSION_FUNCTION_POINTER TransmitFile (WSAID_TRANSMITFILE)")) * Support for [Get|Set]SystemFileCacheSize ([Wine Bug #35886](http://bugs.winehq.org/show_bug.cgi?id=35886 "Lotus Notes 9 'cacheset.exe' utility needs KERNEL32.dll.SetSystemFileCacheSize")) * Support for inherited file ACLs ([Wine Bug #34406](http://bugs.winehq.org/show_bug.cgi?id=34406 "Finale Notepad 2012 doesn't copy/create user files on program start")) diff --git a/debian/changelog b/debian/changelog index dcc91de8..0fa9d80f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ wine-compholio (1.7.24) UNRELEASED; urgency=low * Added patch to implement GetSystemTimes. * Added patch to implement SHCreateSessionKey. * Added patch to create AppData\LocalLow directory. + * Added patch to fix edge cases in TOOLTIPS_GetTipText. * Added patch to allow special characters in pipe names. * Added patch with stubs for [Get|Set]SystemFileCacheSize. * Added patch to implement AllocateAndGetTcpExTableFromStack. diff --git a/patches/Makefile b/patches/Makefile index a2fda562..686aad06 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -32,6 +32,7 @@ PATCHLIST := Miscellaneous.ok \ shell32-SHCreateSessionKey.ok \ shlwapi-UrlCombine.ok \ strmbase-Lock_Race_Conditions.ok \ + user32-GetTipText.ok \ wineboot-HKEY_DYN_DATA.ok \ winepulse-PulseAudio_Support.ok \ winex11-XEMBED.ok \ @@ -579,6 +580,25 @@ strmbase-Lock_Race_Conditions.ok: echo '+ { "strmbase-Lock_Race_Conditions", "Erich E. Hoover", "Fix possible race conditions in strmbase/quartz." },'; \ ) > strmbase-Lock_Race_Conditions.ok +# Patchset user32-GetTipText +# | +# | Included patches: +# | * Handle TOOLTIPS_GetTipText edge cases. [by Erich E. Hoover] +# | +# | This patchset fixes the following Wine bugs: +# | * [#30648] SEGA Genesis / Mega Drive Classic Collection (Steam) crashes on startup +# | +# | Modified files: +# | * dlls/comctl32/tooltips.c +# | +.INTERMEDIATE: user32-GetTipText.ok +user32-GetTipText.ok: + $(PATCH) < user32-GetTipText/0001-Fix-TOOLTIPS_GetTipText-when-a-resource-cannot-be-fo.patch + $(PATCH) < user32-GetTipText/0002-Fix-TOOLTIPS_GetTipText-when-a-NULL-instance-is-used.patch + @( \ + echo '+ { "user32-GetTipText", "Erich E. Hoover", "Handle TOOLTIPS_GetTipText edge cases." },'; \ + ) > user32-GetTipText.ok + # Patchset wineboot-HKEY_DYN_DATA # | # | Included patches: diff --git a/patches/user32-GetTipText/0001-Fix-TOOLTIPS_GetTipText-when-a-resource-cannot-be-fo.patch b/patches/user32-GetTipText/0001-Fix-TOOLTIPS_GetTipText-when-a-resource-cannot-be-fo.patch new file mode 100644 index 00000000..df407e07 --- /dev/null +++ b/patches/user32-GetTipText/0001-Fix-TOOLTIPS_GetTipText-when-a-resource-cannot-be-fo.patch @@ -0,0 +1,34 @@ +From f9894bb1a114f2e3d87b153815e37cedb3b6b31b Mon Sep 17 00:00:00 2001 +From: "Erich E. Hoover" +Date: Sun, 27 Jul 2014 09:12:15 -0600 +Subject: Fix TOOLTIPS_GetTipText when a resource cannot be found. + +Based on patch by Nikolay Sivov. +--- + dlls/comctl32/tooltips.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c +index f74ea65..b44ccc5 100644 +--- a/dlls/comctl32/tooltips.c ++++ b/dlls/comctl32/tooltips.c +@@ -484,6 +484,8 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer) + { + TTTOOL_INFO *toolPtr = &infoPtr->tools[nTool]; + ++ /* always NULL-terminate the buffer, just in case we fail to load the string */ ++ buffer[0] = '\0'; + if (IS_INTRESOURCE(toolPtr->lpszText) && toolPtr->hinst) { + /* load a resource */ + TRACE("load res string %p %x\n", +@@ -505,7 +507,6 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer) + } + else { + /* no text available */ +- buffer[0] = '\0'; + } + + TRACE("%s\n", debugstr_w(buffer)); +-- +1.7.9.5 + diff --git a/patches/user32-GetTipText/0002-Fix-TOOLTIPS_GetTipText-when-a-NULL-instance-is-used.patch b/patches/user32-GetTipText/0002-Fix-TOOLTIPS_GetTipText-when-a-NULL-instance-is-used.patch new file mode 100644 index 00000000..6fafc029 --- /dev/null +++ b/patches/user32-GetTipText/0002-Fix-TOOLTIPS_GetTipText-when-a-NULL-instance-is-used.patch @@ -0,0 +1,35 @@ +From 1491fbb70dc29e603a466f85311fc96ee95f0b5c Mon Sep 17 00:00:00 2001 +From: "Erich E. Hoover" +Date: Sun, 27 Jul 2014 09:12:50 -0600 +Subject: Fix TOOLTIPS_GetTipText when a NULL instance is used. + +Based on patch by Nikolay Sivov. +--- + dlls/comctl32/tooltips.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c +index b44ccc5..c3e28bb 100644 +--- a/dlls/comctl32/tooltips.c ++++ b/dlls/comctl32/tooltips.c +@@ -486,12 +486,11 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer) + + /* always NULL-terminate the buffer, just in case we fail to load the string */ + buffer[0] = '\0'; +- if (IS_INTRESOURCE(toolPtr->lpszText) && toolPtr->hinst) { +- /* load a resource */ +- TRACE("load res string %p %x\n", +- toolPtr->hinst, LOWORD(toolPtr->lpszText)); +- LoadStringW (toolPtr->hinst, LOWORD(toolPtr->lpszText), +- buffer, INFOTIPSIZE); ++ if (IS_INTRESOURCE(toolPtr->lpszText)) { ++ HINSTANCE hinst = toolPtr->hinst ? toolPtr->hinst : GetModuleHandleW(NULL); ++ /* load a resource */ ++ TRACE("load res string %p %x\n", hinst, LOWORD(toolPtr->lpszText)); ++ LoadStringW (hinst, LOWORD(toolPtr->lpszText), buffer, INFOTIPSIZE); + } + else if (toolPtr->lpszText) { + if (toolPtr->lpszText == LPSTR_TEXTCALLBACKW) { +-- +1.7.9.5 + diff --git a/patches/user32-GetTipText/definition b/patches/user32-GetTipText/definition new file mode 100644 index 00000000..eeab8bf7 --- /dev/null +++ b/patches/user32-GetTipText/definition @@ -0,0 +1,4 @@ +Author: Erich E. Hoover +Subject: Handle TOOLTIPS_GetTipText edge cases. +Revision: 1 +Fixes: [30648] Support for TOOLTIPS_GetTipText edge cases