Changeset 75825 in vbox for trunk/src/VBox
- Timestamp:
- Nov 29, 2018 10:17:30 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/GuestControl/service.cpp
r75824 r75825 1460 1460 * Remove the command from the queue. 1461 1461 */ 1462 HostCommand *pFirstCmd = *rClientState.mHostCmdList.begin(); 1463 if (pFirstCmd ) 1462 Assert(*rClientState.mHostCmdList.begin() == pFirstCmd); 1463 rClientState.mHostCmdList.pop_front(); 1464 1465 /* 1466 * Compose a reply to the host service. 1467 */ 1468 VBOXHGCMSVCPARM aReplyParams[5]; 1469 HGCMSvcSetU32(&aReplyParams[0], pFirstCmd->m_idContext); 1470 switch (pFirstCmd->mMsgType) 1464 1471 { 1465 rClientState.mHostCmdList.pop_front(); 1466 1467 /* 1468 * Compose a reply to the host service. 1469 */ 1470 VBOXHGCMSVCPARM aReplyParams[5]; 1471 HGCMSvcSetU32(&aReplyParams[0], pFirstCmd->m_idContext); 1472 switch (pFirstCmd->mMsgType) 1473 { 1474 case HOST_EXEC_CMD: 1475 HGCMSvcSetU32(&aReplyParams[1], 0); /* pid */ 1476 HGCMSvcSetU32(&aReplyParams[2], PROC_STS_ERROR); /* status */ 1477 HGCMSvcSetU32(&aReplyParams[3], rcSkip); /* flags / whatever */ 1478 HGCMSvcSetPv(&aReplyParams[4], NULL, 0); /* data buffer */ 1479 GstCtrlService::hostCallback(GUEST_EXEC_STATUS, 5, aReplyParams); 1480 break; 1481 1482 case HOST_SESSION_CREATE: 1483 HGCMSvcSetU32(&aReplyParams[1], GUEST_SESSION_NOTIFYTYPE_ERROR); /* type */ 1484 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* result */ 1485 GstCtrlService::hostCallback(GUEST_SESSION_NOTIFY, 3, aReplyParams); 1486 break; 1487 1488 case HOST_EXEC_SET_INPUT: 1489 HGCMSvcSetU32(&aReplyParams[1], pFirstCmd->mParmCount >= 2 ? pFirstCmd->mpParms[1].u.uint32 : 0); 1490 HGCMSvcSetU32(&aReplyParams[2], INPUT_STS_ERROR); /* status */ 1491 HGCMSvcSetU32(&aReplyParams[3], rcSkip); /* flags / whatever */ 1492 HGCMSvcSetU32(&aReplyParams[4], 0); /* bytes consumed */ 1493 GstCtrlService::hostCallback(GUEST_EXEC_INPUT_STATUS, 5, aReplyParams); 1494 break; 1495 1496 case HOST_FILE_OPEN: 1497 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_OPEN); /* type*/ 1498 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1499 HGCMSvcSetU32(&aReplyParams[3], VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pFirstCmd->m_idContext)); /* handle */ 1500 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams); 1501 break; 1502 case HOST_FILE_CLOSE: 1503 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_ERROR); /* type*/ 1504 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1505 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 3, aReplyParams); 1506 break; 1507 case HOST_FILE_READ: 1508 case HOST_FILE_READ_AT: 1509 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_READ); /* type */ 1510 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1511 HGCMSvcSetPv(&aReplyParams[3], NULL, 0); /* data buffer */ 1512 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams); 1513 break; 1514 case HOST_FILE_WRITE: 1515 case HOST_FILE_WRITE_AT: 1516 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_WRITE); /* type */ 1517 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1518 HGCMSvcSetU32(&aReplyParams[3], 0); /* bytes written */ 1519 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams); 1520 break; 1521 case HOST_FILE_SEEK: 1522 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_SEEK); /* type */ 1523 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1524 HGCMSvcSetU64(&aReplyParams[3], 0); /* actual */ 1525 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams); 1526 break; 1527 case HOST_FILE_TELL: 1528 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_TELL); /* type */ 1529 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1530 HGCMSvcSetU64(&aReplyParams[3], 0); /* actual */ 1531 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams); 1532 break; 1533 1534 case HOST_EXEC_GET_OUTPUT: /** @todo This can't be right/work. */ 1535 case HOST_EXEC_TERMINATE: /** @todo This can't be right/work. */ 1536 case HOST_EXEC_WAIT_FOR: /** @todo This can't be right/work. */ 1537 case HOST_PATH_USER_DOCUMENTS: 1538 case HOST_PATH_USER_HOME: 1539 case HOST_PATH_RENAME: 1540 case HOST_DIR_REMOVE: 1541 default: 1542 HGCMSvcSetU32(&aReplyParams[1], pFirstCmd->mMsgType); 1543 HGCMSvcSetU32(&aReplyParams[2], (uint32_t)rcSkip); 1544 HGCMSvcSetPv(&aReplyParams[3], NULL, 0); 1545 GstCtrlService::hostCallback(GUEST_MSG_REPLY, 4, aReplyParams); 1546 break; 1547 } 1548 1549 /* 1550 * Free the command. 1551 */ 1552 pFirstCmd->SaneRelease(); 1472 case HOST_EXEC_CMD: 1473 HGCMSvcSetU32(&aReplyParams[1], 0); /* pid */ 1474 HGCMSvcSetU32(&aReplyParams[2], PROC_STS_ERROR); /* status */ 1475 HGCMSvcSetU32(&aReplyParams[3], rcSkip); /* flags / whatever */ 1476 HGCMSvcSetPv(&aReplyParams[4], NULL, 0); /* data buffer */ 1477 GstCtrlService::hostCallback(GUEST_EXEC_STATUS, 5, aReplyParams); 1478 break; 1479 1480 case HOST_SESSION_CREATE: 1481 HGCMSvcSetU32(&aReplyParams[1], GUEST_SESSION_NOTIFYTYPE_ERROR); /* type */ 1482 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* result */ 1483 GstCtrlService::hostCallback(GUEST_SESSION_NOTIFY, 3, aReplyParams); 1484 break; 1485 1486 case HOST_EXEC_SET_INPUT: 1487 HGCMSvcSetU32(&aReplyParams[1], pFirstCmd->mParmCount >= 2 ? pFirstCmd->mpParms[1].u.uint32 : 0); 1488 HGCMSvcSetU32(&aReplyParams[2], INPUT_STS_ERROR); /* status */ 1489 HGCMSvcSetU32(&aReplyParams[3], rcSkip); /* flags / whatever */ 1490 HGCMSvcSetU32(&aReplyParams[4], 0); /* bytes consumed */ 1491 GstCtrlService::hostCallback(GUEST_EXEC_INPUT_STATUS, 5, aReplyParams); 1492 break; 1493 1494 case HOST_FILE_OPEN: 1495 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_OPEN); /* type*/ 1496 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1497 HGCMSvcSetU32(&aReplyParams[3], VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pFirstCmd->m_idContext)); /* handle */ 1498 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams); 1499 break; 1500 case HOST_FILE_CLOSE: 1501 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_ERROR); /* type*/ 1502 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1503 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 3, aReplyParams); 1504 break; 1505 case HOST_FILE_READ: 1506 case HOST_FILE_READ_AT: 1507 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_READ); /* type */ 1508 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1509 HGCMSvcSetPv(&aReplyParams[3], NULL, 0); /* data buffer */ 1510 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams); 1511 break; 1512 case HOST_FILE_WRITE: 1513 case HOST_FILE_WRITE_AT: 1514 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_WRITE); /* type */ 1515 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1516 HGCMSvcSetU32(&aReplyParams[3], 0); /* bytes written */ 1517 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams); 1518 break; 1519 case HOST_FILE_SEEK: 1520 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_SEEK); /* type */ 1521 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1522 HGCMSvcSetU64(&aReplyParams[3], 0); /* actual */ 1523 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams); 1524 break; 1525 case HOST_FILE_TELL: 1526 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_TELL); /* type */ 1527 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1528 HGCMSvcSetU64(&aReplyParams[3], 0); /* actual */ 1529 GstCtrlService::hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams); 1530 break; 1531 1532 case HOST_EXEC_GET_OUTPUT: /** @todo This can't be right/work. */ 1533 case HOST_EXEC_TERMINATE: /** @todo This can't be right/work. */ 1534 case HOST_EXEC_WAIT_FOR: /** @todo This can't be right/work. */ 1535 case HOST_PATH_USER_DOCUMENTS: 1536 case HOST_PATH_USER_HOME: 1537 case HOST_PATH_RENAME: 1538 case HOST_DIR_REMOVE: 1539 default: 1540 HGCMSvcSetU32(&aReplyParams[1], pFirstCmd->mMsgType); 1541 HGCMSvcSetU32(&aReplyParams[2], (uint32_t)rcSkip); 1542 HGCMSvcSetPv(&aReplyParams[3], NULL, 0); 1543 GstCtrlService::hostCallback(GUEST_MSG_REPLY, 4, aReplyParams); 1544 break; 1553 1545 } 1546 1547 /* 1548 * Free the command. 1549 */ 1550 pFirstCmd->SaneRelease(); 1554 1551 } 1555 1552 else
Note:
See TracChangeset
for help on using the changeset viewer.