Changeset 76958 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Jan 23, 2019 6:23:04 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128342
- Location:
- trunk/src/VBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox
- Property svn:mergeinfo
-
old new 8 8 /branches/VBox-5.0/src/VBox:104938,104943,104950,104987-104988,104990,106453 9 9 /branches/VBox-5.1/src/VBox:112367,116543,116550,116568,116573 10 /branches/VBox-5.2/src/VBox:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124263,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812 10 /branches/VBox-5.2/src/VBox:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124263,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812,127158-127159,127162-127167,127180 11 11 /branches/andy/draganddrop/src/VBox:90781-91268 12 12 /branches/andy/guestctrl20/src/VBox:78916,78930
-
- Property svn:mergeinfo
-
trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
r76553 r76958 61 61 62 62 /** 63 * Static callback function for receiving updates on guest control commands63 * Static callback function for receiving updates on guest control messages 64 64 * from the guest. Acts as a dispatcher for the actual class instance. 65 65 * … … 72 72 * return locations. However, there is no explaination for this attitude 73 73 * thowards error handling. Further, it creates a slight problem since 74 * the service would route all functioncalls it didn't recognize here,75 * thereby making any undefined functions confusingly return VINF_SUCCESS.74 * the service would route all message calls it didn't recognize here, 75 * thereby making any undefined messages confusingly return VINF_SUCCESS. 76 76 * 77 77 * In my humble opinion, if the guest gives us incorrect input it should … … 85 85 /* static */ 86 86 DECLCALLBACK(int) Guest::i_notifyCtrlDispatcher(void *pvExtension, 87 uint32_t id Function,87 uint32_t idMessage, 88 88 void *pvData, 89 89 uint32_t cbData) … … 95 95 * changes to the object state. 96 96 */ 97 Log2Func(("pvExtension=%p, id Function=%RU32, pvParms=%p, cbParms=%RU32\n", pvExtension, idFunction, pvData, cbData));97 Log2Func(("pvExtension=%p, idMessage=%RU32, pvParms=%p, cbParms=%RU32\n", pvExtension, idMessage, pvData, cbData)); 98 98 99 99 ComObjPtr<Guest> pGuest = reinterpret_cast<Guest *>(pvExtension); … … 110 110 111 111 /* 112 * For guest control 2.0 using the legacy commands we need to do the following here:112 * For guest control 2.0 using the legacy messages we need to do the following here: 113 113 * - Get the callback header to access the context ID 114 114 * - Get the context ID of the callback … … 123 123 uint32_t const idContext = pSvcCb->mpaParms[0].u.uint32; 124 124 125 VBOXGUESTCTRLHOSTCBCTX CtxCb = { id Function, idContext };125 VBOXGUESTCTRLHOSTCBCTX CtxCb = { idMessage, idContext }; 126 126 int rc = pGuest->i_dispatchToSession(&CtxCb, pSvcCb); 127 127 … … 142 142 AssertPtrReturn(pSvcCb, VERR_INVALID_POINTER); 143 143 144 Log2Func(("u Function=%RU32, uContextID=%RU32, uProtocol=%RU32\n", pCtxCb->uFunction, pCtxCb->uContextID, pCtxCb->uProtocol));144 Log2Func(("uMessage=%RU32, uContextID=%RU32, uProtocol=%RU32\n", pCtxCb->uMessage, pCtxCb->uContextID, pCtxCb->uProtocol)); 145 145 146 146 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 170 170 bool fDispatch = true; 171 171 rc = VERR_INVALID_FUNCTION; 172 if ( pCtxCb->u Function == GUEST_EXEC_STATUS172 if ( pCtxCb->uMessage == GUEST_MSG_EXEC_STATUS 173 173 && pSvcCb->mParms >= 5) 174 174 { … … 183 183 && (int32_t)dataCb.uFlags == VERR_TOO_MUCH_DATA) 184 184 { 185 LogFlowFunc(("Requested commandwith too much data, skipping dispatching ...\n"));185 LogFlowFunc(("Requested message with too much data, skipping dispatching ...\n")); 186 186 Assert(dataCb.uPID == 0); 187 187 fDispatch = false; … … 191 191 #endif 192 192 { 193 switch (pCtxCb->u Function)193 switch (pCtxCb->uMessage) 194 194 { 195 case GUEST_ DISCONNECTED:195 case GUEST_MSG_DISCONNECTED: 196 196 rc = pSession->i_dispatchToThis(pCtxCb, pSvcCb); 197 197 break; 198 198 199 199 /* Process stuff. */ 200 case GUEST_ EXEC_STATUS:201 case GUEST_ EXEC_OUTPUT:202 case GUEST_ EXEC_INPUT_STATUS:203 case GUEST_ EXEC_IO_NOTIFY:200 case GUEST_MSG_EXEC_STATUS: 201 case GUEST_MSG_EXEC_OUTPUT: 202 case GUEST_MSG_EXEC_INPUT_STATUS: 203 case GUEST_MSG_EXEC_IO_NOTIFY: 204 204 rc = pSession->i_dispatchToObject(pCtxCb, pSvcCb); 205 205 break; 206 206 207 207 /* File stuff. */ 208 case GUEST_ FILE_NOTIFY:208 case GUEST_MSG_FILE_NOTIFY: 209 209 rc = pSession->i_dispatchToObject(pCtxCb, pSvcCb); 210 210 break; 211 211 212 212 /* Session stuff. */ 213 case GUEST_ SESSION_NOTIFY:213 case GUEST_MSG_SESSION_NOTIFY: 214 214 rc = pSession->i_dispatchToThis(pCtxCb, pSvcCb); 215 215 break; -
trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
r76553 r76958 813 813 try 814 814 { 815 Log2Func(("uFunc=%RU32, cParms=%RU32\n", pCtxCb->u Function, pSvcCb->mParms));816 817 switch (pCtxCb->u Function)815 Log2Func(("uFunc=%RU32, cParms=%RU32\n", pCtxCb->uMessage, pSvcCb->mParms)); 816 817 switch (pCtxCb->uMessage) 818 818 { 819 819 case GUEST_MSG_PROGRESS_UPDATE: … … 1413 1413 } 1414 1414 1415 int GuestObject::send Command(uint32_t uFunction, uint32_t cParms, PVBOXHGCMSVCPARM paParms)1415 int GuestObject::sendMessage(uint32_t uMessage, uint32_t cParms, PVBOXHGCMSVCPARM paParms) 1416 1416 { 1417 1417 #ifndef VBOX_GUESTCTRL_TEST_CASE … … 1432 1432 1433 1433 /* Make the call. */ 1434 LogFlowThisFunc(("u Function=%RU32, cParms=%RU32\n", uFunction, cParms));1435 vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, u Function, cParms, paParms);1434 LogFlowThisFunc(("uMessage=%RU32, cParms=%RU32\n", uMessage, cParms)); 1435 vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uMessage, cParms, paParms); 1436 1436 if (RT_FAILURE(vrc)) 1437 1437 { … … 1443 1443 1444 1444 /* Not needed within testcases. */ 1445 RT_NOREF(u Function, cParms, paParms);1445 RT_NOREF(uMessage, cParms, paParms); 1446 1446 int vrc = VINF_SUCCESS; 1447 1447 #endif -
trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
r76553 r76958 170 170 171 171 LogFlowThisFunc(("strPath=%s, uContextID=%RU32, uFunction=%RU32, pSvcCb=%p\n", 172 mData.mOpenInfo.mPath.c_str(), pCbCtx->uContextID, pCbCtx->u Function, pSvcCb));172 mData.mOpenInfo.mPath.c_str(), pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb)); 173 173 174 174 int vrc; 175 switch (pCbCtx->u Function)176 { 177 case GUEST_ DIR_NOTIFY:175 switch (pCbCtx->uMessage) 176 { 177 case GUEST_MSG_DIR_NOTIFY: 178 178 { 179 179 int idx = 1; /* Current parameter index. */ -
trunk/src/VBox/Main/src-client/GuestFileImpl.cpp
r76553 r76958 333 333 334 334 LogFlowThisFunc(("strName=%s, uContextID=%RU32, uFunction=%RU32, pSvcCb=%p\n", 335 mData.mOpenInfo.mFilename.c_str(), pCbCtx->uContextID, pCbCtx->u Function, pSvcCb));335 mData.mOpenInfo.mFilename.c_str(), pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb)); 336 336 337 337 int vrc; 338 switch (pCbCtx->u Function)339 { 340 case GUEST_ DISCONNECTED:338 switch (pCbCtx->uMessage) 339 { 340 case GUEST_MSG_DISCONNECTED: 341 341 vrc = i_onGuestDisconnected(pCbCtx, pSvcCb); 342 342 break; 343 343 344 case GUEST_ FILE_NOTIFY:344 case GUEST_MSG_FILE_NOTIFY: 345 345 vrc = i_onFileNotify(pCbCtx, pSvcCb); 346 346 break; … … 386 386 HGCMSvcSetU32(&paParms[i++], mObjectID /* Guest file ID */); 387 387 388 vrc = send Command(HOST_FILE_CLOSE, i, paParms);388 vrc = sendMessage(HOST_MSG_FILE_CLOSE, i, paParms); 389 389 if (RT_SUCCESS(vrc)) 390 390 vrc = i_waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */, … … 730 730 alock.release(); /* Drop write lock before sending. */ 731 731 732 vrc = send Command(HOST_FILE_OPEN, i, paParms);732 vrc = sendMessage(HOST_MSG_FILE_OPEN, i, paParms); 733 733 if (RT_SUCCESS(vrc)) 734 734 vrc = i_waitForStatusChange(pEvent, uTimeoutMS, NULL /* FileStatus */, prcGuest); … … 785 785 alock.release(); /* Drop write lock before sending. */ 786 786 787 vrc = send Command(HOST_FILE_READ, i, paParms);787 vrc = sendMessage(HOST_MSG_FILE_READ, i, paParms); 788 788 if (RT_SUCCESS(vrc)) 789 789 { … … 845 845 alock.release(); /* Drop write lock before sending. */ 846 846 847 vrc = send Command(HOST_FILE_READ_AT, i, paParms);847 vrc = sendMessage(HOST_MSG_FILE_READ_AT, i, paParms); 848 848 if (RT_SUCCESS(vrc)) 849 849 { … … 907 907 alock.release(); /* Drop write lock before sending. */ 908 908 909 vrc = send Command(HOST_FILE_SEEK, i, paParms);909 vrc = sendMessage(HOST_MSG_FILE_SEEK, i, paParms); 910 910 if (RT_SUCCESS(vrc)) 911 911 { … … 1171 1171 alock.release(); /* Drop write lock before sending. */ 1172 1172 1173 vrc = send Command(HOST_FILE_WRITE, i, paParms);1173 vrc = sendMessage(HOST_MSG_FILE_WRITE, i, paParms); 1174 1174 if (RT_SUCCESS(vrc)) 1175 1175 { … … 1235 1235 alock.release(); /* Drop write lock before sending. */ 1236 1236 1237 vrc = send Command(HOST_FILE_WRITE_AT, i, paParms);1237 vrc = sendMessage(HOST_MSG_FILE_WRITE_AT, i, paParms); 1238 1238 if (RT_SUCCESS(vrc)) 1239 1239 { -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r76553 r76958 416 416 AssertPtrReturn(pSvcCb, VERR_INVALID_POINTER); 417 417 #ifdef DEBUG 418 LogFlowThisFunc(("uPID=%RU32, uContextID=%RU32, u Function=%RU32, pSvcCb=%p\n",419 mData.mPID, pCbCtx->uContextID, pCbCtx->u Function, pSvcCb));418 LogFlowThisFunc(("uPID=%RU32, uContextID=%RU32, uMessage=%RU32, pSvcCb=%p\n", 419 mData.mPID, pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb)); 420 420 #endif 421 421 422 422 int vrc; 423 switch (pCbCtx->u Function)424 { 425 case GUEST_ DISCONNECTED:423 switch (pCbCtx->uMessage) 424 { 425 case GUEST_MSG_DISCONNECTED: 426 426 { 427 427 vrc = i_onGuestDisconnected(pCbCtx, pSvcCb); … … 429 429 } 430 430 431 case GUEST_ EXEC_STATUS:431 case GUEST_MSG_EXEC_STATUS: 432 432 { 433 433 vrc = i_onProcessStatusChange(pCbCtx, pSvcCb); … … 435 435 } 436 436 437 case GUEST_ EXEC_OUTPUT:437 case GUEST_MSG_EXEC_OUTPUT: 438 438 { 439 439 vrc = i_onProcessOutput(pCbCtx, pSvcCb); … … 441 441 } 442 442 443 case GUEST_ EXEC_INPUT_STATUS:443 case GUEST_MSG_EXEC_INPUT_STATUS: 444 444 { 445 445 vrc = i_onProcessInputStatus(pCbCtx, pSvcCb); … … 916 916 alock.release(); /* Drop the write lock before sending. */ 917 917 918 vrc = send Command(HOST_EXEC_GET_OUTPUT, i, paParms);918 vrc = sendMessage(HOST_MSG_EXEC_GET_OUTPUT, i, paParms); 919 919 } 920 920 … … 1132 1132 rLock.release(); /* Drop the write lock before sending. */ 1133 1133 1134 vrc = send Command(HOST_EXEC_CMD, i, paParms);1134 vrc = sendMessage(HOST_MSG_EXEC_CMD, i, paParms); 1135 1135 if (RT_FAILURE(vrc)) 1136 1136 { … … 1251 1251 alock.release(); /* Drop the write lock before sending. */ 1252 1252 1253 vrc = send Command(HOST_EXEC_TERMINATE, i, paParms);1253 vrc = sendMessage(HOST_MSG_EXEC_TERMINATE, i, paParms); 1254 1254 if (RT_SUCCESS(vrc)) 1255 1255 vrc = i_waitForStatusChange(pEvent, uTimeoutMS, … … 1733 1733 1734 1734 uint32_t cbProcessed = 0; 1735 vrc = send Command(HOST_EXEC_SET_INPUT, i, paParms);1735 vrc = sendMessage(HOST_MSG_EXEC_SET_INPUT, i, paParms); 1736 1736 if (RT_SUCCESS(vrc)) 1737 1737 { -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r76553 r76958 718 718 alock.release(); /* Drop the write lock before waiting. */ 719 719 720 vrc = i_send Command(HOST_SESSION_CLOSE, i, paParms, VBOX_GUESTCTRL_DST_BOTH);720 vrc = i_sendMessage(HOST_MSG_SESSION_CLOSE, i, paParms, VBOX_GUESTCTRL_DST_BOTH); 721 721 if (RT_SUCCESS(vrc)) 722 722 vrc = i_waitForStatusChange(pEvent, GuestSessionWaitForFlag_Terminate, uTimeoutMS, … … 1073 1073 alock.release(); /* Drop write lock before sending. */ 1074 1074 1075 vrc = i_send Command(HOST_DIR_REMOVE, i, paParms);1075 vrc = i_sendMessage(HOST_MSG_DIR_REMOVE, i, paParms); 1076 1076 if (RT_SUCCESS(vrc)) 1077 1077 { … … 1314 1314 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1315 1315 1316 LogFlowThisFunc(("sessionID=%RU32, CID=%RU32, u Function=%RU32, pSvcCb=%p\n",1317 mData.mSession.mID, pCbCtx->uContextID, pCbCtx->u Function, pSvcCb));1316 LogFlowThisFunc(("sessionID=%RU32, CID=%RU32, uMessage=%RU32, pSvcCb=%p\n", 1317 mData.mSession.mID, pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb)); 1318 1318 int rc; 1319 switch (pCbCtx->u Function)1320 { 1321 case GUEST_ DISCONNECTED:1319 switch (pCbCtx->uMessage) 1320 { 1321 case GUEST_MSG_DISCONNECTED: 1322 1322 /** @todo Handle closing all guest objects. */ 1323 1323 rc = VERR_INTERNAL_ERROR; 1324 1324 break; 1325 1325 1326 case GUEST_ SESSION_NOTIFY: /* Guest Additions >= 4.3.0. */1326 case GUEST_MSG_SESSION_NOTIFY: /* Guest Additions >= 4.3.0. */ 1327 1327 { 1328 1328 rc = i_onSessionStatusChange(pCbCtx, pSvcCb); … … 1947 1947 alock.release(); /* Drop write lock before sending. */ 1948 1948 1949 vrc = i_send Command(HOST_SESSION_CREATE, i, paParms, VBOX_GUESTCTRL_DST_ROOT_SVC);1949 vrc = i_sendMessage(HOST_MSG_SESSION_CREATE, i, paParms, VBOX_GUESTCTRL_DST_ROOT_SVC); 1950 1950 if (RT_SUCCESS(vrc)) 1951 1951 { … … 2136 2136 alock.release(); /* Drop write lock before sending. */ 2137 2137 2138 vrc = i_send Command(HOST_PATH_RENAME, i, paParms);2138 vrc = i_sendMessage(HOST_MSG_PATH_RENAME, i, paParms); 2139 2139 if (RT_SUCCESS(vrc)) 2140 2140 { … … 2177 2177 alock.release(); /* Drop write lock before sending. */ 2178 2178 2179 vrc = i_send Command(HOST_PATH_USER_DOCUMENTS, i, paParms);2179 vrc = i_sendMessage(HOST_MSG_PATH_USER_DOCUMENTS, i, paParms); 2180 2180 if (RT_SUCCESS(vrc)) 2181 2181 { … … 2227 2227 alock.release(); /* Drop write lock before sending. */ 2228 2228 2229 vrc = i_send Command(HOST_PATH_USER_HOME, i, paParms);2229 vrc = i_sendMessage(HOST_MSG_PATH_USER_HOME, i, paParms); 2230 2230 if (RT_SUCCESS(vrc)) 2231 2231 { … … 2437 2437 } 2438 2438 2439 int GuestSession::i_send Command(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms,2439 int GuestSession::i_sendMessage(uint32_t uMessage, uint32_t uParms, PVBOXHGCMSVCPARM paParms, 2440 2440 uint64_t fDst /*= VBOX_GUESTCTRL_DST_SESSION*/) 2441 2441 { … … 2450 2450 AssertPtr(pVMMDev); 2451 2451 2452 LogFlowThisFunc(("u Function=%RU32 (%s), uParms=%RU32\n", uFunction, GstCtrlHostFnName((guestControl::eHostFn)uFunction), uParms));2452 LogFlowThisFunc(("uMessage=%RU32 (%s), uParms=%RU32\n", uMessage, GstCtrlHostMsgtoStr((guestControl::eHostMsg)uMessage), uParms)); 2453 2453 2454 2454 /* HACK ALERT! We extend the first parameter to 64-bit and use the … … 2460 2460 2461 2461 /* Make the call. */ 2462 int vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, u Function, uParms, paParms);2462 int vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uMessage, uParms, paParms); 2463 2463 if (RT_FAILURE(vrc)) 2464 2464 {
Note:
See TracChangeset
for help on using the changeset viewer.