VirtualBox

Changeset 91633 in vbox


Ignore:
Timestamp:
Oct 8, 2021 8:42:00 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147358
Message:

IPRT/dbg.h,dbgkrnlinfo-r0drv-nt.cpp: Added a few pseudo symbols to the NT kernel debug info provider to expose some basic module info (simpler than adding dedicated APIs for each of them). bugref:10118

Location:
trunk
Files:
2 edited

Legend:

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

    r89971 r91633  
    19621962 *
    19631963 * @param   hKrnlInfo       The kernel info handle.
    1964  * @param   pszModule       Reserved for future extensions. Pass NULL.
     1964 * @param   pszModule       The name of the module to search, pass NULL to
     1965 *                          search the default kernel module(s).
    19651966 * @param   pszSymbol       The C name of the symbol.
     1967 *                          On Windows NT there are the following special symbols:
     1968 *                              - __ImageBase: The base address of the module.
     1969 *                              - __ImageSize: The size of the module.
     1970 *                              - __ImageNtHdrs: Address of the NT headers.
    19661971 * @param   ppvSymbol       Where to return the symbol value, passing NULL is
    19671972 *                          OK. This may be modified even on failure, in
     
    19801985 *          or something.
    19811986 * @param   hKrnlInfo       The kernel info handle.
    1982  * @param   pszModule       Reserved for future extensions. Pass NULL.
     1987 * @param   pszModule       The name of the module to search, pass NULL to
     1988 *                          search the default kernel module(s).
    19831989 * @param   pszSymbol       The C name of the symbol.
     1990 *                          On Windows NT there are the following special symbols:
     1991 *                              - __ImageBase: The base address of the module.
     1992 *                              - __ImageSize: The size of the module.
     1993 *                              - __ImageNtHdrs: Address of the NT headers.
    19841994 * @sa      RTR0DbgKrnlInfoQuerySymbol, RTLdrGetSymbol
    19851995 */
  • trunk/src/VBox/Runtime/r0drv/nt/dbgkrnlinfo-r0drv-nt.cpp

    r85906 r91633  
    170170    if (pModInfo->fOkay)
    171171    {
     172        /*
     173         * Pseudo symbols:
     174         */
     175        if (   pszSymbol[0] == '_'
     176            && pszSymbol[1] == '_'
     177            && pszSymbol[2] == 'I')
     178        {
     179            if (strcmp(pszSymbol, "__ImageBase") == 0)
     180            {
     181                *ppvSymbol = (void *)pModInfo->pbImageBase;
     182                return VINF_SUCCESS;
     183            }
     184            if (strcmp(pszSymbol, "__ImageSize") == 0)
     185            {
     186                *ppvSymbol = (void *)(uintptr_t)pModInfo->cbImage;
     187                return VINF_SUCCESS;
     188            }
     189            if (strcmp(pszSymbol, "__ImageNtHdrs") == 0)
     190            {
     191                *ppvSymbol = pModInfo->pNtHdrs;
     192                return VINF_SUCCESS;
     193            }
     194        }
     195
    172196        /*
    173197         * Binary search.
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