VirtualBox

Changeset 75798 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Nov 28, 2018 11:47:11 PM (6 years ago)
Author:
vboxsync
Message:

VBoxGuestControl: Optimizing message handling - part 1. bugref:9313

Location:
trunk/src/VBox/Main/src-client
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp

    r75737 r75798  
    11791179}
    11801180
    1181 int GuestObject::sendCommand(uint32_t uFunction,
    1182                              uint32_t cParms, PVBOXHGCMSVCPARM paParms)
     1181int GuestObject::sendCommand(uint32_t uFunction, uint32_t cParms, PVBOXHGCMSVCPARM paParms)
    11831182{
    11841183#ifndef VBOX_GUESTCTRL_TEST_CASE
     
    11921191    if (pVMMDev)
    11931192    {
     1193        /* HACK ALERT! We extend the first parameter to 64-bit and use the
     1194                       two topmost bits for call destination information. */
     1195        Assert(paParms[0].type == VBOX_HGCM_SVC_PARM_32BIT);
     1196        paParms[0].type = VBOX_HGCM_SVC_PARM_64BIT;
     1197        paParms[0].u.uint64 = (uint64_t)paParms[0].u.uint32 | VBOX_GUESTCTRL_DST_SESSION;
     1198
     1199        /* Make the call. */
    11941200        LogFlowThisFunc(("uFunction=%RU32, cParms=%RU32\n", uFunction, cParms));
    11951201        vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uFunction, cParms, paParms);
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r75737 r75798  
    718718    alock.release(); /* Drop the write lock before waiting. */
    719719
    720     vrc = i_sendCommand(HOST_SESSION_CLOSE, i, paParms);
     720    vrc = i_sendCommand(HOST_SESSION_CLOSE, i, paParms, VBOX_GUESTCTRL_DST_BOTH);
    721721    if (RT_SUCCESS(vrc))
    722722        vrc = i_waitForStatusChange(pEvent, GuestSessionWaitForFlag_Terminate, uTimeoutMS,
     
    19461946    alock.release(); /* Drop write lock before sending. */
    19471947
    1948     vrc = i_sendCommand(HOST_SESSION_CREATE, i, paParms);
     1948    vrc = i_sendCommand(HOST_SESSION_CREATE, i, paParms, VBOX_GUESTCTRL_DST_ROOT_SVC);
    19491949    if (RT_SUCCESS(vrc))
    19501950    {
     
    24542454}
    24552455
    2456 int GuestSession::i_sendCommand(uint32_t uFunction,
    2457                                 uint32_t uParms, PVBOXHGCMSVCPARM paParms)
     2456int GuestSession::i_sendCommand(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms,
     2457                                uint64_t fDst /*= VBOX_GUESTCTRL_DST_SESSION*/)
    24582458{
    24592459    LogFlowThisFuncEnter();
     
    24672467    AssertPtr(pVMMDev);
    24682468
    2469     LogFlowThisFunc(("uFunction=%RU32, uParms=%RU32\n", uFunction, uParms));
     2469    LogFlowThisFunc(("uFunction=%RU32 (%s), uParms=%RU32\n", uFunction, GstCtrlHostFnName((guestControl::eHostFn)uFunction), uParms));
     2470
     2471    /* HACK ALERT! We extend the first parameter to 64-bit and use the
     2472                   two topmost bits for call destination information. */
     2473    Assert(fDst == VBOX_GUESTCTRL_DST_SESSION || fDst == VBOX_GUESTCTRL_DST_ROOT_SVC || fDst == VBOX_GUESTCTRL_DST_BOTH);
     2474    Assert(paParms[0].type == VBOX_HGCM_SVC_PARM_32BIT);
     2475    paParms[0].type = VBOX_HGCM_SVC_PARM_64BIT;
     2476    paParms[0].u.uint64 = (uint64_t)paParms[0].u.uint32 | fDst;
     2477
     2478    /* Make the call. */
    24702479    int vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uFunction, uParms, paParms);
    24712480    if (RT_FAILURE(vrc))
  • trunk/src/VBox/Main/src-client/HGCMThread.cpp

    r75747 r75798  
    556556int HGCMThread::MsgComplete(HGCMMsgCore *pMsg, int32_t result)
    557557{
    558     LogFlow(("HGCMThread::MsgComplete: thread = %p, pMsg = %p\n", this, pMsg));
     558    LogFlow(("HGCMThread::MsgComplete: thread = %p, pMsg = %p, result = %Rrc (%d)\n", this, pMsg, result, result));
    559559
    560560    AssertRelease(pMsg->m_pThread == this);
     
    740740}
    741741
    742 int hgcmMsgComplete(HGCMMsgCore *pMsg, int32_t u32Result)
    743 {
    744     LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p\n", pMsg));
     742int hgcmMsgComplete(HGCMMsgCore *pMsg, int32_t rcMsg)
     743{
     744    LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p, rcMsg = %Rrc (%d)\n", pMsg, rcMsg, rcMsg));
    745745
    746746    int rc;
    747747    if (pMsg)
    748         rc = pMsg->Thread()->MsgComplete(pMsg, u32Result);
     748        rc = pMsg->Thread()->MsgComplete(pMsg, rcMsg);
    749749    else
    750750        rc = VINF_SUCCESS;
    751751
    752     LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p, rc = %Rrc\n", pMsg, rc));
     752    LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p, rcMsg =%Rrc (%d), returns rc = %Rrc\n", pMsg, rcMsg, rcMsg, rc));
    753753    return rc;
    754754}
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