Changeset 81259 in vbox
- Timestamp:
- Oct 14, 2019 1:18:28 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/SharedClipboard-win.h
r81212 r81259 355 355 /** Number of bytes already processed. */ 356 356 uint64_t m_cbProcessed; 357 /** Whether we already notified the parent of completionor not. */358 bool m_f NotifiedComplete;357 /** Whether this object already is in completed state or not. */ 358 bool m_fIsComplete; 359 359 }; 360 360 -
trunk/src/VBox/GuestHost/SharedClipboard/ClipboardDataObjectImpl-win.cpp
r81223 r81259 649 649 } 650 650 651 if (FAILED(hr)) 651 if ( FAILED(hr) 652 && hr != DV_E_FORMATETC) /* Can happen if the caller queries unknown / unhandled formats. */ 653 { 652 654 LogRel(("Shared Clipboard: Error returning data from data object (%Rhrc)\n", hr)); 655 } 653 656 654 657 LogFlowFunc(("hr=%Rhrc\n", hr)); -
trunk/src/VBox/GuestHost/SharedClipboard/ClipboardStreamImpl-win.cpp
r81223 r81259 55 55 , m_objInfo(*pObjInfo) 56 56 , m_cbProcessed(0) 57 , m_f NotifiedComplete(false)57 , m_fIsComplete(false) 58 58 { 59 59 AssertPtr(m_pTransfer); … … 113 113 if (lCount == 0) 114 114 { 115 if ( !m_fNotifiedComplete116 && m_pParent)117 {118 m_pParent->OnTransferComplete();119 }120 121 115 delete this; 122 116 return 0; … … 173 167 return STG_E_INVALIDPOINTER; 174 168 175 if (nBytesToRead == 0) 169 if ( nBytesToRead == 0 170 || m_fIsComplete) 176 171 { 177 172 if (nBytesRead) … … 212 207 const uint64_t cbSize = (uint64_t)m_objInfo.cbObject; 213 208 const uint32_t cbToRead = RT_MIN(cbSize - m_cbProcessed, nBytesToRead); 214 215 bool fComplete = false;216 209 217 210 if (RT_SUCCESS(rc)) … … 229 222 230 223 /* Transfer complete? Make sure to close the object again. */ 231 fComplete = m_cbProcessed == cbSize;232 233 if ( fComplete)224 m_fIsComplete = m_cbProcessed == cbSize; 225 226 if (m_fIsComplete) 234 227 { 235 228 if (m_pTransfer->ProviderIface.pfnObjClose) … … 240 233 241 234 if (m_pParent) 242 {243 235 m_pParent->OnTransferComplete(); 244 m_fNotifiedComplete = true;245 }246 236 } 247 237 } -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp
r81229 r81259 766 766 { 767 767 PSHCLOBJHANDLEINFO pIt; 768 RTListForEach(&pTransfer->lstObj, pIt, SHCLOBJHANDLEINFO, Node) 768 RTListForEach(&pTransfer->lstObj, pIt, SHCLOBJHANDLEINFO, Node) /** @todo Slooow ...but works for now. */ 769 769 { 770 770 if (pIt->hObj == hObj) … … 792 792 int rc = VINF_SUCCESS; 793 793 794 AssertMsgReturn(pTransfer->pszPathRootAbs, ("Transfer has no root path set\n"), VERR_INVALID_PARAMETER); 795 AssertMsgReturn(pOpenCreateParms->pszPath, ("No path in open/create params set\n"), VERR_INVALID_PARAMETER); 796 794 797 LogFlowFunc(("pszPath=%s, fCreate=0x%x\n", pOpenCreateParms->pszPath, pOpenCreateParms->fCreate)); 795 798 … … 797 800 { 798 801 PSHCLOBJHANDLEINFO pInfo 799 = (PSHCLOBJHANDLEINFO)RTMemAlloc (sizeof(SHCLOBJHANDLEINFO));802 = (PSHCLOBJHANDLEINFO)RTMemAllocZ(sizeof(SHCLOBJHANDLEINFO)); 800 803 if (pInfo) 801 804 { … … 811 814 if (RT_SUCCESS(rc)) 812 815 { 813 char *pszPathAbs = RTStrAPrintf2("%s/%s", pTransfer->pszPathRootAbs, pOpenCreateParms->pszPath);814 if (p szPathAbs)816 pInfo->pszPathLocalAbs = RTStrAPrintf2("%s/%s", pTransfer->pszPathRootAbs, pOpenCreateParms->pszPath); 817 if (pInfo->pszPathLocalAbs) 815 818 { 816 LogFlowFunc(("%s\n", pszPathAbs)); 817 818 rc = RTFileOpen(&pInfo->u.Local.hFile, pszPathAbs, fOpen); 819 RTStrFree(pszPathAbs); 819 rc = RTFileOpen(&pInfo->u.Local.hFile, pInfo->pszPathLocalAbs, fOpen); 820 if (RT_SUCCESS(rc)) 821 { 822 LogRel2(("Shared Clipboard: Opened file '%s'\n", pInfo->pszPathLocalAbs)); 823 } 824 else 825 LogRel(("Shared Clipboard: Error opening file '%s', rc=%Rrc\n", pInfo->pszPathLocalAbs, rc)); 820 826 } 821 827 else … … 910 916 911 917 RTListNodeRemove(&pInfo->Node); 918 919 ShClTransferObjHandleInfoDestroy(pInfo); 912 920 913 921 RTMemFree(pInfo); … … 2863 2871 2864 2872 /** 2865 * Converts Shared Clipboard create flags (see SharedClipboard- uri.) into IPRT create flags.2873 * Converts Shared Clipboard create flags (see SharedClipboard-transfers.h) into IPRT create flags. 2866 2874 * 2867 2875 * @returns IPRT status code. 2868 * @param fWritable Whether the shared folder is writable2876 * @param fWritable Whether the object is writable. 2869 2877 * @param fShClFlags Shared clipboard create flags. 2870 2878 * @param fMode File attributes. -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp
r81229 r81259 2140 2140 { 2141 2141 LogRel2(("Shared Clipboard: Reported status %s (rc=%Rrc) of transfer %RU32 to guest\n", 2142 ShCl GuestMsgToStr(uStatus), rcTransfer, pTransfer->State.uID));2142 ShClTransferStatusToStr(uStatus), rcTransfer, pTransfer->State.uID)); 2143 2143 2144 2144 if (puEvent) … … 2269 2269 else 2270 2270 LogRel(("Shared Clipboard: Guest reported status %s (error %Rrc) while starting transfer %RU32\n", 2271 ShCl GuestMsgToStr(pReply->u.TransferStatus.uStatus),2271 ShClTransferStatusToStr(pReply->u.TransferStatus.uStatus), 2272 2272 pReply->rc, pTransfer->State.uID)); 2273 2273 }
Note:
See TracChangeset
for help on using the changeset viewer.