VirtualBox

Changeset 101177 in vbox


Ignore:
Timestamp:
Sep 19, 2023 4:59:11 PM (16 months ago)
Author:
vboxsync
Message:

Main: Added GuestOSType::i_platformArchitecture() for easier retrieving the guest OS' platform architecture internally. bugref:10384

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestOSTypeImpl.h

    r101171 r101177  
    5656    const Utf8Str &i_description() const { return mDescription; }
    5757    bool i_is64Bit() const { return !!(mOSHint & VBOXOSHINT_64BIT); }
     58    PlatformArchitecture_T i_platformArchitecture() const;
    5859    bool i_recommendedIOAPIC() const { return !!(mOSHint & VBOXOSHINT_IOAPIC); }
    5960    bool i_recommendedX2APIC() const { return !!(mOSHint & VBOXOSHINT_X2APIC); }
  • trunk/src/VBox/Main/src-server/GuestOSTypeImpl.cpp

    r101171 r101177  
    208208}
    209209
    210 HRESULT GuestOSType::getPlatformArchitecture(PlatformArchitecture_T *aPlatformArchitecture)
     210PlatformArchitecture_T GuestOSType::i_platformArchitecture() const
    211211{
    212212    /* mOSType constant during life time, no need to lock */
     
    214214    if (   osTypePlatformArchitectureMasked & VBOXOSTYPE_x86
    215215        || osTypePlatformArchitectureMasked & VBOXOSTYPE_x64)
    216         *aPlatformArchitecture = PlatformArchitecture_x86;
     216        return PlatformArchitecture_x86;
    217217    else if (   osTypePlatformArchitectureMasked & VBOXOSTYPE_arm32
    218218             || osTypePlatformArchitectureMasked & VBOXOSTYPE_arm64)
    219         *aPlatformArchitecture = PlatformArchitecture_ARM;
    220     else
    221     {
    222         AssertFailed(); /* Something is fishy in the OSTYPE spec. */
    223         *aPlatformArchitecture = PlatformArchitecture_None;
    224     }
    225 
     219        return PlatformArchitecture_ARM;
     220
     221    /* Will happen when called before being properly initialized(). */
     222    return PlatformArchitecture_None;
     223}
     224
     225HRESULT GuestOSType::getPlatformArchitecture(PlatformArchitecture_T *aPlatformArchitecture)
     226{
     227    *aPlatformArchitecture = i_platformArchitecture();
    226228    return S_OK;
    227229}
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