VirtualBox

Changeset 86300 in vbox for trunk/include


Ignore:
Timestamp:
Sep 26, 2020 9:59:44 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140580
Message:

Runtime: Add API to load kernel modules by name and add simple implementation for macOS, bugref:9836

Location:
trunk/include/iprt
Files:
2 edited

Legend:

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

    r82968 r86300  
    152152                                         PRTKRNLMODINFO phKrnlModInfoRef);
    153153
     154/**
     155 * Tries to load a kernel module by the given name.
     156 *
     157 * @returns IPRT status code.
     158 * @retval  VERR_NOT_SUPPORTED if not supported by or implemented for the platform.
     159 * @param   pszName         The name of the kernel module. This is highly platform
     160 *                          dependent.
     161 *
     162 * @note On macOS for example the name is the bundle ID.
     163 */
     164RTDECL(int) RTKrnlModLoadByName(const char *pszName);
     165
     166/**
     167 * Tries to load a kernel module by the given file path.
     168 *
     169 * @returns IPRT status code.
     170 * @retval  VERR_NOT_SUPPORTED if not supported by or implemented for the platform.
     171 * @param   pszPath         The path of the kernel module.
     172 */
     173RTDECL(int) RTKrnlModLoadByPath(const char *pszPath);
     174
     175/**
     176 * Tries to unload a kernel module by the given name.
     177 *
     178 * @returns IPRT status code.
     179 * @param   pszName         The name of the kernel module. This is highly platform
     180 *                          dependent and should be queried with RTKrnlModInfoGetName()
     181 *                          when checking whether the module was actually loaded.
     182 *
     183 * @note On macOS for example the name is the bundle ID.
     184 */
     185RTDECL(int) RTKrnlModUnloadByName(const char *pszName);
     186
    154187/** @} */
    155188
  • trunk/include/iprt/mangling.h

    r86296 r86300  
    12261226# define RTKrnlModInfoRetain                            RT_MANGLER(RTKrnlModInfoRetain)
    12271227# define RTKrnlModInfoRelease                           RT_MANGLER(RTKrnlModInfoRelease)
     1228# define RTKrnlModLoadByName                            RT_MANGLER(RTKrnlModLoadByName)
     1229# define RTKrnlModLoadByPath                            RT_MANGLER(RTKrnlModLoadByPath)
    12281230# define RTKrnlModLoadedGetCount                        RT_MANGLER(RTKrnlModLoadedGetCount)
    12291231# define RTKrnlModLoadedQueryInfo                       RT_MANGLER(RTKrnlModLoadedQueryInfo)
    12301232# define RTKrnlModLoadedQueryInfoAll                    RT_MANGLER(RTKrnlModLoadedQueryInfoAll)
    12311233# define RTKrnlModQueryLoaded                           RT_MANGLER(RTKrnlModQueryLoaded)
     1234# define RTKrnlModUnloadByName                          RT_MANGLER(RTKrnlModUnloadByName)
    12321235# define RTLatin1CalcUtf16Len                           RT_MANGLER(RTLatin1CalcUtf16Len)
    12331236# define RTLatin1CalcUtf16LenEx                         RT_MANGLER(RTLatin1CalcUtf16LenEx)
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