VirtualBox

Changeset 71405 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Mar 20, 2018 2:20:36 PM (7 years ago)
Author:
vboxsync
Message:

Guest Control/VBoxService: Cleaned up / shortened VGSvcGstCtrlSessionHandler().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp

    r71364 r71405  
    995995    bool const fImpersonated = RT_BOOL(pSession->fFlags & (  VBOXSERVICECTRLSESSION_FLAG_SPAWN
    996996                                                           | VBOXSERVICECTRLSESSION_FLAG_ANONYMOUS));
    997     int rc;
     997    int rc = VERR_NOT_SUPPORTED; /* Play safe by default. */
     998
    998999    switch (uMsg)
    9991000    {
     
    10071008            if (fImpersonated)
    10081009                rc = vgsvcGstCtrlSessionHandleDirRemove(pSession, pHostCtx);
    1009             else
    1010                 rc = VERR_NOT_SUPPORTED;
    10111010            break;
    10121011
     
    10341033            if (fImpersonated)
    10351034                rc = vgsvcGstCtrlSessionHandleFileOpen(pSession, pHostCtx);
    1036             else
    1037                 rc = VERR_NOT_SUPPORTED;
    10381035            break;
    10391036
     
    10411038            if (fImpersonated)
    10421039                rc = vgsvcGstCtrlSessionHandleFileClose(pSession, pHostCtx);
    1043             else
    1044                 rc = VERR_NOT_SUPPORTED;
    10451040            break;
    10461041
     
    10481043            if (fImpersonated)
    10491044                rc = vgsvcGstCtrlSessionHandleFileRead(pSession, pHostCtx, pvScratchBuf, cbScratchBuf);
    1050             else
    1051                 rc = VERR_NOT_SUPPORTED;
    10521045            break;
    10531046
     
    10551048            if (fImpersonated)
    10561049                rc = vgsvcGstCtrlSessionHandleFileReadAt(pSession, pHostCtx, pvScratchBuf, cbScratchBuf);
    1057             else
    1058                 rc = VERR_NOT_SUPPORTED;
    10591050            break;
    10601051
     
    10621053            if (fImpersonated)
    10631054                rc = vgsvcGstCtrlSessionHandleFileWrite(pSession, pHostCtx, pvScratchBuf, cbScratchBuf);
    1064             else
    1065                 rc = VERR_NOT_SUPPORTED;
    10661055            break;
    10671056
     
    10691058            if (fImpersonated)
    10701059                rc = vgsvcGstCtrlSessionHandleFileWriteAt(pSession, pHostCtx, pvScratchBuf, cbScratchBuf);
    1071             else
    1072                 rc = VERR_NOT_SUPPORTED;
    10731060            break;
    10741061
     
    10761063            if (fImpersonated)
    10771064                rc = vgsvcGstCtrlSessionHandleFileSeek(pSession, pHostCtx);
    1078             else
    1079                 rc = VERR_NOT_SUPPORTED;
    10801065            break;
    10811066
     
    10831068            if (fImpersonated)
    10841069                rc = vgsvcGstCtrlSessionHandleFileTell(pSession, pHostCtx);
    1085             else
    1086                 rc = VERR_NOT_SUPPORTED;
    10871070            break;
    10881071
     
    10901073            if (fImpersonated)
    10911074                rc = vgsvcGstCtrlSessionHandlePathRename(pSession, pHostCtx);
    1092             else
    1093                 rc = VERR_NOT_SUPPORTED;
    10941075            break;
    10951076
     
    10971078            if (fImpersonated)
    10981079                rc = vgsvcGstCtrlSessionHandlePathUserDocuments(pSession, pHostCtx);
    1099             else
    1100                 rc = VERR_NOT_SUPPORTED;
    11011080            break;
    11021081
     
    11041083            if (fImpersonated)
    11051084                rc = vgsvcGstCtrlSessionHandlePathUserHome(pSession, pHostCtx);
    1106             else
    1107                 rc = VERR_NOT_SUPPORTED;
    11081085            break;
    11091086
    1110         default:
    1111             rc = VbglR3GuestCtrlMsgSkip(pHostCtx->uClientID);
    1112             VGSvcVerbose(3, "Unsupported message (uMsg=%RU32, cParms=%RU32) from host, skipping\n", uMsg, pHostCtx->uNumParms);
     1087        default: /* Not supported, see next code block. */
    11131088            break;
    11141089    }
     1090
     1091    if (rc == VERR_NOT_SUPPORTED)
     1092    {
     1093        VGSvcVerbose(3, "Unsupported message (uMsg=%RU32, cParms=%RU32) from host, skipping\n", uMsg, pHostCtx->uNumParms);
     1094
     1095        /* Tell the host service to skip the message. */
     1096        VbglR3GuestCtrlMsgSkip(pHostCtx->uClientID);
     1097
     1098        rc = VINF_SUCCESS;
     1099    }
     1100    /* Note: Other replies must be reported to the host service by the appropriate command handlers above. */
    11151101
    11161102    if (RT_FAILURE(rc))
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