Changeset 47695 in vbox for trunk/src/VBox
- Timestamp:
- Aug 13, 2013 2:40:20 PM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestCtrl.cpp
r47620 r47695 138 138 * @return IPRT status code. 139 139 * @param uClientId The client ID returned by VbglR3GuestCtrlConnect(). 140 * @param uFilterAdd Context ID filter mask to add. 141 * @param uFilterRemove Context ID filter mask to remove. 142 */ 143 VBGLR3DECL(int) VbglR3GuestCtrlMsgFilterSet(uint32_t uClientId, 144 uint32_t uFilterAdd, uint32_t uFilterRemove) 140 * @param uValue The value to filter messages for. 141 * @param uMaskAdd Filter mask to add. 142 * @param uMaskRemove Filter mask to remove. 143 */ 144 VBGLR3DECL(int) VbglR3GuestCtrlMsgFilterSet(uint32_t uClientId, uint32_t uValue, 145 uint32_t uMaskAdd, uint32_t uMaskRemove) 145 146 { 146 147 HGCMMsgCmdFilterSet Msg; … … 149 150 Msg.hdr.u32ClientID = uClientId; 150 151 Msg.hdr.u32Function = GUEST_MSG_FILTER_SET; /* Tell the host we want to set a filter. */ 151 Msg.hdr.cParms = 3; 152 153 VbglHGCMParmUInt32Set(&Msg.add, uFilterAdd); 154 VbglHGCMParmUInt32Set(&Msg.remove, uFilterRemove); 152 Msg.hdr.cParms = 4; 153 154 VbglHGCMParmUInt32Set(&Msg.value, uValue); 155 VbglHGCMParmUInt32Set(&Msg.mask_add, uMaskAdd); 156 VbglHGCMParmUInt32Set(&Msg.mask_remove, uMaskRemove); 155 157 VbglHGCMParmUInt32Set(&Msg.flags, 0 /* Flags, unused */); 156 158 -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp
r47622 r47695 1442 1442 /* The process thread is not interested in receiving any commands; 1443 1443 * tell the host service. */ 1444 rc = VbglR3GuestCtrlMsgFilterSet(pProcess->uClientID, 0 /* Skip all */, 0); 1444 rc = VbglR3GuestCtrlMsgFilterSet(pProcess->uClientID, 0 /* Skip all */, 1445 0 /* Filter mask to add */, 0 /* Filter mask to remove */); 1445 1446 if (RT_FAILURE(rc)) 1446 1447 { -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
r47622 r47695 911 911 912 912 /** 913 * Thread main routine for a forked guest session . This914 * thread runs in the main executable to control the forked913 * Thread main routine for a forked guest session process. 914 * This thread runs in the main executable to control the forked 915 915 * session process. 916 916 * … … 936 936 /* The session thread is not interested in receiving any commands; 937 937 * tell the host service. */ 938 rc = VbglR3GuestCtrlMsgFilterSet(uClientID, 0 /* Skip all */, 0); 938 rc = VbglR3GuestCtrlMsgFilterSet(uClientID, 0 /* Skip all */, 939 0 /* Filter mask to add */, 0 /* Filter mask to remove */); 939 940 if (RT_FAILURE(rc)) 940 941 { 941 942 VBoxServiceError("Unable to set message filter, rc=%Rrc\n", rc); 942 943 /* Non-critical. */ 944 rc = VINF_SUCCESS; 943 945 } 944 946 } 945 947 else 946 {947 948 VBoxServiceError("Error connecting to guest control service, rc=%Rrc\n", rc); 948 return rc; 949 } 950 951 /* Let caller know that we're done initializing. */ 952 rc = RTThreadUserSignal(RTThreadSelf()); 949 950 if (RT_FAILURE(rc)) 951 pThread->fShutdown = true; 952 953 /* Let caller know that we're done initializing, regardless of the result. */ 954 int rc2 = RTThreadUserSignal(RTThreadSelf()); 955 AssertRC(rc2); 956 953 957 if (RT_FAILURE(rc)) 954 958 return rc; … … 1069 1073 Assert(uSessionStatus != GUEST_SESSION_NOTIFYTYPE_UNDEFINED); 1070 1074 VBGLR3GUESTCTRLCMDCTX ctx = { uClientID, VBOX_GUESTCTRL_CONTEXTID_MAKE_SESSION(uSessionID) }; 1071 intrc2 = VbglR3GuestCtrlSessionNotify(&ctx,1072 1075 rc2 = VbglR3GuestCtrlSessionNotify(&ctx, 1076 uSessionStatus, uSessionRc); 1073 1077 if (RT_FAILURE(rc2)) 1074 1078 VBoxServiceError("Reporting session ID=%RU32 final status failed with rc=%Rrc\n", … … 1100 1104 * session we don't want to handle. */ 1101 1105 uint32_t uFilterAdd = 1102 VBOX_GUESTCTRL_ CONTEXTID_MAKE_SESSION(pSession->StartupInfo.uSessionID);1103 uFilterAdd |= 0x7FFFFFF; /* We only want to filter for session IDs. */1104 1105 rc = VbglR3GuestCtrlMsgFilterSet(uClientID,uFilterAdd, 0 /* Filter remove */);1106 VBOX_GUESTCTRL_FILTER_BY_SESSION(pSession->StartupInfo.uSessionID); 1107 rc = VbglR3GuestCtrlMsgFilterSet(uClientID, 1108 VBOX_GUESTCTRL_CONTEXTID_MAKE_SESSION(pSession->StartupInfo.uSessionID), 1109 uFilterAdd, 0 /* Filter remove */); 1106 1110 VBoxServiceVerbose(3, "Setting message filterAdd=0x%x returned %Rrc\n", 1107 1111 uFilterAdd, rc); … … 1930 1934 int rc = GstCntlSessionThreadWait(pThread, 1931 1935 5 * 60 * 1000 /* 5 minutes timeout */, uFlags); 1932 /** @todo Kill session process if still around? */1933 1936 1934 1937 /* Remove session from list and destroy object. */ 1935 1938 RTListNodeRemove(&pThread->Node); 1939 1936 1940 RTMemFree(pThread); 1941 pThread = NULL; 1937 1942 1938 1943 return rc; -
trunk/src/VBox/HostServices/GuestControl/service.cpp
r47621 r47695 287 287 int CopyTo(VBOXHGCMSVCPARM paDstParms[], uint32_t cDstParms) const 288 288 { 289 LogFlowFunc(("pHostCmd=%p, mMsgType=%RU32, mParmCount=%RU32, mContextID=%RU32 \n",290 this, mMsgType, mParmCount, mContextID ));289 LogFlowFunc(("pHostCmd=%p, mMsgType=%RU32, mParmCount=%RU32, mContextID=%RU32 (Session %RU32)\n", 290 this, mMsgType, mParmCount, mContextID, VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(mContextID))); 291 291 292 292 int rc = VINF_SUCCESS; … … 478 478 : mSvcHelpers(NULL), 479 479 mID(0), 480 mFlags(0), mContextFilter(0), 480 mFlags(0), 481 mFilterMask(0), mFilterValue(0), 481 482 mHostCmdRc(VINF_SUCCESS), mHostCmdTries(0), 482 483 mHostCmdTS(0), … … 487 488 : mSvcHelpers(pSvcHelpers), 488 489 mID(uClientID), 489 mFlags(0), mContextFilter(0), 490 mFlags(0), 491 mFilterMask(0), mFilterValue(0), 490 492 mHostCmdRc(VINF_SUCCESS), mHostCmdTries(0), 491 493 mHostCmdTS(0), … … 571 573 if (mFlags & CLIENTSTATE_FLAG_CONTEXTFILTER) 572 574 { 573 fWant = 574 (pHostCmd->mContextID & mContextFilter) == pHostCmd->mContextID; 575 fWant = (pHostCmd->mContextID & mFilterMask) == mFilterValue; 575 576 } 576 577 else /* Client is interested in all commands. */ 577 578 fWant = true; 578 579 579 LogFlowFunc(("[Client %RU32] mFlags=0x%x, mContextID=%RU32 (session %RU32), m ContextFilter=0x%x, fWant=%RTbool\n",580 LogFlowFunc(("[Client %RU32] mFlags=0x%x, mContextID=%RU32 (session %RU32), mFilterMask=0x%x, mFilterValue=%RU32, fWant=%RTbool\n", 580 581 mID, mFlags, pHostCmd->mContextID, 581 582 VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(pHostCmd->mContextID), 582 m ContextFilter, fWant));583 mFilterMask, mFilterValue, fWant)); 583 584 584 585 return fWant; … … 831 832 /** Client flags. @sa CLIENTSTATE_FLAG_ flags. */ 832 833 uint32_t mFlags; 833 /** The context ID filter, based on the flags set. */ 834 uint32_t mContextFilter; 834 /** The context ID filter mask, if any. */ 835 uint32_t mFilterMask; 836 /** The context ID filter value, if any. */ 837 uint32_t mFilterValue; 835 838 /** Host command list to process. */ 836 839 HostCmdList mHostCmdList; … … 1152 1155 return VERR_NOT_FOUND; /* Should never happen. */ 1153 1156 1154 if (cParms != 3)1157 if (cParms != 4) 1155 1158 return VERR_INVALID_PARAMETER; 1156 1159 1157 uint32_t u MaskAdd, uMaskRemove;1158 int rc = paParms[0].getUInt32(&u MaskAdd);1160 uint32_t uValue, uMaskAdd, uMaskRemove; 1161 int rc = paParms[0].getUInt32(&uValue); 1159 1162 if (RT_SUCCESS(rc)) 1160 rc = paParms[1].getUInt32(&uMaskRemove); 1163 rc = paParms[1].getUInt32(&uMaskAdd); 1164 if (RT_SUCCESS(rc)) 1165 rc = paParms[2].getUInt32(&uMaskRemove); 1166 /** @todo paParm[3] (flags) not used yet. */ 1161 1167 if (RT_SUCCESS(rc)) 1162 1168 { … … 1165 1171 clientState.mFlags |= CLIENTSTATE_FLAG_CONTEXTFILTER; 1166 1172 if (uMaskAdd) 1167 clientState.m ContextFilter|= uMaskAdd;1173 clientState.mFilterMask |= uMaskAdd; 1168 1174 if (uMaskRemove) 1169 clientState.mContextFilter &= ~uMaskRemove; 1170 1171 LogFlowFunc(("[Client %RU32] Setting message filter=0x%x set (flags=0x%x, maskAdd=0x%x, maskRemove=0x%x)\n", 1172 u32ClientID, clientState.mContextFilter, clientState.mFlags, 1173 uMaskAdd, uMaskRemove)); 1175 clientState.mFilterMask &= ~uMaskRemove; 1176 1177 clientState.mFilterValue = uValue; 1178 1179 LogFlowFunc(("[Client %RU32] Setting message filterMask=0x%x, filterVal=%RU32 set (flags=0x%x, maskAdd=0x%x, maskRemove=0x%x)\n", 1180 u32ClientID, clientState.mFilterMask, clientState.mFilterValue, 1181 clientState.mFlags, uMaskAdd, uMaskRemove)); 1174 1182 } 1175 1183 … … 1196 1204 1197 1205 clientState.mFlags &= ~CLIENTSTATE_FLAG_CONTEXTFILTER; 1198 clientState.mContextFilter = 0; 1206 clientState.mFilterMask = 0; 1207 clientState.mFilterValue = 0; 1199 1208 1200 1209 LogFlowFunc(("[Client %RU32} Unset message filter\n", u32ClientID));
Note:
See TracChangeset
for help on using the changeset viewer.