Restore ole32-STGPROP patch 0001

This commit is contained in:
Alistair Leslie-Hughes 2019-11-13 16:13:53 +11:00
parent 411f2a9702
commit cec9c7c73e
3 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,37 @@
From 9a73838c005c3bdb74a449bb7afb269112d6ae34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 20 Jan 2017 01:35:05 +0100
Subject: ole32: Correctly parse unicode property storage dictionaries.
---
dlls/ole32/stg_prop.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index a2598832bf1..f952704c7cd 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -1020,15 +1020,18 @@ static HRESULT PropertyStorage_ReadDictionary(PropertyStorage_impl *This,
if (This->codePage != CP_UNICODE)
ptr[cbEntry - 1] = '\0';
else
- *((LPWSTR)ptr + cbEntry / sizeof(WCHAR)) = '\0';
+ ((LPWSTR)ptr)[cbEntry - 1] = 0;
hr = PropertyStorage_StoreNameWithId(This, (char*)ptr, This->codePage, propid);
if (This->codePage == CP_UNICODE)
{
+ /* cbEntry is the number of characters */
+ cbEntry *= 2;
+
/* Unicode entries are padded to DWORD boundaries */
if (cbEntry % sizeof(DWORD))
ptr += sizeof(DWORD) - (cbEntry % sizeof(DWORD));
}
- ptr += sizeof(DWORD) + cbEntry;
+ ptr += cbEntry;
}
return hr;
}
--
2.11.0

View File

@ -0,0 +1 @@
Fixes: [42046] Multiple fixes for ole32 property storage

View File

@ -232,6 +232,7 @@ patch_enable_all ()
enable_nvcuvid_CUDA_Video_Support="$1"
enable_nvencodeapi_Video_Encoder="$1"
enable_ole32_HGLOBALStream="$1"
enable_ole32_STGPROP="$1"
enable_oleaut32_CreateTypeLib="$1"
enable_oleaut32_Load_Save_EMF="$1"
enable_oleaut32_OLEPictureImpl_SaveAsFile="$1"
@ -817,6 +818,9 @@ patch_enable ()
ole32-HGLOBALStream)
enable_ole32_HGLOBALStream="$2"
;;
ole32-STGPROP)
enable_ole32_STGPROP="$2"
;;
oleaut32-CreateTypeLib)
enable_oleaut32_CreateTypeLib="$2"
;;
@ -5212,6 +5216,21 @@ if test "$enable_ole32_HGLOBALStream" -eq 1; then
) >> "$patchlist"
fi
# Patchset ole32-STGPROP
# |
# | This patchset fixes the following Wine bugs:
# | * [#42046] Multiple fixes for ole32 property storage
# |
# | Modified files:
# | * dlls/ole32/stg_prop.c
# |
if test "$enable_ole32_STGPROP" -eq 1; then
patch_apply ole32-STGPROP/0001-ole32-Correctly-parse-unicode-property-storage-dicti.patch
(
printf '%s\n' '+ { "Michael Müller", "ole32: Correctly parse unicode property storage dictionaries.", 1 },';
) >> "$patchlist"
fi
# Patchset oleaut32-CreateTypeLib
# |
# | This patchset fixes the following Wine bugs: