1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

riched20: Call GlobalReAlloc with GMEM_MOVEABLE flag.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53474
This commit is contained in:
Rémi Bernon 2022-11-19 17:13:19 +01:00 committed by Alexandre Julliard
parent da929946e6
commit dfd44bb979

View File

@ -375,7 +375,7 @@ static DWORD CALLBACK ME_AppendToHGLOBAL(DWORD_PTR dwCookie, LPBYTE lpBuff, LONG
if (pData->nLength+cb+1 >= cb) {
/* round up to 2^17 */
int nNewSize = (((nMaxSize+cb+1)|0x1FFFF)+1) & 0xFFFE0000;
pData->hData = GlobalReAlloc(pData->hData, nNewSize, 0);
pData->hData = GlobalReAlloc(pData->hData, nNewSize, GMEM_MOVEABLE);
}
pDest = GlobalLock(pData->hData);
memcpy(pDest + pData->nLength, lpBuff, cb);
@ -397,7 +397,7 @@ static HGLOBAL get_rtf_text(ME_TextEditor *editor, const ME_Cursor *start, int n
es.dwCookie = (DWORD_PTR)&gds;
es.pfnCallback = ME_AppendToHGLOBAL;
ME_StreamOutRange(editor, SF_RTF, start, nChars, &es);
GlobalReAlloc(gds.hData, gds.nLength+1, 0);
GlobalReAlloc(gds.hData, gds.nLength+1, GMEM_MOVEABLE);
return gds.hData;
}