VirtualBox

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


Ignore:
Timestamp:
Jan 23, 2019 6:23:04 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128342
Message:

Guest Control: Unifying terminology for (client/host) commands, functions and messages; it's all about messages now. Renaming, no functional changes.

Location:
trunk/src/VBox
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        88/branches/VBox-5.0/src/VBox:104938,104943,104950,104987-104988,104990,106453
        99/branches/VBox-5.1/src/VBox:112367,116543,116550,116568,116573
        10 /branches/VBox-5.2/src/VBox:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124263,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812
         10/branches/VBox-5.2/src/VBox:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124263,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812,127158-127159,127162-127167,127180
        1111/branches/andy/draganddrop/src/VBox:90781-91268
        1212/branches/andy/guestctrl20/src/VBox:78916,78930
  • trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp

    r76553 r76958  
    6161
    6262/**
    63  * Static callback function for receiving updates on guest control commands
     63 * Static callback function for receiving updates on guest control messages
    6464 * from the guest. Acts as a dispatcher for the actual class instance.
    6565 *
     
    7272 *          return locations.  However, there is no explaination for this attitude
    7373 *          thowards error handling.   Further, it creates a slight problem since
    74  *          the service would route all function calls it didn't recognize here,
    75  *          thereby making any undefined functions confusingly return VINF_SUCCESS.
     74 *          the service would route all message calls it didn't recognize here,
     75 *          thereby making any undefined messages confusingly return VINF_SUCCESS.
    7676 *
    7777 *          In my humble opinion, if the guest gives us incorrect input it should
     
    8585/* static */
    8686DECLCALLBACK(int) Guest::i_notifyCtrlDispatcher(void    *pvExtension,
    87                                                 uint32_t idFunction,
     87                                                uint32_t idMessage,
    8888                                                void    *pvData,
    8989                                                uint32_t cbData)
     
    9595     * changes to the object state.
    9696     */
    97     Log2Func(("pvExtension=%p, idFunction=%RU32, pvParms=%p, cbParms=%RU32\n", pvExtension, idFunction, pvData, cbData));
     97    Log2Func(("pvExtension=%p, idMessage=%RU32, pvParms=%p, cbParms=%RU32\n", pvExtension, idMessage, pvData, cbData));
    9898
    9999    ComObjPtr<Guest> pGuest = reinterpret_cast<Guest *>(pvExtension);
     
    110110
    111111    /*
    112      * For guest control 2.0 using the legacy commands we need to do the following here:
     112     * For guest control 2.0 using the legacy messages we need to do the following here:
    113113     * - Get the callback header to access the context ID
    114114     * - Get the context ID of the callback
     
    123123    uint32_t const idContext = pSvcCb->mpaParms[0].u.uint32;
    124124
    125     VBOXGUESTCTRLHOSTCBCTX CtxCb = { idFunction, idContext };
     125    VBOXGUESTCTRLHOSTCBCTX CtxCb = { idMessage, idContext };
    126126    int rc = pGuest->i_dispatchToSession(&CtxCb, pSvcCb);
    127127
     
    142142    AssertPtrReturn(pSvcCb, VERR_INVALID_POINTER);
    143143
    144     Log2Func(("uFunction=%RU32, uContextID=%RU32, uProtocol=%RU32\n", pCtxCb->uFunction, pCtxCb->uContextID, pCtxCb->uProtocol));
     144    Log2Func(("uMessage=%RU32, uContextID=%RU32, uProtocol=%RU32\n", pCtxCb->uMessage, pCtxCb->uContextID, pCtxCb->uProtocol));
    145145
    146146    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    170170        bool fDispatch = true;
    171171        rc = VERR_INVALID_FUNCTION;
    172         if (   pCtxCb->uFunction == GUEST_EXEC_STATUS
     172        if (   pCtxCb->uMessage == GUEST_MSG_EXEC_STATUS
    173173            && pSvcCb->mParms    >= 5)
    174174        {
     
    183183                && (int32_t)dataCb.uFlags == VERR_TOO_MUCH_DATA)
    184184            {
    185                 LogFlowFunc(("Requested command with too much data, skipping dispatching ...\n"));
     185                LogFlowFunc(("Requested message with too much data, skipping dispatching ...\n"));
    186186                Assert(dataCb.uPID == 0);
    187187                fDispatch = false;
     
    191191#endif
    192192        {
    193             switch (pCtxCb->uFunction)
     193            switch (pCtxCb->uMessage)
    194194            {
    195                 case GUEST_DISCONNECTED:
     195                case GUEST_MSG_DISCONNECTED:
    196196                    rc = pSession->i_dispatchToThis(pCtxCb, pSvcCb);
    197197                    break;
    198198
    199199                /* Process stuff. */
    200                 case GUEST_EXEC_STATUS:
    201                 case GUEST_EXEC_OUTPUT:
    202                 case GUEST_EXEC_INPUT_STATUS:
    203                 case GUEST_EXEC_IO_NOTIFY:
     200                case GUEST_MSG_EXEC_STATUS:
     201                case GUEST_MSG_EXEC_OUTPUT:
     202                case GUEST_MSG_EXEC_INPUT_STATUS:
     203                case GUEST_MSG_EXEC_IO_NOTIFY:
    204204                    rc = pSession->i_dispatchToObject(pCtxCb, pSvcCb);
    205205                    break;
    206206
    207207                /* File stuff. */
    208                 case GUEST_FILE_NOTIFY:
     208                case GUEST_MSG_FILE_NOTIFY:
    209209                    rc = pSession->i_dispatchToObject(pCtxCb, pSvcCb);
    210210                    break;
    211211
    212212                /* Session stuff. */
    213                 case GUEST_SESSION_NOTIFY:
     213                case GUEST_MSG_SESSION_NOTIFY:
    214214                    rc = pSession->i_dispatchToThis(pCtxCb, pSvcCb);
    215215                    break;
  • trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp

    r76553 r76958  
    813813    try
    814814    {
    815         Log2Func(("uFunc=%RU32, cParms=%RU32\n", pCtxCb->uFunction, pSvcCb->mParms));
    816 
    817         switch (pCtxCb->uFunction)
     815        Log2Func(("uFunc=%RU32, cParms=%RU32\n", pCtxCb->uMessage, pSvcCb->mParms));
     816
     817        switch (pCtxCb->uMessage)
    818818        {
    819819            case GUEST_MSG_PROGRESS_UPDATE:
     
    14131413}
    14141414
    1415 int GuestObject::sendCommand(uint32_t uFunction, uint32_t cParms, PVBOXHGCMSVCPARM paParms)
     1415int GuestObject::sendMessage(uint32_t uMessage, uint32_t cParms, PVBOXHGCMSVCPARM paParms)
    14161416{
    14171417#ifndef VBOX_GUESTCTRL_TEST_CASE
     
    14321432
    14331433        /* Make the call. */
    1434         LogFlowThisFunc(("uFunction=%RU32, cParms=%RU32\n", uFunction, cParms));
    1435         vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uFunction, cParms, paParms);
     1434        LogFlowThisFunc(("uMessage=%RU32, cParms=%RU32\n", uMessage, cParms));
     1435        vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uMessage, cParms, paParms);
    14361436        if (RT_FAILURE(vrc))
    14371437        {
     
    14431443
    14441444    /* Not needed within testcases. */
    1445     RT_NOREF(uFunction, cParms, paParms);
     1445    RT_NOREF(uMessage, cParms, paParms);
    14461446    int vrc = VINF_SUCCESS;
    14471447#endif
  • trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp

    r76553 r76958  
    170170
    171171    LogFlowThisFunc(("strPath=%s, uContextID=%RU32, uFunction=%RU32, pSvcCb=%p\n",
    172                      mData.mOpenInfo.mPath.c_str(), pCbCtx->uContextID, pCbCtx->uFunction, pSvcCb));
     172                     mData.mOpenInfo.mPath.c_str(), pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb));
    173173
    174174    int vrc;
    175     switch (pCbCtx->uFunction)
    176     {
    177         case GUEST_DIR_NOTIFY:
     175    switch (pCbCtx->uMessage)
     176    {
     177        case GUEST_MSG_DIR_NOTIFY:
    178178        {
    179179            int idx = 1; /* Current parameter index. */
  • trunk/src/VBox/Main/src-client/GuestFileImpl.cpp

    r76553 r76958  
    333333
    334334    LogFlowThisFunc(("strName=%s, uContextID=%RU32, uFunction=%RU32, pSvcCb=%p\n",
    335                      mData.mOpenInfo.mFilename.c_str(), pCbCtx->uContextID, pCbCtx->uFunction, pSvcCb));
     335                     mData.mOpenInfo.mFilename.c_str(), pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb));
    336336
    337337    int vrc;
    338     switch (pCbCtx->uFunction)
    339     {
    340         case GUEST_DISCONNECTED:
     338    switch (pCbCtx->uMessage)
     339    {
     340        case GUEST_MSG_DISCONNECTED:
    341341            vrc = i_onGuestDisconnected(pCbCtx, pSvcCb);
    342342            break;
    343343
    344         case GUEST_FILE_NOTIFY:
     344        case GUEST_MSG_FILE_NOTIFY:
    345345            vrc = i_onFileNotify(pCbCtx, pSvcCb);
    346346            break;
     
    386386    HGCMSvcSetU32(&paParms[i++], mObjectID /* Guest file ID */);
    387387
    388     vrc = sendCommand(HOST_FILE_CLOSE, i, paParms);
     388    vrc = sendMessage(HOST_MSG_FILE_CLOSE, i, paParms);
    389389    if (RT_SUCCESS(vrc))
    390390        vrc = i_waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */,
     
    730730    alock.release(); /* Drop write lock before sending. */
    731731
    732     vrc = sendCommand(HOST_FILE_OPEN, i, paParms);
     732    vrc = sendMessage(HOST_MSG_FILE_OPEN, i, paParms);
    733733    if (RT_SUCCESS(vrc))
    734734        vrc = i_waitForStatusChange(pEvent, uTimeoutMS, NULL /* FileStatus */, prcGuest);
     
    785785    alock.release(); /* Drop write lock before sending. */
    786786
    787     vrc = sendCommand(HOST_FILE_READ, i, paParms);
     787    vrc = sendMessage(HOST_MSG_FILE_READ, i, paParms);
    788788    if (RT_SUCCESS(vrc))
    789789    {
     
    845845    alock.release(); /* Drop write lock before sending. */
    846846
    847     vrc = sendCommand(HOST_FILE_READ_AT, i, paParms);
     847    vrc = sendMessage(HOST_MSG_FILE_READ_AT, i, paParms);
    848848    if (RT_SUCCESS(vrc))
    849849    {
     
    907907    alock.release(); /* Drop write lock before sending. */
    908908
    909     vrc = sendCommand(HOST_FILE_SEEK, i, paParms);
     909    vrc = sendMessage(HOST_MSG_FILE_SEEK, i, paParms);
    910910    if (RT_SUCCESS(vrc))
    911911    {
     
    11711171    alock.release(); /* Drop write lock before sending. */
    11721172
    1173     vrc = sendCommand(HOST_FILE_WRITE, i, paParms);
     1173    vrc = sendMessage(HOST_MSG_FILE_WRITE, i, paParms);
    11741174    if (RT_SUCCESS(vrc))
    11751175    {
     
    12351235    alock.release(); /* Drop write lock before sending. */
    12361236
    1237     vrc = sendCommand(HOST_FILE_WRITE_AT, i, paParms);
     1237    vrc = sendMessage(HOST_MSG_FILE_WRITE_AT, i, paParms);
    12381238    if (RT_SUCCESS(vrc))
    12391239    {
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r76553 r76958  
    416416    AssertPtrReturn(pSvcCb, VERR_INVALID_POINTER);
    417417#ifdef DEBUG
    418     LogFlowThisFunc(("uPID=%RU32, uContextID=%RU32, uFunction=%RU32, pSvcCb=%p\n",
    419                      mData.mPID, pCbCtx->uContextID, pCbCtx->uFunction, pSvcCb));
     418    LogFlowThisFunc(("uPID=%RU32, uContextID=%RU32, uMessage=%RU32, pSvcCb=%p\n",
     419                     mData.mPID, pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb));
    420420#endif
    421421
    422422    int vrc;
    423     switch (pCbCtx->uFunction)
    424     {
    425         case GUEST_DISCONNECTED:
     423    switch (pCbCtx->uMessage)
     424    {
     425        case GUEST_MSG_DISCONNECTED:
    426426        {
    427427            vrc = i_onGuestDisconnected(pCbCtx, pSvcCb);
     
    429429        }
    430430
    431         case GUEST_EXEC_STATUS:
     431        case GUEST_MSG_EXEC_STATUS:
    432432        {
    433433            vrc = i_onProcessStatusChange(pCbCtx, pSvcCb);
     
    435435        }
    436436
    437         case GUEST_EXEC_OUTPUT:
     437        case GUEST_MSG_EXEC_OUTPUT:
    438438        {
    439439            vrc = i_onProcessOutput(pCbCtx, pSvcCb);
     
    441441        }
    442442
    443         case GUEST_EXEC_INPUT_STATUS:
     443        case GUEST_MSG_EXEC_INPUT_STATUS:
    444444        {
    445445            vrc = i_onProcessInputStatus(pCbCtx, pSvcCb);
     
    916916        alock.release(); /* Drop the write lock before sending. */
    917917
    918         vrc = sendCommand(HOST_EXEC_GET_OUTPUT, i, paParms);
     918        vrc = sendMessage(HOST_MSG_EXEC_GET_OUTPUT, i, paParms);
    919919    }
    920920
     
    11321132        rLock.release(); /* Drop the write lock before sending. */
    11331133
    1134         vrc = sendCommand(HOST_EXEC_CMD, i, paParms);
     1134        vrc = sendMessage(HOST_MSG_EXEC_CMD, i, paParms);
    11351135        if (RT_FAILURE(vrc))
    11361136        {
     
    12511251            alock.release(); /* Drop the write lock before sending. */
    12521252
    1253             vrc = sendCommand(HOST_EXEC_TERMINATE, i, paParms);
     1253            vrc = sendMessage(HOST_MSG_EXEC_TERMINATE, i, paParms);
    12541254            if (RT_SUCCESS(vrc))
    12551255                vrc = i_waitForStatusChange(pEvent, uTimeoutMS,
     
    17331733
    17341734    uint32_t cbProcessed = 0;
    1735     vrc = sendCommand(HOST_EXEC_SET_INPUT, i, paParms);
     1735    vrc = sendMessage(HOST_MSG_EXEC_SET_INPUT, i, paParms);
    17361736    if (RT_SUCCESS(vrc))
    17371737    {
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r76553 r76958  
    718718    alock.release(); /* Drop the write lock before waiting. */
    719719
    720     vrc = i_sendCommand(HOST_SESSION_CLOSE, i, paParms, VBOX_GUESTCTRL_DST_BOTH);
     720    vrc = i_sendMessage(HOST_MSG_SESSION_CLOSE, i, paParms, VBOX_GUESTCTRL_DST_BOTH);
    721721    if (RT_SUCCESS(vrc))
    722722        vrc = i_waitForStatusChange(pEvent, GuestSessionWaitForFlag_Terminate, uTimeoutMS,
     
    10731073    alock.release(); /* Drop write lock before sending. */
    10741074
    1075     vrc = i_sendCommand(HOST_DIR_REMOVE, i, paParms);
     1075    vrc = i_sendMessage(HOST_MSG_DIR_REMOVE, i, paParms);
    10761076    if (RT_SUCCESS(vrc))
    10771077    {
     
    13141314    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    13151315
    1316     LogFlowThisFunc(("sessionID=%RU32, CID=%RU32, uFunction=%RU32, pSvcCb=%p\n",
    1317                      mData.mSession.mID, pCbCtx->uContextID, pCbCtx->uFunction, pSvcCb));
     1316    LogFlowThisFunc(("sessionID=%RU32, CID=%RU32, uMessage=%RU32, pSvcCb=%p\n",
     1317                     mData.mSession.mID, pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb));
    13181318    int rc;
    1319     switch (pCbCtx->uFunction)
    1320     {
    1321         case GUEST_DISCONNECTED:
     1319    switch (pCbCtx->uMessage)
     1320    {
     1321        case GUEST_MSG_DISCONNECTED:
    13221322            /** @todo Handle closing all guest objects. */
    13231323            rc = VERR_INTERNAL_ERROR;
    13241324            break;
    13251325
    1326         case GUEST_SESSION_NOTIFY: /* Guest Additions >= 4.3.0. */
     1326        case GUEST_MSG_SESSION_NOTIFY: /* Guest Additions >= 4.3.0. */
    13271327        {
    13281328            rc = i_onSessionStatusChange(pCbCtx, pSvcCb);
     
    19471947    alock.release(); /* Drop write lock before sending. */
    19481948
    1949     vrc = i_sendCommand(HOST_SESSION_CREATE, i, paParms, VBOX_GUESTCTRL_DST_ROOT_SVC);
     1949    vrc = i_sendMessage(HOST_MSG_SESSION_CREATE, i, paParms, VBOX_GUESTCTRL_DST_ROOT_SVC);
    19501950    if (RT_SUCCESS(vrc))
    19511951    {
     
    21362136    alock.release(); /* Drop write lock before sending. */
    21372137
    2138     vrc = i_sendCommand(HOST_PATH_RENAME, i, paParms);
     2138    vrc = i_sendMessage(HOST_MSG_PATH_RENAME, i, paParms);
    21392139    if (RT_SUCCESS(vrc))
    21402140    {
     
    21772177    alock.release(); /* Drop write lock before sending. */
    21782178
    2179     vrc = i_sendCommand(HOST_PATH_USER_DOCUMENTS, i, paParms);
     2179    vrc = i_sendMessage(HOST_MSG_PATH_USER_DOCUMENTS, i, paParms);
    21802180    if (RT_SUCCESS(vrc))
    21812181    {
     
    22272227    alock.release(); /* Drop write lock before sending. */
    22282228
    2229     vrc = i_sendCommand(HOST_PATH_USER_HOME, i, paParms);
     2229    vrc = i_sendMessage(HOST_MSG_PATH_USER_HOME, i, paParms);
    22302230    if (RT_SUCCESS(vrc))
    22312231    {
     
    24372437}
    24382438
    2439 int GuestSession::i_sendCommand(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms,
     2439int GuestSession::i_sendMessage(uint32_t uMessage, uint32_t uParms, PVBOXHGCMSVCPARM paParms,
    24402440                                uint64_t fDst /*= VBOX_GUESTCTRL_DST_SESSION*/)
    24412441{
     
    24502450    AssertPtr(pVMMDev);
    24512451
    2452     LogFlowThisFunc(("uFunction=%RU32 (%s), uParms=%RU32\n", uFunction, GstCtrlHostFnName((guestControl::eHostFn)uFunction), uParms));
     2452    LogFlowThisFunc(("uMessage=%RU32 (%s), uParms=%RU32\n", uMessage, GstCtrlHostMsgtoStr((guestControl::eHostMsg)uMessage), uParms));
    24532453
    24542454    /* HACK ALERT! We extend the first parameter to 64-bit and use the
     
    24602460
    24612461    /* Make the call. */
    2462     int vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uFunction, uParms, paParms);
     2462    int vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uMessage, uParms, paParms);
    24632463    if (RT_FAILURE(vrc))
    24642464    {
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