Damjan Jovanovic : winex11.drv: Use the global memory functions to allocate the memory for STGMEDIUM' s hGlobal.
Alexandre Julliard
julliard at winehq.org
Thu Jun 12 15:51:43 CDT 2014
Module: wine
Branch: master
Commit: 8e32b5f8870ce9ffa7097c985f328e011513d5e4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8e32b5f8870ce9ffa7097c985f328e011513d5e4
Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date: Tue May 27 02:21:53 2014 +0200
winex11.drv: Use the global memory functions to allocate the memory for STGMEDIUM's hGlobal.
---
dlls/winex11.drv/xdnd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c
index eb98215..4db938f 100644
--- a/dlls/winex11.drv/xdnd.c
+++ b/dlls/winex11.drv/xdnd.c
@@ -977,10 +977,11 @@ static HRESULT WINAPI XDNDDATAOBJECT_GetData(IDataObject *dataObject,
if (current->cf_win == formatEtc->cfFormat)
{
pMedium->tymed = TYMED_HGLOBAL;
- pMedium->u.hGlobal = HeapAlloc(GetProcessHeap(), 0, current->size);
+ pMedium->u.hGlobal = GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, current->size);
if (pMedium->u.hGlobal == NULL)
return E_OUTOFMEMORY;
- memcpy(pMedium->u.hGlobal, current->data, current->size);
+ memcpy(GlobalLock(pMedium->u.hGlobal), current->data, current->size);
+ GlobalUnlock(pMedium->u.hGlobal);
pMedium->pUnkForRelease = 0;
return S_OK;
}
More information about the wine-cvs
mailing list