VirtualBox

Changeset 75750 in vbox


Ignore:
Timestamp:
Nov 26, 2018 7:01:13 PM (6 years ago)
Author:
vboxsync
Message:

GuestControl: Restore peek count if the guest cancels the GUEST_MSG_WAIT request (liek for a SIGCHLD).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/GuestControl/service.cpp

    r75746 r75750  
    629629    }
    630630
     631    /** Used by Wakeup() and RunCurrent(). */
    631632    int Run(ClientConnection const *pConnection,
    632633            HostCommand            *pHostCmd)
     
    661662             *        host command via an own GUEST_ type message.
    662663             */
    663             if (rc == VERR_TOO_MUCH_DATA)
     664            if (   rc == VERR_TOO_MUCH_DATA
     665                || rc == VERR_CANCELLED)
    664666            {
    665667                if (mHostCmdTries == 6)
     
    722724    }
    723725
     726    /** Used by for Service::hostProcessCommand(). */
    724727    int Wakeup(void)
    725728    {
     
    779782    }
    780783
     784    /** Internal worker for Run(). */
    781785    int SendReply(ClientConnection const *pConnection,
    782786                  HostCommand            *pHostCmd)
     
    784788        AssertPtrReturn(pConnection, VERR_INVALID_POINTER);
    785789        AssertPtrReturn(pHostCmd, VERR_INVALID_POINTER);
     790
     791        /* In case of VERR_CANCELLED. */
     792        uint32_t const cSavedPeeks = mPeekCount;
    786793
    787794        int rc;
     
    824831         * the pending call with the result we just got. */
    825832        AssertPtr(mSvcHelpers);
    826         mSvcHelpers->pfnCallComplete(pConnection->mHandle, rc);
     833        int rc2 = mSvcHelpers->pfnCallComplete(pConnection->mHandle, rc);
     834
     835        /* Rollback in case the guest cancelled the call. */
     836        if (rc2 == VERR_CANCELLED && RT_SUCCESS(rc))
     837        {
     838            mPeekCount = cSavedPeeks;
     839            rc = VERR_CANCELLED;
     840        }
    827841
    828842        LogFlowThisFunc(("[Client %RU32] Command %RU32 ended with %Rrc (mPeekCount=%RU32, pConnection=%p)\n",
     
    13921406                uClientsWokenUp++;
    13931407#endif
     1408                /** @todo r=bird: Do we need to queue commands on more than one client? */
    13941409            }
    13951410
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