VirtualBox

Changeset 32180 in vbox


Ignore:
Timestamp:
Sep 1, 2010 2:47:33 PM (14 years ago)
Author:
vboxsync
Message:

Additions/common/VBoxGuest: fixed compatibility with VBox 3.2 hosts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest2.cpp

    r31661 r32180  
    4141     *            first in order to accept all other VMMDev messages! Otherwise you'd get
    4242     *            a VERR_NOT_SUPPORTED error.
     43     *
     44     * VBox version <= 3.2: VMMDevReportGuestInfo must always come first.
    4345     */
    4446    VMMDevReportGuestInfo2 *pReq = NULL;
     47    VMMDevReportGuestInfo *pReq3 = NULL;
    4548    int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof (VMMDevReportGuestInfo2), VMMDevReq_ReportGuestInfo2);
    4649    Log(("VBoxGuestReportGuestInfo: VbglGRAlloc VMMDevReportGuestInfo2 completed with rc=%Rrc\n", rc));
     
    5356        pReq->guestInfo.additionsFeatures = 0; /* Not (never?) used. */
    5457        RTStrCopy(pReq->guestInfo.szName, sizeof(pReq->guestInfo.szName), VBOX_VERSION_STRING);
    55 
    56         rc = VbglGRPerform(&pReq->header);
    57         Log(("VBoxGuestReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo2 completed with rc=%Rrc\n", rc));
    58         if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */
    59             rc = VINF_SUCCESS;
    60         VbglGRFree(&pReq->header);
    61     }
    62 
    63     /*
    64      * VMMDevReportGuestInfo acts as a beacon and signals the host that all guest information is
    65      * now complete.  So always send this report last!
    66      */
    67     if (RT_SUCCESS(rc))
    68     {
    69         VMMDevReportGuestInfo *pReq3 = NULL;
     58       
    7059        rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq3, sizeof (VMMDevReportGuestInfo), VMMDevReq_ReportGuestInfo);
    7160        Log(("VBoxGuestReportGuestInfo: VbglGRAlloc VMMDevReportGuestInfo completed with rc=%Rrc\n", rc));
     
    7564            pReq3->guestInfo.osType = enmOSType;
    7665
    77             rc = VbglGRPerform(&pReq3->header);
    78             Log(("VBoxGuestReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo completed with rc=%Rrc\n", rc));
     66            rc = VbglGRPerform(&pReq->header);
     67            Log(("VBoxGuestReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo2 completed with rc=%Rrc\n", rc));
     68            if (rc == VERR_NOT_IMPLEMENTED)
     69            {
     70                /* Compatibility with pre VBox-3.2 hosts -- VMMDevReportGuestInfo2 not implemented. */
     71                rc = VINF_SUCCESS;
     72            }
     73            if (rc == VERR_NOT_SUPPORTED)
     74            {
     75                /* Compatibility with VBox 3.2 hosts:
     76                 * They rely on sending VMMDevReportGuestInfo as the very first request */
     77                rc = VbglGRPerform(&pReq3->header);
     78                Log(("VBoxGuestReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo completed with rc=%Rrc\n", rc));
     79                rc = VbglGRPerform(&pReq->header);
     80                Log(("VBoxGuestReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo2 completed with rc=%Rrc\n", rc));
     81            }
     82            else
     83            {
     84                /*
     85                 * Hosts newer than VBox 3.2:
     86                 * VMMDevReportGuestInfo acts as a beacon and signals the host that all
     87                 * guest information is now complete. So always send this report last!
     88                 */
     89                rc = VbglGRPerform(&pReq3->header);
     90                Log(("VBoxGuestReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo completed with rc=%Rrc\n", rc));
     91            }
    7992            VbglGRFree(&pReq3->header);
    8093        }
     94        VbglGRFree(&pReq->header);
    8195    }
    8296
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