VirtualBox

Ignore:
Timestamp:
Jul 9, 2020 12:05:45 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139069
Message:

SUPLib: Make the suplibOs* hidden. bugref:9794

Location:
trunk/src/VBox/HostDrivers/Support
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h

    r85128 r85129  
    112112#if defined(IN_SUP_HARDENED_R3) && defined(RT_OS_WINDOWS)
    113113# define SUP_HARDENED_NEED_CRT_FUNCTIONS
    114 DECLHIDDEN(int)    suplibHardenedMemComp(void const *pvDst, const void *pvSrc, size_t cbToComp);
    115 DECLHIDDEN(void *) suplibHardenedMemCopy(void *pvDst, const void *pvSrc, size_t cbToCopy);
    116 DECLHIDDEN(void *) suplibHardenedMemSet(void *pvDst, int ch, size_t cbToSet);
    117 DECLHIDDEN(char *) suplibHardenedStrCopy(char *pszDst, const char *pszSrc);
    118 DECLHIDDEN(size_t) suplibHardenedStrLen(const char *psz);
    119 DECLHIDDEN(char *) suplibHardenedStrCat(char *pszDst, const char *pszSrc);
    120 DECLHIDDEN(int)    suplibHardenedStrCmp(const char *psz1, const char *psz2);
    121 DECLHIDDEN(int)    suplibHardenedStrNCmp(const char *psz1, const char *psz2, size_t cchMax);
     114DECLHIDDEN(int)     suplibHardenedMemComp(void const *pvDst, const void *pvSrc, size_t cbToComp);
     115DECLHIDDEN(void *)  suplibHardenedMemCopy(void *pvDst, const void *pvSrc, size_t cbToCopy);
     116DECLHIDDEN(void *)  suplibHardenedMemSet(void *pvDst, int ch, size_t cbToSet);
     117DECLHIDDEN(char *)  suplibHardenedStrCopy(char *pszDst, const char *pszSrc);
     118DECLHIDDEN(size_t)  suplibHardenedStrLen(const char *psz);
     119DECLHIDDEN(char *)  suplibHardenedStrCat(char *pszDst, const char *pszSrc);
     120DECLHIDDEN(int)     suplibHardenedStrCmp(const char *psz1, const char *psz2);
     121DECLHIDDEN(int)     suplibHardenedStrNCmp(const char *psz1, const char *psz2, size_t cchMax);
    122122#else
    123123# undef SUP_HARDENED_NEED_CRT_FUNCTIONS
     
    132132#endif
    133133DECLHIDDEN(DECL_NO_RETURN(void)) suplibHardenedExit(RTEXITCODE rcExit);
    134 DECLHIDDEN(void)   suplibHardenedPrintF(const char *pszFormat, ...);
    135 DECLHIDDEN(void)   suplibHardenedPrintFV(const char *pszFormat, va_list va);
     134DECLHIDDEN(void)    suplibHardenedPrintF(const char *pszFormat, ...);
     135DECLHIDDEN(void)    suplibHardenedPrintFV(const char *pszFormat, va_list va);
    136136
    137137/** @} */
     
    357357*******************************************************************************/
    358358RT_C_DECLS_BEGIN
    359 int     suplibOsInstall(void);
    360 int     suplibOsUninstall(void);
    361 int     suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo);
    362 int     suplibOsTerm(PSUPLIBDATA pThis);
    363 int     suplibOsHardenedVerifyInit(void);
    364 int     suplibOsHardenedVerifyTerm(void);
    365 int     suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq);
    366 int     suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu);
    367 int     suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages);
    368 int     suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages);
    369 int     suplibOsQueryVTxSupported(const char **ppszWhy);
    370 bool    suplibOsIsNemSupportedWhenNoVtxOrAmdV(void);
     359DECLHIDDEN(int)     suplibOsInstall(void);
     360DECLHIDDEN(int)     suplibOsUninstall(void);
     361DECLHIDDEN(int)     suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo);
     362DECLHIDDEN(int)     suplibOsTerm(PSUPLIBDATA pThis);
     363DECLHIDDEN(int)     suplibOsHardenedVerifyInit(void);
     364DECLHIDDEN(int)     suplibOsHardenedVerifyTerm(void);
     365DECLHIDDEN(int)     suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq);
     366DECLHIDDEN(int)     suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu);
     367DECLHIDDEN(int)     suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages);
     368DECLHIDDEN(int)     suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages);
     369DECLHIDDEN(int)     suplibOsQueryVTxSupported(const char **ppszWhy);
     370DECLHIDDEN(bool)    suplibOsIsNemSupportedWhenNoVtxOrAmdV(void);
    371371
    372372
     
    401401 */
    402402DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc,
    403                                                                  const char *pszMsgFmt, va_list va);
     403                                                        const char *pszMsgFmt, va_list va);
    404404
    405405/**
     
    407407 */
    408408DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc,
    409                                                                 const char *pszMsgFmt, ...);
     409                                                       const char *pszMsgFmt, ...);
    410410
    411411/**
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp

    r82968 r85129  
    187187
    188188
    189 int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
     189DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
    190190{
    191191    RT_NOREF(penmWhat, pErrInfo);
     
    221221
    222222
    223 int suplibOsTerm(PSUPLIBDATA pThis)
     223DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis)
    224224{
    225225    /*
     
    254254#ifndef IN_SUP_HARDENED_R3
    255255
    256 int suplibOsInstall(void)
     256DECLHIDDEN(int) suplibOsInstall(void)
    257257{
    258258    return VERR_NOT_IMPLEMENTED;
     
    260260
    261261
    262 int suplibOsUninstall(void)
     262DECLHIDDEN(int) suplibOsUninstall(void)
    263263{
    264264    return VERR_NOT_IMPLEMENTED;
     
    266266
    267267
    268 int suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
     268DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
    269269{
    270270    RT_NOREF(cbReq);
     
    275275
    276276
    277 int suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
     277DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
    278278{
    279279    int rc = ioctl(pThis->hDevice, uFunction, idCpu);
     
    284284
    285285
    286 int suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
     286DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
    287287{
    288288    NOREF(pThis);
     
    297297
    298298
    299 int suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */)
     299DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */)
    300300{
    301301    NOREF(pThis);
  • trunk/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp

    r82968 r85129  
    6868
    6969
    70 int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
     70DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
    7171{
    7272    /*
     
    120120
    121121
    122 int suplibOsTerm(PSUPLIBDATA pThis)
     122DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis)
    123123{
    124124    /*
     
    137137#ifndef IN_SUP_HARDENED_R3
    138138
    139 int suplibOsInstall(void)
     139DECLHIDDEN(int) suplibOsInstall(void)
    140140{
    141141    return VERR_NOT_IMPLEMENTED;
     
    143143
    144144
    145 int suplibOsUninstall(void)
     145DECLHIDDEN(int) suplibOsUninstall(void)
    146146{
    147147    return VERR_NOT_IMPLEMENTED;
     
    149149
    150150
    151 int suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
     151DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
    152152{
    153153    if (RT_LIKELY(ioctl(pThis->hDevice, uFunction, pvReq) >= 0))
     
    157157
    158158
    159 int suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
     159DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
    160160{
    161161    int rc = ioctl(pThis->hDevice, uFunction, idCpu);
     
    166166
    167167
    168 int suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
     168DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
    169169{
    170170    NOREF(pThis);
     
    176176
    177177
    178 int suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages)
     178DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages)
    179179{
    180180    NOREF(pThis);
  • trunk/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp

    r82968 r85129  
    7676
    7777
    78 int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
     78DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
    7979{
    8080    RT_NOREF2(penmWhat, pErrInfo);
     
    146146
    147147
    148 int suplibOsTerm(PSUPLIBDATA pThis)
     148DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis)
    149149{
    150150    /*
     
    164164#ifndef IN_SUP_HARDENED_R3
    165165
    166 int suplibOsInstall(void)
     166DECLHIDDEN(int) suplibOsInstall(void)
    167167{
    168168    // nothing to do on Linux
     
    171171
    172172
    173 int suplibOsUninstall(void)
     173DECLHIDDEN(int) suplibOsUninstall(void)
    174174{
    175175    // nothing to do on Linux
     
    178178
    179179
    180 int suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
     180DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
    181181{
    182182    AssertMsg(pThis->hDevice != (intptr_t)NIL_RTFILE, ("SUPLIB not initiated successfully!\n"));
     
    208208
    209209
    210 int suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
     210DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
    211211{
    212212    int rc = ioctl(pThis->hDevice, uFunction, idCpu);
     
    217217
    218218
    219 int suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
     219DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
    220220{
    221221    size_t cbMmap = (pThis->fSysMadviseWorks ? cPages : cPages + 2) << PAGE_SHIFT;
     
    252252
    253253
    254 int suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages)
     254DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages)
    255255{
    256256    NOREF(pThis);
     
    269269 * @param   ppszWhy         Where to return explanatory message.
    270270 */
    271 int suplibOsQueryVTxSupported(const char **ppszWhy)
     271DECLHIDDEN(int) suplibOsQueryVTxSupported(const char **ppszWhy)
    272272{
    273273    char szBuf[256];
  • trunk/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp

    r82968 r85129  
    6565
    6666
    67 int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
     67DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
    6868{
    6969    /*
     
    105105
    106106
    107 int suplibOsTerm(PSUPLIBDATA pThis)
     107DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis)
    108108{
    109109    /*
     
    123123#ifndef IN_SUP_HARDENED_R3
    124124
    125 int suplibOsInstall(void)
     125DECLHIDDEN(int) suplibOsInstall(void)
    126126{
    127127    /** @remark OS/2: Not supported */
     
    130130
    131131
    132 int suplibOsUninstall(void)
     132DECLHIDDEN(int) suplibOsUninstall(void)
    133133{
    134134    /** @remark OS/2: Not supported */
     
    137137
    138138
    139 int suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
     139DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
    140140{
    141141    ULONG cbReturned = sizeof(SUPREQHDR);
     
    149149
    150150
    151 int suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
     151DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
    152152{
    153153    NOREF(idCpu);
     
    164164
    165165
    166 int suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
     166DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
    167167{
    168168    NOREF(pThis);
     
    179179
    180180
    181 int suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */)
     181DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */)
    182182{
    183183    NOREF(pThis);
  • trunk/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp

    r82968 r85129  
    7979
    8080
    81 int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
     81DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
    8282{
    8383    /*
     
    154154
    155155
    156 int suplibOsTerm(PSUPLIBDATA pThis)
     156DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis)
    157157{
    158158    /*
     
    184184#ifndef IN_SUP_HARDENED_R3
    185185
    186 int suplibOsInstall(void)
     186DECLHIDDEN(int) suplibOsInstall(void)
    187187{
    188188    return VERR_NOT_IMPLEMENTED;
    189189}
    190190
    191 int suplibOsUninstall(void)
     191DECLHIDDEN(int) suplibOsUninstall(void)
    192192{
    193193    return VERR_NOT_IMPLEMENTED;
     
    195195
    196196
    197 int suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
     197DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
    198198{
    199199    if (RT_LIKELY(ioctl(pThis->hDevice, uFunction, pvReq) >= 0))
     
    203203
    204204
    205 int suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
     205DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
    206206{
    207207    int rc = ioctl(pThis->hDevice, uFunction, idCpu);
     
    212212
    213213
    214 int suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
     214DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
    215215{
    216216    NOREF(pThis);
     
    225225
    226226
    227 int suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages)
     227DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages)
    228228{
    229229    NOREF(pThis);
  • trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp

    r84054 r85129  
    9292
    9393
    94 int suplibOsHardenedVerifyInit(void)
     94DECLHIDDEN(int) suplibOsHardenedVerifyInit(void)
    9595{
    9696    if (!g_fHardenedVerifyInited)
     
    109109
    110110
    111 int suplibOsHardenedVerifyTerm(void)
     111DECLHIDDEN(int) suplibOsHardenedVerifyTerm(void)
    112112{
    113113    /** @todo free resources...  */
     
    116116
    117117
    118 int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
     118DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)
    119119{
    120120    /*
     
    273273#ifndef IN_SUP_HARDENED_R3
    274274
    275 int suplibOsInstall(void)
     275DECLHIDDEN(int) suplibOsInstall(void)
    276276{
    277277    int rc = suplibOsCreateService();
     
    286286
    287287
    288 int suplibOsUninstall(void)
     288DECLHIDDEN(int) suplibOsUninstall(void)
    289289{
    290290    int rc = suplibOsStopService();
     
    648648
    649649
    650 int suplibOsTerm(PSUPLIBDATA pThis)
     650DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis)
    651651{
    652652    /*
     
    666666#ifndef IN_SUP_HARDENED_R3
    667667
    668 int suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
     668DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)
    669669{
    670670    RT_NOREF1(cbReq);
     
    698698
    699699
    700 int suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
     700DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)
    701701{
    702702    /*
     
    725725
    726726
    727 int suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
     727DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)
    728728{
    729729    NOREF(pThis);
     
    735735
    736736
    737 int suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */)
     737DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */)
    738738{
    739739    NOREF(pThis);
     
    744744
    745745
    746 bool suplibOsIsNemSupportedWhenNoVtxOrAmdV(void)
     746DECLHIDDEN(bool) suplibOsIsNemSupportedWhenNoVtxOrAmdV(void)
    747747{
    748748# if ARCH_BITS == 64
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette