Changeset 16216 in vbox
- Timestamp:
- Jan 24, 2009 4:30:43 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r16174 r16216 902 902 CheckComRCReturnRC (rc); 903 903 904 /* when setting, always use the "etalon" value for consistency -- lookup 905 * by ID is case-insensitive and the input value may have different case */ 906 Bstr osTypeId; 907 rc = guestOSType->COMGETTER(Id) (osTypeId.asOutParam()); 908 CheckComRCReturnRC (rc); 909 904 910 AutoWriteLock alock (this); 905 911 … … 908 914 909 915 mUserData.backup(); 910 mUserData->mOSTypeId = aOSTypeId;916 mUserData->mOSTypeId = osTypeId; 911 917 912 918 return S_OK; -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r16040 r16216 1304 1304 STDMETHODIMP VirtualBox::GetGuestOSType (IN_BSTR aId, IGuestOSType **aType) 1305 1305 { 1306 CheckComArgNotNull(aType); 1307 1308 AutoCaller autoCaller (this); 1309 CheckComRCReturnRC (autoCaller.rc()); 1306 /* Old ID to new ID conversion table. See r39691 for a source */ 1307 static const wchar_t *kOldNewIDs[] = 1308 { 1309 L"unknown", L"Other", 1310 L"win31", L"Windows31", 1311 L"win95", L"Windows95", 1312 L"win98", L"Windows98", 1313 L"winme", L"WindowsMe", 1314 L"winnt4", L"WindowsNT4", 1315 L"win2k", L"Windows2000", 1316 L"winxp", L"WindowsXP", 1317 L"win2k3", L"Windows2003", 1318 L"winvista", L"WindowsVista", 1319 L"win2k8", L"Windows2008", 1320 L"ecs", L"OS2eCS", 1321 L"fedoracore", L"Fedora", 1322 /* the rest is covered by the case-insensitive comparison */ 1323 }; 1324 1325 CheckComArgNotNull (aType); 1326 1327 AutoCaller autoCaller (this); 1328 CheckComRCReturnRC (autoCaller.rc()); 1329 1330 /* first, look for a substitution */ 1331 Bstr id = aId; 1332 for (size_t i = 0; i < RT_ELEMENTS (kOldNewIDs) / 2; i += 2) 1333 { 1334 if (id == kOldNewIDs [i]) 1335 { 1336 id = kOldNewIDs [i + 1]; 1337 break; 1338 } 1339 } 1310 1340 1311 1341 *aType = NULL; … … 1319 1349 const Bstr &typeId = (*it)->id(); 1320 1350 AssertMsg (!!typeId, ("ID must not be NULL")); 1321 if (typeId == aId)1351 if (typeId.compareIgnoreCase (id) == 0) 1322 1352 { 1323 1353 (*it).queryInterfaceTo (aType);
Note:
See TracChangeset
for help on using the changeset viewer.