- Timestamp:
- Dec 9, 2010 10:33:41 AM (14 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxService
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r34406 r34867 153 153 154 154 case HOST_EXEC_SET_INPUT: 155 rc = VBoxServiceControlExecHandleCmdSetInput(g_GuestControlSvcClientID, uNumParms); 155 /** @todo Make buffer size configurable via guest properties/argv! */ 156 rc = VBoxServiceControlExecHandleCmdSetInput(g_GuestControlSvcClientID, uNumParms, _1M /* Buffer size */); 156 157 break; 157 158 -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp
r34709 r34867 104 104 { 105 105 size_t cbToWrite = pStdInBuf->cbSize - pStdInBuf->cbOffset; 106 cbToWrite = RT_MIN(cbToWrite, _ 64K);106 cbToWrite = RT_MIN(cbToWrite, _1M); 107 107 *pfClose = false; 108 108 if (cbToWrite && pStdInBuf->fAlive) … … 1597 1597 * offering. 1598 1598 */ 1599 int VBoxServiceControlExecHandleCmdSetInput(uint32_t u32ClientId, uint32_t uNumParms )1599 int VBoxServiceControlExecHandleCmdSetInput(uint32_t u32ClientId, uint32_t uNumParms, size_t cbMaxBufSize) 1600 1600 { 1601 1601 uint32_t uContextID; 1602 1602 uint32_t uPID; 1603 1603 uint32_t uFlags; 1604 uint8_t abBuffer[_64K];1605 1604 uint32_t cbSize; 1606 1605 1607 if (uNumParms != 5) 1608 return VERR_INVALID_PARAMETER; 1606 AssertReturn(RT_IS_POWER_OF_TWO(cbMaxBufSize), VERR_INVALID_PARAMETER); 1607 uint8_t *pabBuffer = (uint8_t*)RTMemAlloc(cbMaxBufSize); 1608 AssertPtrReturn(pabBuffer, VERR_NO_MEMORY); 1609 1609 1610 1610 /* … … 1613 1613 int rc = VbglR3GuestCtrlExecGetHostCmdInput(u32ClientId, uNumParms, 1614 1614 &uContextID, &uPID, &uFlags, 1615 abBuffer, sizeof(abBuffer), &cbSize);1615 pabBuffer, cbMaxBufSize, &cbSize); 1616 1616 if (RT_FAILURE(rc)) 1617 1617 { … … 1619 1619 } 1620 1620 else if ( cbSize <= 0 1621 || cbSize > sizeof(abBuffer))1621 || cbSize > cbMaxBufSize) 1622 1622 { 1623 1623 VBoxServiceError("ControlExec: Input size is invalid! cbSize=%u\n", cbSize); … … 1652 1652 */ 1653 1653 uint32_t cbWritten; 1654 rc = VBoxServiceControlExecWritePipeBuffer(&pData->stdIn, abBuffer, cbSize, fPendingClose, &cbWritten);1654 rc = VBoxServiceControlExecWritePipeBuffer(&pData->stdIn, pabBuffer, cbSize, fPendingClose, &cbWritten); 1655 1655 #ifdef DEBUG 1656 1656 VBoxServiceVerbose(4, "ControlExec: Written to StdIn buffer (PID %u): rc=%Rrc, uFlags=0x%x, cbAlloc=%u, cbSize=%u, cbOffset=%u\n", … … 1692 1692 rc = VERR_NOT_FOUND; /* PID not found! */ 1693 1693 } 1694 RTMemFree(pabBuffer); 1694 1695 VBoxServiceVerbose(3, "ControlExec: VBoxServiceControlExecHandleCmdSetInput returned with %Rrc\n", rc); 1695 1696 return rc; … … 1713 1714 int rc = VbglR3GuestCtrlExecGetHostCmdOutput(u32ClientId, uNumParms, 1714 1715 &uContextID, &uPID, &uHandleID, &uFlags); 1715 if (RT_FAILURE(rc)) 1716 { 1717 VBoxServiceError("ControlExec: Failed to retrieve exec output command! Error: %Rrc\n", rc); 1718 } 1719 else 1716 if (RT_SUCCESS(rc)) 1720 1717 { 1721 1718 PVBOXSERVICECTRLTHREAD pNode = VBoxServiceControlExecFindProcess(uPID); … … 1725 1722 AssertPtr(pData); 1726 1723 1727 const uint32_t cbSize = _ 4K;1724 const uint32_t cbSize = _1M; 1728 1725 uint32_t cbRead = cbSize; 1729 1726 uint8_t *pBuf = (uint8_t*)RTMemAlloc(cbSize); … … 1749 1746 rc = VERR_NOT_FOUND; /* PID not found! */ 1750 1747 } 1748 else 1749 VBoxServiceError("ControlExec: Failed to retrieve exec output command! Error: %Rrc\n", rc); 1751 1750 VBoxServiceVerbose(3, "ControlExec: VBoxServiceControlExecHandleCmdGetOutput returned with %Rrc\n", rc); 1752 1751 return rc; -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h
r34273 r34867 93 93 94 94 /** The service name (needed for mutex creation on Windows). */ 95 #define VBOXSERVICE_NAME "VBoxService"95 #define VBOXSERVICE_NAME "VBoxService" 96 96 97 97 #ifdef RT_OS_WINDOWS … … 292 292 #ifdef VBOX_WITH_GUEST_CONTROL 293 293 extern int VBoxServiceControlExecHandleCmdStartProcess(uint32_t u32ClientId, uint32_t uNumParms); 294 extern int VBoxServiceControlExecHandleCmdSetInput(uint32_t u32ClientId, uint32_t uNumParms );294 extern int VBoxServiceControlExecHandleCmdSetInput(uint32_t u32ClientId, uint32_t uNumParms, size_t cbMaxBufSize); 295 295 extern int VBoxServiceControlExecHandleCmdGetOutput(uint32_t u32ClientId, uint32_t uNumParms); 296 296 extern int VBoxServiceControlExecProcess(uint32_t uContext, const char *pszCmd, uint32_t uFlags,
Note:
See TracChangeset
for help on using the changeset viewer.