VirtualBox

Changeset 80708 in vbox for trunk/include


Ignore:
Timestamp:
Sep 10, 2019 4:34:49 PM (5 years ago)
Author:
vboxsync
Message:

IPRT: Added RTSystemFirmwareXXX API to query the firmware type / UEFI variables. Only very limited support for Windows for now. Work in progress.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r80585 r80708  
    22172217# define RTSymlinkRead                                  RT_MANGLER(RTSymlinkRead)
    22182218# define RTSymlinkReadA                                 RT_MANGLER(RTSymlinkReadA)
     2219# define RTSystemFirmwareQueryType                      RT_MANGLER(RTSystemFirmwareQueryType)
     2220# define RTSystemFirmwareValueFree                      RT_MANGLER(RTSystemFirmwareValueFree)
     2221# define RTSystemFirmwareValueGet                       RT_MANGLER(RTSystemFirmwareValueGet)
    22192222# define RTSystemIsInsideVM                             RT_MANGLER(RTSystemIsInsideVM)
    22202223# define RTSystemQueryAvailableRam                      RT_MANGLER(RTSystemQueryAvailableRam)
  • trunk/include/iprt/system.h

    r78939 r80708  
    260260RTDECL(bool) RTSystemIsInsideVM(void);
    261261
     262/**
     263 * Enumeration for defining a system's firmware type.
     264 */
     265typedef enum RTSYSFWTYPE
     266{
     267    /** Unknown firmware. */
     268    RTSYSFWTYPE_UNKNOWN = 0,
     269    /** Firmware is BIOS. */
     270    RTSYSFWTYPE_BIOS,
     271    /** Firmware is UEFI. */
     272    RTSYSFWTYPE_UEFI,
     273    /** The usual 32-bit hack.  */
     274    RTSYSFWTYP_32_BIT_HACK = 0x7fffffff
     275} RTSYSFWTYPE;
     276/** Pointer to a system firmware type. */
     277typedef RTSYSFWTYPE *PRTSYSFWTYPE;
     278
     279/**
     280 * Queries the system's firmware type.
     281 *
     282 * @retval  IPRT status code.
     283 * @param   pFirmwareType       Where to store the firmware type on success.
     284 */
     285RTDECL(int) RTSystemFirmwareQueryType(PRTSYSFWTYPE pFirmwareType);
     286
     287/**
     288 * Enumeration for defining a system firmware value type.
     289 */
     290typedef enum RTSYSFWVALUETYPE
     291{
     292    /** Invalid value type. */
     293    RTSYSFWVALUETYPE_INVALID = 0,
     294    /** Value is of type boolean. */
     295    RTSYSFWVALUETYPE_BOOLEAN,
     296    /** The usual 32-bit hack.  */
     297    RTSYSFWVALUETYPE_32_BIT_HACK = 0x7fffffff
     298} RTSYSFWVALUETYPE;
     299
     300/**
     301 * Structure for keeping a system firmware value.
     302 */
     303typedef struct RTSYSFWVALUE
     304{
     305    /** Value type. */
     306    RTSYSFWVALUETYPE enmType;
     307    union
     308    {
     309        /** Boolean value. */
     310        bool fVal;
     311    } u;
     312} RTSYSFWVALUE;
     313/** Pointer to a system firmware value. */
     314typedef RTSYSFWVALUE *PRTSYSFWVALUE;
     315
     316/**
     317 * Enumeration for a system firmware property.
     318 */
     319typedef enum RTSYSFWPRPOP
     320{
     321    /** Invalid property, do not use. */
     322    RTSYSFWPROP_INVALID = 0,
     323    /** @todo Not yet implemented. */
     324    RTSYSFWPROP_BOOT_CURRENT,
     325    /** @todo Not yet implemented. */
     326    RTSYSFWPROP_BOOT_ORDER,
     327    /** @todo Not yet implemented. */
     328    RTSYSFWPROP_BOOT_NEXT,
     329    /** boolean: Whether Secure Boot is enabled or not. */
     330    RTSYSFWPROP_SECURE_BOOT,
     331    /** @todo Not yet implemented. */
     332    RTSYSFWPROP_TIMEOUT,
     333    /** @todo Not yet implemented. */
     334    RTSYSFWPROP_PLATFORM_LANG,
     335    /** The usual 32-bit hack.  */
     336    RTSYSFWPROP_32_BIT_HACK = 0x7fffffff
     337} RTSYSFWPROP;
     338
     339RTDECL(int) RTSystemFirmwareValueGet(RTSYSFWPROP enmProp, PRTSYSFWVALUE *ppValue);
     340
     341RTDECL(void) RTSystemFirmwareValueFree(PRTSYSFWVALUE pValue);
     342
    262343#ifdef RT_OS_WINDOWS
    263344
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