VirtualBox

Changeset 101318 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Sep 29, 2023 3:13:07 PM (17 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159318
Message:

Main: Move findEfiRom to the common code and add a PlatformArchitecture_T parameter to IVirtualBox::CheckFirmwarePresent to differentiate between x86 and ARM, bugref:10528

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigCommon.cpp

    r101173 r101318  
    34213421}
    34223422
     3423
     3424#ifndef VBOX_WITH_EFI_IN_DD2
     3425DECLHIDDEN(int) findEfiRom(IVirtualBox* vbox, PlatformArchitecture_T aPlatformArchitecture, FirmwareType_T aFirmwareType, Utf8Str *pEfiRomFile)
     3426{
     3427    Bstr aFilePath, empty;
     3428    BOOL fPresent = FALSE;
     3429    HRESULT hrc = vbox->CheckFirmwarePresent(aPlatformArchitecture, aFirmwareType, empty.raw(),
     3430                                             empty.asOutParam(), aFilePath.asOutParam(), &fPresent);
     3431    AssertComRCReturn(hrc, Global::vboxStatusCodeFromCOM(hrc));
     3432
     3433    if (!fPresent)
     3434    {
     3435        LogRel(("Failed to find an EFI ROM file.\n"));
     3436        return VERR_FILE_NOT_FOUND;
     3437    }
     3438
     3439    *pEfiRomFile = Utf8Str(aFilePath);
     3440
     3441    return VINF_SUCCESS;
     3442}
     3443#endif
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigX86.cpp

    r101271 r101318  
    194194    }
    195195};
    196 
    197 #ifndef VBOX_WITH_EFI_IN_DD2
    198 static int findEfiRom(IVirtualBox* vbox, FirmwareType_T aFirmwareType, Utf8Str *pEfiRomFile)
    199 {
    200     Bstr aFilePath, empty;
    201     BOOL fPresent = FALSE;
    202     HRESULT hrc = vbox->CheckFirmwarePresent(aFirmwareType, empty.raw(),
    203                                              empty.asOutParam(), aFilePath.asOutParam(), &fPresent);
    204     AssertComRCReturn(hrc, Global::vboxStatusCodeFromCOM(hrc));
    205 
    206     if (!fPresent)
    207     {
    208         LogRel(("Failed to find an EFI ROM file.\n"));
    209         return VERR_FILE_NOT_FOUND;
    210     }
    211 
    212     *pEfiRomFile = Utf8Str(aFilePath);
    213 
    214     return VINF_SUCCESS;
    215 }
    216 #endif
    217196
    218197/**
     
    16761655#else
    16771656            Utf8Str efiRomFile;
    1678             vrc = findEfiRom(virtualBox, eFwType, &efiRomFile);
     1657            vrc = findEfiRom(virtualBox, PlatformArchitecture_x86, eFwType, &efiRomFile);
    16791658            AssertRCReturn(vrc, vrc);
    16801659            const char *pszEfiRomFile = efiRomFile.c_str();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette