Changeset 29785 in vbox
- Timestamp:
- May 25, 2010 1:30:45 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/GuestControlSvc.h
r29516 r29785 74 74 /** Context ID to identify callback data. */ 75 75 uint32_t u32ContextID; 76 } HOSTCCALLBACKHEADER, *PHOSTCCALLBACKHEADER;76 } CALLBACKHEADER, *PCALLBACKHEADER; 77 77 78 78 /** … … 80 80 * notify the host of changes to properties. 81 81 */ 82 typedef struct _VBoxGuestCtrl ExecCallbackData82 typedef struct _VBoxGuestCtrlCallbackDataExecStatus 83 83 { 84 84 /** Callback data header. */ 85 HOSTCCALLBACKHEADER hdr;85 CALLBACKHEADER hdr; 86 86 /** The process ID (PID). */ 87 87 uint32_t u32PID; … … 94 94 /** Size of optional data buffer (not used atm). */ 95 95 uint32_t cbData; 96 } HOSTEXECCALLBACKDATA, *PHOSTEXECCALLBACKDATA;97 98 typedef struct _VBoxGuestCtrl ExecOutCallbackData96 } CALLBACKDATAEXECSTATUS, *PCALLBACKDATAEXECSTATUS; 97 98 typedef struct _VBoxGuestCtrlCallbackDataExecOut 99 99 { 100 100 /** Callback data header. */ 101 HOSTCCALLBACKHEADER hdr;101 CALLBACKHEADER hdr; 102 102 /** The process ID (PID). */ 103 103 uint32_t u32PID; … … 110 110 /** Size of optional data buffer. */ 111 111 uint32_t cbData; 112 } HOSTEXECOUTCALLBACKDATA, *PHOSTEXECOUTCALLBACKDATA; 112 } CALLBACKDATAEXECOUT, *PCALLBACKDATAEXECOUT; 113 114 typedef struct _VBoxGuestCtrlCallbackDataClientDisconnected 115 { 116 /** Callback data header. */ 117 CALLBACKHEADER hdr; 118 } CALLBACKDATACLIENTDISCONNECTED, *PCALLBACKDATACLIENTDISCONNECTED; 113 119 114 120 enum 115 121 { 116 /** Magic number for sanity checking the HOSTEXECCALLBACKDATA structure. */ 117 HOSTEXECCALLBACKDATAMAGIC = 0x26011982, 118 /** Magic number for sanity checking the HOSTEXECOUTCALLBACKDATA structure. */ 119 HOSTEXECOUTCALLBACKDATAMAGIC = 0x11061949 122 /** Magic number for sanity checking the CALLBACKDATACLIENTDISCONNECTED structure. */ 123 CALLBACKDATAMAGICCLIENTDISCONNECTED = 0x08041984, 124 /** Magic number for sanity checking the CALLBACKDATAEXECSTATUS structure. */ 125 CALLBACKDATAMAGICEXECSTATUS = 0x26011982, 126 /** Magic number for sanity checking the CALLBACKDATAEXECOUT structure. */ 127 CALLBACKDATAMAGICEXECOUT = 0x11061949 120 128 }; 121 129 … … 160 168 GUEST_GET_HOST_MSG = 1, 161 169 /** 162 * Guest asks the host to cancel all pending waits the guest waits on.170 * Guest asks the host to cancel all pending waits the guest itself waits on. 163 171 * This becomes necessary when the guest wants to quit but still waits for 164 172 * commands from the host. 165 173 */ 166 174 GUEST_CANCEL_PENDING_WAITS = 2, 175 /** 176 * Guest disconnected (terminated normally or due to a crash HGCM 177 * detected when calling service::clientDisconnect(). 178 */ 179 GUEST_DISCONNECTED = 3, 167 180 /** 168 181 * TODO -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r29740 r29785 367 367 368 368 /* Wait for process to exit ... */ 369 BOOL fCompleted = false; 369 BOOL fCompleted = FALSE; 370 BOOL fCanceled = FALSE; 370 371 while (SUCCEEDED(progress->COMGETTER(Completed(&fCompleted)))) 371 372 { … … 424 425 hrc = progress->Cancel(); 425 426 if (SUCCEEDED(hrc)) 426 fCanceledAlready = true;427 fCanceledAlready = TRUE; 427 428 else 428 429 g_fExecCanceled = false; 430 } 431 432 /* progress canceled by Main API? */ 433 if ( SUCCEEDED(progress->COMGETTER(Canceled(&fCanceled))) 434 && fCanceled) 435 { 436 break; 429 437 } 430 438 … … 441 449 } 442 450 443 BOOL fCanceled; 444 if (SUCCEEDED(progress->COMGETTER(Canceled)(&fCanceled)) && fCanceled) 445 if (fVerbose) RTPrintf("Process execution canceled!\n"); 451 if (fCanceled && fVerbose) 452 RTPrintf("Process execution canceled!\n"); 446 453 447 454 if (fCompleted) -
trunk/src/VBox/HostServices/GuestControl/service.cpp
r29438 r29785 48 48 49 49 /** 50 * Structure for holding a buffered host command 50 * Structure for holding all clients with their 51 * generated host contexts. This is necessary for 52 * mainting the relationship between a client and its context IDs. 53 */ 54 struct ClientContexts 55 { 56 /** This client ID. */ 57 uint32_t mClientID; 58 /** The list of contexts a client is assigned to. */ 59 std::list< uint32_t > mContextList; 60 61 /** The normal contructor. */ 62 ClientContexts(uint32_t aClientID) 63 : mClientID(aClientID) {} 64 }; 65 /** The client list + iterator type */ 66 typedef std::list< ClientContexts > ClientContextsList; 67 typedef std::list< ClientContexts >::iterator ClientContextsListIter; 68 typedef std::list< ClientContexts >::const_iterator ClientContextsListIterConst; 69 70 /** 71 * Structure for holding a buffered host command. 51 72 */ 52 73 struct HostCmd 53 74 { 75 /** The context ID this command belongs to. Will be extracted 76 * from the HGCM parameters. */ 77 uint32_t mContextID; 54 78 /** Dynamic structure for holding the HGCM parms */ 55 VBOXGUESTCTRPARAMBUFFER parmBuf; 79 VBOXGUESTCTRPARAMBUFFER mParmBuf; 80 81 /** The standard contructor. */ 82 HostCmd() : mContextID(0) {} 56 83 }; 57 84 /** The host cmd list + iterator type */ … … 61 88 62 89 /** 63 * Structure for holding an uncompleted guest call 90 * Structure for holding an uncompleted guest call. 64 91 */ 65 92 struct GuestCall … … 74 101 uint32_t mNumParms; 75 102 76 /** The standard con structor*/103 /** The standard contructor. */ 77 104 GuestCall() : mClientID(0), mHandle(0), mParms(NULL), mNumParms(0) {} 78 /** The normal contructor */105 /** The normal contructor. */ 79 106 GuestCall(uint32_t aClientID, VBOXHGCMCALLHANDLE aHandle, 80 107 VBOXHGCMSVCPARM aParms[], uint32_t cParms) … … 92 119 { 93 120 private: 94 /** Type definition for use in callback functions */121 /** Type definition for use in callback functions. */ 95 122 typedef Service SELF; 96 123 /** HGCM helper functions. */ 97 124 PVBOXHGCMSVCHELPERS mpHelpers; 98 /** Callback function supplied by the host for notification of updates 99 * to properties */ 125 /* 126 * Callback function supplied by the host for notification of updates 127 * to properties. 128 */ 100 129 PFNHGCMSVCEXT mpfnHostCallback; 101 /** User data pointer to be supplied to the host callback function */130 /** User data pointer to be supplied to the host callback function. */ 102 131 void *mpvHostData; 103 /** The deferred calls list */132 /** The deferred calls list. */ 104 133 CallList mClientList; 105 /** The host command list */134 /** The host command list. */ 106 135 HostCmdList mHostCmds; 136 /** Client contexts list. */ 137 ClientContextsList mClientContextsList; 107 138 108 139 public: … … 368 399 { 369 400 LogFlowFunc(("Client (%ld) disconnected\n", u32ClientID)); 401 370 402 /* 371 403 * Throw out all stale clients. 372 404 */ 373 CallListIter it = mClientList.begin(); 374 while (it != mClientList.end()) 405 int rc = VINF_SUCCESS; 406 407 ClientContextsListIter it = mClientContextsList.begin(); 408 while ( it != mClientContextsList.end() 409 && RT_SUCCESS(rc)) 375 410 { 376 411 if (it->mClientID == u32ClientID) 377 it = mClientList.erase(it); 412 { 413 std::list< uint32_t >::iterator itContext = it->mContextList.begin(); 414 while ( itContext != it->mContextList.end() 415 && RT_SUCCESS(rc)) 416 { 417 LogFlowFunc(("Notifying host context %u of disconnect ...\n", (*itContext))); 418 419 /* 420 * Notify the host that clients with u32ClientID are no longer 421 * around and need to be cleaned up (canceling waits etc). 422 */ 423 if (mpfnHostCallback) 424 { 425 CALLBACKDATACLIENTDISCONNECTED data; 426 data.hdr.u32Magic = CALLBACKDATAMAGICCLIENTDISCONNECTED; 427 data.hdr.u32ContextID = (*itContext); 428 rc = mpfnHostCallback(mpvHostData, GUEST_DISCONNECTED, (void *)(&data), sizeof(data)); 429 if (RT_FAILURE(rc)) 430 LogFlowFunc(("Notification of host context %u failed with %Rrc\n", rc)); 431 } 432 itContext++; 433 } 434 it = mClientContextsList.erase(it); 435 } 378 436 else 379 437 it++; 380 438 } 381 return VINF_SUCCESS;439 return rc; 382 440 } 383 441 … … 388 446 389 447 /* Sufficient parameter space? */ 390 if (pCmd-> parmBuf.uParmCount > cParms)391 { 392 paParms[0].setUInt32(pCmd-> parmBuf.uMsg); /* Message ID */393 paParms[1].setUInt32(pCmd-> parmBuf.uParmCount); /* Required parameters for message */448 if (pCmd->mParmBuf.uParmCount > cParms) 449 { 450 paParms[0].setUInt32(pCmd->mParmBuf.uMsg); /* Message ID */ 451 paParms[1].setUInt32(pCmd->mParmBuf.uParmCount); /* Required parameters for message */ 394 452 395 453 /* … … 402 460 else 403 461 { 404 rc = paramBufferAssign(&pCmd-> parmBuf, cParms, paParms);462 rc = paramBufferAssign(&pCmd->mParmBuf, cParms, paParms); 405 463 } 406 464 return rc; … … 415 473 { 416 474 int rc = VINF_SUCCESS; 475 476 /* 477 * Lookup client in our list so that we can assign the context ID of 478 * a command to that client. 479 */ 480 std::list< ClientContexts >::reverse_iterator it = mClientContextsList.rbegin(); 481 while (it != mClientContextsList.rend()) 482 { 483 if (it->mClientID == u32ClientID) 484 break; 485 it++; 486 } 487 488 /* Not found? Add client to list. */ 489 if (it == mClientContextsList.rend()) 490 { 491 mClientContextsList.push_back(ClientContexts(u32ClientID)); 492 it = mClientContextsList.rbegin(); 493 } 494 Assert(it != mClientContextsList.rend()); 417 495 418 496 /* … … 435 513 if (RT_SUCCESS(rc)) 436 514 { 437 /* Only if the guest really got and understood the message 438 * remove it from the list. */ 439 paramBufferFree(&curCmd.parmBuf); 515 /* Remember which client processes which context (for 516 * later reference & cleanup). */ 517 Assert(curCmd.mContextID > 0); 518 it->mContextList.push_back(curCmd.mContextID); 519 520 /* Only if the guest really got and understood the message remove it from the list. */ 521 paramBufferFree(&curCmd.mParmBuf); 440 522 mHostCmds.pop_front(); 441 523 } … … 444 526 } 445 527 528 /* 529 * Client asks itself (in another thread) to cancel all pending waits which are blocking the client 530 * from shutting down / doing something else. 531 */ 446 532 int Service::cancelPendingWaits(uint32_t u32ClientID) 447 533 { … … 454 540 if (it->mNumParms >= 2) 455 541 { 456 it->mParms[0].setUInt32(GETHOSTMSG_EXEC_HOST_CANCEL_WAIT); /* Message ID */457 it->mParms[1].setUInt32(0); /* Required parameters for message */542 it->mParms[0].setUInt32(GETHOSTMSG_EXEC_HOST_CANCEL_WAIT); /* Message ID. */ 543 it->mParms[1].setUInt32(0); /* Required parameters for message. */ 458 544 } 459 545 if (mpHelpers) … … 475 561 && cParms == 5) 476 562 { 477 HOSTEXECCALLBACKDATAdata;478 data.hdr.u32Magic = HOSTEXECCALLBACKDATAMAGIC;563 CALLBACKDATAEXECSTATUS data; 564 data.hdr.u32Magic = CALLBACKDATAMAGICEXECSTATUS; 479 565 paParms[0].getUInt32(&data.hdr.u32ContextID); 480 566 … … 491 577 && cParms == 5) 492 578 { 493 HOSTEXECOUTCALLBACKDATAdata;494 data.hdr.u32Magic = HOSTEXECOUTCALLBACKDATAMAGIC;579 CALLBACKDATAEXECOUT data; 580 data.hdr.u32Magic = CALLBACKDATAMAGICEXECOUT; 495 581 paParms[0].getUInt32(&data.hdr.u32ContextID); 496 582 … … 515 601 516 602 HostCmd newCmd; 603 rc = paramBufferAllocate(&newCmd.mParmBuf, eFunction, cParms, paParms); 604 if ( RT_SUCCESS(rc) 605 && newCmd.mParmBuf.uParmCount > 0) 606 { 607 /* 608 * Assume that the context ID *always* is the first parameter, 609 * assign the context ID to the command. 610 */ 611 newCmd.mParmBuf.pParms[0].getUInt32(&newCmd.mContextID); 612 Assert(newCmd.mContextID > 0); 613 } 614 517 615 bool fProcessed = false; 518 rc = paramBufferAllocate(&newCmd.parmBuf, eFunction, cParms, paParms);519 616 if (RT_SUCCESS(rc)) 520 617 { … … 539 636 else /* If command was understood by the client, free and remove from host commands list. */ 540 637 { 541 paramBufferFree(&newCmd. parmBuf);638 paramBufferFree(&newCmd.mParmBuf); 542 639 fProcessed = true; 543 640 } … … 668 765 HostCmdListIter it; 669 766 for (it = mHostCmds.begin(); it != mHostCmds.end(); it++) 670 paramBufferFree(&it-> parmBuf);767 paramBufferFree(&it->mParmBuf); 671 768 mHostCmds.clear(); 672 769 -
trunk/src/VBox/Main/GuestImpl.cpp
r29645 r29785 484 484 485 485 int rc = VINF_SUCCESS; 486 if (u32Function == GUEST_EXEC_SEND_STATUS) 486 if (u32Function == GUEST_DISCONNECTED) 487 { 488 LogFlowFunc(("GUEST_DISCONNECTED\n")); 489 490 PCALLBACKDATACLIENTDISCONNECTED pCBData = reinterpret_cast<PCALLBACKDATACLIENTDISCONNECTED>(pvParms); 491 AssertPtr(pCBData); 492 AssertReturn(sizeof(CALLBACKDATACLIENTDISCONNECTED) == cbParms, VERR_INVALID_PARAMETER); 493 AssertReturn(CALLBACKDATAMAGICCLIENTDISCONNECTED == pCBData->hdr.u32Magic, VERR_INVALID_PARAMETER); 494 495 rc = pGuest->notifyCtrlClientDisconnected(u32Function, pCBData); 496 } 497 else if (u32Function == GUEST_EXEC_SEND_STATUS) 487 498 { 488 499 LogFlowFunc(("GUEST_EXEC_SEND_STATUS\n")); 489 500 490 P HOSTEXECCALLBACKDATA pCBData = reinterpret_cast<PHOSTEXECCALLBACKDATA>(pvParms);501 PCALLBACKDATAEXECSTATUS pCBData = reinterpret_cast<PCALLBACKDATAEXECSTATUS>(pvParms); 491 502 AssertPtr(pCBData); 492 AssertReturn(sizeof( HOSTEXECCALLBACKDATA) == cbParms, VERR_INVALID_PARAMETER);493 AssertReturn( HOSTEXECCALLBACKDATAMAGIC== pCBData->hdr.u32Magic, VERR_INVALID_PARAMETER);494 495 rc = pGuest->notifyCtrlExec (u32Function, pCBData);503 AssertReturn(sizeof(CALLBACKDATAEXECSTATUS) == cbParms, VERR_INVALID_PARAMETER); 504 AssertReturn(CALLBACKDATAMAGICEXECSTATUS == pCBData->hdr.u32Magic, VERR_INVALID_PARAMETER); 505 506 rc = pGuest->notifyCtrlExecStatus(u32Function, pCBData); 496 507 } 497 508 else if (u32Function == GUEST_EXEC_SEND_OUTPUT) … … 499 510 LogFlowFunc(("GUEST_EXEC_SEND_OUTPUT\n")); 500 511 501 P HOSTEXECOUTCALLBACKDATA pCBData = reinterpret_cast<PHOSTEXECOUTCALLBACKDATA>(pvParms);512 PCALLBACKDATAEXECOUT pCBData = reinterpret_cast<PCALLBACKDATAEXECOUT>(pvParms); 502 513 AssertPtr(pCBData); 503 AssertReturn(sizeof( HOSTEXECOUTCALLBACKDATA) == cbParms, VERR_INVALID_PARAMETER);504 AssertReturn( HOSTEXECOUTCALLBACKDATAMAGIC== pCBData->hdr.u32Magic, VERR_INVALID_PARAMETER);514 AssertReturn(sizeof(CALLBACKDATAEXECOUT) == cbParms, VERR_INVALID_PARAMETER); 515 AssertReturn(CALLBACKDATAMAGICEXECOUT == pCBData->hdr.u32Magic, VERR_INVALID_PARAMETER); 505 516 506 517 rc = pGuest->notifyCtrlExecOut(u32Function, pCBData); … … 512 523 513 524 /* Function for handling the execution start/termination notification. */ 514 int Guest::notifyCtrlExec (uint32_tu32Function,515 PHOSTEXECCALLBACKDATApData)525 int Guest::notifyCtrlExecStatus(uint32_t u32Function, 526 PCALLBACKDATAEXECSTATUS pData) 516 527 { 517 528 LogFlowFuncEnter(); … … 526 537 if (it != mCallbackList.end()) 527 538 { 528 P HOSTEXECCALLBACKDATA pCBData = (HOSTEXECCALLBACKDATA*)it->pvData;539 PCALLBACKDATAEXECSTATUS pCBData = (PCALLBACKDATAEXECSTATUS)it->pvData; 529 540 AssertPtr(pCBData); 530 541 … … 617 628 pData->hdr.u32ContextID, pData->u32Status)); 618 629 } 619 ASMAtomicWriteBool(&it-> bCalled, true);630 ASMAtomicWriteBool(&it->fCalled, true); 620 631 } 621 632 else … … 626 637 627 638 /* Function for handling the execution output notification. */ 628 int Guest::notifyCtrlExecOut(uint32_t 629 P HOSTEXECOUTCALLBACKDATApData)639 int Guest::notifyCtrlExecOut(uint32_t u32Function, 640 PCALLBACKDATAEXECOUT pData) 630 641 { 631 642 LogFlowFuncEnter(); … … 638 649 if (it != mCallbackList.end()) 639 650 { 640 Assert(!it-> bCalled);641 P HOSTEXECOUTCALLBACKDATA pCBData = (HOSTEXECOUTCALLBACKDATA*)it->pvData;651 Assert(!it->fCalled); 652 PCALLBACKDATAEXECOUT pCBData = (CALLBACKDATAEXECOUT*)it->pvData; 642 653 AssertPtr(pCBData); 643 654 … … 662 673 pCBData->cbData = 0; 663 674 } 664 ASMAtomicWriteBool(&it-> bCalled, true);675 ASMAtomicWriteBool(&it->fCalled, true); 665 676 } 666 677 else 667 678 LogFlowFunc(("Unexpected callback (magic=%u, context ID=%u) arrived\n", pData->hdr.u32Magic, pData->hdr.u32ContextID)); 679 LogFlowFuncLeave(); 680 return rc; 681 } 682 683 int Guest::notifyCtrlClientDisconnected(uint32_t u32Function, 684 PCALLBACKDATACLIENTDISCONNECTED pData) 685 { 686 LogFlowFuncEnter(); 687 int rc = VINF_SUCCESS; 688 689 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 690 691 /** @todo Maybe use a map instead of list for fast context lookup. */ 692 CallbackListIter it; 693 for (it = mCallbackList.begin(); it != mCallbackList.end(); it++) 694 { 695 if (it->mContextID == pData->hdr.u32ContextID) 696 destroyCtrlCallbackContext(it); 697 } 698 668 699 LogFlowFuncLeave(); 669 700 return rc; … … 738 769 context.mContextID = uNewContext; 739 770 context.mType = enmType; 740 context. bCalled = false;771 context.fCalled = false; 741 772 context.pvData = pvData; 742 773 context.cbData = cbData; … … 868 899 if (RT_SUCCESS(vrc)) 869 900 { 870 P HOSTEXECCALLBACKDATA pData = (HOSTEXECCALLBACKDATA*)RTMemAlloc(sizeof(HOSTEXECCALLBACKDATA));901 PCALLBACKDATAEXECSTATUS pData = (PCALLBACKDATAEXECSTATUS)RTMemAlloc(sizeof(CALLBACKDATAEXECSTATUS)); 871 902 AssertReturn(pData, VBOX_E_IPRT_ERROR); 872 903 uContextID = addCtrlCallbackContext(VBOXGUESTCTRLCALLBACKTYPE_EXEC_START, 873 pData, sizeof( HOSTEXECCALLBACKDATA), progress);904 pData, sizeof(CALLBACKDATAEXECSTATUS), progress); 874 905 Assert(uContextID > 0); 875 906 … … 926 957 { 927 958 uint64_t u64Started = RTTimeMilliTS(); 928 while (!it-> bCalled)959 while (!it->fCalled) 929 960 { 930 961 /* Check for timeout. */ … … 957 988 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 958 989 959 P HOSTEXECCALLBACKDATA pData = (HOSTEXECCALLBACKDATA*)it->pvData;960 Assert(it->cbData == sizeof( HOSTEXECCALLBACKDATA));990 PCALLBACKDATAEXECSTATUS pData = (PCALLBACKDATAEXECSTATUS)it->pvData; 991 Assert(it->cbData == sizeof(CALLBACKDATAEXECSTATUS)); 961 992 AssertPtr(pData); 962 993 963 if (it-> bCalled)994 if (it->fCalled) 964 995 { 965 996 /* Did we get some status? */ … … 1008 1039 rc = setError(VBOX_E_IPRT_ERROR, 1009 1040 tr("The file '%s' was not found on guest"), Utf8Command.raw()); 1041 } 1042 else if (vrc == VERR_PATH_NOT_FOUND) 1043 { 1044 rc = setError(VBOX_E_IPRT_ERROR, 1045 tr("The path to file '%s' was not found on guest"), Utf8Command.raw()); 1010 1046 } 1011 1047 else if (vrc == VERR_BAD_EXE_FORMAT) … … 1123 1159 1124 1160 /* Search for existing PID. */ 1125 P HOSTEXECOUTCALLBACKDATA pData = (HOSTEXECOUTCALLBACKDATA*)RTMemAlloc(sizeof(HOSTEXECOUTCALLBACKDATA));1161 PCALLBACKDATAEXECOUT pData = (CALLBACKDATAEXECOUT*)RTMemAlloc(sizeof(CALLBACKDATAEXECOUT)); 1126 1162 AssertReturn(pData, VBOX_E_IPRT_ERROR); 1127 1163 uint32_t uContextID = addCtrlCallbackContext(VBOXGUESTCTRLCALLBACKTYPE_EXEC_OUTPUT, 1128 pData, sizeof( HOSTEXECOUTCALLBACKDATA), progress);1164 pData, sizeof(CALLBACKDATAEXECOUT), progress); 1129 1165 Assert(uContextID > 0); 1130 1166 … … 1175 1211 { 1176 1212 uint64_t u64Started = RTTimeMilliTS(); 1177 while (!it-> bCalled)1213 while (!it->fCalled) 1178 1214 { 1179 1215 /* Check for timeout. */ … … 1203 1239 if (!fCanceled) 1204 1240 { 1205 if (it-> bCalled)1241 if (it->fCalled) 1206 1242 { 1207 1243 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1208 1244 1209 1245 /* Did we get some output? */ 1210 pData = ( HOSTEXECOUTCALLBACKDATA*)it->pvData;1211 Assert(it->cbData == sizeof( HOSTEXECOUTCALLBACKDATA));1246 pData = (PCALLBACKDATAEXECOUT)it->pvData; 1247 Assert(it->cbData == sizeof(CALLBACKDATAEXECOUT)); 1212 1248 AssertPtr(pData); 1213 1249 -
trunk/src/VBox/Main/include/GuestImpl.h
r29591 r29785 127 127 uint32_t cbData; 128 128 /** Atomic flag whether callback was called. */ 129 volatile bool bCalled;129 volatile bool fCalled; 130 130 /** Pointer to user-supplied IProgress. */ 131 131 ComObjPtr<Progress> pProgress; … … 137 137 struct GuestProcess 138 138 { 139 uint32_t mPID;140 uint32_t mStatus;141 uint32_t mFlags;142 uint32_t mExitCode;139 uint32_t mPID; 140 uint32_t mStatus; 141 uint32_t mFlags; 142 uint32_t mExitCode; 143 143 }; 144 144 typedef std::list< GuestProcess > GuestProcessList; … … 148 148 int prepareExecuteEnv(const char *pszEnv, void **ppvList, uint32_t *pcbList, uint32_t *pcEnv); 149 149 /** Handler for guest execution control notifications. */ 150 int notifyCtrlExec(uint32_t u32Function, PHOSTEXECCALLBACKDATA pData); 151 int notifyCtrlExecOut(uint32_t u32Function, PHOSTEXECOUTCALLBACKDATA pData); 150 int notifyCtrlClientDisconnected(uint32_t u32Function, PCALLBACKDATACLIENTDISCONNECTED pData); 151 int notifyCtrlExecStatus(uint32_t u32Function, PCALLBACKDATAEXECSTATUS pData); 152 int notifyCtrlExecOut(uint32_t u32Function, PCALLBACKDATAEXECOUT pData); 152 153 CallbackListIter getCtrlCallbackContextByID(uint32_t u32ContextID); 153 154 GuestProcessIter getProcessByPID(uint32_t u32PID);
Note:
See TracChangeset
for help on using the changeset viewer.