VirtualBox

Ignore:
Timestamp:
Jul 9, 2019 8:14:01 AM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard/URI: Update.

File:
1 edited

Legend:

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

    r79497 r79630  
    4747
    4848VBoxClipboardWinStreamImpl::VBoxClipboardWinStreamImpl(VBoxClipboardWinDataObject *pParent,
    49                                                        PSHAREDCLIPBOARDURITRANSFER pTransfer, uint64_t uObjIdx)
     49                                                       PSHAREDCLIPBOARDURITRANSFER pTransfer, SHAREDCLIPBOARDOBJHANDLE hObj)
    5050    : m_pParent(pParent)
    5151    , m_lRefCount(1)
    5252    , m_pURITransfer(pTransfer)
    53     , m_uObjIdx(uObjIdx)
     53    , m_hObj(hObj)
    5454{
    5555    AssertPtr(m_pURITransfer);
    5656
    57     LogFunc(("m_uObjIdx=%RU64\n", uObjIdx));
     57    LogFunc(("m_hObj=%RU64\n", m_hObj));
    5858}
    5959
     
    160160    LogFlowThisFuncEnter();
    161161
    162     AssertPtr(m_pURITransfer->State.ObjCtx.pObjInfo);
    163 
    164     const uint64_t cbSize      = m_pURITransfer->State.ObjCtx.pObjInfo->cbObject;
    165           uint64_t cbProcessed = m_pURITransfer->State.ObjCtx.cbProcessed;
     162    const uint64_t cbSize      = m_pURITransfer->ProviderIface.pfnObjGetSize(&m_pURITransfer->ProviderCtx, m_hObj);
     163          uint64_t cbProcessed = m_pURITransfer->ProviderIface.pfnObjGetProcessed(&m_pURITransfer->ProviderCtx, m_hObj);
    166164
    167165    if (cbProcessed == cbSize)
     
    181179    if (cbToRead)
    182180    {
    183         rc = m_pURITransfer->ProviderIface.pfnObjRead(&m_pURITransfer->ProviderCtx, m_pURITransfer->State.ObjCtx.uHandle,
     181        rc = m_pURITransfer->ProviderIface.pfnObjRead(&m_pURITransfer->ProviderCtx, m_hObj,
    184182                                                      pvBuffer, cbToRead, 0 /* fFlags */, &cbRead);
    185183        if (RT_SUCCESS(rc))
     
    191189                m_pParent->OnTransferComplete();
    192190
    193             m_pURITransfer->State.ObjCtx.cbProcessed = cbProcessed;
     191    #if 0
     192            m_pObj->State.cbProcessed = cbProcessed;
     193            Assert(m_pObj->State.cbProcessed <= m_pObj->objInfo.cbObject);
     194    #endif
    194195        }
    195196    }
     
    231232    if (pStatStg)
    232233    {
    233         const SharedClipboardURIObject *pObj = SharedClipboardURITransferGetObject(m_pURITransfer, m_uObjIdx);
    234 
    235234        RT_BZERO(pStatStg, sizeof(STATSTG));
    236235
     
    243242            case STATFLAG_DEFAULT:
    244243            {
    245                 int rc2 = RTStrToUtf16(pObj->GetDestPathAbs().c_str(), &pStatStg->pwcsName);
     244                int rc2 = RTStrToUtf16(m_pURITransfer->ProviderIface.pfnObjGetPath(&m_pURITransfer->ProviderCtx, m_hObj),
     245                                       &pStatStg->pwcsName);
    246246                if (RT_FAILURE(rc2))
    247247                    hr = E_FAIL;
     
    259259            pStatStg->grfMode           = STGM_READ;
    260260            pStatStg->grfLocksSupported = 0;
    261             pStatStg->cbSize.QuadPart   = pObj->GetSize();
     261            pStatStg->cbSize.QuadPart   = m_pURITransfer->ProviderIface.pfnObjGetSize(&m_pURITransfer->ProviderCtx, m_hObj);
    262262        }
    263263    }
     
    295295 * @param   pParent             Pointer to the parent data object.
    296296 * @param   pTransfer           Pointer to URI transfer object to use.
    297  * @param   uObjIdx             Index of object to handle within the given URI transfer object.
     297 * @param   hObj                Handle of URI transfer object.
    298298 * @param   ppStream            Where to return the created stream object on success.
    299299 */
    300300/* static */
    301 HRESULT VBoxClipboardWinStreamImpl::Create(VBoxClipboardWinDataObject *pParent,
    302                                            PSHAREDCLIPBOARDURITRANSFER pTransfer, uint64_t uObjIdx, IStream **ppStream)
     301HRESULT VBoxClipboardWinStreamImpl::Create(VBoxClipboardWinDataObject *pParent, PSHAREDCLIPBOARDURITRANSFER pTransfer,
     302                                           SHAREDCLIPBOARDOBJHANDLE hObj, IStream **ppStream)
    303303{
    304304    AssertPtrReturn(pTransfer, E_POINTER);
    305305
    306     VBoxClipboardWinStreamImpl *pStream = new VBoxClipboardWinStreamImpl(pParent, pTransfer, uObjIdx);
     306    VBoxClipboardWinStreamImpl *pStream = new VBoxClipboardWinStreamImpl(pParent, pTransfer, hObj);
    307307    if (pStream)
    308308    {
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