Changeset 39824 in vbox for trunk/src/VBox
- Timestamp:
- Jan 20, 2012 9:39:14 PM (13 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestImpl.h
r39659 r39824 133 133 // Public methods that are not in IDL (only called internally). 134 134 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); 136 136 bool facilityIsActive(VBoxGuestFacilityType enmFacility); 137 137 HRESULT facilityUpdate(VBoxGuestFacilityType enmFacility, VBoxGuestFacilityStatus enmStatus); … … 293 293 AdditionsRunLevelType_T mAdditionsRunLevel; 294 294 Bstr mAdditionsVersion; 295 //ULONG mAdditionsRevision; 295 296 Bstr mInterfaceVersion; 296 297 }; -
trunk/src/VBox/Main/src-client/GuestImpl.cpp
r39805 r39824 204 204 205 205 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 209 210 { 210 211 /* … … 239 240 } 240 241 242 /** @todo r=bird: See comment about the space before 'r' in 243 * setAdditionsInfo2. */ 241 244 Bstr additionsVersion = BstrFmt("%ls r%ls", 242 245 addVersion.raw(), addRevision.raw()); … … 254 257 } 255 258 } 256 else257 mData.mAdditionsVersion.cloneTo(aAdditionsVersion);258 259 259 260 return hr; … … 761 762 * Gets called by vmmdevUpdateGuestInfo2. 762 763 * 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. 765 769 */ 766 void Guest::setAdditionsInfo2( Bstr aAdditionsVersion, Bstr aVersionName, Bstr aRevision)770 void Guest::setAdditionsInfo2(const char *a_pszVersion, const char *a_pszVersionName, uint32_t a_uRevision) 767 771 { 768 772 AutoCaller autoCaller(this); … … 771 775 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 772 776 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') 774 782 /* 775 783 * aVersionName could be "x.y.z_BETA1_FOOBAR", so append revision manually to 776 784 * become "x.y.z_BETA1_FOOBAR r12345". 777 785 */ 778 mData.mAdditionsVersion = BstrFmt("% ls r%ls", aVersionName.raw(), aRevision.raw());786 mData.mAdditionsVersion = BstrFmt("%s r%u", a_pszVersionName, a_uRevision); 779 787 else /* aAdditionsVersion is in x.y.zr12345 format. */ 780 mData.mAdditionsVersion = aAdditionsVersion; 788 mData.mAdditionsVersion = Bstr(a_pszVersion); 789 //mData.mAdditionsRevision = a_uRevision; 781 790 } 782 791 -
trunk/src/VBox/Main/src-client/VMMDevInterface.cpp
r37175 r39824 232 232 */ 233 233 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. */ 235 235 guest->setAdditionsStatus(VBoxGuestFacilityType_All, 236 236 VBoxGuestFacilityStatus_Inactive, … … 245 245 * 246 246 * @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. 248 249 * @thread The emulation thread. 249 250 */ 250 DECLCALLBACK(void) vmmdevUpdateGuestInfo2(PPDMIVMMDEVCONNECTOR pInterface, const VBoxGuestInfo2 *guestInfo) 251 { 252 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); 253 254 Assert(guestInfo); 255 if (!guestInfo) 251 DECLCALLBACK(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) 256 260 return; 257 261 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); 275 274 276 275 /*
Note:
See TracChangeset
for help on using the changeset viewer.