VirtualBox

Ignore:
Timestamp:
Apr 21, 2010 11:18:32 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60367
Message:

Guest Control: Update (first stuff for piping output).

Location:
trunk/src/VBox/HostServices/GuestControl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/GuestControl/Makefile.kmk

    r27897 r28557  
    2424
    2525# Include sub-makefile(s).
    26 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
     26# include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
    2727
    2828#
  • trunk/src/VBox/HostServices/GuestControl/service.cpp

    r28286 r28557  
    235235    }
    236236private:
    237     int paramBufferAllocate(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
     237    int paramBufferAllocate(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
    238238    void paramBufferFree(PVBOXGUESTCTRPARAMBUFFER pBuf);
    239239    int paramBufferAssign(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
     
    269269/** @todo Write some nice doc headers! */
    270270/* 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[])
     271int Service::paramBufferAllocate(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    272272{
    273273    AssertPtr(pBuf);
     
    281281    if (RT_SUCCESS(rc))
    282282    {
     283        pBuf->uMsg = uMsg;
    283284        pBuf->uParmCount = cParms;
    284285        pBuf->pParms = (VBOXHGCMSVCPARM*)RTMemAlloc(sizeof(VBOXHGCMSVCPARM) * pBuf->uParmCount);
     
    436437             if (uParmCount > cParms)
    437438             {
    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 */
    443440                 paParms[1].setUInt32(uParmCount); /* Required parameters for message */
    444441
     
    508505                                  (void *)(&data), sizeof(data));
    509506    }
     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    }
    510523    else
    511524        rc = VERR_NOT_SUPPORTED;
     
    519532
    520533    HostCmd newCmd;
    521     rc = paramBufferAllocate(&newCmd.parmBuf, cParms, paParms);
     534    rc = paramBufferAllocate(&newCmd.parmBuf, eFunction, cParms, paParms);
    522535    if (RT_SUCCESS(rc))
    523536    {
     
    565578                break;
    566579
    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);
    575584                break;
    576585
     
    621630
    622631            /* 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);
    629639                break;
    630640
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette