From: Michael Müller michael@fds-team.de
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42046 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
Original patch was missing symmetric fix for serialization part.
dlls/ole32/stg_prop.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index 505467cad5..095bbaab94 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1195,20 +1195,25 @@ static HRESULT PropertyStorage_ReadDictionary(PropertyStorage_impl *This, ptr += sizeof(PROPID); StorageUtl_ReadDWord(ptr, 0, &cbEntry); ptr += sizeof(DWORD); - TRACE("Reading entry with ID 0x%08x, %d bytes\n", propid, cbEntry); /* Make sure the source string is NULL-terminated */ if (This->codePage != CP_UNICODE) ptr[cbEntry - 1] = '\0'; else - *((LPWSTR)ptr + cbEntry / sizeof(WCHAR)) = '\0'; + ((WCHAR *)ptr)[cbEntry - 1] = '\0'; + + TRACE("Reading entry with ID %#x, %d chars, name %s.\n", propid, cbEntry, This->codePage == CP_UNICODE ? + debugstr_wn((WCHAR *)ptr, cbEntry) : debugstr_an((char *)ptr, cbEntry)); + hr = PropertyStorage_StoreNameWithId(This, (char*)ptr, This->codePage, propid); if (This->codePage == CP_UNICODE) { + cbEntry *= sizeof(WCHAR); + /* 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; } @@ -1753,7 +1758,7 @@ static inline HRESULT PropertyStorage_WriteWStringToStream(IStream *stm, HeapFree(GetProcessHeap(), 0, leStr); return hr; #else - return IStream_Write(stm, str, len, written); + return IStream_Write(stm, str, len * sizeof(WCHAR), written); #endif }
@@ -1768,7 +1773,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key, { PropertyStorage_impl *This = extra; struct DictionaryClosure *c = closure; - DWORD propid; + DWORD propid, keyLen; ULONG count;
assert(key); @@ -1780,10 +1785,9 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key, c->bytesWritten += sizeof(DWORD); if (This->codePage == CP_UNICODE) { - DWORD keyLen, pad = 0; + DWORD pad = 0, pad_len;
- StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, - (lstrlenW((LPCWSTR)key) + 1) * sizeof(WCHAR)); + StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, lstrlenW((LPCWSTR)key) + 1); c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count); if (FAILED(c->hr)) goto end; @@ -1792,20 +1796,21 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key, &count); if (FAILED(c->hr)) goto end; - c->bytesWritten += keyLen * sizeof(WCHAR); - if (keyLen % sizeof(DWORD)) + keyLen *= sizeof(WCHAR); + c->bytesWritten += keyLen; + + /* Align to 4 bytes. */ + pad_len = sizeof(DWORD) - keyLen % sizeof(DWORD); + if (pad_len) { - c->hr = IStream_Write(This->stm, &pad, - sizeof(DWORD) - keyLen % sizeof(DWORD), &count); + c->hr = IStream_Write(This->stm, &pad, pad_len, &count); if (FAILED(c->hr)) goto end; - c->bytesWritten += sizeof(DWORD) - keyLen % sizeof(DWORD); + c->bytesWritten += pad_len; } } else { - DWORD keyLen; - StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, strlen((LPCSTR)key) + 1); c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count); if (FAILED(c->hr))
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/ole32/stg_prop.c | 39 ++++++++++++++++++--------------------- dlls/ole32/storage32.c | 8 ++++---- dlls/ole32/storage32.h | 2 +- 3 files changed, 23 insertions(+), 26 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index 095bbaab94..d6b0d6c215 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1711,9 +1711,9 @@ static void PropertyStorage_MakeHeader(PropertyStorage_impl *This, StorageUtl_WriteWord((BYTE *)&hdr->wByteOrder, 0, PROPSETHDR_BYTEORDER_MAGIC); StorageUtl_WriteWord((BYTE *)&hdr->wFormat, 0, This->format); - StorageUtl_WriteDWord((BYTE *)&hdr->dwOSVer, 0, This->originatorOS); + StorageUtl_WriteDWord(&hdr->dwOSVer, 0, This->originatorOS); StorageUtl_WriteGUID((BYTE *)&hdr->clsid, 0, &This->clsid); - StorageUtl_WriteDWord((BYTE *)&hdr->reserved, 0, 1); + StorageUtl_WriteDWord(&hdr->reserved, 0, 1); }
static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This, @@ -1721,7 +1721,7 @@ static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This, { assert(fmtOffset); StorageUtl_WriteGUID((BYTE *)fmtOffset, 0, &This->fmtid); - StorageUtl_WriteDWord((BYTE *)fmtOffset, offsetof(FORMATIDOFFSET, dwOffset), + StorageUtl_WriteDWord(fmtOffset, offsetof(FORMATIDOFFSET, dwOffset), sizeof(PROPERTYSETHEADER) + sizeof(FORMATIDOFFSET)); }
@@ -1729,18 +1729,16 @@ static void PropertyStorage_MakeSectionHdr(DWORD cbSection, DWORD numProps, PROPERTYSECTIONHEADER *hdr) { assert(hdr); - StorageUtl_WriteDWord((BYTE *)hdr, 0, cbSection); - StorageUtl_WriteDWord((BYTE *)hdr, - offsetof(PROPERTYSECTIONHEADER, cProperties), numProps); + StorageUtl_WriteDWord(hdr, 0, cbSection); + StorageUtl_WriteDWord(hdr, offsetof(PROPERTYSECTIONHEADER, cProperties), numProps); }
static void PropertyStorage_MakePropertyIdOffset(DWORD propid, DWORD dwOffset, PROPERTYIDOFFSET *propIdOffset) { assert(propIdOffset); - StorageUtl_WriteDWord((BYTE *)propIdOffset, 0, propid); - StorageUtl_WriteDWord((BYTE *)propIdOffset, - offsetof(PROPERTYIDOFFSET, dwOffset), dwOffset); + StorageUtl_WriteDWord(propIdOffset, 0, propid); + StorageUtl_WriteDWord(propIdOffset, offsetof(PROPERTYIDOFFSET, dwOffset), dwOffset); }
static inline HRESULT PropertyStorage_WriteWStringToStream(IStream *stm, @@ -1778,7 +1776,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key,
assert(key); assert(closure); - StorageUtl_WriteDWord((LPBYTE)&propid, 0, PtrToUlong(value)); + StorageUtl_WriteDWord(&propid, 0, PtrToUlong(value)); c->hr = IStream_Write(This->stm, &propid, sizeof(propid), &count); if (FAILED(c->hr)) goto end; @@ -1787,7 +1785,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key, { DWORD pad = 0, pad_len;
- StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, lstrlenW((LPCWSTR)key) + 1); + StorageUtl_WriteDWord(&keyLen, 0, lstrlenW((LPCWSTR)key) + 1); c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count); if (FAILED(c->hr)) goto end; @@ -1811,7 +1809,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key, } else { - StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, strlen((LPCSTR)key) + 1); + StorageUtl_WriteDWord(&keyLen, 0, strlen((LPCSTR)key) + 1); c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count); if (FAILED(c->hr)) goto end; @@ -1859,8 +1857,7 @@ static HRESULT PropertyStorage_WriteDictionaryToStream( hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL); if (FAILED(hr)) goto end; - StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, - dictionary_num_entries(This->name_to_propid)); + StorageUtl_WriteDWord(&dwTemp, 0, dictionary_num_entries(This->name_to_propid)); hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count); if (FAILED(hr)) goto end; @@ -1914,7 +1911,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL); if (FAILED(hr)) goto end; - StorageUtl_WriteDWord((LPBYTE)&dwType, 0, var->vt); + StorageUtl_WriteDWord(&dwType, 0, var->vt); hr = IStream_Write(This->stm, &dwType, sizeof(dwType), &count); if (FAILED(hr)) goto end; @@ -1947,7 +1944,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, { DWORD dwTemp;
- StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, var->u.lVal); + StorageUtl_WriteDWord(&dwTemp, 0, var->u.lVal); hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count); bytesWritten = count; break; @@ -1960,7 +1957,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, len = (lstrlenW(var->u.pwszVal) + 1) * sizeof(WCHAR); else len = lstrlenA(var->u.pszVal) + 1; - StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, len); + StorageUtl_WriteDWord(&dwTemp, 0, len); hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count); if (FAILED(hr)) goto end; @@ -1972,7 +1969,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, { DWORD len = lstrlenW(var->u.pwszVal) + 1, dwTemp;
- StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, len); + StorageUtl_WriteDWord(&dwTemp, 0, len); hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count); if (FAILED(hr)) goto end; @@ -1996,8 +1993,8 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, DWORD cf_hdr[2], len;
len = var->u.pclipdata->cbSize; - StorageUtl_WriteDWord((LPBYTE)&cf_hdr[0], 0, len + 8); - StorageUtl_WriteDWord((LPBYTE)&cf_hdr[1], 0, var->u.pclipdata->ulClipFmt); + StorageUtl_WriteDWord(&cf_hdr[0], 0, len + 8); + StorageUtl_WriteDWord(&cf_hdr[1], 0, var->u.pclipdata->ulClipFmt); hr = IStream_Write(This->stm, cf_hdr, sizeof(cf_hdr), &count); if (FAILED(hr)) goto end; @@ -2192,7 +2189,7 @@ static HRESULT PropertyStorage_WriteToStream(PropertyStorage_impl *This) hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL); if (FAILED(hr)) goto end; - StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, sectionOffset); + StorageUtl_WriteDWord(&dwTemp, 0, sectionOffset); hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count);
end: diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 515880ec36..08a1d2201f 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -6962,10 +6962,10 @@ void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) *value = lendian32toh(tmp); }
-void StorageUtl_WriteDWord(BYTE* buffer, ULONG offset, DWORD value) +void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) { - value = htole32(value); - memcpy(buffer+offset, &value, sizeof(DWORD)); + value = htole32(value); + memcpy((BYTE *)buffer + offset, &value, sizeof(DWORD)); }
void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, @@ -7896,7 +7896,7 @@ static void SmallBlockChainStream_SetNextBlockInChain(
offsetOfBlockInDepot.QuadPart = (ULONGLONG)blockIndex * sizeof(ULONG);
- StorageUtl_WriteDWord((BYTE *)&buffer, 0, nextBlock); + StorageUtl_WriteDWord(&buffer, 0, nextBlock);
/* * Read those bytes in the buffer from the small block file. diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index c628523d09..a54871f55b 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -558,7 +558,7 @@ StgStreamImpl* StgStreamImpl_Construct( void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value) DECLSPEC_HIDDEN; void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN; void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSPEC_HIDDEN; -void StorageUtl_WriteDWord(BYTE* buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN; +void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN; void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, ULARGE_INTEGER* value) DECLSPEC_HIDDEN; void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset,
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/ole32/stg_prop.c | 7 +++---- dlls/ole32/storage32.c | 6 +++--- dlls/ole32/storage32.h | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index d6b0d6c215..79f1c20742 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1708,9 +1708,8 @@ static void PropertyStorage_MakeHeader(PropertyStorage_impl *This, PROPERTYSETHEADER *hdr) { assert(hdr); - StorageUtl_WriteWord((BYTE *)&hdr->wByteOrder, 0, - PROPSETHDR_BYTEORDER_MAGIC); - StorageUtl_WriteWord((BYTE *)&hdr->wFormat, 0, This->format); + StorageUtl_WriteWord(&hdr->wByteOrder, 0, PROPSETHDR_BYTEORDER_MAGIC); + StorageUtl_WriteWord(&hdr->wFormat, 0, This->format); StorageUtl_WriteDWord(&hdr->dwOSVer, 0, This->originatorOS); StorageUtl_WriteGUID((BYTE *)&hdr->clsid, 0, &This->clsid); StorageUtl_WriteDWord(&hdr->reserved, 0, 1); @@ -1934,7 +1933,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, { WORD wTemp;
- StorageUtl_WriteWord((LPBYTE)&wTemp, 0, var->u.iVal); + StorageUtl_WriteWord(&wTemp, 0, var->u.iVal); hr = IStream_Write(This->stm, &wTemp, sizeof(wTemp), &count); bytesWritten = count; break; diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 08a1d2201f..6e0a9bb449 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -6948,10 +6948,10 @@ void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value) *value = lendian16toh(tmp); }
-void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value) +void StorageUtl_WriteWord(void *buffer, ULONG offset, WORD value) { - value = htole16(value); - memcpy(buffer+offset, &value, sizeof(WORD)); + value = htole16(value); + memcpy((BYTE *)buffer + offset, &value, sizeof(WORD)); }
void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index a54871f55b..046334b98b 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -556,7 +556,7 @@ StgStreamImpl* StgStreamImpl_Construct( * worry about bit order */ void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value) DECLSPEC_HIDDEN; -void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN; +void StorageUtl_WriteWord(void *buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN; void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSPEC_HIDDEN; void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN; void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset,
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/ole32/stg_prop.c | 6 +++--- dlls/ole32/storage32.c | 4 ++-- dlls/ole32/storage32.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index 79f1c20742..eeda2132dd 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1711,7 +1711,7 @@ static void PropertyStorage_MakeHeader(PropertyStorage_impl *This, StorageUtl_WriteWord(&hdr->wByteOrder, 0, PROPSETHDR_BYTEORDER_MAGIC); StorageUtl_WriteWord(&hdr->wFormat, 0, This->format); StorageUtl_WriteDWord(&hdr->dwOSVer, 0, This->originatorOS); - StorageUtl_WriteGUID((BYTE *)&hdr->clsid, 0, &This->clsid); + StorageUtl_WriteGUID(&hdr->clsid, 0, &This->clsid); StorageUtl_WriteDWord(&hdr->reserved, 0, 1); }
@@ -1719,7 +1719,7 @@ static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This, FORMATIDOFFSET *fmtOffset) { assert(fmtOffset); - StorageUtl_WriteGUID((BYTE *)fmtOffset, 0, &This->fmtid); + StorageUtl_WriteGUID(fmtOffset, 0, &This->fmtid); StorageUtl_WriteDWord(fmtOffset, offsetof(FORMATIDOFFSET, dwOffset), sizeof(PROPERTYSETHEADER) + sizeof(FORMATIDOFFSET)); } @@ -2008,7 +2008,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, { CLSID temp;
- StorageUtl_WriteGUID((BYTE *)&temp, 0, var->u.puuid); + StorageUtl_WriteGUID(&temp, 0, var->u.puuid); hr = IStream_Write(This->stm, &temp, sizeof(temp), &count); bytesWritten = count; break; diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 6e0a9bb449..5fc1f59b78 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -7005,13 +7005,13 @@ void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) memcpy(value->Data4, buffer+offset+8, sizeof(value->Data4)); }
-void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value) +void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) { StorageUtl_WriteDWord(buffer, offset, value->Data1); StorageUtl_WriteWord(buffer, offset+4, value->Data2); StorageUtl_WriteWord(buffer, offset+6, value->Data3);
- memcpy(buffer+offset+8, value->Data4, sizeof(value->Data4)); + memcpy((BYTE *)buffer + offset + 8, value->Data4, sizeof(value->Data4)); }
void StorageUtl_CopyDirEntryToSTATSTG( diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index 046334b98b..bfd3a3121f 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -564,7 +564,7 @@ void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset, const ULARGE_INTEGER *value) DECLSPEC_HIDDEN; void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) DECLSPEC_HIDDEN; -void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN; +void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN; void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination, const DirEntry* source, int statFlags) DECLSPEC_HIDDEN;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=62013
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===
ole32: clipboard.c:1484: Test failed: got 800401d0 clipboard.c:1485: Test failed: got 0
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/ole32/stg_prop.c | 5 ++--- dlls/ole32/storage32.c | 7 +++---- dlls/ole32/storage32.h | 3 +-- 3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index eeda2132dd..84eaa2aac4 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1981,9 +1981,8 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, { FILETIME temp;
- StorageUtl_WriteULargeInteger((BYTE *)&temp, 0, - (const ULARGE_INTEGER *)&var->u.filetime); - hr = IStream_Write(This->stm, &temp, sizeof(FILETIME), &count); + StorageUtl_WriteULargeInteger(&temp, 0, (const ULARGE_INTEGER *)&var->u.filetime); + hr = IStream_Write(This->stm, &temp, sizeof(temp), &count); bytesWritten = count; break; } diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 5fc1f59b78..52ecf59028 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -6982,17 +6982,16 @@ void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, #endif }
-void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset, - const ULARGE_INTEGER *value) +void StorageUtl_WriteULargeInteger(void *buffer, ULONG offset, const ULARGE_INTEGER *value) { #ifdef WORDS_BIGENDIAN ULARGE_INTEGER tmp;
tmp.u.LowPart = htole32(value->u.HighPart); tmp.u.HighPart = htole32(value->u.LowPart); - memcpy(buffer + offset, &tmp, sizeof(ULARGE_INTEGER)); + memcpy((BYTE *)buffer + offset, &tmp, sizeof(ULARGE_INTEGER)); #else - memcpy(buffer + offset, value, sizeof(ULARGE_INTEGER)); + memcpy((BYTE *)buffer + offset, value, sizeof(ULARGE_INTEGER)); #endif }
diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index bfd3a3121f..f79f96e929 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -561,8 +561,7 @@ void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSP void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN; void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, ULARGE_INTEGER* value) DECLSPEC_HIDDEN; -void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset, - const ULARGE_INTEGER *value) DECLSPEC_HIDDEN; +void StorageUtl_WriteULargeInteger(void *buffer, ULONG offset, const ULARGE_INTEGER *value) DECLSPEC_HIDDEN; void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) DECLSPEC_HIDDEN; void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN; void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=62010
Your paranoid android.
=== debian10 (64 bit WoW report) ===
ole32: clipboard.c:1017: Test failed: failed to clear clipboard, hr = 0x00000000 clipboard.c:626: Test failed: got 800401d0 clipboard.c:1027: Test failed: expected data_cmpl ref=0, got 4