Changeset 105922 in vbox for trunk/src/VBox
- Timestamp:
- Sep 2, 2024 6:08:46 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/UnattendedImpl.cpp
r105917 r105922 341 341 { 342 342 HRESULT hrc; 343 HRESULT getSupportedGuestOSTypesRC; 343 344 344 /* Get a list of guest OS Type Ids supported by the host. */ 345 345 ComPtr<ISystemProperties> pSystemProperties; … … 353 353 if (SUCCEEDED(hrc)) 354 354 { 355 getSupportedGuestOSTypesRC = pPlatformProperties->COMGETTER(SupportedGuestOSTypes)(ComSafeArrayAsOutParam(supportedGuestOSTypes)); 355 hrc = pPlatformProperties->COMGETTER(SupportedGuestOSTypes)(ComSafeArrayAsOutParam(supportedGuestOSTypes)); 356 if (!SUCCEEDED(hrc)) 357 supportedGuestOSTypes.resize(0); 356 358 } 357 359 } … … 506 508 } 507 509 508 if (SUCCEEDED(getSupportedGuestOSTypesRC))509 {510 bool fSupported = false;511 for (size_t i = 0; i < supportedGuestOSTypes.size() && !fSupported; ++i)512 {513 ComPtr<IGuestOSType> guestOSType = supportedGuestOSTypes[i]; 514 515 Bstr guestId;516 guestOSType->COMGETTER(Id)(guestId.asOutParam());517 if (guestId == mStrDetectedOSTypeId)518 fSupported = true;519 }520 if (!fSupported)521 {522 mStrDetectedOSTypeId.setNull();523 mStrDetectedOSVersion.setNull();524 mStrDetectedOSFlavor.setNull();525 mDetectedOSLanguages.clear();526 mStrDetectedOSHints.setNull();527 mDetectedImages.clear();528 529 } 510 /* Check if detected OS type is supported (covers platform architecture). */ 511 bool fSupported = false; 512 for (size_t i = 0; i < supportedGuestOSTypes.size() && !fSupported; ++i) 513 { 514 ComPtr<IGuestOSType> guestOSType = supportedGuestOSTypes[i]; 515 516 Bstr guestId; 517 guestOSType->COMGETTER(Id)(guestId.asOutParam()); 518 if (guestId == mStrDetectedOSTypeId) 519 fSupported = true; 520 } 521 if (!fSupported) 522 { 523 mStrDetectedOSTypeId.setNull(); 524 mStrDetectedOSVersion.setNull(); 525 mStrDetectedOSFlavor.setNull(); 526 mDetectedOSLanguages.clear(); 527 mStrDetectedOSHints.setNull(); 528 mDetectedImages.clear(); 529 hrc = E_FAIL; 530 } 531 530 532 /** @todo implement actual detection logic. */ 531 533 return hrc;
Note:
See TracChangeset
for help on using the changeset viewer.