VirtualBox

Changeset 71432 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Mar 21, 2018 1:33:17 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121400
Message:

Guest Control/VBoxService: Retrieve the context ID for messages not supported by VGSvcGstCtrlSessionHandler().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp

    r71405 r71432  
    10931093        VGSvcVerbose(3, "Unsupported message (uMsg=%RU32, cParms=%RU32) from host, skipping\n", uMsg, pHostCtx->uNumParms);
    10941094
     1095        /**
     1096         * !!! HACK ALERT BEGIN !!!
     1097         * As peeking for the current message by VbglR3GuestCtrlMsgWaitFor() / GUEST_MSG_WAIT only gives us the message type and
     1098         * the number of parameters, but *not* the actual context ID the message is bound to, try to retrieve it here.
     1099         *
     1100         * This is needed in order to reply to the host with the current context ID, without breaking existing clients.
     1101         * Not doing this isn't fatal, but will make host clients wait longer (timing out) for not implemented messages.
     1102         ** @todo Get rid of this as soon as we have a protocl bump (v4).
     1103         */
     1104        struct HGCMMsgSkip
     1105        {
     1106            VBGLIOCHGCMCALL hdr;
     1107            /** UInt32: Context ID. */
     1108            HGCMFunctionParameter context;
     1109        };
     1110
     1111        HGCMMsgSkip Msg;
     1112        VBGL_HGCM_HDR_INIT(&Msg.hdr, pHostCtx->uClientID, GUEST_MSG_WAIT, pHostCtx->uNumParms);
     1113
     1114        /* Don't want to drag in VbglHGCMParmUInt32Set(). */
     1115        Msg.context.type      = VMMDevHGCMParmType_32bit;
     1116        Msg.context.u.value64 = 0; /* init unused bits to 0 */
     1117        Msg.context.u.value32 = 0;
     1118
     1119        /* Retrieve the context ID of the message which is not supported and put it in pHostCtx. */
     1120        int rc2 = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
     1121        if (RT_SUCCESS(rc2))
     1122            Msg.context.GetUInt32(&pHostCtx->uContextID);
     1123
     1124        /** !!!                !!!
     1125         *  !!! HACK ALERT END !!!
     1126         *  !!!                !!! */
     1127
     1128        rc2 = VbglR3GuestCtrlMsgReply(pHostCtx, VERR_NOT_SUPPORTED);
     1129        AssertRC(rc2);
     1130
    10951131        /* Tell the host service to skip the message. */
    10961132        VbglR3GuestCtrlMsgSkip(pHostCtx->uClientID);
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