Changeset 42765 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 10, 2012 8:12:35 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r42759 r42765 2203 2203 } 2204 2204 2205 STDMETHODIMP GuestSession::DirectoryCreateTemp(IN_BSTR aTemplate, ULONG aMode, IN_BSTR a Name, BOOL aSecure, BSTR *aDirectory)2205 STDMETHODIMP GuestSession::DirectoryCreateTemp(IN_BSTR aTemplate, ULONG aMode, IN_BSTR aPath, BOOL aSecure, BSTR *aDirectory) 2206 2206 { 2207 2207 #ifndef VBOX_WITH_GUEST_CONTROL … … 2223 2223 { 2224 2224 Utf8Str strTemplate(aTemplate); 2225 Utf8Str strPath(aPath); 2225 2226 procInfo.mName = Utf8StrFmt(tr("Creating temporary directory from template \"%s\"", 2226 2227 strTemplate.c_str())); … … 2230 2231 /* Construct arguments. */ 2231 2232 procInfo.mArguments.push_back(Utf8Str("--machinereadable")); 2232 procInfo.mArguments.push_back(Bstr(aTemplate)); /* The template we want to use. */ 2233 if (strPath.length()) /* Otherwise use /tmp or equivalent. */ 2234 { 2235 procInfo.mArguments.push_back(Utf8Str("-d")); 2236 procInfo.mArguments.push_back(strPath); 2237 } 2238 procInfo.mArguments.push_back(strTemplate); 2233 2239 } 2234 2240 catch (...) … … 2284 2290 if (RT_SUCCESS(rc)) 2285 2291 { 2286 streamBlock.GetString("name"); 2292 const char *pcszName = streamBlock.GetString("name"); 2293 if (!pcszName) 2294 return setError(E_FAIL, tr("No name returned after creating temporary directory")); 2287 2295 int64_t i64rc; 2288 2296 if (RT_FAILURE(streamBlock.GetInt64Ex("rc", &i64rc))) 2289 2297 return setError(E_FAIL, tr("No return code after creating temporary directory")); 2290 2298 if (RT_FAILURE((int)i64rc)) 2291 return setError(VBOX_E_IPRT_ERROR, tr("File deletion failed: %Rrc"), rc); 2299 { 2300 HRESULT hrc = i64rc == VERR_INVALID_PARAMETER ? E_INVALIDARG 2301 : i64rc == VERR_NOT_SUPPORTED ? VBOX_E_NOT_SUPPORTED 2302 : VBOX_E_IPRT_ERROR; 2303 return setError(hrc, tr("Temporary directory creation failed: %Rrc"), 2304 (int)i64rc); 2305 } 2306 try 2307 { 2308 Bstr(pcszName).cloneTo(aDirectory); 2309 } 2310 catch (...) 2311 { 2312 return E_OUTOFMEMORY; 2313 } 2292 2314 } 2293 2315 else
Note:
See TracChangeset
for help on using the changeset viewer.