VirtualBox

Ignore:
Timestamp:
Oct 9, 2019 8:56:50 AM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard/Win: Use a dedicated running flag for IDataObject implementation; makes it more independent from the underlying transfer object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/ClipboardDataObjectImpl-win.cpp

    r81025 r81172  
    4040/** @todo Also handle Unicode entries.
    4141 *        !!! WARNING: Buggy, doesn't work yet (some memory corruption / garbage in the file name descriptions) !!! */
    42 //#define VBOX_CLIPBOARD_WITH_UNICODE_SUPPORT 0
     42//#define VBOX_CLIPBOARD_WITH_UNICODE_SUPPORT 1
    4343
    4444SharedClipboardWinDataObject::SharedClipboardWinDataObject(PSHCLTRANSFER pTransfer,
     
    5050    , m_pStream(NULL)
    5151    , m_uObjIdx(0)
     52    , m_fRunning(false)
    5253    , m_EventListComplete(NIL_RTSEMEVENT)
    5354    , m_EventTransferComplete(NIL_RTSEMEVENT)
     
    132133SharedClipboardWinDataObject::~SharedClipboardWinDataObject(void)
    133134{
     135    LogFlowFuncEnter();
     136
    134137    RTSemEventDestroy(m_EventListComplete);
    135138    m_EventListComplete = NIL_RTSEMEVENT;
     
    572575
    573576        const uint32_t enmTransferStatus = SharedClipboardTransferGetStatus(m_pTransfer);
    574 
    575         LogFlowFunc(("FormatIndex_FileDescriptor%s, transfer status is %s\n",
    576                      fUnicode ? "W" : "A", VBoxShClTransferStatusToStr(enmTransferStatus)));
     577        RT_NOREF(enmTransferStatus);
     578
     579        LogFlowFunc(("FormatIndex_FileDescriptor%s, enmTransferStatus=%s, m_fRunning=%RTbool\n",
     580                     fUnicode ? "W" : "A", VBoxShClTransferStatusToStr(enmTransferStatus), m_fRunning));
    577581
    578582        int rc;
    579583
    580584        /* The caller can call GetData() several times, so make sure we don't do the same transfer multiple times. */
    581         if (enmTransferStatus == SHCLTRANSFERSTATUS_INITIALIZED)
     585        if (!m_fRunning)
    582586        {
    583587            /* Start the transfer asynchronously in a separate thread. */
     
    585589            if (RT_SUCCESS(rc))
    586590            {
     591                m_fRunning = true;
     592
    587593                /* Don't block for too long here, as this also will screw other apps running on the OS. */
    588594                LogFunc(("Waiting for listing to arrive ...\n"));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette