VirtualBox

Ignore:
Timestamp:
May 31, 2010 12:41:27 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
62166
Message:

Guest Control/HostService: Renamed structure for better understanding.

File:
1 edited

Legend:

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

    r29898 r29900  
    100100
    101101/**
    102  * Structure for holding a buffered host command.
    103  */
    104 struct HostCmd
    105 {
    106     /** The context ID this command belongs to. Will be extracted
    107       * from the HGCM parameters. */
    108     uint32_t mContextID;
    109     /** Dynamic structure for holding the HGCM parms */
    110     VBOXGUESTCTRPARAMBUFFER mParmBuf;
    111 
    112     /** The standard contructor. */
    113     HostCmd() : mContextID(0) {}
    114 };
    115 /** The host cmd list + iterator type */
    116 typedef std::list< HostCmd > HostCmdList;
    117 typedef std::list< HostCmd >::iterator HostCmdListIter;
    118 typedef std::list< HostCmd >::const_iterator HostCmdListIterConst;
    119 
    120 /**
    121102 * Structure for holding an uncompleted guest call.
    122103 */
    123 struct GuestCall
     104struct ClientWaiter
    124105{
    125106    /** Client ID; a client can have multiple handles! */
     
    133114
    134115    /** The standard contructor. */
    135     GuestCall() : mClientID(0), mHandle(0), mParms(NULL), mNumParms(0) {}
     116    ClientWaiter() : mClientID(0), mHandle(0), mParms(NULL), mNumParms(0) {}
    136117    /** The normal contructor. */
    137     GuestCall(uint32_t aClientID, VBOXHGCMCALLHANDLE aHandle,
     118    ClientWaiter(uint32_t aClientID, VBOXHGCMCALLHANDLE aHandle,
    138119              VBOXHGCMSVCPARM aParms[], uint32_t cParms)
    139120              : mClientID(aClientID), mHandle(aHandle), mParms(aParms), mNumParms(cParms) {}
    140121};
    141122/** The guest call list type */
    142 typedef std::list< GuestCall > CallList;
    143 typedef std::list< GuestCall >::iterator CallListIter;
    144 typedef std::list< GuestCall >::const_iterator CallListIterConst;
     123typedef std::list< ClientWaiter > ClientWaiterList;
     124typedef std::list< ClientWaiter >::iterator CallListIter;
     125typedef std::list< ClientWaiter >::const_iterator CallListIterConst;
     126
     127/**
     128 * Structure for holding a buffered host command.
     129 */
     130struct HostCmd
     131{
     132    /** The context ID this command belongs to. Will be extracted
     133      * from the HGCM parameters. */
     134    uint32_t mContextID;
     135    /** Dynamic structure for holding the HGCM parms */
     136    VBOXGUESTCTRPARAMBUFFER mParmBuf;
     137
     138    /** The standard contructor. */
     139    HostCmd() : mContextID(0) {}
     140};
     141/** The host cmd list + iterator type */
     142typedef std::list< HostCmd > HostCmdList;
     143typedef std::list< HostCmd >::iterator HostCmdListIter;
     144typedef std::list< HostCmd >::const_iterator HostCmdListIterConst;
    145145
    146146/**
     
    162162    void *mpvHostData;
    163163    /** The deferred calls list. */
    164     CallList mClientList;
     164    ClientWaiterList mClientWaiterList;
    165165    /** The host command list. */
    166166    HostCmdList mHostCmds;
     
    436436    int rc = VINF_SUCCESS;
    437437
    438     CallListIter itCall = mClientList.begin();
    439     while (itCall != mClientList.end())
     438    CallListIter itCall = mClientWaiterList.begin();
     439    while (itCall != mClientWaiterList.end())
    440440    {
    441441        if (itCall->mClientID == u32ClientID)
    442442        {       
    443             itCall = mClientList.erase(itCall);
     443            itCall = mClientWaiterList.erase(itCall);
    444444        }
    445445        else
     
    543543    if (mHostCmds.empty()) /* If command list is empty, defer ... */
    544544    {
    545         mClientList.push_back(GuestCall(u32ClientID, callHandle, paParms, cParms));
     545        mClientWaiterList.push_back(ClientWaiter(u32ClientID, callHandle, paParms, cParms));
    546546        rc = VINF_HGCM_ASYNC_EXECUTE;
    547547    }
     
    576576{
    577577    int rc = VINF_SUCCESS;
    578     CallListIter it = mClientList.begin();
    579     while (it != mClientList.end())
     578    CallListIter it = mClientWaiterList.begin();
     579    while (it != mClientWaiterList.end())
    580580    {
    581581        if (it->mClientID == u32ClientID)
     
    588588            if (mpHelpers)
    589589                mpHelpers->pfnCallComplete(it->mHandle, rc);
    590             it = mClientList.erase(it);
     590            it = mClientWaiterList.erase(it);
    591591        }
    592592        else
     
    660660    {
    661661        /* Can we wake up a waiting client on guest? */
    662         if (!mClientList.empty())
    663         {
    664             GuestCall guest = mClientList.front();
     662        if (!mClientWaiterList.empty())
     663        {
     664            ClientWaiter guest = mClientWaiterList.front();
    665665            rc = sendHostCmdToGuest(&newCmd,
    666666                                    guest.mHandle, guest.mNumParms, guest.mParms);
     
    669669            AssertPtr(mpHelpers);
    670670            mpHelpers->pfnCallComplete(guest.mHandle, rc);
    671             mClientList.pop_front();
     671            mClientWaiterList.pop_front();
    672672
    673673            /* If we got VERR_TOO_MUCH_DATA we buffer the host command in the next block
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette