Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

int kLdrModQuerySymbol ( PKLDRMOD  pMod,
const void *  pvBits,
KLDRADDR  BaseAddress,
KU32  iSymbol,
const char *  pchSymbol,
KSIZE  cchSymbol,
const char *  pszVersion,
PFNKLDRMODGETIMPORT  pfnGetForwarder,
void *  pvUser,
PKLDRADDR  puValue,
KU32 *  pfKind 
)

Queries a symbol by name or ordinal number.

Returns:
0 and *puValue and *pfKind on success. KLDR_ERR_SYMBOL_NOT_FOUND is returned if the symbol wasn't found. Other failures could stem from bad executable format failures, read failure in case pvBits isn't specified and no mapping should be used.
Parameters:
pMod The module.
pvBits Optional pointer to bits returned by kLdrModGetBits() currently located at BaseAddress. This can be used by some module interpreters to reduce memory consumption.
BaseAddress The module base address to use when calculating the symbol value. There are two special values that can be used: KLDRMOD_BASEADDRESS_LINK and KLDRMOD_BASEADDRESS_MAP.
iSymbol The symbol ordinal. (optional)
pchSymbol The symbol name. (optional) Important, this doesn't have to be a null-terminated string.
cchSymbol The length of the symbol name.
pszVersion The symbol version. NULL if not versioned.
pfnGetForwarder The callback to use when resolving a forwarder symbol. This is optional and if not specified KLDR_ERR_FORWARDER is returned instead.
pvUser The user argument for the pfnGetForwarder callback.
puValue Where to store the symbol value. (optional)
pfKind On input one of the KLDRSYMKIND_REQ_* defines. On output the symbol kind. (optional)

Definition at line 429 of file kLdrMod.c.

References K_VALIDATE_FLAGS, KERR_INVALID_PARAMETER, KLDRMOD_VALIDATE, KLDRSYMKIND_REQ_SEGMENTED, KLDRMODOPS::pfnQuerySymbol, and KLDRMOD::pOps.

Referenced by BasicTestsEnumSymCallback(), BasicTestsSub2(), kldrDyldModFixupGetImportCallback(), kldrDyldModQuerySymbol(), and TestModule().

{
    KLDRMOD_VALIDATE(pMod);
    if (!puValue && !pfKind)
        return KERR_INVALID_PARAMETER;
    if (puValue)
        *puValue = 0;
    if (pfKind)
        K_VALIDATE_FLAGS(*pfKind, KLDRSYMKIND_REQ_SEGMENTED);
    return pMod->pOps->pfnQuerySymbol(pMod, pvBits, BaseAddress, iSymbol, pchSymbol, cchSymbol, pszVersion,
                                      pfnGetForwarder, pvUser, puValue, pfKind);
}


Generated by  Doxygen 1.6.0   Back to index