VirtualBox

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


Ignore:
Timestamp:
Nov 26, 2018 6:54:55 PM (6 years ago)
Author:
vboxsync
Message:

HGCM: Continue with getting VERR_CANCELLED to the service when the guest has cancelled (or canceled if you prefer) the command.

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

Legend:

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

    r75740 r75747  
    139139        ~HGCMService() {};
    140140
    141         static DECLCALLBACK(void) svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc);
     141        static DECLCALLBACK(int) svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc);
    142142        static DECLCALLBACK(void) svcHlpDisconnectClient(void *pvInstance, uint32_t u32ClientId);
    143143        static DECLCALLBACK(bool) svcHlpIsCallRestored(VBOXHGCMCALLHANDLE callHandle);
     
    796796 * @interface_method_impl{VBOXHGCMSVCHELPERS,pfnCallComplete}
    797797 */
    798 /* static */ DECLCALLBACK(void) HGCMService::svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc)
     798/* static */ DECLCALLBACK(int) HGCMService::svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc)
    799799{
    800800   HGCMMsgCore *pMsgCore = (HGCMMsgCore *)callHandle;
    801801
    802    if (pMsgCore->MsgId () == SVC_MSG_GUESTCALL)
    803    {
    804        /* Only call the completion for these messages. The helper
    805         * is called by the service, and the service does not get
    806         * any other messages.
    807         */
    808        hgcmMsgComplete(pMsgCore, rc);
    809    }
    810    else
    811    {
    812        AssertFailed();
    813    }
     802   /* Only call the completion for these messages. The helper
     803    * is called by the service, and the service does not get
     804    * any other messages.
     805    */
     806   AssertMsgReturn(pMsgCore->MsgId() == SVC_MSG_GUESTCALL, ("%d\n", pMsgCore->MsgId()), VERR_WRONG_TYPE);
     807   return hgcmMsgComplete(pMsgCore, rc);
    814808}
    815809
  • trunk/src/VBox/Main/src-client/HGCMThread.cpp

    r75601 r75747  
    147147        int MsgGet(HGCMMsgCore **ppMsg);
    148148        int MsgPost(HGCMMsgCore *pMsg, PHGCMMSGCALLBACK pfnCallback, bool bWait);
    149         void MsgComplete(HGCMMsgCore *pMsg, int32_t result);
     149        int MsgComplete(HGCMMsgCore *pMsg, int32_t result);
    150150};
    151151
     
    554554}
    555555
    556 void HGCMThread::MsgComplete(HGCMMsgCore *pMsg, int32_t result)
     556int HGCMThread::MsgComplete(HGCMMsgCore *pMsg, int32_t result)
    557557{
    558558    LogFlow(("HGCMThread::MsgComplete: thread = %p, pMsg = %p\n", this, pMsg));
     
    561561    AssertReleaseMsg((pMsg->m_fu32Flags & HGCM_MSG_F_IN_PROCESS) != 0, ("%p %x\n", pMsg, pMsg->m_fu32Flags));
    562562
     563    int rcRet = VINF_SUCCESS;
    563564    if (pMsg->m_pfnCallback)
    564565    {
    565566        /** @todo call callback with error code in MsgPost in case of errors */
    566567
    567         pMsg->m_pfnCallback(result, pMsg);
    568 
    569         LogFlow(("HGCMThread::MsgComplete: callback executed. pMsg = %p, thread = %p\n", pMsg, this));
     568        rcRet = pMsg->m_pfnCallback(result, pMsg);
     569
     570        LogFlow(("HGCMThread::MsgComplete: callback executed. pMsg = %p, thread = %p, rcRet = %Rrc\n", pMsg, this, rcRet));
    570571    }
    571572
     
    616617        }
    617618    }
     619
     620    return rcRet;
    618621}
    619622
     
    737740}
    738741
    739 void hgcmMsgComplete(HGCMMsgCore *pMsg, int32_t u32Result)
     742int hgcmMsgComplete(HGCMMsgCore *pMsg, int32_t u32Result)
    740743{
    741744    LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p\n", pMsg));
    742745
     746    int rc;
    743747    if (pMsg)
    744         pMsg->Thread()->MsgComplete(pMsg, u32Result);
    745 
    746 
    747     LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p, rc = void\n", pMsg));
     748        rc = pMsg->Thread()->MsgComplete(pMsg, u32Result);
     749    else
     750        rc = VINF_SUCCESS;
     751
     752    LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p, rc = %Rrc\n", pMsg, rc));
     753    return rc;
    748754}
    749755
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