Changeset 28557 in vbox for trunk/src/VBox/HostServices/GuestControl
- Timestamp:
- Apr 21, 2010 11:18:32 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60367
- Location:
- trunk/src/VBox/HostServices/GuestControl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/GuestControl/Makefile.kmk
r27897 r28557 24 24 25 25 # Include sub-makefile(s). 26 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk26 # include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk 27 27 28 28 # -
trunk/src/VBox/HostServices/GuestControl/service.cpp
r28286 r28557 235 235 } 236 236 private: 237 int paramBufferAllocate(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);237 int paramBufferAllocate(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 238 238 void paramBufferFree(PVBOXGUESTCTRPARAMBUFFER pBuf); 239 239 int paramBufferAssign(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); … … 269 269 /** @todo Write some nice doc headers! */ 270 270 /* Stores a HGCM request in an internal buffer (pEx). Needs to be freed later using execBufferFree(). */ 271 int Service::paramBufferAllocate(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t cParms, VBOXHGCMSVCPARM paParms[])271 int Service::paramBufferAllocate(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 272 272 { 273 273 AssertPtr(pBuf); … … 281 281 if (RT_SUCCESS(rc)) 282 282 { 283 pBuf->uMsg = uMsg; 283 284 pBuf->uParmCount = cParms; 284 285 pBuf->pParms = (VBOXHGCMSVCPARM*)RTMemAlloc(sizeof(VBOXHGCMSVCPARM) * pBuf->uParmCount); … … 436 437 if (uParmCount > cParms) 437 438 { 438 uint32_t uCmd = 0; 439 if (uParmCount) 440 curCmd.parmBuf.pParms[0].getUInt32(&uCmd); 441 442 paParms[0].setUInt32(/*uCmd*/ 1); /* Message ID */ 439 paParms[0].setUInt32(curCmd.parmBuf.uMsg); /* Message ID */ 443 440 paParms[1].setUInt32(uParmCount); /* Required parameters for message */ 444 441 … … 508 505 (void *)(&data), sizeof(data)); 509 506 } 507 else if ( eFunction == GUEST_EXEC_SEND_OUTPUT 508 && cParms == 5) 509 { 510 HOSTEXECOUTCALLBACKDATA data; 511 data.hdr.u32Magic = HOSTEXECOUTCALLBACKDATAMAGIC; 512 paParms[0].getUInt32(&data.hdr.u32ContextID); 513 514 paParms[1].getUInt32(&data.u32PID); 515 paParms[2].getUInt32(&data.u32HandleId); 516 paParms[3].getUInt32(&data.u32Flags); 517 paParms[4].getPointer(&data.pvData, &data.cbData); 518 519 if (mpfnHostCallback) 520 rc = mpfnHostCallback(mpvHostData, eFunction, 521 (void *)(&data), sizeof(data)); 522 } 510 523 else 511 524 rc = VERR_NOT_SUPPORTED; … … 519 532 520 533 HostCmd newCmd; 521 rc = paramBufferAllocate(&newCmd.parmBuf, cParms, paParms);534 rc = paramBufferAllocate(&newCmd.parmBuf, eFunction, cParms, paParms); 522 535 if (RT_SUCCESS(rc)) 523 536 { … … 565 578 break; 566 579 567 /* The guest notifies the host that some output at stdout is available. */ 568 case GUEST_EXEC_SEND_STDOUT: 569 LogFlowFunc(("GUEST_EXEC_SEND_STDOUT\n")); 570 break; 571 572 /* The guest notifies the host that some output at stderr is available. */ 573 case GUEST_EXEC_SEND_STDERR: 574 LogFlowFunc(("GUEST_EXEC_SEND_STDERR\n")); 580 /* The guest notifies the host that some output at stdout/stderr is available. */ 581 case GUEST_EXEC_SEND_OUTPUT: 582 LogFlowFunc(("GUEST_EXEC_SEND_OUTPUT\n")); 583 rc = notifyHost(eFunction, cParms, paParms); 575 584 break; 576 585 … … 621 630 622 631 /* The host wants to send something to the guest's stdin pipe. */ 623 case HOST_EXEC_SEND_STDIN: 624 LogFlowFunc(("HOST_EXEC_SEND_STDIN\n")); 625 break; 626 627 case HOST_EXEC_GET_STATUS: 628 LogFlowFunc(("HOST_EXEC_GET_STATUS\n")); 632 case HOST_EXEC_SET_INPUT: 633 LogFlowFunc(("HOST_EXEC_SET_INPUT\n")); 634 break; 635 636 case HOST_EXEC_GET_OUTPUT: 637 LogFlowFunc(("HOST_EXEC_GET_OUTPUT\n")); 638 rc = processCmd(eFunction, cParms, paParms); 629 639 break; 630 640
Note:
See TracChangeset
for help on using the changeset viewer.