Changeset 39905 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Jan 30, 2012 12:41:49 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 75975
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestCtrlImplDir.cpp
r39843 r39905 250 250 break; 251 251 252 case VERR_ FILE_NOT_FOUND:252 case VERR_PATH_NOT_FOUND: 253 253 *aExists = FALSE; 254 254 break; … … 497 497 const char *pszFsType = stdOut[0].GetString("ftype"); 498 498 if (!pszFsType) /* Attribute missing? */ 499 rc = VERR_ NOT_FOUND;499 rc = VERR_PATH_NOT_FOUND; 500 500 if ( RT_SUCCESS(rc) 501 501 && strcmp(pszFsType, "d")) /* Directory? */ 502 502 { 503 rc = VERR_ FILE_NOT_FOUND;503 rc = VERR_PATH_NOT_FOUND; 504 504 /* This is not critical for Main, so don't set hr -- 505 505 * we will take care of rc then. */ -
trunk/src/VBox/Main/src-client/GuestCtrlImplTasks.cpp
r39843 r39905 263 263 BOOL fCompleted = FALSE; 264 264 BOOL fCanceled = FALSE; 265 266 size_t cbToRead = cbSize;267 265 uint64_t cbTransferedTotal = 0; 268 269 size_t cbRead;270 266 271 267 SafeArray<BYTE> aInputData(_64K); … … 273 269 && !fCompleted) 274 270 { 275 /** @todo Not very efficient, but works for now. */ 276 vrc = RTFileSeek(fileSource, cbTransferedTotal, 277 RTFILE_SEEK_BEGIN, NULL /* poffActual */); 278 if (RT_SUCCESS(vrc)) 279 { 280 vrc = RTFileRead(fileSource, (uint8_t*)aInputData.raw(), 281 RT_MIN(cbToRead, _64K), &cbRead); 282 /* 283 * Some other error occured? There might be a chance that RTFileRead 284 * could not resolve/map the native error code to an IPRT code, so just 285 * print a generic error. 286 */ 287 if (RT_FAILURE(vrc)) 271 size_t cbToRead = cbSize; 272 size_t cbRead = 0; 273 if (cbSize) /* If we have nothing to read, take a shortcut. */ 274 { 275 /** @todo Not very efficient, but works for now. */ 276 vrc = RTFileSeek(fileSource, cbTransferedTotal, 277 RTFILE_SEEK_BEGIN, NULL /* poffActual */); 278 if (RT_SUCCESS(vrc)) 279 { 280 vrc = RTFileRead(fileSource, (uint8_t*)aInputData.raw(), 281 RT_MIN(cbToRead, _64K), &cbRead); 282 /* 283 * Some other error occured? There might be a chance that RTFileRead 284 * could not resolve/map the native error code to an IPRT code, so just 285 * print a generic error. 286 */ 287 if (RT_FAILURE(vrc)) 288 { 289 rc = GuestTask::setProgressErrorInfo(VBOX_E_IPRT_ERROR, aTask->pProgress, 290 Guest::tr("Could not read from file \"%s\" (%Rrc)"), 291 aTask->strSource.c_str(), vrc); 292 break; 293 } 294 } 295 else 288 296 { 289 297 rc = GuestTask::setProgressErrorInfo(VBOX_E_IPRT_ERROR, aTask->pProgress, 290 Guest::tr(" Could not read from file \"%s\"(%Rrc)"),291 aTask->strSource.c_str(), vrc);298 Guest::tr("Seeking file \"%s\" failed; offset = %RU64 (%Rrc)"), 299 aTask->strSource.c_str(), cbTransferedTotal, vrc); 292 300 break; 293 301 } 294 }295 else296 {297 rc = GuestTask::setProgressErrorInfo(VBOX_E_IPRT_ERROR, aTask->pProgress,298 Guest::tr("Seeking file \"%s\" failed; offset = %RU64 (%Rrc)"),299 aTask->strSource.c_str(), cbTransferedTotal, vrc);300 break;301 302 } 302 303 /* Resize buffer to reflect amount we just have read. … … 317 318 } 318 319 319 ULONG uBytesWritten ;320 ULONG uBytesWritten = 0; 320 321 rc = pGuest->SetProcessInput(uPID, uFlags, 321 322 0 /* Infinite timeout */,
Note:
See TracChangeset
for help on using the changeset viewer.