VirtualBox

Ignore:
Timestamp:
Dec 9, 2019 1:21:55 PM (5 years ago)
Author:
vboxsync
Message:

SharedClipboardSvc,Vbgl: Reviewed and adjusted the handling of the VBOX_SHCL_GUEST_FN_REPORT_FORMATS message, paddling back the parameter changes from the 6.1 dev cycle and fixing a couple of bugs introduced. Also documented the message and renamed it to a more sensible name. Dropped the new Vbgl method, renaming the old one. bugref:9437

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp

    r82506 r82513  
    23152315 * Reports (advertises) guest clipboard formats to the host.
    23162316 *
    2317  * @returns VBox status code.
    2318  * @param   pCtx                The command context returned by VbglR3ClipboardConnectEx().
    2319  * @param   pFormats            The formats to report.
    2320  */
    2321 VBGLR3DECL(int) VbglR3ClipboardFormatsReportEx(PVBGLR3SHCLCMDCTX pCtx, PSHCLFORMATDATA pFormats)
    2322 {
    2323     AssertPtrReturn(pCtx,     VERR_INVALID_POINTER);
    2324     AssertPtrReturn(pFormats, VERR_INVALID_POINTER);
    2325 
    2326     VBoxShClFormatsMsg Msg;
    2327 
    2328     int rc;
    2329 
    2330     LogFlowFunc(("uFormats=0x%x\n", pFormats->Formats));
    2331 
    2332     if (pCtx->fUseLegacyProtocol)
    2333     {
    2334         VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, VBOX_SHCL_GUEST_FN_FORMATS_REPORT, 1);
    2335         Msg.u.v0.uFormats.SetUInt32(pFormats->Formats);
    2336 
    2337         rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg.hdr) + sizeof(Msg.u.v0));
    2338     }
    2339     else
    2340     {
    2341         VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, VBOX_SHCL_GUEST_FN_FORMATS_REPORT, 3);
    2342 
    2343         Msg.u.v1.uContext.SetUInt64(pCtx->uContextID);
    2344         Msg.u.v1.uFormats.SetUInt32(pFormats->Formats);
    2345         Msg.u.v1.fFlags.SetUInt32(pFormats->fFlags);
    2346 
    2347         rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg.hdr) + sizeof(Msg.u.v1));
    2348     }
    2349 
    2350     LogFlowFuncLeaveRC(rc);
    2351     return rc;
    2352 }
    2353 
    2354 /**
    2355  * Reports (advertises) guest clipboard formats to the host.
    2356  *
    23572317 * Legacy function, do not use anymore.
    23582318 *
     
    23612321 * @param   fFormats        The formats to report.
    23622322 */
    2363 VBGLR3DECL(int) VbglR3ClipboardFormatsReport(HGCMCLIENTID idClient, uint32_t fFormats)
    2364 {
    2365     AssertReturn(idClient, VERR_INVALID_PARAMETER);
    2366     AssertReturn(fFormats, VERR_INVALID_PARAMETER);
    2367 
    2368     VBoxShClFormatsMsg Msg;
    2369 
    2370     VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHCL_GUEST_FN_FORMATS_REPORT, 1);
    2371     VbglHGCMParmUInt32Set(&Msg.u.v0.uFormats, fFormats);
    2372 
    2373     int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg.hdr) + sizeof(Msg.u.v0));
     2323VBGLR3DECL(int) VbglR3ClipboardReportFormats(HGCMCLIENTID idClient, uint32_t fFormats)
     2324{
     2325    struct
     2326    {
     2327        VBGLIOCHGCMCALL             Hdr;
     2328        VBoxShClParmReportFormats   Parms;
     2329    } Msg;
     2330
     2331    VBGL_HGCM_HDR_INIT(&Msg.Hdr, idClient, VBOX_SHCL_GUEST_FN_REPORT_FORMATS, VBOX_SHCL_CPARMS_REPORT_FORMATS);
     2332    VbglHGCMParmUInt32Set(&Msg.Parms.f32Formats, fFormats);
     2333
     2334    int rc = VbglR3HGCMCall(&Msg.Hdr, sizeof(Msg));
    23742335
    23752336    LogFlowFuncLeaveRC(rc);
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