Changeset 40685 in vbox for trunk/src/VBox/Main/src-client/GuestCtrlImplTasks.cpp
- Timestamp:
- Mar 28, 2012 2:48:00 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestCtrlImplTasks.cpp
r40579 r40685 279 279 BOOL fCompleted = FALSE; 280 280 BOOL fCanceled = FALSE; 281 281 282 uint64_t cbTransferedTotal = 0; 283 uint64_t cbToRead = cbSize; 282 284 283 285 SafeArray<BYTE> aInputData(_64K); … … 285 287 && !fCompleted) 286 288 { 287 size_t cbToRead = cbSize;288 289 size_t cbRead = 0; 289 290 if (cbSize) /* If we have nothing to read, take a shortcut. */ … … 334 335 } 335 336 336 ULONG uBytesWritten = 0;337 ULONG cbBytesWritten = 0; 337 338 rc = pGuest->SetProcessInput(uPID, uFlags, 338 339 0 /* Infinite timeout */, 339 ComSafeArrayAsInParam(aInputData), & uBytesWritten);340 ComSafeArrayAsInParam(aInputData), &cbBytesWritten); 340 341 if (FAILED(rc)) 341 342 { … … 346 347 Assert(cbRead <= cbToRead); 347 348 Assert(cbToRead >= cbRead); 348 cbToRead -= cbRead; 349 350 cbTransferedTotal += uBytesWritten; 349 /* Only subtract bytes reported written by the guest. */ 350 cbToRead -= cbBytesWritten; 351 352 cbTransferedTotal += cbBytesWritten; 351 353 Assert(cbTransferedTotal <= cbSize); 352 354 aTask->pProgress->SetCurrentOperationProgress((ULONG)(cbTransferedTotal * 100 / cbSize)); … … 377 379 * canceled or we simply got all stuff transferred. 378 380 */ 379 ExecuteProcessStatus_T retStatus; 380 ULONG uRetExitCode; 381 382 rc = executeWaitForExit(uPID, execProgress, 0 /* No timeout */, 383 &retStatus, &uRetExitCode); 381 rc = executeWaitForExit(uPID, execProgress, 0 /* No timeout */); 384 382 if (FAILED(rc)) 385 383 { … … 388 386 else 389 387 { 390 if ( uRetExitCode != 0 391 || retStatus != ExecuteProcessStatus_TerminatedNormally) 388 VBOXGUESTCTRL_PROCESS proc; 389 vrc = processGetStatus(uPID, &proc, true /* Remove from PID list. */); 390 if (RT_SUCCESS(vrc)) 392 391 { 393 rc = GuestTask::setProgressErrorMsg(VBOX_E_IPRT_ERROR, aTask->pProgress, 394 Guest::tr("Guest process reported error %u (status: %u) while copying file \"%s\" to \"%s\""), 395 uRetExitCode, retStatus, aTask->strSource.c_str(), aTask->strDest.c_str()); 392 393 if ( proc.mExitCode != 0 394 || proc.mStatus != ExecuteProcessStatus_TerminatedNormally) 395 { 396 rc = GuestTask::setProgressErrorMsg(VBOX_E_IPRT_ERROR, aTask->pProgress, 397 Guest::tr("Guest process reported error %u (status: %u) while copying file \"%s\" to \"%s\""), 398 proc.mExitCode, proc.mStatus, aTask->strSource.c_str(), aTask->strDest.c_str()); 399 } 396 400 } 397 401 }
Note:
See TracChangeset
for help on using the changeset viewer.