VirtualBox

Changeset 101282 in vbox for trunk


Ignore:
Timestamp:
Sep 27, 2023 8:21:09 AM (16 months ago)
Author:
vboxsync
Message:

Main: Added IPlatformProperties::supportedGuestOSTypes() getter to return supported guest OS types for a specific platform. The IVirtualBox::guestOSTypes() getter in turn will return all guest OS types for all platforms. bugref:10384

Location:
trunk/src/VBox/Main
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r101200 r101282  
    28712871    <attribute name="guestOSTypes" type="IGuestOSType" readonly="yes" safearray="yes">
    28722872      <desc>
    2873         Array of guest OS type objects known to this VirtualBox installation.
     2873        Array of all guest OS type objects known to this VirtualBox installation.
    28742874      </desc>
    28752875    </attribute>
     
    1269112691    name="IPlatformProperties"
    1269212692    extends="$unknown"
    12693     uuid="1ec98a25-d94c-4cfb-a012-5e21481c154c"
     12693    uuid="6bf432a7-b9e6-4317-ba51-52373dac02de"
    1269412694    wsmap="managed"
    1269512695    rest="managed"
     
    1275912759      <desc>
    1276012760        Returns an array of officially supported values for enum <link to="FirmwareType"/>,
     12761        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12762      </desc>
     12763    </attribute>
     12764
     12765    <attribute name="supportedGuestOSTypes" type="IGuestOSType" safearray="yes" readonly="yes">
     12766      <desc>
     12767        Returns an array of officially supported values for enum <link to="IGuestOSType"/>,
    1276112768        in the sense of what is e.g. worth offering in the VirtualBox GUI.
    1276212769      </desc>
  • trunk/src/VBox/Main/include/PlatformPropertiesImpl.h

    r101057 r101282  
    8080    HRESULT getSupportedFirmwareTypes(std::vector<FirmwareType_T> &aSupportedFirmwareTypes) RT_OVERRIDE;
    8181    HRESULT getSupportedGraphicsControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes) RT_OVERRIDE;
     82    HRESULT getSupportedGuestOSTypes(std::vector<ComPtr<IGuestOSType>> &aSupportedGuestOSTypes);
    8283    HRESULT getSupportedNetworkAdapterTypes(std::vector<NetworkAdapterType_T> &aSupportedNetworkAdapterTypes) RT_OVERRIDE;
    8384    HRESULT getSupportedUartTypes(std::vector<UartType_T> &aSupportedUartTypes) RT_OVERRIDE;
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r101180 r101282  
    322322    HRESULT i_releaseCryptoIf(PCVBOXCRYPTOIF pCryptoIf);
    323323    HRESULT i_unloadCryptoIfModule(void);
    324 
    325 
     324    HRESULT i_getSupportedGuestOSTypes(std::vector<PlatformArchitecture_T> aArchitectures, std::vector<ComPtr<IGuestOSType>> &aGuestOSTypes);
    326325
    327326private:
  • trunk/src/VBox/Main/src-all/PlatformPropertiesImpl.cpp

    r101200 r101282  
    718718}
    719719
     720HRESULT PlatformProperties::getSupportedGuestOSTypes(std::vector<ComPtr<IGuestOSType>> &aSupportedGuestOSTypes)
     721{
     722    std::vector<PlatformArchitecture_T> vecArchitectures(mPlatformArchitecture);
     723    return mParent->i_getSupportedGuestOSTypes(vecArchitectures, aSupportedGuestOSTypes);
     724}
     725
    720726HRESULT PlatformProperties::getSupportedNetworkAdapterTypes(std::vector<NetworkAdapterType_T> &aSupportedNetworkAdapterTypes)
    721727{
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r101180 r101282  
    13741374}
    13751375
    1376 HRESULT VirtualBox::getGuestOSTypes(std::vector<ComPtr<IGuestOSType> > &aGuestOSTypes)
     1376
     1377/**
     1378 * Returns all supported guest OS types for one ore more platform architecture(s).
     1379 *
     1380 * @returns HRESULT
     1381 * @param   aArchitectures          Platform architectures to return supported guest OS types for.
     1382 *                                  If empty, all supported guest OS for all platform architectures will be returned.
     1383 * @param   aGuestOSTypes           Where to return the supported guest OS types.
     1384 *                                  Will be empty if none supported.
     1385 */
     1386HRESULT VirtualBox::i_getSupportedGuestOSTypes(std::vector<PlatformArchitecture_T> aArchitectures, std::vector<ComPtr<IGuestOSType>> &aGuestOSTypes)
    13771387{
    13781388    AutoReadLock al(m->allGuestOSTypes.getLockHandle() COMMA_LOCKVAL_SRC_POS);
    13791389
    1380     com::SafeArray<PlatformArchitecture_T> supportedPlatformArchitectures;
    1381     HRESULT hrc = m->pSystemProperties->COMGETTER(SupportedPlatformArchitectures)(ComSafeArrayAsOutParam(supportedPlatformArchitectures));
    1382     ComAssertComRCRetRC(hrc);
    1383 
    13841390    aGuestOSTypes.clear();
    13851391
     
    13891395    {
    13901396        bool fFound = false;
    1391         if (supportedPlatformArchitectures.size() == 0) /* If empty, we add all types we have. */
     1397        if (aArchitectures.size() == 0) /* If empty, we add all types we have. */
    13921398            fFound = true;
    13931399        else
    13941400        {
    1395             for (size_t i = 0; i < supportedPlatformArchitectures.size(); i++)
     1401            for (size_t i = 0; i < aArchitectures.size(); i++)
    13961402            {
    1397                 if (supportedPlatformArchitectures[i] == (*it)->i_platformArchitecture())
     1403                if (aArchitectures[i] == (*it)->i_platformArchitecture())
    13981404                {
    13991405                    fFound = true;
     
    14121418
    14131419    return S_OK;
     1420}
     1421
     1422HRESULT VirtualBox::getGuestOSTypes(std::vector<ComPtr<IGuestOSType> > &aGuestOSTypes)
     1423{
     1424    std::vector<PlatformArchitecture_T> vecArchitectures; /* Stays empty to return all guest OS types. */
     1425    return VirtualBox::i_getSupportedGuestOSTypes(vecArchitectures, aGuestOSTypes);
    14141426}
    14151427
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