VirtualBox

Changeset 39824 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 20, 2012 9:39:14 PM (13 years ago)
Author:
vboxsync
Message:

IGuest/version: todos and some clean up (no real changes intended).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestImpl.h

    r39659 r39824  
    133133    // Public methods that are not in IDL (only called internally).
    134134    void setAdditionsInfo(Bstr aInterfaceVersion, VBOXOSTYPE aOsType);
    135     void setAdditionsInfo2(Bstr aAdditionsVersion, Bstr aVersionName, Bstr aRevision);
     135    void setAdditionsInfo2(const char *a_pszVersion, const char *a_pszVersionName, uint32_t a_uRevision);
    136136    bool facilityIsActive(VBoxGuestFacilityType enmFacility);
    137137    HRESULT facilityUpdate(VBoxGuestFacilityType enmFacility, VBoxGuestFacilityStatus enmStatus);
     
    293293        AdditionsRunLevelType_T mAdditionsRunLevel;
    294294        Bstr                    mAdditionsVersion;
     295        //ULONG                   mAdditionsRevision;
    295296        Bstr                    mInterfaceVersion;
    296297    };
  • trunk/src/VBox/Main/src-client/GuestImpl.cpp

    r39805 r39824  
    204204
    205205    HRESULT hr = S_OK;
    206     if (   mData.mAdditionsVersion.isEmpty()
    207         /* Only try alternative way if GA are active! */
    208         && mData.mAdditionsRunLevel > AdditionsRunLevelType_None)
     206    if (   !mData.mAdditionsVersion.isEmpty()
     207        || !mData.mAdditionsRunLevel > AdditionsRunLevelType_None)
     208        mData.mAdditionsVersion.cloneTo(aAdditionsVersion);
     209    else
    209210    {
    210211        /*
     
    239240                }
    240241
     242                /** @todo r=bird: See comment about the space before 'r' in
     243                 *        setAdditionsInfo2. */
    241244                Bstr additionsVersion = BstrFmt("%ls r%ls",
    242245                                                addVersion.raw(), addRevision.raw());
     
    254257        }
    255258    }
    256     else
    257         mData.mAdditionsVersion.cloneTo(aAdditionsVersion);
    258259
    259260    return hr;
     
    761762 * Gets called by vmmdevUpdateGuestInfo2.
    762763 *
    763  * @param aAdditionsVersion
    764  * @param aVersionName
     764 * @param   a_pszVersion            The GuestInfo2 numbers turned into
     765 * @param   a_pszVersionName        This turns out to be the version string +
     766 *                                  beta/alpha/whatever suffix, duplicating info
     767 *                                  passed in @a a_pszVersion.
     768 * @param   a_uRevision             The SVN revision number.
    765769 */
    766 void Guest::setAdditionsInfo2(Bstr aAdditionsVersion, Bstr aVersionName, Bstr aRevision)
     770void Guest::setAdditionsInfo2(const char *a_pszVersion, const char *a_pszVersionName, uint32_t a_uRevision)
    767771{
    768772    AutoCaller autoCaller(this);
     
    771775    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    772776
    773     if (!aVersionName.isEmpty())
     777    /** @todo r=bird: WHY is this code returning "1.2.3 r45678" in one case and
     778     *        "1.2.3r45678" in the else?  Why aren't we doing it the same way as
     779     *        IVirtualBox? One version attribute and one revision attribute, no
     780     *        abigiuos spaces! */
     781    if (*a_pszVersionName != '\0')
    774782        /*
    775783         * aVersionName could be "x.y.z_BETA1_FOOBAR", so append revision manually to
    776784         * become "x.y.z_BETA1_FOOBAR r12345".
    777785         */
    778         mData.mAdditionsVersion = BstrFmt("%ls r%ls", aVersionName.raw(), aRevision.raw());
     786        mData.mAdditionsVersion = BstrFmt("%s r%u", a_pszVersionName, a_uRevision);
    779787    else /* aAdditionsVersion is in x.y.zr12345 format. */
    780         mData.mAdditionsVersion = aAdditionsVersion;
     788        mData.mAdditionsVersion = Bstr(a_pszVersion);
     789    //mData.mAdditionsRevision = a_uRevision;
    781790}
    782791
  • trunk/src/VBox/Main/src-client/VMMDevInterface.cpp

    r37175 r39824  
    232232         */
    233233        guest->setAdditionsInfo(Bstr(), guestInfo->osType); /* Clear interface version + OS type. */
    234         guest->setAdditionsInfo2(Bstr(), Bstr(), Bstr()); /* Clear Guest Additions version. */
     234        guest->setAdditionsInfo2("", "", 0); /* Clear Guest Additions version. */
    235235        guest->setAdditionsStatus(VBoxGuestFacilityType_All,
    236236                                  VBoxGuestFacilityStatus_Inactive,
     
    245245 *
    246246 * @param   pInterface          Pointer to this interface.
    247  * @param   guestInfo           Pointer to Guest Additions information structure.
     247 * @param   pGuestInfo          Pointer to Guest Additions information
     248 *                              structure.
    248249 * @thread  The emulation thread.
    249250 */
    250 DECLCALLBACK(void) vmmdevUpdateGuestInfo2(PPDMIVMMDEVCONNECTOR pInterface, const VBoxGuestInfo2 *guestInfo)
    251 {
    252     PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);
    253 
    254     Assert(guestInfo);
    255     if (!guestInfo)
     251DECLCALLBACK(void) vmmdevUpdateGuestInfo2(PPDMIVMMDEVCONNECTOR pInterface, const VBoxGuestInfo2 *pGuestInfo)
     252{
     253    PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);
     254    AssertPtr(pGuestInfo);
     255
     256    /* Store that information in IGuest. */
     257    Guest *pGuest = pDrv->pVMMDev->getParent()->getGuest();
     258    Assert(pGuest);
     259    if (!pGuest)
    256260        return;
    257261
    258     /* Store that information in IGuest. */
    259     Guest* guest = pDrv->pVMMDev->getParent()->getGuest();
    260     Assert(guest);
    261     if (!guest)
    262         return;
    263 
    264     if (   guestInfo->additionsMajor    != 0
    265         && guestInfo->additionsRevision != 0)
    266     {
    267         char version[32];
    268         RTStrPrintf(version, sizeof(version), "%d.%d.%dr%ld", guestInfo->additionsMajor,
    269                                                               guestInfo->additionsMinor,
    270                                                               guestInfo->additionsBuild,
    271                                                               guestInfo->additionsRevision);
    272         char revision[16];
    273         RTStrPrintf(revision, sizeof(revision), "%ld", guestInfo->additionsRevision);
    274         guest->setAdditionsInfo2(Bstr(version), Bstr(guestInfo->szName), Bstr(revision));
     262    if (   pGuestInfo->additionsMajor    != 0
     263        && pGuestInfo->additionsRevision != 0)
     264    {
     265        /** @todo r=bird: See comments on space before 'r' in setAdditionsInfo2! */
     266        char szVersion[32];
     267        RTStrPrintf(szVersion, sizeof(szVersion), "%d.%d.%dr%ld",
     268                    pGuestInfo->additionsMajor,
     269                    pGuestInfo->additionsMinor,
     270                    pGuestInfo->additionsBuild,
     271                    pGuestInfo->additionsRevision);
     272
     273        pGuest->setAdditionsInfo2(szVersion, pGuestInfo->szName, pGuestInfo->additionsRevision);
    275274
    276275        /*
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