VirtualBox

Ignore:
Timestamp:
Jun 17, 2019 10:30:49 AM (6 years ago)
Author:
vboxsync
Message:

Shared Clipboard/URI: Update.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/ClipboardProvider-HostService.cpp

    r79120 r79174  
    100100}
    101101
     102/**
     103 * Returns the event's (raw) data (mutable).
     104 *
     105 * @returns Pointer to the event's raw data.
     106 */
    102107void *SharedClipboardProviderHostService::Event::DataRaw()
    103108{
     
    105110}
    106111
     112/**
     113 * Returns the event's data size (in bytes).
     114 *
     115 * @returns Data size (in bytes).
     116 */
    107117uint32_t SharedClipboardProviderHostService::Event::DataSize()
    108118{
     
    125135    int rc;
    126136
    127     Event *pEvent = eventGet(VBOX_SHARED_CLIPBOARD_GUEST_FN_WRITE_DATA_HDR);
    128     if (pEvent)
    129     {
    130         rc = pEvent->Wait(m_uTimeoutMs);
    131         if (RT_SUCCESS(rc))
    132             memcpy(pDataHdr, pEvent->DataRaw(), pEvent->DataSize());
     137    if (m_Callbacks.pfnReadDataHdr)
     138    {
     139        SHAREDCLIPBOARDPROVIDERCALLBACKDATA data = { this, m_Callbacks.pvUser };
     140        rc = m_Callbacks.pfnReadDataHdr(&data);
    133141    }
    134142    else
    135         rc = VERR_NOT_FOUND;
     143        rc = VERR_NOT_SUPPORTED;
     144
     145    if (RT_SUCCESS(rc))
     146    {
     147        Event *pEvent = eventGet(VBOX_SHARED_CLIPBOARD_GUEST_FN_WRITE_DATA_HDR);
     148        if (pEvent)
     149        {
     150            rc = pEvent->Wait(m_uTimeoutMs);
     151            if (RT_SUCCESS(rc))
     152                memcpy(pDataHdr, pEvent->DataRaw(), pEvent->DataSize());
     153        }
     154        else
     155            rc = VERR_NOT_FOUND;
     156    }
    136157
    137158    LogFlowFuncLeaveRC(rc);
     
    277298                Event *pEvent = eventGet(pParms->u.HostService.uMsg);
    278299                if (pEvent)
    279                 {
    280300                    rc = pEvent->SetData(&dataHdr, sizeof(dataHdr));
    281                 }
    282301            }
    283302            break;
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