VirtualBox

Changeset 101171 in vbox


Ignore:
Timestamp:
Sep 19, 2023 3:04:10 PM (12 months ago)
Author:
vboxsync
Message:

Main: Added a IGuestOSType::platformArchitecture attribute for returning the guest OS' platform architecture. bugref:5936

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

Legend:

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

    r101169 r101171  
    1351913519  <interface
    1352013520    name="IGuestOSType" extends="$unknown"
    13521     uuid="858fc38e-efe6-47d0-b6ac-c71023f9d043"
     13521    uuid="4799a50c-9451-4cbe-b80b-73df6c21ac06"
    1352213522    wsmap="struct"
    1352313523    rest="managed"
     
    1355013550    <attribute name="is64Bit" type="boolean" readonly="yes">
    1355113551      <desc>Returns @c true if the given OS is 64-bit</desc>
     13552    </attribute>
     13553
     13554    <attribute name="platformArchitecture" type="PlatformArchitecture" readonly="yes">
     13555      <desc>Returns the guest OS platform architecture.</desc>
    1355213556    </attribute>
    1355313557
  • trunk/src/VBox/Main/include/GuestOSTypeImpl.h

    r101164 r101171  
    7474    HRESULT getDescription(com::Utf8Str &aDescription);
    7575    HRESULT getIs64Bit(BOOL *aIs64Bit);
     76    HRESULT getPlatformArchitecture(PlatformArchitecture_T *aPlatformArchitecture);
    7677    HRESULT getRecommendedIOAPIC(BOOL *aRecommendedIOAPIC);
    7778    HRESULT getRecommendedVirtEx(BOOL *aRecommendedVirtEx);
  • trunk/src/VBox/Main/src-server/GuestOSTypeImpl.cpp

    r101164 r101171  
    208208}
    209209
     210HRESULT GuestOSType::getPlatformArchitecture(PlatformArchitecture_T *aPlatformArchitecture)
     211{
     212    /* mOSType constant during life time, no need to lock */
     213    VBOXOSTYPE const osTypePlatformArchitectureMasked = VBOXOSTYPE(mOSType & VBOXOSTYPE_ArchitectureMask);
     214    if (   osTypePlatformArchitectureMasked & VBOXOSTYPE_x86
     215        || osTypePlatformArchitectureMasked & VBOXOSTYPE_x64)
     216        *aPlatformArchitecture = PlatformArchitecture_x86;
     217    else if (   osTypePlatformArchitectureMasked & VBOXOSTYPE_arm32
     218             || 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
     226    return S_OK;
     227}
     228
    210229HRESULT GuestOSType::getRecommendedIOAPIC(BOOL *aRecommendedIOAPIC)
    211230{
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