VirtualBox

Changeset 28233 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 13, 2010 8:23:52 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59974
Message:

Guest Control: Update.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/GuestImpl.cpp

    r28218 r28233  
    437437}
    438438
    439 // static
    440 DECLCALLBACK(int) Guest::doGuestCtrlNotification(void *pvExtension,
    441                                                  uint32_t u32Function,
    442                                                  void *pvParms,
    443                                                  uint32_t cbParms)
     439/**
     440 * Static callback function for receiving updates on processes started on
     441 * the guest side.
     442 *
     443 * @returns VBox status code.
     444 *
     445 * @todo
     446 *
     447 */
     448DECLCALLBACK(int) Guest::doGuestCtrlExecNotification(void *pvExtension,
     449                                                     uint32_t u32Function,
     450                                                     void *pvParms,
     451                                                     uint32_t cbParms)
    444452{
    445453    using namespace guestControl;
     
    449457     * changes to the object state.
    450458     */
    451     PHOSTCALLBACKDATA pCBData = reinterpret_cast<PHOSTCALLBACKDATA>(pvParms);
     459    PHOSTEXECCALLBACKDATA pCBData = reinterpret_cast<PHOSTEXECCALLBACKDATA>(pvParms);
    452460    AssertPtr(pCBData);
    453     AssertReturn(sizeof(HOSTCALLBACKDATA) == cbParms, VERR_INVALID_PARAMETER);
     461    AssertReturn(sizeof(HOSTEXECCALLBACKDATA) == cbParms, VERR_INVALID_PARAMETER);
    454462    AssertReturn(HOSTCALLBACKMAGIC == pCBData->u32Magic, VERR_INVALID_PARAMETER);
    455463    LogFlowFunc(("pvExtension = %p, u32Function = %d, pvParms = %p, cbParms = %d\n",
    456464                 pvExtension, u32Function, pvParms, cbParms));
     465    ComObjPtr<Guest> pGuest = reinterpret_cast<Guest *>(pvExtension);
    457466
    458467    int rc = VINF_SUCCESS;
    459     Guest *pGuest = static_cast <Guest *>(pvExtension);
    460     AssertPtr(pGuest);
    461 
    462     switch (u32Function)
    463     {       
    464         case GUEST_EXEC_SEND_STATUS:
    465             LogFlowFunc(("GUEST_EXEC_SEND_STATUS\n"));
    466             break;
    467 
    468         default:
    469             rc = VERR_NOT_SUPPORTED;
    470             break;
    471     }
     468    if (u32Function == GUEST_EXEC_SEND_STATUS)
     469    {
     470       
     471    }
     472    else
     473        rc = VERR_NOT_SUPPORTED;
    472474
    473475    ASMAtomicWriteBool(&pGuest->mSignalled, true);
     
    520522        HGCMSVCEXTHANDLE hExt;
    521523        int vrc = HGCMHostRegisterServiceExtension(&hExt, "VBoxGuestControlSvc",
    522                                                    &Guest::doGuestCtrlNotification,
     524                                                   &Guest::doGuestCtrlExecNotification,
    523525                                                   this);
    524526        if (RT_SUCCESS(vrc))
     
    594596                        if (vmmDev)
    595597                        {
    596                             LogFlow(("Guest::ExecuteProgram: numParms=%d\n", i));
     598                            LogFlowFunc(("hgcmHostCall numParms=%d\n", i));
    597599                            vrc = vmmDev->hgcmHostCall("VBoxGuestControlSvc", HOST_EXEC_CMD,
    598600                                                       i, paParms);
    599                             /** @todo Get the PID. */
    600601                        }
    601602                        RTMemFree(pvEnv);
     
    605606                if (RT_SUCCESS(vrc))
    606607                {
    607                     /* Wait for the HGCM low level callback */
     608                    LogFlowFunc(("Waiting for HGCM callback (timeout=%ldms) ...\n", aTimeoutMS));
     609
     610                    /*
     611                     * Wait for the HGCM low level callback until the process
     612                     * has been started (or something went wrong). This is necessary to
     613                     * get the PID.
     614                     */
    608615                    mSignalled = false;
    609616                    uint64_t u64Started = RTTimeMilliTS();
     
    622629                        RTThreadSleep(100);
    623630                    } while (!mSignalled);
     631
     632                    /* Did we get some status? */
     633                    if (mSignalled)
     634                    {
     635
     636                    }
    624637#if 0
    625638                    progress.queryInterfaceTo(aProgress);
  • trunk/src/VBox/Main/include/GuestImpl.h

    r28206 r28233  
    110110    int prepareExecuteEnv(const char *pszEnv, void **ppvList, uint32_t *pcbList, uint32_t *pcEnv);
    111111    /** Static callback for handling guest notifications. */
    112     static DECLCALLBACK(int) doGuestCtrlNotification(void *pvExtension, uint32_t u32Function, void *pvParms, uint32_t cbParms);
     112    static DECLCALLBACK(int) doGuestCtrlExecNotification(void *pvExtension, uint32_t u32Function, void *pvParms, uint32_t cbParms);
    113113# endif
    114114
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