Changeset 7786 for trunk/src


Ignore:
Timestamp:
Jan 26, 2002, 11:40:47 AM (24 years ago)
Author:
sandervl
Message:

Fixed bug in OLE clipboard implementation; the handle returned by GetClipboardData is no longer valid after calling CloseClipboard. A copy of the data must be made.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ole32/clipboard.c

    r6711 r7786  
    12401240  hData = GetClipboardData(pformatetcIn->cfFormat);
    12411241
     1242#ifdef __WIN32OS2__
     1243{
     1244  //must make a copy of global handle returned by GetClipboardData; it
     1245  //is not valid after we call CloseClipboard
     1246  //Application is responsible for freeing the memory (Forte Agent does this)
     1247  LPVOID src;
     1248  LPVOID dest;
     1249  ULONG  size;
     1250  HANDLE hDest;
     1251
     1252  src = GlobalLock(hData);
     1253  if(src) {
     1254      size = GlobalSize(hData);
     1255      hDest = GlobalAlloc(GHND, size);
     1256      dest  = GlobalLock(hDest);
     1257      memcpy(dest, src, size);
     1258      GlobalUnlock(hDest);
     1259  }
     1260  GlobalUnlock(hData);
     1261  hData = hDest;
     1262}
     1263#endif
     1264
    12421265  /*
    12431266   * Return the clipboard data in the storage medium structure
Note: See TracChangeset for help on using the changeset viewer.