- Timestamp:
- Oct 10, 2018 11:47:54 AM (6 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r74602 r74734 11969 11969 <interface 11970 11970 name="IGuestSession" extends="$unknown" 11971 uuid=" 9880f6e3-c4c1-4031-8ec2-28ee088370e4"11971 uuid="07241827-f602-48c8-8511-4d933f3cf0bb" 11972 11972 wsmap="managed" 11973 11973 reservedMethods="8" reservedAttributes="8" … … 12147 12147 <desc>Array of source filters. This uses the 12148 12148 DOS/NT style wildcard characters '?' and '*'.</desc> 12149 </param>12150 <param name="types" type="FsObjType" dir="in" safearray="yes">12151 <desc>Array of source <link to="FsObjType"/> types.</desc>12152 12149 </param> 12153 12150 <param name="flags" type="wstring" dir="in" safearray="yes"> … … 12205 12202 <desc>Array of source filters. This uses the 12206 12203 DOS/NT style wildcard characters '?' and '*'.</desc> 12207 </param>12208 <param name="types" type="FsObjType" dir="in" safearray="yes">12209 <desc>Array of source <link to="FsObjType"/> types.</desc>12210 12204 </param> 12211 12205 <param name="flags" type="wstring" dir="in" safearray="yes"> -
trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h
r72088 r74734 1118 1118 * extended director's cut version. */ 1119 1119 int signalWaitEventInternalEx(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, int rc, int guestRc, const GuestWaitEventPayload *pPayload); 1120 1120 1121 public: 1121 1122 … … 1129 1130 int unregisterWaitEvent(GuestWaitEvent *pEvent); 1130 1131 int waitForEvent(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, VBoxEventType_T *pType, IEvent **ppEvent); 1132 1133 public: 1134 1135 static FsObjType_T fileModeToFsObjType(RTFMODE fMode); 1131 1136 1132 1137 protected: -
trunk/src/VBox/Main/include/GuestSessionImpl.h
r72070 r74734 83 83 HRESULT copyFromGuest(const std::vector<com::Utf8Str> &aSources, 84 84 const std::vector<com::Utf8Str> &aFilters, 85 const std::vector<FsObjType_T> &aTypes,86 85 const std::vector<com::Utf8Str> &aFlags, 87 86 const com::Utf8Str &aDestination, … … 89 88 HRESULT copyToGuest(const std::vector<com::Utf8Str> &aSources, 90 89 const std::vector<com::Utf8Str> &aFilters, 91 const std::vector<FsObjType_T> &aTypes,92 90 const std::vector<com::Utf8Str> &aFlags, 93 91 const com::Utf8Str &aDestination, -
trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
r73505 r74734 1133 1133 } 1134 1134 1135 /** 1136 * Converts RTFMODE to FsObjType_T. 1137 * 1138 * @return Converted FsObjType_T type. 1139 * @param enmType RTFMODE to convert. 1140 */ 1141 /* static */ 1142 FsObjType_T GuestBase::fileModeToFsObjType(RTFMODE fMode) 1143 { 1144 if (RTFS_IS_FILE(fMode)) return FsObjType_File; 1145 else if (RTFS_IS_DIRECTORY(fMode)) return FsObjType_Directory; 1146 else if (RTFS_IS_SYMLINK(fMode)) return FsObjType_Symlink; 1147 1148 return FsObjType_Unknown; 1149 } 1150 1135 1151 GuestObject::GuestObject(void) 1136 1152 : mSession(NULL), -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r73505 r74734 2892 2892 2893 2893 HRESULT GuestSession::copyFromGuest(const std::vector<com::Utf8Str> &aSources, const std::vector<com::Utf8Str> &aFilters, 2894 const std::vector< FsObjType_T> &aTypes, const std::vector<com::Utf8Str> &aFlags,2895 const com::Utf8Str &aDestination,ComPtr<IProgress> &aProgress)2894 const std::vector<com::Utf8Str> &aFlags, const com::Utf8Str &aDestination, 2895 ComPtr<IProgress> &aProgress) 2896 2896 { 2897 2897 AutoCaller autoCaller(this); … … 2900 2900 const size_t cSources = aSources.size(); 2901 2901 if ( aFilters.size() != cSources 2902 || aTypes.size() != cSources2903 2902 || aFlags.size() != cSources) 2904 2903 { … … 2910 2909 std::vector<com::Utf8Str>::const_iterator itSource = aSources.begin(); 2911 2910 std::vector<com::Utf8Str>::const_iterator itFilter = aFilters.begin(); 2912 std::vector<FsObjType_T>::const_iterator itType = aTypes.begin();2913 2911 std::vector<com::Utf8Str>::const_iterator itFlags = aFlags.begin(); 2914 2912 2913 const bool fContinueOnErrors = false; /** @todo Do we want a flag for that? */ 2914 const bool fFollowSymlinks = true; /** @todo Ditto. */ 2915 2915 2916 while (itSource != aSources.end()) 2916 2917 { 2918 GuestFsObjData objData; 2919 int rcGuest; 2920 int vrc = i_fsQueryInfo(*(itSource), fFollowSymlinks, objData, &rcGuest); 2921 if ( RT_FAILURE(vrc) 2922 && !fContinueOnErrors) 2923 { 2924 if (GuestProcess::i_isGuestError(vrc)) 2925 return setError(E_FAIL, tr("Unable to query type for source '%s': %s"), (*itSource).c_str(), 2926 GuestProcess::i_guestErrorToString(rcGuest).c_str()); 2927 else 2928 return setError(E_FAIL, tr("Unable to query type for source '%s' (%Rrc)"), (*itSource).c_str(), vrc); 2929 } 2930 2917 2931 GuestSessionFsSourceSpec source; 2918 2932 source.strSource = *itSource; 2919 2933 source.strFilter = *itFilter; 2920 source.enmType = *itType;2934 source.enmType = objData.mType; 2921 2935 source.enmPathStyle = i_getPathStyle(); 2922 2936 … … 2938 2952 ++itSource; 2939 2953 ++itFilter; 2940 ++itType;2941 2954 ++itFlags; 2942 2955 } … … 2946 2959 2947 2960 HRESULT GuestSession::copyToGuest(const std::vector<com::Utf8Str> &aSources, const std::vector<com::Utf8Str> &aFilters, 2948 const std::vector< FsObjType_T> &aTypes, const std::vector<com::Utf8Str> &aFlags,2949 const com::Utf8Str &aDestination,ComPtr<IProgress> &aProgress)2961 const std::vector<com::Utf8Str> &aFlags, const com::Utf8Str &aDestination, 2962 ComPtr<IProgress> &aProgress) 2950 2963 { 2951 2964 AutoCaller autoCaller(this); … … 2954 2967 const size_t cSources = aSources.size(); 2955 2968 if ( aFilters.size() != cSources 2956 || aTypes.size() != cSources2957 2969 || aFlags.size() != cSources) 2958 2970 { … … 2964 2976 std::vector<com::Utf8Str>::const_iterator itSource = aSources.begin(); 2965 2977 std::vector<com::Utf8Str>::const_iterator itFilter = aFilters.begin(); 2966 std::vector<FsObjType_T>::const_iterator itType = aTypes.begin();2967 2978 std::vector<com::Utf8Str>::const_iterator itFlags = aFlags.begin(); 2968 2979 2980 const bool fContinueOnErrors = false; /** @todo Do we want a flag for that? */ 2981 2969 2982 while (itSource != aSources.end()) 2970 2983 { 2984 RTFSOBJINFO objInfo; 2985 int vrc = RTPathQueryInfo((*itSource).c_str(), &objInfo, RTFSOBJATTRADD_NOTHING); 2986 if ( RT_FAILURE(vrc) 2987 && !fContinueOnErrors) 2988 { 2989 return setError(E_FAIL, tr("Unable to query type for source '%s' (%Rrc)"), (*itSource).c_str(), vrc); 2990 } 2991 2971 2992 GuestSessionFsSourceSpec source; 2972 2993 source.strSource = *itSource; 2973 2994 source.strFilter = *itFilter; 2974 source.enmType = *itType;2995 source.enmType = GuestBase::fileModeToFsObjType(objInfo.Attr.fMode); 2975 2996 source.enmPathStyle = i_getPathStyle(); 2976 2997 … … 2993 3014 ++itSource; 2994 3015 ++itFilter; 2995 ++itType;2996 3016 ++itFlags; 2997 3017 }
Note:
See TracChangeset
for help on using the changeset viewer.