Changeset 28233 in vbox for trunk/src/VBox/Main
- Timestamp:
- Apr 13, 2010 8:23:52 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59974
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/GuestImpl.cpp
r28218 r28233 437 437 } 438 438 439 // static 440 DECLCALLBACK(int) Guest::doGuestCtrlNotification(void *pvExtension, 441 uint32_t u32Function, 442 void *pvParms, 443 uint32_t cbParms) 439 /** 440 * Static callback function for receiving updates on processes started on 441 * the guest side. 442 * 443 * @returns VBox status code. 444 * 445 * @todo 446 * 447 */ 448 DECLCALLBACK(int) Guest::doGuestCtrlExecNotification(void *pvExtension, 449 uint32_t u32Function, 450 void *pvParms, 451 uint32_t cbParms) 444 452 { 445 453 using namespace guestControl; … … 449 457 * changes to the object state. 450 458 */ 451 PHOST CALLBACKDATA pCBData = reinterpret_cast<PHOSTCALLBACKDATA>(pvParms);459 PHOSTEXECCALLBACKDATA pCBData = reinterpret_cast<PHOSTEXECCALLBACKDATA>(pvParms); 452 460 AssertPtr(pCBData); 453 AssertReturn(sizeof(HOST CALLBACKDATA) == cbParms, VERR_INVALID_PARAMETER);461 AssertReturn(sizeof(HOSTEXECCALLBACKDATA) == cbParms, VERR_INVALID_PARAMETER); 454 462 AssertReturn(HOSTCALLBACKMAGIC == pCBData->u32Magic, VERR_INVALID_PARAMETER); 455 463 LogFlowFunc(("pvExtension = %p, u32Function = %d, pvParms = %p, cbParms = %d\n", 456 464 pvExtension, u32Function, pvParms, cbParms)); 465 ComObjPtr<Guest> pGuest = reinterpret_cast<Guest *>(pvExtension); 457 466 458 467 int rc = VINF_SUCCESS; 459 Guest *pGuest = static_cast <Guest *>(pvExtension); 460 AssertPtr(pGuest); 461 462 switch (u32Function) 463 { 464 case GUEST_EXEC_SEND_STATUS: 465 LogFlowFunc(("GUEST_EXEC_SEND_STATUS\n")); 466 break; 467 468 default: 469 rc = VERR_NOT_SUPPORTED; 470 break; 471 } 468 if (u32Function == GUEST_EXEC_SEND_STATUS) 469 { 470 471 } 472 else 473 rc = VERR_NOT_SUPPORTED; 472 474 473 475 ASMAtomicWriteBool(&pGuest->mSignalled, true); … … 520 522 HGCMSVCEXTHANDLE hExt; 521 523 int vrc = HGCMHostRegisterServiceExtension(&hExt, "VBoxGuestControlSvc", 522 &Guest::doGuestCtrl Notification,524 &Guest::doGuestCtrlExecNotification, 523 525 this); 524 526 if (RT_SUCCESS(vrc)) … … 594 596 if (vmmDev) 595 597 { 596 LogFlow (("Guest::ExecuteProgram:numParms=%d\n", i));598 LogFlowFunc(("hgcmHostCall numParms=%d\n", i)); 597 599 vrc = vmmDev->hgcmHostCall("VBoxGuestControlSvc", HOST_EXEC_CMD, 598 600 i, paParms); 599 /** @todo Get the PID. */600 601 } 601 602 RTMemFree(pvEnv); … … 605 606 if (RT_SUCCESS(vrc)) 606 607 { 607 /* Wait for the HGCM low level callback */ 608 LogFlowFunc(("Waiting for HGCM callback (timeout=%ldms) ...\n", aTimeoutMS)); 609 610 /* 611 * Wait for the HGCM low level callback until the process 612 * has been started (or something went wrong). This is necessary to 613 * get the PID. 614 */ 608 615 mSignalled = false; 609 616 uint64_t u64Started = RTTimeMilliTS(); … … 622 629 RTThreadSleep(100); 623 630 } while (!mSignalled); 631 632 /* Did we get some status? */ 633 if (mSignalled) 634 { 635 636 } 624 637 #if 0 625 638 progress.queryInterfaceTo(aProgress); -
trunk/src/VBox/Main/include/GuestImpl.h
r28206 r28233 110 110 int prepareExecuteEnv(const char *pszEnv, void **ppvList, uint32_t *pcbList, uint32_t *pcEnv); 111 111 /** Static callback for handling guest notifications. */ 112 static DECLCALLBACK(int) doGuestCtrl Notification(void *pvExtension, uint32_t u32Function, void *pvParms, uint32_t cbParms);112 static DECLCALLBACK(int) doGuestCtrlExecNotification(void *pvExtension, uint32_t u32Function, void *pvParms, uint32_t cbParms); 113 113 # endif 114 114
Note:
See TracChangeset
for help on using the changeset viewer.