VirtualBox

Changeset 81843 in vbox


Ignore:
Timestamp:
Nov 14, 2019 4:30:44 PM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard/Transfers: Update.

Location:
trunk
Files:
10 edited

Legend:

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

    r81820 r81843  
    110110{
    111111    /** Available format(s) as bit map. */
    112     SHCLFORMATS uFormats;
     112    SHCLFORMATS Formats;
    113113    /** Formats flags. Currently unused. */
    114114    uint32_t    fFlags;
     
    284284 *  @{
    285285 */
    286 extern DECLCALLBACK(int)  ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, uint32_t u32Format, void **ppv, uint32_t *pcb);
    287 extern DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, uint32_t u32Formats);
     286extern DECLCALLBACK(int)  ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb);
     287extern DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, SHCLFORMATS Formats);
    288288extern DECLCALLBACK(void) ClipRequestFromX11CompleteCallback(SHCLCONTEXT *pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb);
    289289/** @} */
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp

    r81768 r81843  
    257257                    if (RT_SUCCESS(rc))
    258258                    {
    259                         LogFunc(("WM_CLIPBOARDUPDATE: Reporting formats 0x%x\n", Formats.uFormats));
     259                        LogFunc(("WM_CLIPBOARDUPDATE: Reporting formats 0x%x\n", Formats.Formats));
    260260                        rc = VbglR3ClipboardFormatsReportEx(&pCtx->CmdCtx, &Formats);
    261261                    }
     
    303303                    rc = SharedClipboardWinGetFormats(pWinCtx, &Formats);
    304304                    if (RT_SUCCESS(rc)
    305                         && Formats.uFormats != VBOX_SHCL_FMT_NONE)
     305                        && Formats.Formats != VBOX_SHCL_FMT_NONE)
    306306                    {
    307307                        rc = VbglR3ClipboardFormatsReportEx(&pCtx->CmdCtx, &Formats);
     
    515515            Assert(pEvent->enmType == VBGLR3CLIPBOARDEVENTTYPE_REPORT_FORMATS);
    516516
    517             const SHCLFORMATS fFormats = pEvent->u.ReportedFormats.uFormats;
     517            const SHCLFORMATS fFormats = pEvent->u.ReportedFormats.Formats;
    518518
    519519            if (fFormats != VBOX_SHCL_FMT_NONE) /* Could arrive with some older GA versions. */
     
    10161016                    {
    10171017                        pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_REPORT_FORMATS;
    1018                         pEvent->u.ReportedFormats.uFormats = uFormats;
     1018                        pEvent->u.ReportedFormats.Formats = uFormats;
    10191019                        break;
    10201020                    }
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp

    r81831 r81843  
    200200        rc = Msg.u.v1.uContext.GetUInt64(&pCtx->uContextID);
    201201        if (RT_SUCCESS(rc))
    202             rc = Msg.u.v1.uFormats.GetUInt32(&pFormats->uFormats);
     202            rc = Msg.u.v1.uFormats.GetUInt32(&pFormats->Formats);
    203203        if (RT_SUCCESS(rc))
    204204            rc = Msg.u.v1.fFlags.GetUInt32(&pFormats->fFlags);
     
    23632363    int rc;
    23642364
    2365     LogFlowFunc(("uFormats=0x%x\n", pFormats->uFormats));
     2365    LogFlowFunc(("uFormats=0x%x\n", pFormats->Formats));
    23662366
    23672367    if (pCtx->fUseLegacyProtocol)
    23682368    {
    23692369        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, VBOX_SHCL_GUEST_FN_FORMATS_REPORT, 1);
    2370         Msg.u.v0.uFormats.SetUInt32(pFormats->uFormats);
     2370        Msg.u.v0.uFormats.SetUInt32(pFormats->Formats);
    23712371
    23722372        rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg.hdr) + sizeof(Msg.u.v0));
     
    23772377
    23782378        Msg.u.v1.uContext.SetUInt64(pCtx->uContextID);
    2379         Msg.u.v1.uFormats.SetUInt32(pFormats->uFormats);
     2379        Msg.u.v1.uFormats.SetUInt32(pFormats->Formats);
    23802380        Msg.u.v1.fFlags.SetUInt32(pFormats->fFlags);
    23812381
  • trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp

    r81820 r81843  
    4646struct _SHCLCONTEXT
    4747{
    48     /** Client ID for the clipboard subsystem */
    49     uint32_t client;
    50 
    51     /** Pointer to the X11 clipboard backend */
    52     CLIPBACKEND *pBackend;
     48    /** Client command context */
     49    VBGLR3SHCLCMDCTX CmdCtx;
     50#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     51    /** Associated transfer data. */
     52    SHCLTRANSFERCTX  TransferCtx;
     53#endif
     54    /** Pointer to the X11 clipboard backend. */
     55    CLIPBACKEND     *pBackend;
    5356};
    5457
    5558/** Only one client is supported. There seems to be no need for more clients. */
    56 static SHCLCONTEXT g_ctx;
    57 
    58 
    59 /**
    60  * Transfer clipboard data from the guest to the host.
    61  *
    62  * @returns VBox result code
    63  * @param   u32Format The format of the data being sent
    64  * @param   pv        Pointer to the data being sent
    65  * @param   cb        Size of the data being sent in bytes
    66  */
    67 static int vboxClipboardSendData(uint32_t u32Format, void *pv, uint32_t cb)
    68 {
    69     int rc;
    70     LogFlowFunc(("u32Format=%d, pv=%p, cb=%d\n", u32Format, pv, cb));
    71     rc = VbglR3ClipboardWriteData(g_ctx.client, u32Format, pv, cb);
    72     LogFlowFuncLeaveRC(rc);
    73     return rc;
    74 }
     59static SHCLCONTEXT g_Ctx;
    7560
    7661
     
    7964 *
    8065 * @returns VBox result code
    81  * @param   pCtx      Our context information
    82  * @param   u32Format The format of the data being requested
    83  * @param   ppv       On success and if pcb > 0, this will point to a buffer
    84  *                    to be freed with RTMemFree containing the data read.
    85  * @param   pcb       On success, this contains the number of bytes of data
    86  *                    returned
    87  */
    88 DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, uint32_t u32Format, void **ppv, uint32_t *pcb)
     66 * @param   pCtx                Our context information.
     67 * @param   Format              The format of the data being requested.
     68 * @param   ppv                 On success and if pcb > 0, this will point to a buffer
     69 *                              to be freed with RTMemFree containing the data read.
     70 * @param   pcb                 On success, this contains the number of bytes of data
     71 *                              returned.
     72 */
     73DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
    8974{
    9075    RT_NOREF(pCtx);
     76
     77    LogFlowFunc(("Format=0x%x\n", Format));
     78
    9179    int rc = VINF_SUCCESS;
    92     uint32_t cb = 1024;
    93     void *pv = RTMemAlloc(cb);
    94 
    95     *ppv = 0;
    96     LogFlowFunc(("u32Format=%u\n", u32Format));
    97     if (RT_UNLIKELY(!pv))
    98         rc = VERR_NO_MEMORY;
    99     if (RT_SUCCESS(rc))
    100         rc = VbglR3ClipboardReadData(g_ctx.client, u32Format, pv, cb, pcb);
    101     if (RT_SUCCESS(rc) && (rc != VINF_BUFFER_OVERFLOW))
    102         *ppv = pv;
    103     /* A return value of VINF_BUFFER_OVERFLOW tells us to try again with a
    104      * larger buffer.  The size of the buffer needed is placed in *pcb.
    105      * So we start all over again. */
    106     if (rc == VINF_BUFFER_OVERFLOW)
    107     {
    108         cb = *pcb;
    109         RTMemFree(pv);
    110         pv = RTMemAlloc(cb);
    111         if (RT_UNLIKELY(!pv))
     80
     81    uint32_t cbRead = 0;
     82
     83#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     84    if (Format == VBOX_SHCL_FMT_URI_LIST)
     85    {
     86        //rc = VbglR3ClipboardRootListRead()
     87    }
     88    else
     89#endif
     90    {
     91        SHCLDATABLOCK dataBlock;
     92        RT_ZERO(dataBlock);
     93
     94        dataBlock.uFormat = Format;
     95        dataBlock.cbData  = _4K;
     96        dataBlock.pvData  = RTMemAlloc(dataBlock.cbData);
     97        if (dataBlock.pvData)
     98        {
     99            rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, &dataBlock, &cbRead);
     100        }
     101        else
    112102            rc = VERR_NO_MEMORY;
    113         if (RT_SUCCESS(rc))
    114             rc = VbglR3ClipboardReadData(g_ctx.client, u32Format, pv, cb, pcb);
    115         if (RT_SUCCESS(rc) && (rc != VINF_BUFFER_OVERFLOW))
    116             *ppv = pv;
    117     }
    118     /* Catch other errors. This also catches the case in which the buffer was
    119      * too small a second time, possibly because the clipboard contents
    120      * changed half-way through the operation.  Since we can't say whether or
    121      * not this is actually an error, we just return size 0.
    122      */
    123     if (RT_FAILURE(rc) || (VINF_BUFFER_OVERFLOW == rc))
    124     {
    125         *pcb = 0;
    126         if (pv != NULL)
    127             RTMemFree(pv);
    128     }
     103
     104        /*
     105         * A return value of VINF_BUFFER_OVERFLOW tells us to try again with a
     106         * larger buffer.  The size of the buffer needed is placed in *pcb.
     107         * So we start all over again.
     108         */
     109        if (rc == VINF_BUFFER_OVERFLOW)
     110        {
     111            /* cbRead contains the size required. */
     112
     113            dataBlock.cbData = cbRead;
     114            dataBlock.pvData = RTMemRealloc(dataBlock.pvData, cbRead);
     115            if (dataBlock.pvData)
     116            {
     117                rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, &dataBlock, &cbRead);
     118                if (    RT_SUCCESS(rc)
     119                     && (rc != VINF_BUFFER_OVERFLOW))
     120                {
     121                    *pcb = cbRead; /* Actual bytes read. */
     122                    *ppv = dataBlock.pvData;
     123                }
     124            }
     125            else
     126                rc = VERR_NO_MEMORY;
     127        }
     128
     129        /*
     130         * Catch other errors. This also catches the case in which the buffer was
     131         * too small a second time, possibly because the clipboard contents
     132         * changed half-way through the operation.  Since we can't say whether or
     133         * not this is actually an error, we just return size 0.
     134         */
     135        if (   RT_FAILURE(rc)
     136            || (VINF_BUFFER_OVERFLOW == rc))
     137        {
     138            RTMemFree(dataBlock.pvData);
     139        }
     140    }
     141
    129142    LogFlowFuncLeaveRC(rc);
    130     if (RT_SUCCESS(rc))
    131         LogFlow(("    *pcb=%d\n", *pcb));
    132143    return rc;
    133144}
    134145
    135 /** Opaque data structure describing a request from the host for clipboard
     146/**
     147 * Opaque data structure describing a request from the host for clipboard
    136148 * data, passed in when the request is forwarded to the X11 backend so that
    137  * it can be completed correctly. */
     149 * it can be completed correctly.
     150 */
    138151struct _CLIPREADCBREQ
    139152{
    140153    /** The data format that was requested. */
    141     uint32_t u32Format;
     154    SHCLFORMAT Format;
    142155};
    143156
     
    146159 *
    147160 * @param pCtx                  Our context information.
    148  * @param u32Formats            The formats to report.
    149  */
    150 DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, uint32_t u32Formats)
     161 * @param Formats               The formats to report.
     162 */
     163DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, SHCLFORMATS Formats)
    151164{
    152165    RT_NOREF(pCtx);
    153166
    154     LogFlowFunc(("u32Formats=%RU32\n", u32Formats));
    155 
    156     int rc = VbglR3ClipboardFormatsReport(g_ctx.client, u32Formats);
    157     RT_NOREF(rc);
    158 
    159     LogFlowFuncLeaveRC(rc);
    160 }
    161 
    162 /** This is called by the backend to tell us that a request for data from
     167    LogFlowFunc(("Formats=0x%x\n", Formats));
     168
     169    SHCLFORMATDATA formatData;
     170    RT_ZERO(formatData);
     171
     172    formatData.Formats = Formats;
     173
     174    int rc2 = VbglR3ClipboardFormatsReportEx(&pCtx->CmdCtx, &formatData);
     175    RT_NOREF(rc2);
     176    LogFlowFuncLeaveRC(rc2);
     177}
     178
     179/**
     180 * This is called by the backend to tell us that a request for data from
    163181 * X11 has completed.
    164  * @param  pCtx      Our context information
    165  * @param  rc        the iprt result code of the request
    166  * @param  pReq      the request structure that we passed in when we started
    167  *                   the request.  We RTMemFree() this in this function.
    168  * @param  pv        the clipboard data returned from X11 if the request
    169  *                   succeeded (see @a rc)
    170  * @param  cb        the size of the data in @a pv
     182 *
     183 * @param  pCtx                 Our context information.
     184 * @param  rc                   The IPRT result code of the request.
     185 * @param  pReq                 The request structure that we passed in when we started
     186 *                              the request.  We RTMemFree() this in this function.
     187 * @param  pv                   The clipboard data returned from X11 if the request succeeded (see @a rc).
     188 * @param  cb                   The size of the data in @a pv.
    171189 */
    172190DECLCALLBACK(void) ClipRequestFromX11CompleteCallback(SHCLCONTEXT *pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb)
    173191{
    174192    RT_NOREF(pCtx);
     193
     194    LogFlowFunc(("rc=%Rrc, Format=0x%x, pv=%p, cb=%RU32\n", rc, pReq->Format, pv, cb));
     195
     196    SHCLDATABLOCK dataBlock;
     197    RT_ZERO(dataBlock);
     198
     199    dataBlock.uFormat = pReq->Format;
     200
    175201    if (RT_SUCCESS(rc))
    176         vboxClipboardSendData(pReq->u32Format, pv, cb);
    177     else
    178         vboxClipboardSendData(0, NULL, 0);
     202    {
     203        dataBlock.pvData = pv;
     204        dataBlock.cbData = cb;
     205    }
     206
     207    int rc2 = VbglR3ClipboardWriteDataEx(&pCtx->CmdCtx, &dataBlock);
     208    RT_NOREF(rc2);
     209
    179210    RTMemFree(pReq);
     211
     212    LogFlowFuncLeaveRC(rc2);
    180213}
    181214
     
    183216 * Connect the guest clipboard to the host.
    184217 *
    185  * @returns VBox status code
     218 * @returns VBox status code.
    186219 */
    187220static int vboxClipboardConnect(void)
     
    189222    LogFlowFuncEnter();
    190223
    191     /* Sanity */
    192     AssertReturn(g_ctx.client   == 0,    VERR_WRONG_ORDER);
    193     AssertReturn(g_ctx.pBackend == NULL, VERR_WRONG_ORDER);
    194 
    195224    int rc;
    196225
    197     g_ctx.pBackend = ClipConstructX11(&g_ctx, false);
    198     if (g_ctx.pBackend)
    199     {
    200         rc = ClipStartX11(g_ctx.pBackend, false /* grab */);
     226    g_Ctx.pBackend = ClipConstructX11(&g_Ctx, false);
     227    if (g_Ctx.pBackend)
     228    {
     229        rc = ClipStartX11(g_Ctx.pBackend, false /* grab */);
    201230        if (RT_SUCCESS(rc))
    202231        {
    203             rc = VbglR3ClipboardConnect(&g_ctx.client);
    204             if (RT_SUCCESS(rc))
    205             {
    206                 Assert(g_ctx.client);
    207             }
    208             else
    209                 VBClLogError("Error connecting to host, rc=%Rrc\n", rc);
     232            rc = VbglR3ClipboardConnectEx(&g_Ctx.CmdCtx);
    210233        }
    211234    }
     
    213236        rc = VERR_NO_MEMORY;
    214237
    215     if (rc != VINF_SUCCESS && g_ctx.pBackend)
    216         ClipDestructX11(g_ctx.pBackend);
     238    if (RT_FAILURE(rc))
     239    {
     240        VBClLogError("Error connecting to host service, rc=%Rrc\n", rc);
     241
     242        VbglR3ClipboardDisconnectEx(&g_Ctx.CmdCtx);
     243        ClipDestructX11(g_Ctx.pBackend);
     244    }
    217245
    218246    LogFlowFuncLeaveRC(rc);
     
    225253int vboxClipboardMain(void)
    226254{
     255    LogRel2(("Worker loop running\n"));
     256
    227257    int rc;
    228     LogFlowFunc(("Starting guest clipboard service\n"));
    229     bool fExiting = false;
    230 
    231     while (!fExiting)
    232     {
    233         uint32_t Msg;
    234         uint32_t fFormats;
    235         rc = VbglR3ClipboardGetHostMsgOld(g_ctx.client, &Msg, &fFormats);
    236         if (RT_SUCCESS(rc))
    237         {
    238             switch (Msg)
    239             {
    240                 case VBOX_SHCL_HOST_MSG_FORMATS_REPORT:
    241                 {
    242                     /* The host has announced available clipboard formats.
    243                      * Save the information so that it is available for
    244                      * future requests from guest applications.
    245                      */
    246                     LogFlowFunc(("VBOX_SHCL_HOST_MSG_FORMATS_WRITE fFormats=%x\n", fFormats));
    247                     ClipAnnounceFormatToX11(g_ctx.pBackend, fFormats);
    248                     break;
    249                 }
    250 
    251                 case VBOX_SHCL_HOST_MSG_READ_DATA:
     258
     259    SHCLCONTEXT *pCtx = &g_Ctx;
     260
     261    bool fShutdown = false;
     262
     263    /* The thread waits for incoming messages from the host. */
     264    for (;;)
     265    {
     266        PVBGLR3CLIPBOARDEVENT pEvent = NULL;
     267
     268        LogFlowFunc(("Waiting for host message (fUseLegacyProtocol=%RTbool, fHostFeatures=%#RX64) ...\n",
     269                     pCtx->CmdCtx.fUseLegacyProtocol, pCtx->CmdCtx.fHostFeatures));
     270
     271        if (pCtx->CmdCtx.fUseLegacyProtocol)
     272        {
     273            uint32_t uMsg;
     274            uint32_t uFormats;
     275
     276            rc = VbglR3ClipboardGetHostMsgOld(pCtx->CmdCtx.uClientID, &uMsg, &uFormats);
     277            if (RT_FAILURE(rc))
     278            {
     279                if (rc == VERR_INTERRUPTED)
     280                    break;
     281
     282                LogFunc(("Error getting host message, rc=%Rrc\n", rc));
     283            }
     284            else
     285            {
     286                pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT));
     287                AssertPtrBreakStmt(pEvent, rc = VERR_NO_MEMORY);
     288
     289                switch (uMsg)
     290                {
     291                    case VBOX_SHCL_HOST_MSG_FORMATS_REPORT:
     292                    {
     293                        pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_REPORT_FORMATS;
     294                        pEvent->u.ReportedFormats.Formats = uFormats;
     295                        break;
     296                    }
     297
     298                    case VBOX_SHCL_HOST_MSG_READ_DATA:
     299                    {
     300                        pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_READ_DATA;
     301                        pEvent->u.ReadData.uFmt = uFormats;
     302                        break;
     303                    }
     304
     305                    case VBOX_SHCL_HOST_MSG_QUIT:
     306                    {
     307                        pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_QUIT;
     308                        break;
     309                    }
     310
     311                    default:
     312                        rc = VERR_NOT_SUPPORTED;
     313                        break;
     314                }
     315
     316                if (RT_SUCCESS(rc))
     317                {
     318                    /* Copy over our command context to the event. */
     319                    pEvent->cmdCtx = pCtx->CmdCtx;
     320                }
     321            }
     322        }
     323        else /* Host service has peeking for messages support. */
     324        {
     325            pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT));
     326            AssertPtrBreakStmt(pEvent, rc = VERR_NO_MEMORY);
     327
     328            uint32_t uMsg   = 0;
     329            uint32_t cParms = 0;
     330            rc = VbglR3ClipboardMsgPeekWait(&pCtx->CmdCtx, &uMsg, &cParms, NULL /* pidRestoreCheck */);
     331            if (RT_SUCCESS(rc))
     332            {
     333#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     334                rc = VbglR3ClipboardEventGetNextEx(uMsg, cParms, &pCtx->CmdCtx, &pCtx->TransferCtx, pEvent);
     335#else
     336                rc = VbglR3ClipboardEventGetNext(uMsg, cParms, &pCtx->CmdCtx, pEvent);
     337#endif
     338            }
     339        }
     340
     341        if (RT_FAILURE(rc))
     342        {
     343            LogFlowFunc(("Getting next event failed with %Rrc\n", rc));
     344
     345            VbglR3ClipboardEventFree(pEvent);
     346            pEvent = NULL;
     347
     348            if (fShutdown)
     349                break;
     350
     351            /* Wait a bit before retrying. */
     352            RTThreadSleep(1000);
     353            continue;
     354        }
     355        else
     356        {
     357            AssertPtr(pEvent);
     358            LogFlowFunc(("Event uType=%RU32\n", pEvent->enmType));
     359
     360            switch (pEvent->enmType)
     361            {
     362                case VBGLR3CLIPBOARDEVENTTYPE_REPORT_FORMATS:
     363                {
     364                    ClipAnnounceFormatToX11(g_Ctx.pBackend, pEvent->u.ReportedFormats.Formats);
     365                    break;
     366                }
     367
     368                case VBGLR3CLIPBOARDEVENTTYPE_READ_DATA:
    252369                {
    253370                    /* The host needs data in the specified format. */
    254                     LogFlowFunc(("VBOX_SHCL_HOST_MSG_READ_DATA fFormats=%x\n", fFormats));
    255371                    CLIPREADCBREQ *pReq;
    256                     pReq = (CLIPREADCBREQ *)RTMemAllocZ(sizeof(*pReq));
    257                     if (!pReq)
     372                    pReq = (CLIPREADCBREQ *)RTMemAllocZ(sizeof(CLIPREADCBREQ));
     373                    if (pReq)
    258374                    {
    259                         rc = VERR_NO_MEMORY;
    260                         fExiting = true;
     375                        pReq->Format = pEvent->u.ReadData.uFmt;
     376                        ClipReadDataFromX11(g_Ctx.pBackend, pReq->Format, pReq);
    261377                    }
    262378                    else
    263                     {
    264                         pReq->u32Format = fFormats;
    265                         ClipReadDataFromX11(g_ctx.pBackend, fFormats,
    266                                                pReq);
    267                     }
    268                     break;
    269                 }
    270 
    271                 case VBOX_SHCL_HOST_MSG_QUIT:
    272                 {
    273                     /* The host is terminating. */
    274                     LogFlowFunc(("VBOX_SHCL_HOST_MSG_QUIT\n"));
    275                     if (RT_SUCCESS(ClipStopX11(g_ctx.pBackend)))
    276                         ClipDestructX11(g_ctx.pBackend);
    277                     fExiting = true;
     379                        rc = VERR_NO_MEMORY;
     380                    break;
     381                }
     382
     383                case VBGLR3CLIPBOARDEVENTTYPE_QUIT:
     384                {
     385                    LogRel2(("Host requested termination\n"));
     386                    fShutdown = true;
     387                    break;
     388                }
     389
     390#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     391                case VBGLR3CLIPBOARDEVENTTYPE_TRANSFER_STATUS:
     392                {
     393                    /* Nothing to do here. */
     394                    rc = VINF_SUCCESS;
     395                    break;
     396                }
     397#endif
     398                case VBGLR3CLIPBOARDEVENTTYPE_NONE:
     399                {
     400                    /* Nothing to do here. */
     401                    rc = VINF_SUCCESS;
    278402                    break;
    279403                }
     
    281405                default:
    282406                {
    283                     VBClLogInfo("Unsupported message from host (%RU32)\n", Msg);
    284                     break;
    285                 }
    286             }
    287         }
    288 
    289         LogFlow(("processed host event rc = %d\n", rc));
    290     }
     407                    AssertMsgFailedBreakStmt(("Event type %RU32 not implemented\n", pEvent->enmType), rc = VERR_NOT_SUPPORTED);
     408                }
     409            }
     410
     411            if (pEvent)
     412            {
     413                VbglR3ClipboardEventFree(pEvent);
     414                pEvent = NULL;
     415            }
     416        }
     417
     418        if (fShutdown)
     419            break;
     420    }
     421
     422    LogRel(("Worker loop ended\n"));
     423
    291424    LogFlowFuncLeaveRC(rc);
    292425    return rc;
     
    343476};
    344477
    345 struct VBCLSERVICE **VBClGetClipboardService()
     478struct VBCLSERVICE **VBClGetClipboardService(void)
    346479{
    347480    struct CLIPBOARDSERVICE *pService =
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp

    r81321 r81843  
    459459        LogFlowFunc(("fFormats=0x%08X\n", fFormats));
    460460
    461         pFormats->uFormats = fFormats;
     461        pFormats->Formats = fFormats;
    462462        pFormats->fFlags   = 0; /** @todo Handle flags. */
    463463    }
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp

    r81829 r81843  
    252252#endif
    253253    /** What formats does VBox have on offer? */
    254     uint32_t vboxFormats;
     254    SHCLFORMATS vboxFormats;
    255255    /** Cache of the last unicode data that we received */
    256256    void *pvUnicodeCache;
     
    11001100void ClipDestructX11(CLIPBACKEND *pCtx)
    11011101{
     1102    if (!pCtx)
     1103        return;
     1104
    11021105    if (pCtx->fHaveX11)
     1106    {
    11031107        /* We set this to NULL when the event thread exits.  It really should
    11041108         * have exited at this point, when we are about to unload the code from
    11051109         * memory. */
    11061110        Assert(pCtx->widget == NULL);
     1111    }
     1112
    11071113    RTMemFree(pCtx);
    11081114}
     
    12511257 * data returned.
    12521258 */
    1253 static int clipReadVBoxShCl(CLIPBACKEND *pCtx, uint32_t u32Format,
     1259static int clipReadVBoxShCl(CLIPBACKEND *pCtx, SHCLFORMAT Format,
    12541260                            void **ppv, uint32_t *pcb)
    12551261{
     1262    LogFlowFunc(("pCtx=%p, Format=%02X, ppv=%p, pcb=%p\n", pCtx, Format, ppv, pcb));
     1263
    12561264    int rc = VINF_SUCCESS;
    1257     LogFlowFunc(("pCtx=%p, u32Format=%02X, ppv=%p, pcb=%p\n", pCtx,
    1258                  u32Format, ppv, pcb));
    1259     if (u32Format == VBOX_SHCL_FMT_UNICODETEXT)
     1265
     1266    if (Format == VBOX_SHCL_FMT_UNICODETEXT)
    12601267    {
    12611268        if (pCtx->pvUnicodeCache == NULL)
    1262             rc = ClipRequestDataForX11Callback(pCtx->pFrontend, u32Format,
     1269            rc = ClipRequestDataForX11Callback(pCtx->pFrontend, Format,
    12631270                                               &pCtx->pvUnicodeCache,
    12641271                                               &pCtx->cbUnicodeCache);
     
    12721279    }
    12731280    else
    1274         rc = ClipRequestDataForX11Callback(pCtx->pFrontend, u32Format,
     1281        rc = ClipRequestDataForX11Callback(pCtx->pFrontend, Format,
    12751282                                           ppv, pcb);
    12761283    if (RT_SUCCESS(rc))
     
    14891496
    14901497    CLIPX11FORMAT x11Format = clipFindX11FormatByAtom(pCtx, *atomTarget);
    1491     CLIPFORMAT format = clipRealFormatForX11Format(x11Format);
    1492 
    1493     if (   ((format == UTF8) || (format == TEXT))
     1498    CLIPFORMAT clipFormat = clipRealFormatForX11Format(x11Format);
     1499
     1500    LogFlowFunc(("fFormats=0x%x, x11Format=%u, clipFormat=%u\n", pCtx->vboxFormats, x11Format, clipFormat));
     1501
     1502    if (   ((clipFormat == UTF8) || (clipFormat == TEXT))
    14941503        && (pCtx->vboxFormats & VBOX_SHCL_FMT_UNICODETEXT))
    14951504    {
     
    14991508        if (RT_SUCCESS(rc) && (cb == 0))
    15001509            rc = VERR_NO_DATA;
    1501         if (RT_SUCCESS(rc) && ((format == UTF8) || (format == TEXT)))
     1510        if (RT_SUCCESS(rc) && ((clipFormat == UTF8) || (clipFormat == TEXT)))
    15021511            rc = clipWinTxtToUtf8ForX11CB(XtDisplay(pCtx->widget),
    15031512                                          (PRTUTF16)pv, cb, atomTarget,
     
    15051514                                          pcLenReturn, piFormatReturn);
    15061515        if (RT_SUCCESS(rc))
    1507             clipTrimTrailingNul(*(XtPointer *)pValReturn, pcLenReturn, format);
     1516            clipTrimTrailingNul(*(XtPointer *)pValReturn, pcLenReturn, clipFormat);
    15081517
    15091518        RTMemFree(pv);
    15101519    }
    1511     else if (   (format == BMP)
     1520    else if (   (clipFormat == BMP)
    15121521             && (pCtx->vboxFormats & VBOX_SHCL_FMT_BITMAP))
    15131522    {
     
    15171526        if (RT_SUCCESS(rc) && (cb == 0))
    15181527            rc = VERR_NO_DATA;
    1519         if (RT_SUCCESS(rc) && (format == BMP))
     1528        if (RT_SUCCESS(rc) && (clipFormat == BMP))
    15201529        {
    15211530            /* Create a full BMP from it */
     
    15341543        RTMemFree(pv);
    15351544    }
    1536     else if (  (format == HTML)
     1545    else if (  (clipFormat == HTML)
    15371546            && (pCtx->vboxFormats & VBOX_SHCL_FMT_HTML))
    15381547    {
     
    15571566                                           pcLenReturn, piFormatReturn);
    15581567            if (RT_SUCCESS(rc))
    1559                 clipTrimTrailingNul(*(XtPointer *)pValReturn, pcLenReturn, format);
     1568                clipTrimTrailingNul(*(XtPointer *)pValReturn, pcLenReturn, clipFormat);
    15601569
    15611570            RTMemFree(pv);
    15621571        }
    15631572    }
     1573#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     1574    else if (pCtx->vboxFormats & VBOX_SHCL_FMT_URI_LIST)
     1575    {
     1576        switch (clipFormat)
     1577        {
     1578            case TEXT:
     1579                RT_FALL_THROUGH();
     1580            case UTF8:
     1581            {
     1582                void    *pv = NULL;
     1583                uint32_t cb = 0;
     1584                rc = clipReadVBoxShCl(pCtx, VBOX_SHCL_FMT_URI_LIST, &pv, &cb);
     1585
     1586                RTMemFree(pv);
     1587                break;
     1588            }
     1589
     1590            case URI_LIST:
     1591            {
     1592                break;
     1593            }
     1594
     1595            default:
     1596                rc = VERR_NOT_SUPPORTED;
     1597                break;
     1598        }
     1599    }
     1600#endif
    15641601    else
     1602    {
     1603        *atomTypeReturn = XT_CONVERT_FAIL;
     1604        *pValReturn     = (XtPointer)NULL;
     1605        *pcLenReturn    = 0;
     1606        *piFormatReturn = 0;
     1607
    15651608        rc = VERR_NOT_SUPPORTED;
     1609    }
     1610
     1611    if (RT_FAILURE(rc))
     1612        LogRel2(("Shared Clipboard: Converting format 0x%x for X11 (x11Format=%u, clipFormat=%u) failed, rc=%Rrc\n",
     1613                 pCtx->vboxFormats, x11Format, clipFormat, rc));
    15661614
    15671615    LogFlowFuncLeaveRC(rc);
     
    15871635
    15881636    if (!pCtx)
    1589         return false;
     1637        return False;
    15901638
    15911639    if (!clipIsSupportedSelectionType(pCtx, *atomSelection))
    1592         return false;
     1640        return False;
    15931641
    15941642    if (*atomTarget == clipGetAtom(pCtx, "TARGETS"))
     
    15991647                                     pValReturn, pcLenReturn, piFormatReturn);
    16001648
    1601     LogFlowFunc(("returning, internal status code %Rrc\n", rc));
    1602     return RT_SUCCESS(rc);
     1649    LogFlowFunc(("returning %RTbool, internal status code %Rrc\n", RT_SUCCESS(rc), rc));
     1650    return RT_SUCCESS(rc) ? True : False;
    16031651}
    16041652
     
    16111659    CLIPBACKEND *pCtx;
    16121660    /** Formats supported by VBox. */
    1613     SHCLFORMATS  formats;
     1661    SHCLFORMATS  Formats;
    16141662} CLIPNEWVBOXFORMATS, *PCLIPNEWVBOXFORMATS;
    16151663
     
    16271675 * Takes possession of the X11 clipboard (and middle-button selection).
    16281676 */
    1629 static void clipGrabX11CB(CLIPBACKEND *pCtx, uint32_t u32Formats)
    1630 {
     1677static void clipGrabX11CB(CLIPBACKEND *pCtx, SHCLFORMATS Formats)
     1678{
     1679    LogFlowFuncEnter();
     1680
    16311681    if (XtOwnSelection(pCtx->widget, clipGetAtom(pCtx, "CLIPBOARD"),
    16321682                       CurrentTime, clipXtConvertSelectionProc, NULL, 0))
    16331683    {
    1634         pCtx->vboxFormats = u32Formats;
     1684        pCtx->vboxFormats = Formats;
    16351685        /* Grab the middle-button paste selection too. */
    16361686        XtOwnSelection(pCtx->widget, clipGetAtom(pCtx, "PRIMARY"),
     
    16631713    CLIPBACKEND *pCtx = pFormats->pCtx;
    16641714
    1665     uint32_t fFormats = pFormats->formats;
     1715    uint32_t fFormats = pFormats->Formats;
    16661716
    16671717    RTMemFree(pFormats);
     
    16801730 *
    16811731 * @returns VBox status code.
    1682  * @param   u32Formats          Clipboard formats offered.
    1683  */
    1684 int ClipAnnounceFormatToX11(CLIPBACKEND *pCtx, uint32_t u32Formats)
     1732 * @param   Formats             Clipboard formats offered.
     1733 */
     1734int ClipAnnounceFormatToX11(CLIPBACKEND *pCtx, uint32_t Formats)
    16851735{
    16861736    /*
     
    16971747    {
    16981748        pFormats->pCtx    = pCtx;
    1699         pFormats->formats = u32Formats;
     1749        pFormats->Formats = Formats;
    17001750
    17011751        rc = clipQueueToEventThread(pCtx, clipAnnounceFormatToX11Worker,
     
    22892339 * @returns VBox status code.
    22902340 * @param  pCtx                 Context data for the clipboard backend.
    2291  * @param  u32Format            The format that the VBox would like to receive the data in.
     2341 * @param  Format               The format that the VBox would like to receive the data in.
    22922342 * @param  pReq                 Read callback request to use. Must be free'd in the callback.
    22932343 *
    22942344 * @note   We allocate a request structure which must be freed by the worker.
    22952345 */
    2296 int ClipReadDataFromX11(CLIPBACKEND *pCtx, uint32_t u32Format, CLIPREADCBREQ *pReq)
     2346int ClipReadDataFromX11(CLIPBACKEND *pCtx, SHCLFORMAT Format, CLIPREADCBREQ *pReq)
    22972347{
    22982348    /*
     
    23082358    {
    23092359        pX11Req->mpCtx   = pCtx;
    2310         pX11Req->mFormat = u32Format;
     2360        pX11Req->mFormat = Format;
    23112361        pX11Req->mpReq   = pReq;
    23122362
     
    23862436
    23872437/* Return the data in the simulated VBox clipboard. */
    2388 DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, uint32_t u32Format, void **ppv, uint32_t *pcb)
    2389 {
    2390     RT_NOREF(pCtx, u32Format);
     2438DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, uint32_t Format, void **ppv, uint32_t *pcb)
     2439{
     2440    RT_NOREF(pCtx, Format);
    23912441    *pcb = g_tstVBoxDataCb;
    23922442    if (g_tstVBoxDataPv != NULL)
     
    25032553}
    25042554
    2505 /* The formats currently on offer from X11 via the shared clipboard */
     2555/* The formats currently on offer from X11 via the shared clipboard. */
    25062556static uint32_t g_fX11Formats = 0;
    25072557
    2508 DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, uint32_t u32Formats)
     2558DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, SHCLFORMATS Formats)
    25092559{
    25102560    RT_NOREF(pCtx);
    2511     g_fX11Formats = u32Formats;
     2561    g_fX11Formats = Formats;
    25122562}
    25132563
     
    31453195# include <iprt/test.h>
    31463196
    3147 DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, uint32_t u32Format, void **ppv, uint32_t *pcb)
    3148 {
    3149     RT_NOREF(pCtx, u32Format, ppv, pcb);
     3197DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
     3198{
     3199    RT_NOREF(pCtx, Format, ppv, pcb);
    31503200    return VERR_NO_DATA;
    31513201}
    31523202
    3153 DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, uint32_t u32Formats)
    3154 {
    3155     RT_NOREF(pCtx, u32Formats);
     3203DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, SHCLFORMATS Formats)
     3204{
     3205    RT_NOREF(pCtx, Formats);
    31563206}
    31573207
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp

    r81825 r81843  
    7474        RT_ZERO(formatData);
    7575
    76         formatData.uFormats = fFormats;
     76        formatData.Formats = fFormats;
    7777
    7878        rc = ShClSvcFormatsReport(pCtx->pClient, &formatData);
     
    202202    RT_NOREF(pCmdCtx);
    203203
    204     LogFlowFunc(("uFormats=%02X\n", pFormats->uFormats));
    205 
    206     if (pFormats->uFormats == VBOX_SHCL_FMT_NONE)
     204    LogFlowFunc(("uFormats=%02X\n", pFormats->Formats));
     205
     206    if (pFormats->Formats == VBOX_SHCL_FMT_NONE)
    207207    {
    208208        /* This is just an automatism, not a genuine announcement */
     
    211211
    212212#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    213     if (pFormats->uFormats & VBOX_SHCL_FMT_URI_LIST) /* No transfer support yet. */
     213    if (pFormats->Formats & VBOX_SHCL_FMT_URI_LIST) /* No transfer support yet. */
    214214        return VINF_SUCCESS;
    215215#endif
     
    218218    RT_ZERO(dataReq);
    219219
    220     dataReq.uFmt   = pFormats->uFormats;
     220    dataReq.uFmt   = pFormats->Formats;
    221221    dataReq.cbSize = _64K; /** @todo Make this more dynamic. */
    222222
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp

    r81824 r81843  
    595595        rc = SharedClipboardWinGetFormats(&pCtx->Win, &Formats);
    596596        if (   RT_SUCCESS(rc)
    597             && Formats.uFormats != VBOX_SHCL_FMT_NONE)
     597            && Formats.Formats != VBOX_SHCL_FMT_NONE)
    598598        {
    599599            rc = ShClSvcFormatsReport(pCtx->pClient, &Formats);
     
    726726    AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
    727727
    728     LogFlowFunc(("uFormats=0x%x, hWnd=%p\n", pFormats->uFormats, pCtx->Win.hWnd));
     728    LogFlowFunc(("uFormats=0x%x, hWnd=%p\n", pFormats->Formats, pCtx->Win.hWnd));
    729729
    730730    /*
     
    732732     */
    733733    PostMessage(pCtx->Win.hWnd, SHCL_WIN_WM_REPORT_FORMATS,
    734                 0 /* wParam */, pFormats->uFormats /* lParam */);
     734                0 /* wParam */, pFormats->Formats /* lParam */);
    735735
    736736    rc = VINF_SUCCESS;
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp

    r81829 r81843  
    119119    RT_ZERO(formatData);
    120120
    121     formatData.uFormats = VBOX_SHCL_FMT_NONE;
     121    formatData.Formats = VBOX_SHCL_FMT_NONE;
    122122
    123123    return ShClSvcFormatsReport(pClient, &formatData);
     
    161161    RT_NOREF(pCmdCtx);
    162162
    163     int rc = ClipAnnounceFormatToX11(pClient->State.pCtx->pBackend, pFormats->uFormats);
     163    int rc = ClipAnnounceFormatToX11(pClient->State.pCtx->pBackend, pFormats->Formats);
    164164
    165165    LogFlowFuncLeaveRC(rc);
     
    255255 *
    256256 * @param  pCtx                 Opaque context pointer for the glue code.
    257  * @param  u32Formats           The formats available.
    258  */
    259 DECLCALLBACK(void) ClipReportX11FormatsCallback(PSHCLCONTEXT pCtx, uint32_t u32Formats)
    260 {
    261     LogFlowFunc(("pCtx=%p, u32Formats=%02X\n", pCtx, u32Formats));
    262 
    263     if (u32Formats == VBOX_SHCL_FMT_NONE) /* No formats to report? Bail out early. */
     257 * @param  Formats              The formats available.
     258 */
     259DECLCALLBACK(void) ClipReportX11FormatsCallback(PSHCLCONTEXT pCtx, uint32_t Formats)
     260{
     261    LogFlowFunc(("pCtx=%p, Formats=%02X\n", pCtx, Formats));
     262
     263    if (Formats == VBOX_SHCL_FMT_NONE) /* No formats to report? Bail out early. */
    264264        return;
    265265
     
    267267    RT_ZERO(formatData);
    268268
    269     formatData.uFormats = u32Formats;
     269    formatData.Formats = Formats;
    270270
    271271    int rc = ShClSvcFormatsReport(pCtx->pClient, &formatData);
     
    322322 *
    323323 * @param  pCtx      Pointer to the host clipboard structure.
    324  * @param  u32Format The format in which the data should be transferred
     324 * @param  Format    The format in which the data should be transferred.
    325325 * @param  ppv       On success and if pcb > 0, this will point to a buffer
    326326 *                   to be freed with RTMemFree containing the data read.
     
    328328 *                   returned.
    329329 */
    330 DECLCALLBACK(int) ClipRequestDataForX11Callback(PSHCLCONTEXT pCtx, uint32_t u32Format, void **ppv, uint32_t *pcb)
    331 {
    332     LogFlowFunc(("pCtx=%p, u32Format=%02X, ppv=%p\n", pCtx, u32Format, ppv));
     330DECLCALLBACK(int) ClipRequestDataForX11Callback(PSHCLCONTEXT pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
     331{
     332    LogFlowFunc(("pCtx=%p, Format=0x%x\n", pCtx, Format));
    333333
    334334    if (pCtx->fShuttingDown)
     
    339339    }
    340340
    341     /* Request data from the guest. */
    342     SHCLDATAREQ dataReq;
    343     RT_ZERO(dataReq);
    344 
    345     dataReq.uFmt   = u32Format;
    346     dataReq.cbSize = _64K; /** @todo Make this more dynamic. */
    347 
    348     SHCLEVENTID uEvent;
    349     int rc = ShClSvcDataReadRequest(pCtx->pClient, &dataReq, &uEvent);
    350     if (RT_SUCCESS(rc))
    351     {
    352         PSHCLEVENTPAYLOAD pPayload;
    353         rc = ShClEventWait(&pCtx->pClient->Events, uEvent, 30 * 1000, &pPayload);
     341    int rc;
     342
     343#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     344    if (Format == VBOX_SHCL_FMT_URI_LIST)
     345    {
     346        rc = 0;
     347    }
     348    else
     349#endif
     350    {
     351        /* Request data from the guest. */
     352        SHCLDATAREQ dataReq;
     353        RT_ZERO(dataReq);
     354
     355        dataReq.uFmt   = Format;
     356        dataReq.cbSize = _64K; /** @todo Make this more dynamic. */
     357
     358        SHCLEVENTID uEvent;
     359        rc = ShClSvcDataReadRequest(pCtx->pClient, &dataReq, &uEvent);
    354360        if (RT_SUCCESS(rc))
    355361        {
    356             *ppv = pPayload->pvData;
    357             *pcb = pPayload->cbData;
    358 
    359             /* Detach the payload, as the caller then will own the data. */
    360             ShClEventPayloadDetach(&pCtx->pClient->Events, uEvent);
    361         }
    362 
    363         ShClEventUnregister(&pCtx->pClient->Events, uEvent);
     362            PSHCLEVENTPAYLOAD pPayload;
     363            rc = ShClEventWait(&pCtx->pClient->Events, uEvent, 30 * 1000, &pPayload);
     364            if (RT_SUCCESS(rc))
     365            {
     366                *ppv = pPayload->pvData;
     367                *pcb = pPayload->cbData;
     368
     369                /* Detach the payload, as the caller then will own the data. */
     370                ShClEventPayloadDetach(&pCtx->pClient->Events, uEvent);
     371            }
     372
     373            ShClEventUnregister(&pCtx->pClient->Events, uEvent);
     374        }
    364375    }
    365376
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp

    r81824 r81843  
    12091209        HGCMSvcSetU64(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,
    12101210                                                                  pClient->Events.uID, uEvent));
    1211         HGCMSvcSetU32(&pMsg->paParms[1], pFormats->uFormats);
     1211        HGCMSvcSetU32(&pMsg->paParms[1], pFormats->Formats);
    12121212        HGCMSvcSetU32(&pMsg->paParms[2], 0 /* fFlags */);
    12131213
     
    12181218            /* If this is an URI list, create a transfer locally and also tell the guest to create
    12191219             * a transfer on the guest side. */
    1220             if (pFormats->uFormats & VBOX_SHCL_FMT_URI_LIST)
     1220            if (pFormats->Formats & VBOX_SHCL_FMT_URI_LIST)
    12211221            {
    12221222                rc = shClSvcTransferStart(pClient, SHCLTRANSFERDIR_WRITE, SHCLSOURCE_LOCAL,
     
    13541354                RT_ZERO(formatData);
    13551355
    1356                 formatData.uFormats = g_ExtState.uDelayedFormats;
    1357                 Assert(formatData.uFormats != VBOX_SHCL_FMT_NONE); /* There better is *any* format here now. */
     1356                formatData.Formats = g_ExtState.uDelayedFormats;
     1357                Assert(formatData.Formats != VBOX_SHCL_FMT_NONE); /* There better is *any* format here now. */
    13581358
    13591359                int rc2 = ShClSvcFormatsReport(pClient, &formatData);
     
    18111811                        RT_ZERO(formatData);
    18121812
    1813                         formatData.uFormats = uFormats;
    1814                         Assert(formatData.uFormats != VBOX_SHCL_FMT_NONE); /* Sanity. */
     1813                        formatData.Formats = uFormats;
     1814                        Assert(formatData.Formats != VBOX_SHCL_FMT_NONE); /* Sanity. */
    18151815
    18161816                        rc = ShClSvcImplFormatAnnounce(pClient, &cmdCtx, &formatData);
     
    23232323                    RT_ZERO(formatData);
    23242324
    2325                     formatData.uFormats = u32Format;
     2325                    formatData.Formats = u32Format;
    23262326
    23272327                    rc = ShClSvcFormatsReport(pClient, &formatData);
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