VirtualBox

Changeset 11844 in vbox


Ignore:
Timestamp:
Aug 29, 2008 6:47:01 PM (16 years ago)
Author:
vboxsync
Message:

Do not call HGCM after it has been shut down.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r11820 r11844  
    520520    }
    521521
     522    if (!pDrv->pVMMDev->hgcmIsActive ())
     523    {
     524        return VERR_INVALID_STATE;
     525    }
     526
    522527    return HGCMGuestConnect (pDrv->pHGCMPort, pCmd, pServiceLocation->u.host.achName, pu32ClientID);
    523528}
     
    528533
    529534    PDRVMAINVMMDEV pDrv = PDMIHGCMCONNECTOR_2_MAINVMMDEV(pInterface);
     535
     536    if (!pDrv->pVMMDev->hgcmIsActive ())
     537    {
     538        return VERR_INVALID_STATE;
     539    }
    530540
    531541    return HGCMGuestDisconnect (pDrv->pHGCMPort, pCmd, u32ClientID);
     
    538548
    539549    PDRVMAINVMMDEV pDrv = PDMIHGCMCONNECTOR_2_MAINVMMDEV(pInterface);
     550
     551    if (!pDrv->pVMMDev->hgcmIsActive ())
     552    {
     553        return VERR_INVALID_STATE;
     554    }
    540555
    541556    return HGCMGuestCall (pDrv->pHGCMPort, pCmd, u32ClientID, u32Function, cParms, paParms);
     
    576591int VMMDev::hgcmLoadService (const char *pszServiceLibrary, const char *pszServiceName)
    577592{
    578     if (ASMAtomicReadBool(&m_fHGCMActive) == false)
     593    if (!hgcmIsActive ())
    579594    {
    580595        return VERR_INVALID_STATE;
     
    586601                          uint32_t cParms, PVBOXHGCMSVCPARM paParms)
    587602{
    588     if (ASMAtomicReadBool(&m_fHGCMActive) == false)
     603    if (!hgcmIsActive ())
    589604    {
    590605        return VERR_INVALID_STATE;
  • trunk/src/VBox/Main/include/VMMDev.h

    r11820 r11844  
    5757    void hgcmShutdown (void);
    5858
     59    bool hgcmIsActive (void) { return ASMAtomicReadBool(&m_fHGCMActive); }
     60
    5961private:
    6062    static DECLCALLBACK(void *) drvQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface);
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