VirtualBox

Changeset 28707 in vbox


Ignore:
Timestamp:
Apr 25, 2010 5:18:04 PM (15 years ago)
Author:
vboxsync
Message:

GuestImpl.cpp: Fixed warnings (scope alocks). Don't assert on RTMemAlloc restuls, unless it's a AssertReturn.

File:
1 edited

Legend:

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

    r28641 r28707  
    529529            }
    530530            else
    531                 LogFlowFunc(("Callback (context ID=%u, status=%u) progress already marked as completed\n", 
     531                LogFlowFunc(("Callback (context ID=%u, status=%u) progress already marked as completed\n",
    532532                             pData->hdr.u32ContextID, pData->u32Status));
    533533        }
     
    836836                            break;
    837837
    838                         /* In any other case the process either already 
     838                        /* In any other case the process either already
    839839                         * terminated or something else went wrong, so no PID ... */
    840840                        case PROC_STS_TEN: /* Terminated normally. */
     
    947947    /* Search for existing PID. */
    948948    PHOSTEXECOUTCALLBACKDATA pData = (HOSTEXECOUTCALLBACKDATA*)RTMemAlloc(sizeof(HOSTEXECOUTCALLBACKDATA));
    949     AssertPtr(pData);
    950949    uint32_t uContextID = addCtrlCallbackContext(pData, sizeof(HOSTEXECOUTCALLBACKDATA), NULL /* pProgress */);
    951950    Assert(uContextID > 0);
     
    962961    int vrc = VINF_SUCCESS;
    963962
    964     /* Make sure mParent is valid, so set the read lock while using. */
    965     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    966 
    967     /* Forward the information to the VMM device. */
    968     AssertPtr(mParent);
    969     VMMDev *vmmDev = mParent->getVMMDev();
    970     if (vmmDev)
    971     {
    972         LogFlowFunc(("hgcmHostCall numParms=%d\n", i));
    973         vrc = vmmDev->hgcmHostCall("VBoxGuestControlSvc", HOST_EXEC_GET_OUTPUT,
    974                                    i, paParms);
    975     }
    976 
    977     alock.release();
     963    {
     964        /* Make sure mParent is valid, so set the read lock while using. */
     965        AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     966
     967        /* Forward the information to the VMM device. */
     968        AssertPtr(mParent);
     969        VMMDev *vmmDev = mParent->getVMMDev();
     970        if (vmmDev)
     971        {
     972            LogFlowFunc(("hgcmHostCall numParms=%d\n", i));
     973            vrc = vmmDev->hgcmHostCall("VBoxGuestControlSvc", HOST_EXEC_GET_OUTPUT,
     974                                       i, paParms);
     975        }
     976    }
    978977
    979978    if (RT_SUCCESS(vrc))
     
    10081007
    10091008            /* Did we get some output? */
    1010             PHOSTEXECOUTCALLBACKDATA pData = (HOSTEXECOUTCALLBACKDATA*)it->pvData;
     1009            pData = (HOSTEXECOUTCALLBACKDATA*)it->pvData;
    10111010            Assert(it->cbData == sizeof(HOSTEXECOUTCALLBACKDATA));
    10121011            AssertPtr(pData);
    1013    
     1012
    10141013            if (   it->bCalled
    10151014                && pData->cbData)
     
    10181017                if (pData->cbData > cbData)
    10191018                    outputData.resize(pData->cbData);
    1020    
     1019
    10211020                /* Fill output in supplied out buffer. */
    10221021                memcpy(outputData.raw(), pData->pvData, pData->cbData);
     
    10251024            else
    10261025                vrc = VERR_NO_DATA; /* This is not an error we want to report to COM. */
    1027 
    1028             alock.release();
    10291026        }
    10301027
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