Changeset 28243 in vbox for trunk/src/VBox/Main
- Timestamp:
- Apr 13, 2010 12:07:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/GuestImpl.cpp
r28233 r28243 463 463 LogFlowFunc(("pvExtension = %p, u32Function = %d, pvParms = %p, cbParms = %d\n", 464 464 pvExtension, u32Function, pvParms, cbParms)); 465 ComObjPtr<Guest> pGuest = reinterpret_cast<Guest*>(pvExtension);465 PHOSTEXECCALLBACKDATA pExt = reinterpret_cast<HOSTEXECCALLBACKDATA *>(pvExtension); 466 466 467 467 int rc = VINF_SUCCESS; 468 468 if (u32Function == GUEST_EXEC_SEND_STATUS) 469 469 { 470 470 LogFlowFunc(("GUEST_EXEC_SEND_STATUS\n")); 471 pExt->pid = pCBData->pid; 472 pExt->status = pCBData->status; 473 pExt->flags = pCBData->flags; 474 /** @todo Copy void* buffer! */ 471 475 } 472 476 else 473 477 rc = VERR_NOT_SUPPORTED; 474 478 475 ASMAtomicWriteBool(&p Guest->mSignalled, true);479 ASMAtomicWriteBool(&pExt->called, true); 476 480 return rc; 477 481 } … … 521 525 */ 522 526 HGCMSVCEXTHANDLE hExt; 527 HOSTEXECCALLBACKDATA callbackData; 528 callbackData.called = false; 523 529 int vrc = HGCMHostRegisterServiceExtension(&hExt, "VBoxGuestControlSvc", 524 530 &Guest::doGuestCtrlExecNotification, 525 this);531 &callbackData); 526 532 if (RT_SUCCESS(vrc)) 527 533 { … … 613 619 * get the PID. 614 620 */ 615 mSignalled = false;616 621 uint64_t u64Started = RTTimeMilliTS(); 617 622 do … … 628 633 } 629 634 RTThreadSleep(100); 630 } while (! mSignalled);635 } while (!callbackData.called); 631 636 632 637 /* Did we get some status? */ 633 if ( mSignalled)638 if (callbackData.called) 634 639 { 635 640 switch (callbackData.status) 641 { 642 case PROC_STS_STARTED: 643 *aPID = callbackData.pid; 644 break; 645 646 case PROC_STS_ERROR: 647 vrc = callbackData.flags; /* flags member contains IPRT error code. */ 648 break; 649 650 default: 651 vrc = VERR_INVALID_PARAMETER; 652 break; 653 } 654 } 655 656 if (RT_FAILURE(vrc)) 657 { 658 if (vrc == VERR_FILE_NOT_FOUND) /* This is the most likely error. */ 659 { 660 rc = setError(VBOX_E_IPRT_ERROR, 661 tr("The file \"%s\" was not found on guest"), Utf8Command.raw()); 662 } 663 else 664 { 665 rc = setError(E_UNEXPECTED, 666 tr("The service call failed with the error %Rrc"), vrc); 667 } 636 668 } 637 669 #if 0 … … 640 672 } 641 673 else 674 { 675 /* HGCM call went wrong. */ 642 676 rc = setError(E_UNEXPECTED, 643 tr("The service call failed with the error %Rrc"), 644 vrc);645 677 tr("The service call failed with the error %Rrc"), vrc); 678 } 679 646 680 for (unsigned i = 0; i < uNumArgs; i++) 647 681 RTMemFree(papszArgv[i]);
Note:
See TracChangeset
for help on using the changeset viewer.