VirtualBox

Changeset 80885 in vbox for trunk


Ignore:
Timestamp:
Sep 18, 2019 11:24:54 AM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard/Transfers: Update on IDataObject implementation.

File:
1 edited

Legend:

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

    r80862 r80885  
    2828#include <iprt/win/shlwapi.h>
    2929
     30#include <iprt/asm.h>
    3031#include <iprt/err.h>
    3132#include <iprt/path.h>
     
    364365                }
    365366
     367                if (ASMAtomicReadBool(&pTransfer->Thread.fStop))
     368                {
     369                    LogRel2(("Shared Clipboard: Stopping transfer calculating ...\n"));
     370                    break;
     371                }
     372
    366373                if (RT_FAILURE(rc))
    367374                    break;
     
    373380            if (RT_SUCCESS(rc))
    374381            {
    375                 LogRel2(("Shared Clipboard: Calculation complete, starting transfer ...\n"));
     382                LogRel2(("Shared Clipboard: Transfer calculation complete (%zu root entries)\n", pThis->m_lstEntries.size()));
    376383
    377384                /*
     
    382389                AssertRC(rc2);
    383390
    384                 LogFlowFunc(("Waiting for transfer to complete ...\n"));
    385 
    386                 /* Transferring stuff can take a while, so don't use any timeout here. */
    387                 rc2 = RTSemEventWait(pThis->m_EventTransferComplete, RT_INDEFINITE_WAIT);
    388                 AssertRC(rc2);
     391                if (pThis->m_lstEntries.size())
     392                {
     393                    LogRel2(("Shared Clipboard: Starting transfer ...\n"));
     394
     395                    LogFlowFunc(("Waiting for transfer to complete ...\n"));
     396
     397                    /* Transferring stuff can take a while, so don't use any timeout here. */
     398                    rc2 = RTSemEventWait(pThis->m_EventTransferComplete, RT_INDEFINITE_WAIT);
     399                    AssertRC(rc2);
     400                }
     401                else
     402                   LogRel(("Shared Clipboard: No transfer root entries found -- should not happen, please file a bug report\n"));
    389403            }
     404            else
     405                LogRel(("Shared Clipboard: Transfer failed with %Rrc\n", rc));
    390406        }
    391407
     
    419435    if (!cItems)
    420436        return VERR_NOT_FOUND;
    421           UINT   curIdx = 0; /* Current index of the handled file group descriptor (FGD). */
     437
     438    UINT         curIdx = 0; /* Current index of the handled file group descriptor (FGD). */
    422439
    423440    const size_t cbFGD  = cbFileGroupDescriptor + (cbFileDescriptor * (cItems - 1));
     
    569586                    /* Don't block for too long here, as this also will screw other apps running on the OS. */
    570587                    LogFunc(("Waiting for listing to arrive ...\n"));
    571                     rc = RTSemEventWait(m_EventListComplete, 10 * 1000 /* 10s timeout */);
     588                    rc = RTSemEventWait(m_EventListComplete, 30 * 1000 /* 30s timeout */);
    572589                    if (RT_SUCCESS(rc))
    573590                    {
    574591                        LogFunc(("Listing complete\n"));
    575 
    576 
    577592                    }
    578593                }
     
    594609                hr = S_OK;
    595610            }
     611            else /* We can't tell any better to the caller, unfortunately. */
     612                hr = E_UNEXPECTED;
    596613        }
    597614
     
    626643    }
    627644
    628     /* Error handling; at least return some basic data. */
    629645    if (FAILED(hr))
    630     {
    631         LogFunc(("Failed; copying medium ...\n"));
    632 
    633         //pMedium->tymed          = pThisFormat->tymed;
    634         //pMedium->pUnkForRelease = NULL;
    635     }
    636 
    637     if (hr == DV_E_FORMATETC)
    638         LogRel(("Shared Clipboard: Error handling format\n"));
     646        LogRel(("Shared Clipboard: Error returning data from data object (%Rhrc)\n", hr));
    639647
    640648    LogFlowFunc(("hr=%Rhrc\n", hr));
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