Added patch to fix implementation of compobj.dll16.StringFromGUID2 function.

This commit is contained in:
Sebastian Lackner 2016-02-27 00:58:54 +01:00
parent bdf73385f7
commit bfebdf34eb
3 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,45 @@
From 9bfa901639b950dbfb16c67fe881f742445b30da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
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

View File

@ -0,0 +1 @@
Fixes: Fix implementation of compobj.dll16.StringFromGUID2 function

View File

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