VirtualBox

Changeset 80905 in vbox for trunk


Ignore:
Timestamp:
Sep 19, 2019 12:14:07 PM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard/Transfers: Update.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/SharedClipboard-transfers.h

    r80886 r80905  
    4848 */
    4949
    50 /** No status set. */
    51 #define SHCLTRANSFERSTATUS_NONE           0
    52 /** The transfer has been announced but is not running yet. */
    53 #define SHCLTRANSFERSTATUS_READY          1
    54 /** The transfer is active and running. */
    55 #define SHCLTRANSFERSTATUS_STARTED        2
    56 /** The transfer has been stopped. */
    57 #define SHCLTRANSFERSTATUS_STOPPED        3
    58 /** The transfer has been canceled. */
    59 #define SHCLTRANSFERSTATUS_CANCELED       4
    60 /** The transfer has been killed. */
    61 #define SHCLTRANSFERSTATUS_KILLED         5
    62 /** The transfer ran into an unrecoverable error. */
    63 #define SHCLTRANSFERSTATUS_ERROR          6
     50/**
     51 * Defines the transfer status codes.
     52 */
     53typedef enum
     54{
     55    /** No status set. */
     56    SHCLTRANSFERSTATUS_NONE = 0,
     57    /** The transfer has been initialized but is not running yet. */
     58    SHCLTRANSFERSTATUS_INITIALIZED,
     59    /** The transfer is active and running. */
     60    SHCLTRANSFERSTATUS_STARTED,
     61    /** The transfer has been stopped. */
     62    SHCLTRANSFERSTATUS_STOPPED,
     63    /** The transfer has been canceled. */
     64    SHCLTRANSFERSTATUS_CANCELED,
     65    /** The transfer has been killed. */
     66    SHCLTRANSFERSTATUS_KILLED,
     67    /** The transfer ran into an unrecoverable error. */
     68    SHCLTRANSFERSTATUS_ERROR
     69} SHCLTRANSFERSTATUSENUM;
    6470
    6571/** Defines a transfer status. */
     
    873879    SHCLPROVIDERFUNCMEMBER(TRANSFEROPEN, pfnTransferOpen)
    874880    SHCLPROVIDERFUNCMEMBER(TRANSFERCLOSE, pfnTransferClose)
    875     SHCLPROVIDERFUNCMEMBER(GETROOTS, pfnGetRoots)
     881    SHCLPROVIDERFUNCMEMBER(GETROOTS, pfnRootsGet)
    876882    SHCLPROVIDERFUNCMEMBER(LISTOPEN, pfnListOpen)
    877883    SHCLPROVIDERFUNCMEMBER(LISTCLOSE, pfnListClose)
     
    913919} SHCLTRANSFERCALLBACKDATA, *PSHCLTRANSFERCALLBACKDATA;
    914920
    915 #define SHCLTRANSFERCALLBACKDECLVOID(a_Name) \
    916     typedef DECLCALLBACK(void) RT_CONCAT(FNSHCLCALLBACK, a_Name)(PSHCLTRANSFERCALLBACKDATA pData); \
    917     typedef RT_CONCAT(FNSHCLCALLBACK, a_Name) RT_CONCAT(*PFNSHCLCALLBACK, a_Name);
    918 
    919 #define SHCLTRANSFERCALLBACKDECL(a_Name, ...) \
    920     typedef DECLCALLBACK(void) RT_CONCAT(FNSHCLCALLBACK, a_Name)(PSHCLTRANSFERCALLBACKDATA pData, __VA_ARGS__); \
     921#define SHCLTRANSFERCALLBACKDECL(a_Ret, a_Name, ...) \
     922    typedef DECLCALLBACK(a_Ret) RT_CONCAT(FNSHCLCALLBACK, a_Name)(PSHCLTRANSFERCALLBACKDATA pData, __VA_ARGS__); \
    921923    typedef RT_CONCAT(FNSHCLCALLBACK, a_Name) RT_CONCAT(*PFNSHCLCALLBACK, a_Name);
    922924
     
    924926    RT_CONCAT(PFNSHCLCALLBACK, a_Name) a_Member;
    925927
    926 SHCLTRANSFERCALLBACKDECLVOID(TRANSFERPREPARE)
    927 SHCLTRANSFERCALLBACKDECLVOID(TRANSFERSTARTED)
    928 SHCLTRANSFERCALLBACKDECLVOID(LISTHEADERCOMPLETE)
    929 SHCLTRANSFERCALLBACKDECLVOID(LISTENTRYCOMPLETE)
    930 SHCLTRANSFERCALLBACKDECL    (TRANSFERCOMPLETE, int rc)
    931 SHCLTRANSFERCALLBACKDECLVOID(TRANSFERCANCELED)
    932 SHCLTRANSFERCALLBACKDECL    (TRANSFERERROR, int rc)
     928SHCLTRANSFERCALLBACKDECL(int,  TRANSFERINITIALIZE)
     929SHCLTRANSFERCALLBACKDECL(int,  TRANSFERSTART)
     930SHCLTRANSFERCALLBACKDECL(void, LISTHEADERCOMPLETE)
     931SHCLTRANSFERCALLBACKDECL(void, LISTENTRYCOMPLETE)
     932SHCLTRANSFERCALLBACKDECL(void, TRANSFERCOMPLETE, int rc)
     933SHCLTRANSFERCALLBACKDECL(void, TRANSFERCANCELED)
     934SHCLTRANSFERCALLBACKDECL(void, TRANSFERERROR, int rc)
    933935
    934936/**
     
    938940typedef struct _SHCLTRANSFERCALLBACKS
    939941{
    940     /** Saved user pointer. */
     942    /** Saved user pointer. Optional and can be NULL. */
    941943    void *pvUser;
    942     /** Function pointer, called when the transfer is going to be prepared. */
    943     SHCLTRANSFERCALLBACKMEMBER(TRANSFERPREPARE, pfnTransferPrepare)
    944     /** Function pointer, called when the transfer has been started. */
    945     SHCLTRANSFERCALLBACKMEMBER(TRANSFERSTARTED, pfnTransferStarted)
     944    /** Function pointer, called after the transfer has been initialized. */
     945    SHCLTRANSFERCALLBACKMEMBER(TRANSFERINITIALIZE, pfnTransferInitialize)
     946    /** Function pointer, called before the transfer will be started. */
     947    SHCLTRANSFERCALLBACKMEMBER(TRANSFERSTART, pfnTransferStart)
    946948    /** Function pointer, called when reading / writing the list header is complete. */
    947949    SHCLTRANSFERCALLBACKMEMBER(LISTHEADERCOMPLETE, pfnListHeaderComplete)
     
    10791081int SharedClipboardTransferClose(PSHCLTRANSFER pTransfer);
    10801082
    1081 int SharedClipboardTransferListOpen(PSHCLTRANSFER pTransfer, PSHCLLISTOPENPARMS pOpenParms,
    1082                                        PSHCLLISTHANDLE phList);
     1083int SharedClipboardTransferListOpen(PSHCLTRANSFER pTransfer, PSHCLLISTOPENPARMS pOpenParms, PSHCLLISTHANDLE phList);
    10831084int SharedClipboardTransferListClose(PSHCLTRANSFER pTransfer, SHCLLISTHANDLE hList);
    1084 int SharedClipboardTransferListGetHeader(PSHCLTRANSFER pTransfer, SHCLLISTHANDLE hList,
    1085                                             PSHCLLISTHDR pHdr);
    1086 PSHCLTRANSFEROBJ SharedClipboardTransferListGetObj(PSHCLTRANSFER pTransfer,
    1087                                                                     SHCLLISTHANDLE hList, uint64_t uIdx);
    1088 int SharedClipboardTransferListRead(PSHCLTRANSFER pTransfer, SHCLLISTHANDLE hList,
    1089                                        PSHCLLISTENTRY pEntry);
    1090 int SharedClipboardTransferListWrite(PSHCLTRANSFER pTransfer, SHCLLISTHANDLE hList,
    1091                                         PSHCLLISTENTRY pEntry);
     1085int SharedClipboardTransferListGetHeader(PSHCLTRANSFER pTransfer, SHCLLISTHANDLE hList, PSHCLLISTHDR pHdr);
     1086PSHCLTRANSFEROBJ SharedClipboardTransferListGetObj(PSHCLTRANSFER pTransfer, SHCLLISTHANDLE hList, uint64_t uIdx);
     1087int SharedClipboardTransferListRead(PSHCLTRANSFER pTransfer, SHCLLISTHANDLE hList, PSHCLLISTENTRY pEntry);
     1088int SharedClipboardTransferListWrite(PSHCLTRANSFER pTransfer, SHCLLISTHANDLE hList, PSHCLLISTENTRY pEntry);
    10921089bool SharedClipboardTransferListHandleIsValid(PSHCLTRANSFER pTransfer, SHCLLISTHANDLE hList);
    10931090
    1094 int SharedClipboardTransferPrepare(PSHCLTRANSFER pTransfer);
    1095 int SharedClipboardTransferSetInterface(PSHCLTRANSFER pTransfer,
    1096                                            PSHCLPROVIDERCREATIONCTX pCreationCtx);
    1097 int SharedClipboardTransferSetRoots(PSHCLTRANSFER pTransfer, const char *pszRoots, size_t cbRoots);
     1091int SharedClipboardTransferSetInterface(PSHCLTRANSFER pTransfer, PSHCLPROVIDERCREATIONCTX pCreationCtx);
     1092int SharedClipboardTransferRootsSet(PSHCLTRANSFER pTransfer, const char *pszRoots, size_t cbRoots);
    10981093void SharedClipboardTransferReset(PSHCLTRANSFER pTransfer);
    10991094SharedClipboardArea *SharedClipboardTransferGetArea(PSHCLTRANSFER pTransfer);
     
    11011096uint32_t SharedClipboardTransferRootsCount(PSHCLTRANSFER pTransfer);
    11021097int SharedClipboardTransferRootsEntry(PSHCLTRANSFER pTransfer, uint64_t uIndex, PSHCLROOTLISTENTRY pEntry);
    1103 int SharedClipboardTransferRootsAsList(PSHCLTRANSFER pTransfer, PSHCLROOTLIST *ppRootList);
     1098int SharedClipboardTransferRootsGet(PSHCLTRANSFER pTransfer, PSHCLROOTLIST *ppRootList);
    11041099
    11051100SHCLTRANSFERID SharedClipboardTransferGetID(PSHCLTRANSFER pTransfer);
     
    11081103int SharedClipboardTransferHandleReply(PSHCLTRANSFER pTransfer, PSHCLREPLY pReply);
    11091104int SharedClipboardTransferRun(PSHCLTRANSFER pTransfer, PFNRTTHREAD pfnThreadFunc, void *pvUser);
     1105int SharedClipboardTransferStart(PSHCLTRANSFER pTransfer);
    11101106void SharedClipboardTransferSetCallbacks(PSHCLTRANSFER pTransfer, PSHCLTRANSFERCALLBACKS pCallbacks);
    11111107
     
    11331129bool SharedClipboardMIMENeedsCache(const char *pcszFormat, size_t cchFormatMax);
    11341130
    1135 const char *VBoxShClTransferStatusToStr(uint32_t uStatus);
     1131const char *VBoxShClTransferStatusToStr(SHCLTRANSFERSTATUS enmStatus);
    11361132
    11371133#endif /* !VBOX_INCLUDED_GuestHost_SharedClipboard_transfers_h */
  • trunk/include/VBox/VBoxGuestLib.h

    r80863 r80905  
    576576 * @{ */
    577577
     578#  ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     579/**
     580 * Structure containing context parameters for Shared Clipboard transfers.
     581 */
     582typedef struct VBGLR3SHCLTRANSFERCMDCTX
     583{
     584    /** Callback table to use for all transfers. */
     585    SHCLTRANSFERCALLBACKS Callbacks;
     586} VBGLR3SHCLTRANSFERCMDCTX, *PVBGLR3SHCLTRANSFERCMDCTX;
     587#  endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */
     588
    578589/**
    579590 * Structure containing the context required for
     
    591602
    592603    /** IN: HGCM client ID to use for communication. */
    593     uint32_t            uClientID;
     604    uint32_t                  uClientID;
    594605    /** IN/OUT: Context ID to retrieve or to use. */
    595     uint32_t            uContextID;
     606    uint32_t                  uContextID;
    596607    /** IN: Protocol version to use. */
    597     uint32_t            uProtocolVer;
     608    uint32_t                  uProtocolVer;
    598609    /** IN: Protocol flags. Currently unused. */
    599     uint32_t            uProtocolFlags;
     610    uint32_t                  uProtocolFlags;
    600611    /** IN: Maximum chunk size (in bytes). */
    601     uint32_t            cbChunkSize;
     612    uint32_t                  cbChunkSize;
    602613    /** OUT: Number of parameters retrieved. */
    603     uint32_t            uNumParms;
     614    uint32_t                  uNumParms;
     615#  ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     616    VBGLR3SHCLTRANSFERCMDCTX  Transfers;
     617#  endif
    604618} VBGLR3SHCLCMDCTX, *PVBGLR3SHCLCMDCTX;
    605619
     
    613627    VBGLR3CLIPBOARDEVENTTYPE_READ_DATA,
    614628    VBGLR3CLIPBOARDEVENTTYPE_QUIT,
    615 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     629#  ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    616630    /** Reports a transfer status to the guest. */
    617631    VBGLR3CLIPBOARDEVENTTYPE_URI_TRANSFER_STATUS,
    618 #endif
     632#  endif
    619633    /** Blow the type up to 32-bit. */
    620634    VBGLR3CLIPBOARDEVENTTYPE_32BIT_HACK = 0x7fffffff
     
    636650        /** Reports that data needs to be read from the guest. */
    637651        SHCLDATAREQ          ReadData;
    638 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     652#  ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    639653        /** Reports a transfer status to the guest. */
    640654        struct
     
    647661            SHCLTRANSFERREPORT Report;
    648662        } TransferStatus;
    649 #endif
     663#  endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */
    650664    } u;
    651665} VBGLR3CLIPBOARDEVENT, *PVBGLR3CLIPBOARDEVENT;
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp

    r80886 r80905  
    9494*********************************************************************************************************************************/
    9595#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    96 static DECLCALLBACK(void) vboxClipboardTransferCompleteCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc);
    97 static DECLCALLBACK(void) vboxClipboardTransferErrorCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc);
     96static DECLCALLBACK(int)  vboxClipboardOnTransferStartCallback(PSHCLTRANSFERCALLBACKDATA pData);
     97static DECLCALLBACK(void) vboxClipboardOnTransferCompleteCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc);
     98static DECLCALLBACK(void) vboxClipboardOnTransferErrorCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc);
    9899#endif
    99100
     
    183184}
    184185
    185 static DECLCALLBACK(void) vboxClipboardTransferCompleteCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc)
    186 {
    187     RT_NOREF(rc);
    188 
    189     LogFlowFunc(("pData=%p, rc=%Rrc\n", pData, rc));
     186static DECLCALLBACK(int) vboxClipboardOnTransferStartCallback(PSHCLTRANSFERCALLBACKDATA pData)
     187{
     188    PSHCLCONTEXT pCtx = (PSHCLCONTEXT)pData->pvUser;
     189    AssertPtr(pCtx);
     190
     191    LogFlowFunc(("pCtx=%p\n", pCtx));
     192
     193    int rc = SharedClipboardWinOpen(pCtx->Win.hWnd);
     194    if (RT_SUCCESS(rc))
     195    {
     196        PSHCLTRANSFER pTransfer;
     197        rc = SharedClipboardTransferCreate(&pTransfer);
     198        if (RT_SUCCESS(rc))
     199            rc = SharedClipboardTransferInit(pTransfer, 0 /* uID */,
     200                                             SHCLTRANSFERDIR_WRITE, SHCLSOURCE_LOCAL);
     201        if (RT_SUCCESS(rc))
     202        {
     203            /* The data data in CF_HDROP format, as the files are locally present and don't need to be
     204             * presented as a IDataObject or IStream. */
     205            HANDLE hClip = hClip = GetClipboardData(CF_HDROP);
     206            if (hClip)
     207            {
     208                HDROP hDrop = (HDROP)GlobalLock(hClip);
     209                if (hDrop)
     210                {
     211                    char    *papszList = NULL;
     212                    uint32_t cbList;
     213                    rc = SharedClipboardWinDropFilesToStringList((DROPFILES *)hDrop, &papszList, &cbList);
     214
     215                    GlobalUnlock(hClip);
     216
     217                    if (RT_SUCCESS(rc))
     218                    {
     219                        rc = SharedClipboardTransferRootsSet(pTransfer,
     220                                                             papszList, cbList + 1 /* Include termination */);
     221                        RTStrFree(papszList);
     222                    }
     223                }
     224                else
     225                {
     226                    hClip = NULL;
     227                }
     228            }
     229        }
     230
     231        SharedClipboardWinClose();
     232    }
     233
     234    LogFlowFuncLeaveRC(rc);
     235    return rc;
     236}
     237
     238static DECLCALLBACK(void) vboxClipboardOnTransferCompleteCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc)
     239{
     240    PSHCLCONTEXT pCtx = (PSHCLCONTEXT)pData->pvUser;
     241    AssertPtr(pCtx);
     242
     243    RT_NOREF(pCtx, rc);
     244
     245    LogFlowFunc(("pCtx=%p, rc=%Rrc\n", pCtx, rc));
    190246
    191247    LogRel2(("Shared Clipboard: Transfer to destination complete\n"));
     
    194250}
    195251
    196 static DECLCALLBACK(void) vboxClipboardTransferErrorCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc)
    197 {
    198     RT_NOREF(rc);
    199 
    200     LogFlowFunc(("pData=%p, rc=%Rrc\n", pData, rc));
     252static DECLCALLBACK(void) vboxClipboardOnTransferErrorCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc)
     253{
     254    PSHCLCONTEXT pCtx = (PSHCLCONTEXT)pData->pvUser;
     255    AssertPtr(pCtx);
     256
     257    RT_NOREF(pCtx, rc);
     258
     259    LogFlowFunc(("pCtx=%p, rc=%Rrc\n", pCtx, rc));
    201260
    202261    LogRel(("Shared Clipboard: Transfer to destination failed with %Rrc\n", rc));
     
    770829                   }
    771830               }
    772 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     831#if 0
    773832               else if (uFormat == VBOX_SHCL_FMT_URI_LIST)
    774833               {
     
    9791038               creationCtx.enmSource = SHCLSOURCE_REMOTE;
    9801039
    981                creationCtx.Interface.pfnGetRoots      = vboxClipboardTransferGetRoots;
     1040               creationCtx.Interface.pfnRootsGet      = vboxClipboardTransferGetRoots;
    9821041               creationCtx.Interface.pfnListOpen      = vboxClipboardTransferListOpen;
    9831042               creationCtx.Interface.pfnListClose     = vboxClipboardTransferListClose;
     
    11511210    }
    11521211    else
     1212    {
    11531213        LogRel(("Shared Clipboard: Initialized OLE\n"));
     1214
     1215        /* Install callbacks. */
     1216        RT_ZERO(pCtx->CmdCtx.Transfers.Callbacks);
     1217
     1218        pCtx->CmdCtx.Transfers.Callbacks.pvUser = pCtx; /* Assign context as user-provided callback data. */
     1219
     1220        pCtx->CmdCtx.Transfers.Callbacks.pfnTransferStart    = vboxClipboardOnTransferStartCallback;
     1221        pCtx->CmdCtx.Transfers.Callbacks.pfnTransferComplete = vboxClipboardOnTransferCompleteCallback;
     1222        pCtx->CmdCtx.Transfers.Callbacks.pfnTransferError    = vboxClipboardOnTransferErrorCallback;
     1223    }
    11541224#endif
    11551225
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp

    r80886 r80905  
    12631263    if (RT_SUCCESS(rc))
    12641264    {
     1265        SharedClipboardTransferSetCallbacks(pTransfer, &pCmdCtx->Transfers.Callbacks);
     1266
    12651267        rc = SharedClipboardTransferCtxTransferRegisterByIndex(pTransferCtx, pTransfer, uTransferID);
    12661268        if (RT_SUCCESS(rc))
    12671269        {
    12681270            rc = SharedClipboardTransferInit(pTransfer, uTransferID, enmDir, enmSource);
    1269             if (RT_FAILURE(rc))
     1271            if (RT_SUCCESS(rc))
     1272            {
     1273                rc = SharedClipboardTransferStart(pTransfer);
     1274            }
     1275            else
    12701276                SharedClipboardTransferCtxTransferUnregister(pTransferCtx, uTransferID);
    12711277        }
     
    13591365                switch (transferReport.uStatus)
    13601366                {
    1361                     case SHCLTRANSFERSTATUS_READY:
     1367                    case SHCLTRANSFERSTATUS_INITIALIZED:
    13621368                        RT_FALL_THROUGH();
    13631369                    case SHCLTRANSFERSTATUS_STARTED:
  • trunk/src/VBox/GuestHost/SharedClipboard/ClipboardDataObjectImpl-win.cpp

    r80885 r80905  
    335335    {
    336336        PSHCLROOTLIST pRootList;
    337         rc = SharedClipboardTransferLTransferRootsAsList(pTransfer, &pRootList);
     337        rc = SharedClipboardTransferRootsGet(pTransfer, &pRootList);
    338338        if (RT_SUCCESS(rc))
    339339        {
     
    570570        const bool fUnicode = pFormatEtc->cfFormat == m_cfFileDescriptorW;
    571571
    572         LogFlowFunc(("FormatIndex_FileDescriptor%s\n", fUnicode ? "W" : "A"));
     572        const uint32_t enmTransferStatus = SharedClipboardTransferGetStatus(m_pTransfer);
     573
     574        LogFlowFunc(("FormatIndex_FileDescriptor%s, transfer status is %s\n",
     575                     fUnicode ? "W" : "A", VBoxShClTransferStatusToStr(enmTransferStatus)));
    573576
    574577        int rc;
    575578
    576579        /* The caller can call GetData() several times, so make sure we don't do the same transfer multiple times. */
    577         if (SharedClipboardTransferGetStatus(m_pTransfer) == SHCLTRANSFERSTATUS_NONE)
    578         {
    579             rc = SharedClipboardTransferPrepare(m_pTransfer);
     580        if (enmTransferStatus == SHCLTRANSFERSTATUS_INITIALIZED)
     581        {
     582            /* Start the transfer asynchronously in a separate thread. */
     583            rc = SharedClipboardTransferRun(m_pTransfer, &SharedClipboardWinDataObject::readThread, this);
    580584            if (RT_SUCCESS(rc))
    581585            {
    582                 /* Start the transfer asynchronously in a separate thread. */
    583                 rc = SharedClipboardTransferRun(m_pTransfer, &SharedClipboardWinDataObject::readThread, this);
     586                /* Don't block for too long here, as this also will screw other apps running on the OS. */
     587                LogFunc(("Waiting for listing to arrive ...\n"));
     588                rc = RTSemEventWait(m_EventListComplete, 30 * 1000 /* 30s timeout */);
    584589                if (RT_SUCCESS(rc))
    585590                {
    586                     /* Don't block for too long here, as this also will screw other apps running on the OS. */
    587                     LogFunc(("Waiting for listing to arrive ...\n"));
    588                     rc = RTSemEventWait(m_EventListComplete, 30 * 1000 /* 30s timeout */);
    589                     if (RT_SUCCESS(rc))
    590                     {
    591                         LogFunc(("Listing complete\n"));
    592                     }
     591                    LogFunc(("Listing complete\n"));
    593592                }
    594593            }
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp

    r80886 r80905  
    11571157
    11581158/**
    1159  * Initializes an Shared Clipboard transfer object.
     1159 * Initializes a shared Clipboard transfer object.
    11601160 *
    11611161 * @returns VBox status code.
     
    11731173
    11741174    int rc = SharedClipboardEventSourceCreate(&pTransfer->Events, pTransfer->State.uID);
     1175    if (RT_SUCCESS(rc))
     1176    {
     1177        pTransfer->State.enmStatus = SHCLTRANSFERSTATUS_INITIALIZED; /* Now we're ready to run. */
     1178
     1179        if (pTransfer->Callbacks.pfnTransferInitialize)
     1180        {
     1181            SHCLTRANSFERCALLBACKDATA Data = { pTransfer, pTransfer->Callbacks.pvUser };
     1182            rc = pTransfer->Callbacks.pfnTransferInitialize(&Data);
     1183        }
     1184    }
    11751185
    11761186    LogFlowFuncLeaveRC(rc);
     
    16441654
    16451655/**
    1646  * Returns the current transfer object for a clipboard Shared Clipboard transfer list.
     1656 * Returns the current transfer object for a Shared Clipboard transfer list.
    16471657 *
    16481658 * Currently not implemented and wil return NULL.
     
    18531863
    18541864/**
    1855  * Prepares everything needed for a read / write transfer to begin.
    1856  *
    1857  * @returns VBox status code.
    1858  * @param   pTransfer           Clipboard transfer to prepare.
    1859  */
    1860 int SharedClipboardTransferPrepare(PSHCLTRANSFER pTransfer)
    1861 {
    1862     AssertPtrReturn(pTransfer, VERR_INVALID_POINTER);
    1863 
    1864     LogFlowFuncEnter();
    1865 
    1866     int rc = VINF_SUCCESS;
    1867 
    1868     AssertMsgReturn(pTransfer->State.enmStatus == SHCLTRANSFERSTATUS_NONE,
    1869                     ("Transfer has wrong state (%RU32)\n", pTransfer->State.enmStatus), VERR_WRONG_ORDER);
    1870 
    1871     LogFlowFunc(("pTransfer=%p, enmDir=%RU32\n", pTransfer, pTransfer->State.enmDir));
    1872 
    1873     if (pTransfer->Callbacks.pfnTransferPrepare)
    1874     {
    1875         SHCLTRANSFERCALLBACKDATA callbackData = { pTransfer, pTransfer->Callbacks.pvUser };
    1876         pTransfer->Callbacks.pfnTransferPrepare(&callbackData);
    1877     }
    1878 
    1879     if (RT_SUCCESS(rc))
    1880     {
    1881         pTransfer->State.enmStatus = SHCLTRANSFERSTATUS_READY;
    1882 
    1883         /** @todo Add checksum support. */
    1884     }
    1885 
    1886     LogFlowFuncLeaveRC(rc);
    1887     return rc;
    1888 }
    1889 
    1890 /**
    18911865 * Sets the transfer provider interface for a given transfer.
    18921866 *
     
    19131887    LOG_IFACE_PTR(pfnTransferOpen);
    19141888    LOG_IFACE_PTR(pfnTransferClose);
    1915     LOG_IFACE_PTR(pfnGetRoots);
     1889    LOG_IFACE_PTR(pfnRootsGet);
    19161890    LOG_IFACE_PTR(pfnListOpen);
    19171891    LOG_IFACE_PTR(pfnListClose);
     
    19281902
    19291903/**
    1930  * Clears (resets) the root list of an Shared Clipboard transfer.
     1904 * Clears (resets) the root list of a shared Clipboard transfer.
    19311905 *
    19321906 * @param   pTransfer           Transfer to clear transfer root list for.
     
    19571931
    19581932/**
    1959  * Sets transfer root list entries for a given transfer.
    1960  *
    1961  * @returns VBox status code.
    1962  * @param   pTransfer           Transfer to set transfer list entries for.
    1963  * @param   pszRoots            String list (separated by CRLF) of root entries to set.
    1964  *                              All entries must have the same root path.
    1965  * @param   cbRoots             Size (in bytes) of string list.
    1966  */
    1967 int SharedClipboardTransferSetRoots(PSHCLTRANSFER pTransfer, const char *pszRoots, size_t cbRoots)
    1968 {
    1969     AssertPtrReturn(pTransfer,      VERR_INVALID_POINTER);
    1970     AssertPtrReturn(pszRoots,       VERR_INVALID_POINTER);
    1971     AssertReturn(cbRoots,           VERR_INVALID_PARAMETER);
    1972 
    1973     if (!RTStrIsValidEncoding(pszRoots))
    1974         return VERR_INVALID_PARAMETER;
    1975 
    1976     int rc = VINF_SUCCESS;
     1933 * Resets a shared Clipboard transfer.
     1934 *
     1935 * @param   pTransfer           Clipboard transfer to reset.
     1936 */
     1937void SharedClipboardTransferReset(PSHCLTRANSFER pTransfer)
     1938{
     1939    AssertPtrReturnVoid(pTransfer);
     1940
     1941    LogFlowFuncEnter();
    19771942
    19781943    sharedClipboardTransferListRootsClear(pTransfer);
    1979 
    1980     char  *pszPathRootAbs = NULL;
    1981 
    1982     RTCList<RTCString> lstRootEntries = RTCString(pszRoots, cbRoots - 1).split("\r\n");
    1983     for (size_t i = 0; i < lstRootEntries.size(); ++i)
    1984     {
    1985         PSHCLLISTROOT pListRoot = (PSHCLLISTROOT)RTMemAlloc(sizeof(SHCLLISTROOT));
    1986         AssertPtrBreakStmt(pListRoot, rc = VERR_NO_MEMORY);
    1987 
    1988         pListRoot->pszPathAbs = RTStrDup(lstRootEntries.at(i).c_str());
    1989         AssertPtrBreakStmt(pListRoot->pszPathAbs, rc = VERR_NO_MEMORY);
    1990 
    1991         if (!pszPathRootAbs)
    1992         {
    1993             pszPathRootAbs = RTStrDup(pListRoot->pszPathAbs);
    1994             if (pszPathRootAbs)
    1995             {
    1996                 RTPathStripFilename(pszPathRootAbs);
    1997                 LogFlowFunc(("pszPathRootAbs=%s\n", pszPathRootAbs));
    1998             }
    1999             else
    2000                 rc = VERR_NO_MEMORY;
    2001         }
    2002 
    2003         if (RT_FAILURE(rc))
    2004             break;
    2005 
    2006         /* Make sure all entries have the same root path. */
    2007         if (!RTStrStartsWith(pListRoot->pszPathAbs, pszPathRootAbs))
    2008         {
    2009             rc = VERR_INVALID_PARAMETER;
    2010             break;
    2011         }
    2012 
    2013         RTListAppend(&pTransfer->lstRoots, &pListRoot->Node);
    2014 
    2015         pTransfer->cRoots++;
    2016     }
    2017 
    2018     /** @todo Entry rollback on failure? */
    2019 
    2020     if (RT_SUCCESS(rc))
    2021     {
    2022         pTransfer->pszPathRootAbs = pszPathRootAbs;
    2023         LogFlowFunc(("pszPathRootAbs=%s, cRoots=%zu\n", pTransfer->pszPathRootAbs, pTransfer->cRoots));
    2024     }
    2025 
    2026     LogFlowFuncLeaveRC(rc);
    2027     return rc;
    2028 }
    2029 
    2030 /**
    2031  * Resets an clipboard Shared Clipboard transfer.
    2032  *
    2033  * @param   pTransfer           Clipboard transfer to reset.
    2034  */
    2035 void SharedClipboardTransferReset(PSHCLTRANSFER pTransfer)
    2036 {
    2037     AssertPtrReturnVoid(pTransfer);
    2038 
    2039     LogFlowFuncEnter();
    2040 
    2041     sharedClipboardTransferListRootsClear(pTransfer);
    2042 }
    2043 
    2044 /**
    2045  * Returns the clipboard area for a clipboard Shared Clipboard transfer.
     1944}
     1945
     1946/**
     1947 * Returns the clipboard area for a Shared Clipboard transfer.
    20461948 *
    20471949 * @returns Current clipboard area, or NULL if none.
     
    20751977 * @param   uIdx                Index of root list entry to return.
    20761978 */
    2077 inline PSHCLLISTROOT sharedClipboardTransferRootsGet(PSHCLTRANSFER pTransfer, uint32_t uIdx)
     1979inline PSHCLLISTROOT sharedClipboardTransferRootsGetInternal(PSHCLTRANSFER pTransfer, uint32_t uIdx)
    20781980{
    20791981    if (uIdx >= pTransfer->cRoots)
     
    20811983
    20821984    PSHCLLISTROOT pIt = RTListGetFirst(&pTransfer->lstRoots, SHCLLISTROOT, Node);
    2083     while (uIdx--)
     1985    while (uIdx--) /** @todo Slow, but works for now. */
    20841986        pIt = RTListGetNext(&pTransfer->lstRoots, pIt, SHCLLISTROOT, Node);
    20851987
     
    20961998 */
    20971999int SharedClipboardTransferRootsEntry(PSHCLTRANSFER pTransfer,
    2098                                                uint64_t uIndex, PSHCLROOTLISTENTRY pEntry)
     2000                                      uint64_t uIndex, PSHCLROOTLISTENTRY pEntry)
    20992001{
    21002002    AssertPtrReturn(pTransfer, VERR_INVALID_POINTER);
     
    21062008    int rc;
    21072009
    2108     PSHCLLISTROOT pRoot = sharedClipboardTransferRootsGet(pTransfer, uIndex);
     2010    PSHCLLISTROOT pRoot = sharedClipboardTransferRootsGetInternal(pTransfer, uIndex);
    21092011    AssertPtrReturn(pRoot, VERR_INVALID_PARAMETER);
    21102012
     
    21532055
    21542056/**
    2155  * Returns the root entries of an Shared Clipboard transfer.
     2057 * Returns the root entries of a shared Clipboard transfer.
    21562058 *
    21572059 * @returns VBox status code.
     
    21592061 * @param   ppRootList          Where to store the root list on success.
    21602062 */
    2161 int SharedClipboardTransferRootsAsList(PSHCLTRANSFER pTransfer, PSHCLROOTLIST *ppRootList)
     2063int SharedClipboardTransferRootsGet(PSHCLTRANSFER pTransfer, PSHCLROOTLIST *ppRootList)
    21622064{
    21632065    AssertPtrReturn(pTransfer,  VERR_INVALID_POINTER);
     
    22102112    else if (pTransfer->State.enmSource == SHCLSOURCE_REMOTE)
    22112113    {
    2212         if (pTransfer->ProviderIface.pfnGetRoots)
    2213             rc = pTransfer->ProviderIface.pfnGetRoots(&pTransfer->ProviderCtx, ppRootList);
     2114        if (pTransfer->ProviderIface.pfnRootsGet)
     2115            rc = pTransfer->ProviderIface.pfnRootsGet(&pTransfer->ProviderCtx, ppRootList);
    22142116        else
    22152117            rc = VERR_NOT_SUPPORTED;
     
    22202122}
    22212123
     2124
     2125/**
     2126 * Sets transfer root list entries for a given transfer.
     2127 *
     2128 * @returns VBox status code.
     2129 * @param   pTransfer           Transfer to set transfer list entries for.
     2130 * @param   pszRoots            String list (separated by CRLF) of root entries to set.
     2131 *                              All entries must have the same root path.
     2132 * @param   cbRoots             Size (in bytes) of string list.
     2133 */
     2134int SharedClipboardTransferRootsSet(PSHCLTRANSFER pTransfer, const char *pszRoots, size_t cbRoots)
     2135{
     2136    AssertPtrReturn(pTransfer,      VERR_INVALID_POINTER);
     2137    AssertPtrReturn(pszRoots,       VERR_INVALID_POINTER);
     2138    AssertReturn(cbRoots,           VERR_INVALID_PARAMETER);
     2139
     2140    if (!RTStrIsValidEncoding(pszRoots))
     2141        return VERR_INVALID_PARAMETER;
     2142
     2143    int rc = VINF_SUCCESS;
     2144
     2145    sharedClipboardTransferListRootsClear(pTransfer);
     2146
     2147    char  *pszPathRootAbs = NULL;
     2148
     2149    RTCList<RTCString> lstRootEntries = RTCString(pszRoots, cbRoots - 1).split("\r\n");
     2150    for (size_t i = 0; i < lstRootEntries.size(); ++i)
     2151    {
     2152        PSHCLLISTROOT pListRoot = (PSHCLLISTROOT)RTMemAlloc(sizeof(SHCLLISTROOT));
     2153        AssertPtrBreakStmt(pListRoot, rc = VERR_NO_MEMORY);
     2154
     2155        pListRoot->pszPathAbs = RTStrDup(lstRootEntries.at(i).c_str());
     2156        AssertPtrBreakStmt(pListRoot->pszPathAbs, rc = VERR_NO_MEMORY);
     2157
     2158        if (!pszPathRootAbs)
     2159        {
     2160            pszPathRootAbs = RTStrDup(pListRoot->pszPathAbs);
     2161            if (pszPathRootAbs)
     2162            {
     2163                RTPathStripFilename(pszPathRootAbs);
     2164                LogFlowFunc(("pszPathRootAbs=%s\n", pszPathRootAbs));
     2165            }
     2166            else
     2167                rc = VERR_NO_MEMORY;
     2168        }
     2169
     2170        if (RT_FAILURE(rc))
     2171            break;
     2172
     2173        /* Make sure all entries have the same root path. */
     2174        if (!RTStrStartsWith(pListRoot->pszPathAbs, pszPathRootAbs))
     2175        {
     2176            rc = VERR_INVALID_PARAMETER;
     2177            break;
     2178        }
     2179
     2180        RTListAppend(&pTransfer->lstRoots, &pListRoot->Node);
     2181
     2182        pTransfer->cRoots++;
     2183    }
     2184
     2185    /** @todo Entry rollback on failure? */
     2186
     2187    if (RT_SUCCESS(rc))
     2188    {
     2189        pTransfer->pszPathRootAbs = pszPathRootAbs;
     2190        LogFlowFunc(("pszPathRootAbs=%s, cRoots=%zu\n", pTransfer->pszPathRootAbs, pTransfer->cRoots));
     2191    }
     2192
     2193    LogFlowFuncLeaveRC(rc);
     2194    return rc;
     2195}
     2196
    22222197/**
    22232198 * Returns the transfer's ID.
     
    22602235
    22612236/**
    2262  * Runs (starts) an Shared Clipboard transfer thread.
     2237 * Starts (runs) a Shared Clipboard transfer in a dedicated thread.
    22632238 *
    22642239 * @returns VBox status code.
     
    22712246    AssertPtrReturn(pTransfer, VERR_INVALID_POINTER);
    22722247
    2273     AssertMsgReturn(pTransfer->State.enmStatus == SHCLTRANSFERSTATUS_READY,
    2274                     ("Wrong status (currently is %RU32)\n", pTransfer->State.enmStatus), VERR_WRONG_ORDER);
    2275 
    2276     int rc = sharedClipboardTransferThreadCreate(pTransfer, pfnThreadFunc, pvUser);
     2248    int rc = SharedClipboardTransferStart(pTransfer);
     2249    if (RT_SUCCESS(rc))
     2250        rc = sharedClipboardTransferThreadCreate(pTransfer, pfnThreadFunc, pvUser);
    22772251
    22782252    LogFlowFuncLeaveRC(rc);
     
    22812255
    22822256/**
    2283  * Sets or unsets the callback table to be used for a clipboard Shared Clipboard transfer.
     2257 * Starts an initialized transfer.
     2258 *
     2259 * @returns VBox status code.
     2260 * @param   pTransfer           Clipboard transfer to start.
     2261 */
     2262int SharedClipboardTransferStart(PSHCLTRANSFER pTransfer)
     2263{
     2264    AssertPtrReturn(pTransfer, VERR_INVALID_POINTER);
     2265
     2266    /* Ready to start? */
     2267    AssertMsgReturn(pTransfer->State.enmStatus == SHCLTRANSFERSTATUS_INITIALIZED,
     2268                    ("Wrong status (currently is %s)\n", VBoxShClTransferStatusToStr(pTransfer->State.enmStatus)),
     2269                    VERR_WRONG_ORDER);
     2270
     2271    int rc;
     2272
     2273    if (pTransfer->Callbacks.pfnTransferStart)
     2274    {
     2275        SHCLTRANSFERCALLBACKDATA Data = { pTransfer, pTransfer->Callbacks.pvUser };
     2276        rc = pTransfer->Callbacks.pfnTransferStart(&Data);
     2277    }
     2278    else
     2279        rc = VINF_SUCCESS;
     2280
     2281    /* Nothing else to do here right now. */
     2282
     2283    LogFlowFuncLeaveRC(rc);
     2284    return rc;
     2285}
     2286
     2287/**
     2288 * Sets or unsets the callback table to be used for a Shared Clipboard transfer.
    22842289 *
    22852290 * @returns VBox status code.
     
    22992304        pTransfer->Callbacks.a_pfnCallback = pCallbacks->a_pfnCallback
    23002305
    2301     SET_CALLBACK(pfnTransferPrepare);
    2302     SET_CALLBACK(pfnTransferStarted);
     2306    SET_CALLBACK(pfnTransferInitialize);
     2307    SET_CALLBACK(pfnTransferStart);
    23032308    SET_CALLBACK(pfnListHeaderComplete);
    23042309    SET_CALLBACK(pfnListEntryComplete);
    23052310    SET_CALLBACK(pfnTransferCanceled);
    23062311    SET_CALLBACK(pfnTransferError);
    2307     SET_CALLBACK(pfnTransferStarted);
    23082312
    23092313#undef SET_CALLBACK
     
    23132317
    23142318/**
    2315  * Creates a thread for a clipboard Shared Clipboard transfer.
     2319 * Creates a thread for a Shared Clipboard transfer.
    23162320 *
    23172321 * @returns VBox status code.
     
    23472351
    23482352/**
    2349  * Destroys a thread of a clipboard Shared Clipboard transfer.
     2353 * Destroys a thread of a Shared Clipboard transfer.
    23502354 *
    23512355 * @returns VBox status code.
     
    23742378
    23752379/**
    2376  * Initializes a clipboard Shared Clipboard transfer.
     2380 * Initializes a Shared Clipboard transfer.
    23772381 *
    23782382 * @returns VBox status code.
     
    24022406
    24032407/**
    2404  * Destroys an Shared Clipboard transfer context context struct.
     2408 * Destroys a shared Clipboard transfer context context struct.
    24052409 *
    24062410 * @param   pTransferCtx                Transfer context to destroy.
     
    24302434
    24312435/**
    2432  * Resets an clipboard Shared Clipboard transfer.
     2436 * Resets a shared Clipboard transfer.
    24332437 *
    24342438 * @param   pTransferCtx                Transfer context to reset.
     
    25012505
    25022506/**
    2503  * Registers an Shared Clipboard transfer with a transfer context, i.e. allocates a transfer ID.
     2507 * Registers a shared Clipboard transfer with a transfer context, i.e. allocates a transfer ID.
    25042508 *
    25052509 * @return  VBox status code.
     
    25542558
    25552559/**
    2556  * Registers an Shared Clipboard transfer with a transfer contextby specifying an ID for the transfer.
     2560 * Registers a shared Clipboard transfer with a transfer contextby specifying an ID for the transfer.
    25572561 *
    25582562 * @return  VBox status code.
     
    29482952 *
    29492953 * @returns Transfer status string name.
    2950  * @param   uStatus             The transfer status to translate.
    2951  */
    2952 const char *VBoxShClTransferStatusToStr(uint32_t uStatus)
    2953 {
    2954     switch (uStatus)
     2954 * @param   enmStatus           The transfer status to translate.
     2955 */
     2956const char *VBoxShClTransferStatusToStr(SHCLTRANSFERSTATUS enmStatus)
     2957{
     2958    switch (enmStatus)
    29552959    {
    29562960        RT_CASE_RET_STR(SHCLTRANSFERSTATUS_NONE);
    2957         RT_CASE_RET_STR(SHCLTRANSFERSTATUS_READY);
     2961        RT_CASE_RET_STR(SHCLTRANSFERSTATUS_INITIALIZED);
    29582962        RT_CASE_RET_STR(SHCLTRANSFERSTATUS_STARTED);
    29592963        RT_CASE_RET_STR(SHCLTRANSFERSTATUS_STOPPED);
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp

    r80883 r80905  
    9090
    9191        HGCMSvcSetU32(&pMsgHdr->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,
    92                                                                                    pCtx->pTransfer->State.uID, uEvent));
     92                                                                     pCtx->pTransfer->State.uID, uEvent));
    9393        HGCMSvcSetU32(&pMsgHdr->paParms[1], 0 /* fRoots */);
    9494
     
    644644    LogFlowFuncLeaveRC(rc);
    645645    return rc;
    646 }
    647 
    648 
    649 /*********************************************************************************************************************************
    650 *   transfer callbacks                                                                                                                *
    651 *********************************************************************************************************************************/
    652 
    653 DECLCALLBACK(void) VBoxSvcClipboardTransferPrepareCallback(PSHCLTRANSFERCALLBACKDATA pData)
    654 {
    655     RT_NOREF(pData);
    656 
    657     LogFlowFuncEnter();
    658 }
    659 
    660 DECLCALLBACK(void) VBoxSvcClipboardTransferCompleteCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc)
    661 {
    662     RT_NOREF(pData, rc);
    663 
    664     LogFlowFuncEnter();
    665 
    666     LogRel2(("Shared Clipboard: Transfer complete\n"));
    667 }
    668 
    669 DECLCALLBACK(void) VBoxSvcClipboardTransferCanceledCallback(PSHCLTRANSFERCALLBACKDATA pData)
    670 {
    671     LogFlowFuncEnter();
    672 
    673     RT_NOREF(pData);
    674 
    675     LogRel2(("Shared Clipboard: Transfer canceled\n"));
    676 }
    677 
    678 DECLCALLBACK(void) VBoxSvcClipboardTransferErrorCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc)
    679 {
    680     LogFlowFuncEnter();
    681 
    682     RT_NOREF(pData, rc);
    683 
    684     LogRel(("Shared Clipboard: Transfer failed with %Rrc\n", rc));
    685646}
    686647
     
    13731334                        if (enmDir == SHCLTRANSFERDIR_READ)
    13741335                        {
    1375                             creationCtx.Interface.pfnGetRoots        = sharedClipboardSvcTransferGetRoots;
     1336                            creationCtx.Interface.pfnRootsGet        = sharedClipboardSvcTransferGetRoots;
    13761337                            creationCtx.Interface.pfnListHdrRead     = sharedClipboardSvcTransferListHdrRead;
    13771338                            creationCtx.Interface.pfnListEntryRead   = sharedClipboardSvcTransferListEntryRead;
     
    21762137                    creationCtx.Interface.pfnObjClose        = sharedClipboardSvcTransferObjClose;
    21772138
    2178                     creationCtx.Interface.pfnGetRoots        = sharedClipboardSvcTransferGetRoots;
     2139                    creationCtx.Interface.pfnRootsGet        = sharedClipboardSvcTransferGetRoots;
    21792140                    creationCtx.Interface.pfnListHdrRead     = sharedClipboardSvcTransferListHdrRead;
    21802141                    creationCtx.Interface.pfnListEntryRead   = sharedClipboardSvcTransferListEntryRead;
     
    21932154            creationCtx.enmSource = pClient->State.enmSource;
    21942155            creationCtx.pvUser    = pClient;
    2195 
    2196             /* Register needed callbacks so that we can wait for the meta data to arrive here. */
    2197             SHCLTRANSFERCALLBACKS Callbacks;
    2198             RT_ZERO(Callbacks);
    2199 
    2200             Callbacks.pvUser                = pClient;
    2201 
    2202             Callbacks.pfnTransferPrepare    = VBoxSvcClipboardTransferPrepareCallback;
    2203             Callbacks.pfnTransferComplete   = VBoxSvcClipboardTransferCompleteCallback;
    2204             Callbacks.pfnTransferCanceled   = VBoxSvcClipboardTransferCanceledCallback;
    2205             Callbacks.pfnTransferError      = VBoxSvcClipboardTransferErrorCallback;
    2206 
    2207             SharedClipboardTransferSetCallbacks(pTransfer, &Callbacks);
    22082156
    22092157            uint32_t uTransferID = 0;
     
    22232171                            SHCLEVENTID uEvent;
    22242172                            rc = sharedClipboardSvcTransferSendStatus(pClient, pTransfer,
    2225                                                                       SHCLTRANSFERSTATUS_READY, VINF_SUCCESS,
     2173                                                                      SHCLTRANSFERSTATUS_INITIALIZED, VINF_SUCCESS,
    22262174                                                                      &uEvent);
    22272175                            if (RT_SUCCESS(rc))
     
    22402188                                    Assert(pReply->uType == VBOX_SHCL_REPLYMSGTYPE_TRANSFER_STATUS);
    22412189
    2242                                     if (pReply->u.TransferStatus.uStatus)
     2190                                    if (pReply->u.TransferStatus.uStatus == SHCLTRANSFERSTATUS_STARTED)
    22432191                                    {
    22442192                                        LogRel2(("Shared Clipboard: Started transfer %RU32 on guest\n", pTransfer->State.uID));
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