VirtualBox

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


Ignore:
Timestamp:
Aug 2, 2012 12:18:31 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79704
Message:

Guest Control 2.0: Update.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r42530 r42531  
    746746    uint32_t uVerAdditions = pGuest->getAdditionsVersion();
    747747    mData.mProtocolVersion = (   VBOX_FULL_VERSION_GET_MAJOR(uVerAdditions) >= 4
    748                               && VBOX_FULL_VERSION_GET_MINOR(uVerAdditions) >= 2 )
     748                              && VBOX_FULL_VERSION_GET_MINOR(uVerAdditions) >= 2)
    749749                           ? 2  /* Guest control 2.0. */
    750750                           : 1; /* Legacy guest control (VBox < 4.2). */
     
    896896    LogFlowThisFuncEnter();
    897897
    898     AutoCaller autoCaller(this);
    899     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    900 
    901     ReturnComNotImplemented();
     898    if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     899        return setError(E_INVALIDARG, tr("No directory to check existence for specified"));
     900    CheckComArgOutPointerValid(aExists);
     901
     902    AutoCaller autoCaller(this);
     903    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     904
     905    HRESULT hr = S_OK;
     906
     907    GuestFsObjData objData;
     908    int rc = fileQueryInfoInternal(Utf8Str(aPath), objData);
     909    if (RT_SUCCESS(rc))
     910    {
     911        *aExists = objData.mType == FsObjType_Directory;
     912    }
     913    else
     914    {
     915        switch (rc)
     916        {
     917            /** @todo Add more errors here! */
     918
     919            default:
     920               hr = setError(VBOX_E_IPRT_ERROR, tr("Querying directory existence failed: %Rrc"), rc);
     921               break;
     922        }
     923    }
     924
     925    return hr;
    902926#endif /* VBOX_WITH_GUEST_CONTROL */
    903927}
     
    11221146    LogFlowThisFuncEnter();
    11231147
    1124     AutoCaller autoCaller(this);
    1125     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1126 
    1127     ReturnComNotImplemented();
     1148    if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     1149        return setError(E_INVALIDARG, tr("No file to check existence for specified"));
     1150    CheckComArgOutPointerValid(aExists);
     1151
     1152    AutoCaller autoCaller(this);
     1153    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1154
     1155    HRESULT hr = S_OK;
     1156
     1157    GuestFsObjData objData;
     1158    int rc = fileQueryInfoInternal(Utf8Str(aPath), objData);
     1159    if (RT_SUCCESS(rc))
     1160    {
     1161        *aExists = objData.mType == FsObjType_File;
     1162    }
     1163    else
     1164    {
     1165        switch (rc)
     1166        {
     1167            /** @todo Add more errors here! */
     1168
     1169            default:
     1170               hr = setError(VBOX_E_IPRT_ERROR, tr("Querying file existence failed: %Rrc"), rc);
     1171               break;
     1172        }
     1173    }
     1174
     1175    return hr;
    11281176#endif /* VBOX_WITH_GUEST_CONTROL */
    11291177}
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