Changeset 79630 in vbox for trunk/src/VBox/GuestHost/SharedClipboard/ClipboardStreamImpl-win.cpp
- Timestamp:
- Jul 9, 2019 8:14:01 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/ClipboardStreamImpl-win.cpp
r79497 r79630 47 47 48 48 VBoxClipboardWinStreamImpl::VBoxClipboardWinStreamImpl(VBoxClipboardWinDataObject *pParent, 49 PSHAREDCLIPBOARDURITRANSFER pTransfer, uint64_t uObjIdx)49 PSHAREDCLIPBOARDURITRANSFER pTransfer, SHAREDCLIPBOARDOBJHANDLE hObj) 50 50 : m_pParent(pParent) 51 51 , m_lRefCount(1) 52 52 , m_pURITransfer(pTransfer) 53 , m_ uObjIdx(uObjIdx)53 , m_hObj(hObj) 54 54 { 55 55 AssertPtr(m_pURITransfer); 56 56 57 LogFunc(("m_ uObjIdx=%RU64\n", uObjIdx));57 LogFunc(("m_hObj=%RU64\n", m_hObj)); 58 58 } 59 59 … … 160 160 LogFlowThisFuncEnter(); 161 161 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); 166 164 167 165 if (cbProcessed == cbSize) … … 181 179 if (cbToRead) 182 180 { 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, 184 182 pvBuffer, cbToRead, 0 /* fFlags */, &cbRead); 185 183 if (RT_SUCCESS(rc)) … … 191 189 m_pParent->OnTransferComplete(); 192 190 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 194 195 } 195 196 } … … 231 232 if (pStatStg) 232 233 { 233 const SharedClipboardURIObject *pObj = SharedClipboardURITransferGetObject(m_pURITransfer, m_uObjIdx);234 235 234 RT_BZERO(pStatStg, sizeof(STATSTG)); 236 235 … … 243 242 case STATFLAG_DEFAULT: 244 243 { 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); 246 246 if (RT_FAILURE(rc2)) 247 247 hr = E_FAIL; … … 259 259 pStatStg->grfMode = STGM_READ; 260 260 pStatStg->grfLocksSupported = 0; 261 pStatStg->cbSize.QuadPart = pObj->GetSize();261 pStatStg->cbSize.QuadPart = m_pURITransfer->ProviderIface.pfnObjGetSize(&m_pURITransfer->ProviderCtx, m_hObj); 262 262 } 263 263 } … … 295 295 * @param pParent Pointer to the parent data object. 296 296 * @param pTransfer Pointer to URI transfer object to use. 297 * @param uObjIdx Index of object to handle within the givenURI transfer object.297 * @param hObj Handle of URI transfer object. 298 298 * @param ppStream Where to return the created stream object on success. 299 299 */ 300 300 /* static */ 301 HRESULT VBoxClipboardWinStreamImpl::Create(VBoxClipboardWinDataObject *pParent, 302 PSHAREDCLIPBOARDURITRANSFER pTransfer, uint64_t uObjIdx, IStream **ppStream)301 HRESULT VBoxClipboardWinStreamImpl::Create(VBoxClipboardWinDataObject *pParent, PSHAREDCLIPBOARDURITRANSFER pTransfer, 302 SHAREDCLIPBOARDOBJHANDLE hObj, IStream **ppStream) 303 303 { 304 304 AssertPtrReturn(pTransfer, E_POINTER); 305 305 306 VBoxClipboardWinStreamImpl *pStream = new VBoxClipboardWinStreamImpl(pParent, pTransfer, uObjIdx);306 VBoxClipboardWinStreamImpl *pStream = new VBoxClipboardWinStreamImpl(pParent, pTransfer, hObj); 307 307 if (pStream) 308 308 {
Note:
See TracChangeset
for help on using the changeset viewer.