VirtualBox

Changeset 107099 in vbox


Ignore:
Timestamp:
Nov 22, 2024 1:44:29 AM (8 weeks ago)
Author:
vboxsync
Message:

IPRT: Adding RTArchValToString and RTSystemGetNativeArch for detecting win.amd64 binaries running in an emulator in win.arm64 and suchlike. jiraref:VBP-1466

Location:
trunk
Files:
4 added
4 edited

Legend:

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

    r107064 r107099  
    425425# define RTAcpiTblUuidAppend                            RT_MANGLER(RTAcpiTblUuidAppend)
    426426# define RTAcpiTblUuidAppendFromStr                     RT_MANGLER(RTAcpiTblUuidAppendFromStr)
     427# define RTArchValToString                              RT_MANGLER(RTArchValToString)
    427428# define RTAssertAreQuiet                               RT_MANGLER(RTAssertAreQuiet)
    428429# define RTAssertMayPanic                               RT_MANGLER(RTAssertMayPanic)
     
    25102511# define RTSymlinkRead                                  RT_MANGLER(RTSymlinkRead)
    25112512# define RTSymlinkReadA                                 RT_MANGLER(RTSymlinkReadA)
     2513# define RTSystemGetNativeArch                          RT_MANGLER(RTSystemGetNativeArch)
    25122514# define RTSystemGetPageSize                            RT_MANGLER(RTSystemGetPageSize)
    25132515# define RTSystemGetPageOffsetMask                      RT_MANGLER(RTSystemGetPageOffsetMask)
  • trunk/include/iprt/system.h

    r106061 r107099  
    192192 */
    193193RTDECL(size_t) RTSystemPageAlignSize(size_t cb);
     194
     195
     196/**
     197 * Get the architecture the OS is actually running on.
     198 *
     199 * This bypasses WoW64, Rosetta(2), and similar application compatibility
     200 * emulators.
     201 *
     202 * @returns RT_ARCH_VAL_XXX
     203 *
     204 * @sa      RTArchValToString
     205 */
     206RTDECL(uint32_t) RTSystemGetNativeArch(void);
    194207
    195208
  • trunk/src/VBox/Runtime/Makefile.kmk

    r106949 r107099  
    585585        common/log/RTLogCreateEx.cpp \
    586586        common/math/bignum.cpp \
     587        common/misc/RTArchValToString.cpp \
    587588        common/misc/RTAssertMsg1Weak.cpp \
    588589        common/misc/RTAssertMsg2.cpp \
     
    10881089        r3/win/RTLocaleQueryNormalizedBaseLocaleName-win.cpp \
    10891090        r3/win/RTLocaleQueryUserCountryCode-win.cpp \
     1091        r3/win/RTSystemGetNativeArch-win.cpp \
    10901092        r3/win/RTSystemQueryOSInfo-win.cpp \
    10911093        r3/win/RTSystemShutdown-win.cpp \
     
    11721174        r3/generic/RTLocaleQueryNormalizedBaseLocaleName-r3-generic.cpp \
    11731175        r3/generic/RTLocaleQueryUserCountryCode-r3-generic.cpp \
     1176        r3/generic/RTSystemGetNativeArch-r3-generic.cpp \
    11741177        r3/generic/dirrel-r3-generic.cpp \
    11751178        r3/posix/allocex-r3-posix.cpp \
     
    13191322        r3/generic/RTLocaleQueryNormalizedBaseLocaleName-r3-generic.cpp \
    13201323        r3/generic/RTLocaleQueryUserCountryCode-r3-generic.cpp \
     1324        r3/generic/RTSystemGetNativeArch-r3-generic.cpp \
    13211325        r3/generic/RTTimeZoneGetCurrent-generic.cpp \
    13221326        r3/generic/dirrel-r3-generic.cpp \
     
    14091413        r3/generic/RTLocaleQueryNormalizedBaseLocaleName-r3-generic.cpp \
    14101414        r3/generic/RTLocaleQueryUserCountryCode-r3-generic.cpp \
     1415        r3/generic/RTSystemGetNativeArch-r3-generic.cpp \
    14111416        r3/generic/dirrel-r3-generic.cpp \
    14121417        r3/posix/RTFileQueryFsSizes-posix.cpp \
     
    15121517        r3/generic/RTLocaleQueryNormalizedBaseLocaleName-r3-generic.cpp \
    15131518        r3/generic/RTLocaleQueryUserCountryCode-r3-generic.cpp \
     1519        r3/generic/RTSystemGetNativeArch-r3-generic.cpp \
    15141520        r3/generic/dirrel-r3-generic.cpp \
    15151521        r3/posix/RTFileQueryFsSizes-posix.cpp \
     
    15961602        r3/generic/RTLocaleQueryNormalizedBaseLocaleName-r3-generic.cpp \
    15971603        r3/generic/RTLocaleQueryUserCountryCode-r3-generic.cpp \
     1604        r3/generic/RTSystemGetNativeArch-r3-generic.cpp \
    15981605        r3/generic/dirrel-r3-generic.cpp \
    15991606        r3/posix/RTFileQueryFsSizes-posix.cpp \
     
    16721679        r3/generic/RTLocaleQueryNormalizedBaseLocaleName-r3-generic.cpp \
    16731680        r3/generic/RTLocaleQueryUserCountryCode-r3-generic.cpp \
     1681        r3/generic/RTSystemGetNativeArch-r3-generic.cpp \
    16741682        r3/generic/dirrel-r3-generic.cpp \
    16751683        r3/posix/RTFileQueryFsSizes-posix.cpp \
     
    17841792        r3/generic/RTLocaleQueryNormalizedBaseLocaleName-r3-generic.cpp \
    17851793        r3/generic/RTLocaleQueryUserCountryCode-r3-generic.cpp \
     1794        r3/generic/RTSystemGetNativeArch-r3-generic.cpp \
    17861795        r3/generic/RTTimeZoneGetCurrent-generic.cpp \
    17871796        r3/generic/dirrel-r3-generic.cpp \
  • trunk/src/VBox/Runtime/r3/nt/fs-nt.cpp

    r106061 r107099  
    185185
    186186                /* figure the remote stuff */
    187                 pProperties->fRemote          = RT_BOOL(FsDevInfo.Characteristics & FILE_REMOTE_DEVICE);
     187                pProperties->fRemote          = (FsDevInfo.Characteristics & FILE_REMOTE_DEVICE)
     188                                             || FsDevInfo.DeviceType == FILE_DEVICE_NETWORK
     189                                             || FsDevInfo.DeviceType == FILE_DEVICE_NETWORK_FILE_SYSTEM;
    188190            }
    189191            else
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