VirtualBox

Ignore:
Timestamp:
Jul 9, 2010 12:30:12 PM (15 years ago)
Author:
vboxsync
Message:

More fine grained Guest Additions status; now marks Additions as active when VBoxService was started successfully.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/Helper.cpp

    r29619 r30758  
    191191}
    192192
    193 /** @todo maybe we should drop this routine entirely later because we detecting
    194  *        the running OS via VBoxService in ring 3 using guest properties since a while. */
     193/** @todo Maybe we should drop this routine entirely later because we detecting
     194 *        the running OS via VBoxService in ring 3 using guest properties since a while.
     195 *
     196 *  @todo Consider of using vboxGuestInitReportGuestInfo in the ..\common\Helper.cpp
     197 *        module to have a common base and less redundant code.
     198 */
    195199NTSTATUS hlpVBoxReportGuestInfo (PVBOXGUESTDEVEXT pDevExt)
    196200{
     
    234238        if (RT_FAILURE(rc))
    235239        {
    236             dprintf(("VBoxGuest::hlpVBoxReportGuestInfo: error reporting guest info to VMMDev. "
     240            dprintf(("VBoxGuest::hlpVBoxReportGuestInfo: Error reporting guest info to VMMDev. "
    237241                     "rc = %Rrc\n", rc));
    238242        }
     
    258262        if (RT_FAILURE(rc))
    259263        {
    260             dprintf(("VBoxGuest::hlpVBoxReportGuestInfo: error reporting guest info to VMMDev. "
     264            dprintf(("VBoxGuest::hlpVBoxReportGuestInfo: Error reporting guest info to VMMDev. "
    261265                     "rc = %Rrc\n", rc));
    262266        }
    263         if (rc == VERR_NOT_IMPLEMENTED)
     267        if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */
    264268            rc = VINF_SUCCESS;
    265 
    266269        VbglGRFree (&pReq2->header);
    267270    }
    268271
     272    /*
     273     * Report guest status to host.  Because the host set the "Guest Additions active" flag as soon
     274     * as he received the VMMDevReportGuestInfo above to make sure all is compatible with older Guest
     275     * Additions we now have to disable that flag again here (too early, VBoxService and friends need
     276     * to start up first).
     277     */
     278    VMMDevReportGuestStatus *pReq3;
     279    rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq3, sizeof(*pReq3), VMMDevReq_ReportGuestStatus);
     280    if (RT_SUCCESS(rc))
     281    {
     282        pReq3->guestStatus.facility = VBoxGuestStatusFacility_VBoxGuestDriver;
     283        pReq3->guestStatus.status = VBoxGuestStatusCurrent_Active; /** @todo Are we actually *really* active at this point? */
     284        pReq3->guestStatus.flags = 0;
     285        rc = VbglGRPerform(&pReq3->header);
     286        if (RT_FAILURE(rc))
     287            dprintf(("VBoxGuest::hlpVBoxReportGuestInfo: Reporting guest status failed with rc=%Rrc\n", rc));
     288        if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */
     289            rc = VINF_SUCCESS;
     290        VbglGRFree(&pReq3->header);
     291    }
     292
    269293    return RT_FAILURE(rc) ? STATUS_UNSUCCESSFUL : STATUS_SUCCESS;
    270294}
Note: See TracChangeset for help on using the changeset viewer.

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