Changeset 39898 in vbox
- Timestamp:
- Jan 27, 2012 3:27:29 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestImpl.cpp
r39890 r39898 219 219 /* 220 220 * If we're running older guest additions (< 3.2.0) try get it from 221 * the guest properties. 221 * the guest properties. Detected switched around Version and 222 * Revision in early 3.1.x releases (see r57115). 222 223 */ 223 224 ComPtr<IMachine> ptrMachine = mParent->machine(); … … 226 227 Bstr bstr; 227 228 hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Version").raw(), bstr.asOutParam()); 229 if (SUCCEEDED(hrc)) 230 { 231 Utf8Str str(bstr); 232 if (str.count('.') == 0) 233 hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Revision").raw(), bstr.asOutParam()); 234 str = bstr; 235 if (str.count('.') != 2) 236 hrc = E_FAIL; 237 } 238 228 239 if (SUCCEEDED(hrc)) 229 240 bstr.detachTo(a_pbstrAdditionsVersion); … … 260 271 /* 261 272 * If we're running older guest additions (< 3.2.0) try get it from 262 * the guest properties. 273 * the guest properties. Detected switched around Version and 274 * Revision in early 3.1.x releases (see r57115). 263 275 */ 264 276 ComPtr<IMachine> ptrMachine = mParent->machine(); … … 272 284 uint32_t uRevision; 273 285 int vrc = RTStrToUInt32Full(str.c_str(), 0, &uRevision); 286 if (vrc != VINF_SUCCESS && str.count('.') == 2) 287 { 288 hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Version").raw(), bstr.asOutParam()); 289 if (SUCCEEDED(hrc)) 290 { 291 str = bstr; 292 vrc = RTStrToUInt32Full(str.c_str(), 0, &uRevision); 293 } 294 } 274 295 if (vrc == VINF_SUCCESS) 275 296 *a_puAdditionsRevision = uRevision; … … 281 302 /* Return 0 if we don't know. */ 282 303 *a_puAdditionsRevision = 0; 283 hrc = 0;304 hrc = S_OK; 284 305 } 285 306 }
Note:
See TracChangeset
for help on using the changeset viewer.