mirror of
https://github.com/reactos/wine.git
synced 2025-02-02 18:25:19 +00:00
Must make a copy of global handle returned by GetClipboardData; it is
not valid after we call CloseClipboard. Application is responsible for freeing the memory (fixes copy/paste in mail body in Forte Agent).
This commit is contained in:
parent
fed8f1cbf2
commit
3ad8d3f0d0
@ -1200,6 +1200,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetData(
|
||||
HANDLE hData = 0;
|
||||
BOOL bClipboardOpen = FALSE;
|
||||
HRESULT hr = S_OK;
|
||||
LPVOID src;
|
||||
|
||||
/*
|
||||
* Declare "This" pointer
|
||||
@ -1239,6 +1240,25 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetData(
|
||||
|
||||
hData = GetClipboardData(pformatetcIn->cfFormat);
|
||||
|
||||
/* Must make a copy of global handle returned by GetClipboardData; it
|
||||
* is not valid after we call CloseClipboard
|
||||
* Application is responsible for freeing the memory (Forte Agent does this)
|
||||
*/
|
||||
src = GlobalLock(hData);
|
||||
if(src) {
|
||||
LPVOID dest;
|
||||
ULONG size;
|
||||
HANDLE hDest;
|
||||
|
||||
size = GlobalSize(hData);
|
||||
hDest = GlobalAlloc(GHND, size);
|
||||
dest = GlobalLock(hDest);
|
||||
memcpy(dest, src, size);
|
||||
GlobalUnlock(hDest);
|
||||
GlobalUnlock(hData);
|
||||
hData = hDest;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the clipboard data in the storage medium structure
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user