From bfebdf34eb36bbb2bf81a923e9be1c6f0cc235ef Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 27 Feb 2016 00:58:54 +0100 Subject: [PATCH] Added patch to fix implementation of compobj.dll16.StringFromGUID2 function. --- ...ringFromGUID2-must-write-a-char-stri.patch | 45 +++++++++++++++++++ .../compobj.dll16-StringFromGUID2/definition | 1 + patches/patchinstall.sh | 16 +++++++ 3 files changed, 62 insertions(+) create mode 100644 patches/compobj.dll16-StringFromGUID2/0001-compobj.dll16-StringFromGUID2-must-write-a-char-stri.patch create mode 100644 patches/compobj.dll16-StringFromGUID2/definition diff --git a/patches/compobj.dll16-StringFromGUID2/0001-compobj.dll16-StringFromGUID2-must-write-a-char-stri.patch b/patches/compobj.dll16-StringFromGUID2/0001-compobj.dll16-StringFromGUID2-must-write-a-char-stri.patch new file mode 100644 index 00000000..3061218f --- /dev/null +++ b/patches/compobj.dll16-StringFromGUID2/0001-compobj.dll16-StringFromGUID2-must-write-a-char-stri.patch @@ -0,0 +1,45 @@ +From 9bfa901639b950dbfb16c67fe881f742445b30da Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 27 Feb 2016 00:49:36 +0100 +Subject: compobj.dll16: StringFromGUID2 must write a char string into the + buffer. + +--- + dlls/compobj.dll16/compobj.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/dlls/compobj.dll16/compobj.c b/dlls/compobj.dll16/compobj.c +index 6261c13..9ec8556 100644 +--- a/dlls/compobj.dll16/compobj.c ++++ b/dlls/compobj.dll16/compobj.c +@@ -54,6 +54,7 @@ typedef LPCSTR LPCOLESTR16; + #define STDMETHOD16(m) HRESULT (STDMETHOD16CALLTYPE *m) + #define STDMETHOD16_(t,m) t (STDMETHOD16CALLTYPE *m) + ++#define CHARS_IN_GUID 39 + + /*********************************************************************** + * IMalloc16 interface +@@ -689,9 +690,17 @@ HRESULT WINAPI CLSIDFromProgID16(LPCOLESTR16 progid, LPCLSID riid) + /****************************************************************************** + * StringFromGUID2 [COMPOBJ.76] + */ +-INT WINAPI StringFromGUID216(REFGUID id, LPOLESTR str, INT cmax) ++INT WINAPI StringFromGUID216(REFGUID id, LPOLESTR16 str, INT cmax) + { +- return StringFromGUID2( id, str, cmax ); ++ static const char format[] = "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"; ++ ++ if (!id || cmax < CHARS_IN_GUID) return 0; ++ ++ sprintf( str, format, id->Data1, id->Data2, id->Data3, ++ id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3], ++ id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] ); ++ ++ return CHARS_IN_GUID; + } + + +-- +2.7.1 + diff --git a/patches/compobj.dll16-StringFromGUID2/definition b/patches/compobj.dll16-StringFromGUID2/definition new file mode 100644 index 00000000..a74c722c --- /dev/null +++ b/patches/compobj.dll16-StringFromGUID2/definition @@ -0,0 +1 @@ +Fixes: Fix implementation of compobj.dll16.StringFromGUID2 function diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 72347d02..1e25e156 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -100,6 +100,7 @@ patch_enable_all () enable_comctl32_Button_Theming="$1" enable_comctl32_PROPSHEET_InsertPage="$1" enable_comctl32_TTM_ADDTOOLW="$1" + enable_compobj_dll16_StringFromGUID2="$1" enable_configure_Absolute_RPATH="$1" enable_crypt32_CMS_Certificates="$1" enable_crypt32_CryptUnprotectMemory="$1" @@ -446,6 +447,9 @@ patch_enable () comctl32-TTM_ADDTOOLW) enable_comctl32_TTM_ADDTOOLW="$2" ;; + compobj.dll16-StringFromGUID2) + enable_compobj_dll16_StringFromGUID2="$2" + ;; configure-Absolute_RPATH) enable_configure_Absolute_RPATH="$2" ;; @@ -2823,6 +2827,18 @@ if test "$enable_comctl32_TTM_ADDTOOLW" -eq 1; then ) >> "$patchlist" fi +# Patchset compobj.dll16-StringFromGUID2 +# | +# | Modified files: +# | * dlls/compobj.dll16/compobj.c +# | +if test "$enable_compobj_dll16_StringFromGUID2" -eq 1; then + patch_apply compobj.dll16-StringFromGUID2/0001-compobj.dll16-StringFromGUID2-must-write-a-char-stri.patch + ( + echo '+ { "Michael Müller", "compobj.dll16: StringFromGUID2 must write a char string into the buffer.", 1 },'; + ) >> "$patchlist" +fi + # Patchset configure-Absolute_RPATH # | # | This patchset fixes the following Wine bugs: