VirtualBox

Ignore:
Timestamp:
Aug 12, 2020 12:40:56 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139858
Message:

HGCM / DnD: Removed the protocol version from the generic HGCM client implementation and integrated it into the DnD host service instead (for keeping backwards compatibility).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/DragAndDrop/VBoxDragAndDropSvc.cpp

    r85712 r85714  
    5353    DragAndDropClient(uint32_t idClient)
    5454        : HGCM::Client(idClient)
     55        , uProtocolVerDeprecated(0)
    5556        , fGuestFeatures0(VBOX_DND_GF_NONE)
    5657        , fGuestFeatures1(VBOX_DND_GF_NONE)
     
    7071public:
    7172
     73    /** Protocol version used by this client.
     74     *  Deprecated; only used for keeping backwards compatibility. */
     75    uint32_t                uProtocolVerDeprecated;
    7276    /** Guest feature flags, VBOX_DND_GF_0_XXX. */
    7377    uint64_t                fGuestFeatures0;
     
    531535    if (rc == VINF_SUCCESS) /* Note: rc might be VINF_HGCM_ASYNC_EXECUTE! */
    532536    {
    533         LogFlowFunc(("Client %RU32: Protocol v%RU32\n", pClient->GetClientID(), pClient->GetProtocolVer()));
    534 
    535537        rc = VERR_INVALID_PARAMETER; /* Play safe by default. */
    536538
    537539        /* Whether the client's advertised protocol sends context IDs with commands. */
    538         const bool fHasCtxID = pClient->GetProtocolVer() >= 3;
     540        const bool fHasCtxID = pClient->uProtocolVerDeprecated >= 3;
    539541
    540542        /* Current parameter index to process. */
     
    619621                    data.uProtocol = uProtocolVer;
    620622
    621                 pClient->SetProtocolVer(data.uProtocol);
     623                pClient->uProtocolVerDeprecated = data.uProtocol;
    622624
    623625                /* Return the highest protocol version we're supporting. */
     
    626628                paParms[idxParm - 1].u.uint32 = data.uProtocol;
    627629
    628                 LogFlowFunc(("Client %RU32 is now using protocol v%RU32\n", pClient->GetClientID(), pClient->GetProtocolVer()));
     630                LogFlowFunc(("Client %RU32 is now using protocol v%RU32\n",
     631                             pClient->GetClientID(), pClient->uProtocolVerDeprecated));
    629632
    630633                DO_HOST_CALLBACK();
     
    668671                data.hdr.uMagic = CB_MAGIC_DND_HG_REQ_DATA;
    669672
    670                 switch (pClient->GetProtocolVer())
     673                switch (pClient->uProtocolVerDeprecated)
    671674                {
    672675                    case 3:
     
    724727                data.hdr.uMagic = CB_MAGIC_DND_GH_ACK_PENDING;
    725728
    726                 switch (pClient->GetProtocolVer())
     729                switch (pClient->uProtocolVerDeprecated)
    727730                {
    728731                    case 3:
     
    798801                LogFlowFunc(("GUEST_DND_GH_SND_DATA\n"));
    799802
    800                 switch (pClient->GetProtocolVer())
     803                switch (pClient->uProtocolVerDeprecated)
    801804                {
    802805                    case 3:
     
    889892                LogFlowFunc(("GUEST_DND_GH_SND_FILE_DATA\n"));
    890893
    891                 switch (pClient->GetProtocolVer())
     894                switch (pClient->uProtocolVerDeprecated)
    892895                {
    893896                    /* Protocol v3 adds (optional) checksums. */
     
    10971100                int rc2 = pClient->SetDeferredMsgInfo(HOST_DND_CANCEL,
    10981101                                                      /* Protocol v3+ also contains the context ID. */
    1099                                                       pClient->GetProtocolVer() >= 3 ? 1 : 0);
     1102                                                      pClient->uProtocolVerDeprecated >= 3 ? 1 : 0);
    11001103                pClient->CompleteDeferred(rc2);
    11011104
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette