Changeset 31436 in vbox
- Timestamp:
- Aug 6, 2010 11:39:39 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 64502
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp
r31282 r31436 468 468 VBoxGlobal::tr ("Disabled", "details report (Nested Paging)"); 469 469 QString addVersionStr = console.GetGuest().GetAdditionsVersion(); 470 if (addVersionStr.isEmpty())471 {472 /*473 * If we got back an empty string from GetAdditionsVersion() we either474 * really don't have the Guest Additions version yet or the guest is running475 * older Guest Additions (< 3.2.0) which don't provide VMMDevReq_ReportGuestInfo2,476 * so get the version + revision from the (hopefully) provided guest properties477 * instead.478 */479 QString addVersion = m.GetGuestPropertyValue("/VirtualBox/GuestAdd/Version");480 QString addRevision = m.GetGuestPropertyValue("/VirtualBox/GuestAdd/Revision");481 if (!addVersion.isEmpty() && !addRevision.isEmpty())482 {483 /* Some Guest Additions versions had interchanged version + revision values,484 * so check if the version value at least has a dot to identify it and change485 * both values to reflect the right content. */486 if (!addVersion.contains("."))487 {488 QString addTemp = addVersion;489 addVersion = addRevision;490 addRevision = addTemp;491 }492 493 addVersionStr = addVersion494 + "r"495 + addRevision;496 }497 }498 470 if (addVersionStr.isEmpty()) 499 471 addVersionStr = tr ("Not Detected", "guest additions"); -
trunk/src/VBox/Main/GuestImpl.cpp
r31433 r31436 185 185 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 186 186 187 mData.mAdditionsVersion.cloneTo(aAdditionsVersion); 188 189 return S_OK; 187 HRESULT hr = S_OK; 188 if ( mData.mAdditionsVersion.isEmpty() 189 && mData.mAdditionsActive) /* Only try alternative way if GA are active! */ 190 { 191 /* 192 * If we got back an empty string from GetAdditionsVersion() we either 193 * really don't have the Guest Additions version yet or the guest is running 194 * older Guest Additions (< 3.2.0) which don't provide VMMDevReq_ReportGuestInfo2, 195 * so get the version + revision from the (hopefully) provided guest properties 196 * instead. 197 */ 198 Bstr addVersion; 199 ULONG64 u64Timestamp; 200 Bstr flags; 201 hr = mParent->machine()->GetGuestProperty(Bstr("/VirtualBox/GuestAdd/Version"), 202 addVersion.asOutParam(), &u64Timestamp, flags.asOutParam()); 203 if (hr == S_OK) 204 { 205 Bstr addRevision; 206 hr = mParent->machine()->GetGuestProperty(Bstr("/VirtualBox/GuestAdd/Revision"), 207 addRevision.asOutParam(), &u64Timestamp, flags.asOutParam()); 208 if ( hr == S_OK 209 && !addVersion.isEmpty() 210 && !addVersion.isEmpty()) 211 { 212 /* Some Guest Additions versions had interchanged version + revision values, 213 * so check if the version value at least has a dot to identify it and change 214 * both values to reflect the right content. */ 215 if (!Utf8Str(addVersion).contains(".")) 216 { 217 Bstr addTemp = addVersion; 218 addVersion = addRevision; 219 addRevision = addTemp; 220 } 221 222 Bstr additionsVersion = BstrFmt("%lsr%ls", 223 addVersion.raw(), addRevision.raw()); 224 additionsVersion.cloneTo(aAdditionsVersion); 225 } 226 } 227 else 228 { 229 /* If getting the version + revision above fails or they simply aren't there 230 * because of *really* old Guest Additions we only can report the interface 231 * version to at least have something. */ 232 mData.mInterfaceVersion.cloneTo(aAdditionsVersion); 233 } 234 } 235 else 236 mData.mAdditionsVersion.cloneTo(aAdditionsVersion); 237 238 return hr; 190 239 } 191 240 … … 1456 1505 /* 1457 1506 * Note: The Guest Additions API (interface) version is deprecated 1458 * and will not be used anymore! 1507 * and will not be used anymore! We might need it to at least report 1508 * something as version number if *really* ancient Guest Additions are 1509 * installed (without the guest version + revision properties having set). 1459 1510 */ 1511 mData.mInterfaceVersion = aInterfaceVersion; 1460 1512 1461 1513 /* … … 1476 1528 /* 1477 1529 * Older Additions didn't have this finer grained capability bit, 1478 * so enable it by default. Newer Additions will disable it immediately1479 * if relevant.1530 * so enable it by default. Newer Additions will not enable this here 1531 * and use the setSupportedFeatures function instead. 1480 1532 */ 1481 1533 mData.mSupportsGraphics = mData.mAdditionsActive; … … 1497 1549 * @param aVersionName 1498 1550 */ 1499 void Guest::setAdditionsInfo2(Bstr aAdditionsVersion, Bstr aVersionName )1551 void Guest::setAdditionsInfo2(Bstr aAdditionsVersion, Bstr aVersionName, Bstr aRevision) 1500 1552 { 1501 1553 AutoCaller autoCaller(this); … … 1505 1557 1506 1558 if (!aVersionName.isEmpty()) 1507 mData.mAdditionsVersion = BstrFmt("%ls %ls", aAdditionsVersion.raw(), aVersionName.raw()); 1508 else 1559 /* 1560 * aVersionName could be "x.y.z_BETA1_FOOBAR", so append revision manually to 1561 * become "x.y.z_BETA1_FOOBARr12345". 1562 */ 1563 mData.mAdditionsVersion = BstrFmt("%lsr%ls", aVersionName.raw(), aRevision.raw()); 1564 else /* aAdditionsVersion is in x.y.zr12345 format. */ 1509 1565 mData.mAdditionsVersion = aAdditionsVersion; 1510 1566 } -
trunk/src/VBox/Main/VMMDevInterface.cpp
r31364 r31436 228 228 */ 229 229 guest->setAdditionsInfo(Bstr(), guestInfo->osType); /* Clear interface version + OS type. */ 230 guest->setAdditionsInfo2(Bstr(), Bstr() ); /* Clear Guest Additions version. */230 guest->setAdditionsInfo2(Bstr(), Bstr(), Bstr()); /* Clear Guest Additions version. */ 231 231 guest->setAdditionsStatus(VBoxGuestStatusFacility_All, 232 232 VBoxGuestStatusCurrent_Disabled, … … 266 266 guestInfo->additionsBuild, 267 267 guestInfo->additionsRevision); 268 guest->setAdditionsInfo2(Bstr(version), Bstr(guestInfo->szName)); 268 char revision[16]; 269 RTStrPrintf(revision, sizeof(revision), "%ld", guestInfo->additionsRevision); 270 guest->setAdditionsInfo2(Bstr(version), Bstr(guestInfo->szName), Bstr(revision)); 269 271 270 272 /* -
trunk/src/VBox/Main/include/GuestImpl.h
r31241 r31436 110 110 // Public methods that are not in IDL (only called internally). 111 111 void setAdditionsInfo(Bstr aInterfaceVersion, VBOXOSTYPE aOsType); 112 void setAdditionsInfo2(Bstr aAdditionsVersion, Bstr aVersionName );112 void setAdditionsInfo2(Bstr aAdditionsVersion, Bstr aVersionName, Bstr aRevision); 113 113 void setAdditionsStatus(VBoxGuestStatusFacility Facility, VBoxGuestStatusCurrent Status, ULONG ulFlags); 114 114 void setSupportedFeatures(ULONG64 ulCaps, ULONG64 ulActive); … … 172 172 BOOL mAdditionsActive; 173 173 Bstr mAdditionsVersion; 174 Bstr mInterfaceVersion; 174 175 BOOL mSupportsSeamless; 175 176 BOOL mSupportsGraphics;
Note:
See TracChangeset
for help on using the changeset viewer.