Changeset 37632 in vbox
- Timestamp:
- Jun 24, 2011 1:38:09 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
r37589 r37632 2874 2874 ULONG aFlags, IProgress **aProgress) 2875 2875 { 2876 ReturnComNotImplemented(); 2877 } 2878 2879 STDMETHODIMP Guest::CopyToGuest(IN_BSTR aSource, IN_BSTR aDest, 2880 IN_BSTR aUserName, IN_BSTR aPassword, 2881 ULONG aFlags, IProgress **aProgress) 2882 { 2876 2883 #ifndef VBOX_WITH_GUEST_CONTROL 2877 2884 ReturnComNotImplemented(); … … 2908 2915 2909 2916 rc = progress->init(static_cast<IGuest*>(this), 2910 Bstr(tr("Copying file from guest to host")).raw(),2911 TRUE /* aCancelable */);2912 if (FAILED(rc)) throw rc;2913 2914 /* Initialize our worker task. */2915 TaskGuest *pTask = new TaskGuest(TaskGuest::CopyFileFromGuest, this, progress);2916 AssertPtr(pTask);2917 std::auto_ptr<TaskGuest> task(pTask);2918 2919 /* Assign data - aSource is the source file on the guest,2920 * aDest reflects the full path on the host. */2921 task->strSource = (Utf8Str(aSource));2922 task->strDest = (Utf8Str(aDest));2923 task->strUserName = (Utf8Str(aUserName));2924 task->strPassword = (Utf8Str(aPassword));2925 task->uFlags = aFlags;2926 2927 rc = task->startThread();2928 if (FAILED(rc)) throw rc;2929 2930 /* Don't destruct on success. */2931 task.release();2932 }2933 catch (HRESULT aRC)2934 {2935 rc = aRC;2936 }2937 2938 if (SUCCEEDED(rc))2939 {2940 /* Return progress to the caller. */2941 progress.queryInterfaceTo(aProgress);2942 }2943 return rc;2944 #endif /* VBOX_WITH_GUEST_CONTROL */2945 }2946 2947 STDMETHODIMP Guest::CopyToGuest(IN_BSTR aSource, IN_BSTR aDest,2948 IN_BSTR aUserName, IN_BSTR aPassword,2949 ULONG aFlags, IProgress **aProgress)2950 {2951 #ifndef VBOX_WITH_GUEST_CONTROL2952 ReturnComNotImplemented();2953 #else /* VBOX_WITH_GUEST_CONTROL */2954 CheckComArgStrNotEmptyOrNull(aSource);2955 CheckComArgStrNotEmptyOrNull(aDest);2956 CheckComArgStrNotEmptyOrNull(aUserName);2957 CheckComArgStrNotEmptyOrNull(aPassword);2958 CheckComArgOutPointerValid(aProgress);2959 2960 AutoCaller autoCaller(this);2961 if (FAILED(autoCaller.rc())) return autoCaller.rc();2962 2963 /* Validate flags. */2964 if (aFlags != CopyFileFlag_None)2965 {2966 if ( !(aFlags & CopyFileFlag_Recursive)2967 && !(aFlags & CopyFileFlag_Update)2968 && !(aFlags & CopyFileFlag_FollowLinks))2969 {2970 return setError(E_INVALIDARG, tr("Unknown flags (%#x)"), aFlags);2971 }2972 }2973 2974 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);2975 2976 HRESULT rc = S_OK;2977 2978 ComObjPtr<Progress> progress;2979 try2980 {2981 /* Create the progress object. */2982 progress.createObject();2983 2984 rc = progress->init(static_cast<IGuest*>(this),2985 2917 Bstr(tr("Copying file from host to guest")).raw(), 2986 2918 TRUE /* aCancelable */); … … 3022 2954 STDMETHODIMP Guest::DirectoryClose(ULONG aHandle) 3023 2955 { 3024 #ifndef VBOX_WITH_GUEST_CONTROL3025 2956 ReturnComNotImplemented(); 3026 #else /* VBOX_WITH_GUEST_CONTROL */3027 using namespace guestControl;3028 3029 return VBOX_E_NOT_SUPPORTED;3030 #endif3031 2957 } 3032 2958 … … 3165 3091 ULONG *aHandle) 3166 3092 { 3167 #ifndef VBOX_WITH_GUEST_CONTROL3168 3093 ReturnComNotImplemented(); 3169 #else /* VBOX_WITH_GUEST_CONTROL */3170 using namespace guestControl;3171 3172 return VBOX_E_NOT_SUPPORTED;3173 #endif3174 3094 } 3175 3095 3176 3096 STDMETHODIMP Guest::DirectoryRead(ULONG aHandle, IGuestDirEntry **aDirEntry) 3177 3097 { 3178 #ifndef VBOX_WITH_GUEST_CONTROL3179 3098 ReturnComNotImplemented(); 3180 #else /* VBOX_WITH_GUEST_CONTROL */3181 using namespace guestControl;3182 3183 return VBOX_E_NOT_SUPPORTED;3184 #endif3185 3099 } 3186 3100
Note:
See TracChangeset
for help on using the changeset viewer.