Changeset 75806 in vbox
- Timestamp:
- Nov 29, 2018 7:08:07 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/GuestControl/service.cpp
r75805 r75806 539 539 HGCMSvcSetU32(&mPendingCon.mParms[0], pHostCmd->mMsgType); 540 540 HGCMSvcSetU32(&mPendingCon.mParms[1], pHostCmd->mParmCount); 541 for (uint32_t i = pHostCmd->mParmCount; i >= 2; i--) 541 uint32_t i = RT_MIN(mPendingCon.mNumParms, pHostCmd->mParmCount + 2); 542 while (i-- > 2) 542 543 switch (pHostCmd->mpParms[i - 2].type) 543 544 { … … 548 549 549 550 rc = mSvcHelpers->pfnCallComplete(mPendingCon.mHandle, VINF_SUCCESS); 550 mIsPending = (guestControl::eGuestFn)0; 551 552 mPendingCon.mHandle = NULL; 553 mPendingCon.mParms = NULL; 554 mPendingCon.mNumParms = 0; 555 mIsPending = (guestControl::eGuestFn)0; 551 556 } 552 557 else if (mIsPending == GUEST_MSG_WAIT) … … 607 612 608 613 mSvcHelpers->pfnCallComplete(mPendingCon.mHandle, rcComplete); 609 mIsPending = (guestControl::eGuestFn)0; 610 m_fPendingCancel = false; 614 615 mPendingCon.mHandle = NULL; 616 mPendingCon.mParms = NULL; 617 mPendingCon.mNumParms = 0; 618 mIsPending = (guestControl::eGuestFn)0; 619 m_fPendingCancel = false; 611 620 return VINF_SUCCESS; 612 621 } … … 720 729 721 730 /** 722 * Set to indicate that a client call (GUEST_MSG_WAIT) is pending.723 *724 * @note Only used by GUEST_MSG_WAIT scenarios.725 */726 int OldSetPending(const ClientConnection *pConnection)727 {728 AssertPtrReturn(pConnection, VERR_INVALID_POINTER);729 730 if (mIsPending != 0)731 {732 LogFlowFunc(("[Client %RU32] Already is in pending mode\n", mID));733 734 /*735 * Signal that we don't and can't return yet.736 */737 return VINF_HGCM_ASYNC_EXECUTE;738 }739 740 if (mHostCmdList.empty())741 {742 AssertMsg(mIsPending == 0, ("Client ID=%RU32 already is pending but tried to receive a new host command\n", mID));743 744 mPendingCon.mHandle = pConnection->mHandle;745 mPendingCon.mNumParms = pConnection->mNumParms;746 mPendingCon.mParms = pConnection->mParms;747 748 mIsPending = GUEST_MSG_WAIT;749 750 LogFlowFunc(("[Client %RU32] Is now in pending mode\n", mID));751 752 /*753 * Signal that we don't and can't return yet.754 */755 return VINF_HGCM_ASYNC_EXECUTE;756 }757 758 /*759 * Signal that there already is a connection pending.760 * Shouldn't happen in daily usage.761 */762 AssertMsgFailed(("Client already has a connection pending\n"));763 return VERR_SIGNAL_PENDING;764 }765 766 /**767 731 * @note Only used by GUEST_MSG_WAIT scenarios. 768 732 */ … … 798 762 * Return first host command. 799 763 */ 800 AssertMsgReturn(mIsPending == 0,801 ("Client ID=%RU32 still is in pending mode; can't use another connection\n", mID), VERR_INVALID_PARAMETER);802 803 764 HostCmdListIter curCmd = mHostCmdList.begin(); 804 765 Assert(curCmd != mHostCmdList.end()); … … 1257 1218 paParms[0].u.uint32 = pFirstCmd->mMsgType; 1258 1219 paParms[1].u.uint32 = pFirstCmd->mParmCount; 1259 for (uint32_t i = pFirstCmd->mParmCount; i >= 2; i--) 1220 uint32_t i = RT_MIN(cParms, pFirstCmd->mParmCount + 2); 1221 while (i-- > 2) 1260 1222 switch (pFirstCmd->mpParms[i - 2].type) 1261 1223 {
Note:
See TracChangeset
for help on using the changeset viewer.