Changeset 2854 for trunk/kLdr/kLdrMod.c


Ignore:
Timestamp:
Nov 3, 2006, 4:39:12 AM (19 years ago)
Author:
bird
Message:

Hacking away on the PE module interpreter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/kLdrMod.c

    r2851 r2854  
    22/** @file
    33 *
    4  * kLdr - The Dynamic Loader, The module interpreter.
     4 * kLdr - The Module Interpreter.
    55 *
    66 * Copyright (c) 2006 knut st. osmundsen <bird-kbuild-src@anduin.net>
     
    262262 * @param   uSymbol         The symbol ordinal. (optional)
    263263 * @param   pszSymbol       The symbol name. (optional)
     264 * @param   pfnGetForwarder The callback to use when resolving a forwarder symbol. This is optional
     265 *                          and if not specified KLDR_ERR_FORWARDER is returned instead.
     266 * @param   pvUser          The user argument for the pfnGetForwarder callback.
    264267 * @param   puValue         Where to store the symbol value. (optional)
    265268 * @param   pfKind          Where to store the symbol kind. (optional)
    266269 */
    267270int     kLdrModQuerySymbol(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t uSymbol,
    268                            const char *pszSymbol, PKLDRADDR puValue, uint32_t *pfKind)
     271                           const char *pszSymbol, PFNKLDRMODGETIMPORT pfnGetForwarder, void *pvUser,
     272                           PKLDRADDR puValue, uint32_t *pfKind)
    269273{
    270274    KLDRMOD_VALIDATE(pMod);
     
    275279    if (pfKind)
    276280        *pfKind = 0;
    277     return pMod->pOps->pfnDestroy(pMod);
     281    return pMod->pOps->pfnQuerySymbol(pMod, pvBits, BaseAddress, uSymbol, pszSymbol, pfnGetForwarder, pvUser, puValue, pfKind);
    278282}
    279283
     
    284288 * @returns 0 on success and non-zero a status code on failure.
    285289 * @param   pMod            The module which symbols should be enumerated.
    286  * @param   fFlags          The enumeration flags. A combination of the KLDRMOD_ENUM_SYMS_FLAGS_* \#defines.
    287290 * @param   pvBits          Optional pointer to bits returned by kLdrModGetBits() currently located at BaseAddress.
    288291 *                          This can be used by some module interpreters to reduce memory consumption.
     
    290293 *                          There are two special values that could be can:
    291294 *                              KLDRMOD_BASEADDRESS_LINK and KLDRMOD_BASEADDRESS_MAP.
     295 * @param   fFlags          The enumeration flags. A combination of the KLDRMOD_ENUM_SYMS_FLAGS_* \#defines.
    292296 * @param   pfnCallback     The enumeration callback function.
    293297 * @param   pvUser          The user argument to the callback function.
    294298 */
    295 int     kLdrModEnumSymbols(PKLDRMOD pMod, uint32_t fFlags, const void *pvBits, KLDRADDR BaseAddress,
     299int     kLdrModEnumSymbols(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t fFlags,
    296300                           PFNKLDRMODENUMSYMS pfnCallback, void *pvUser)
    297301{
    298302    KLDRMOD_VALIDATE(pMod);
    299303    KLDRHLP_VALIDATE_FLAGS(fFlags, KLDRMOD_ENUM_SYMS_FLAGS_ALL);
    300     return pMod->pOps->pfnEnumSymbols(pMod, fFlags, pvBits, BaseAddress, pfnCallback, pvUser);
     304    return pMod->pOps->pfnEnumSymbols(pMod, pvBits, BaseAddress, fFlags, pfnCallback, pvUser);
    301305}
    302306
Note: See TracChangeset for help on using the changeset viewer.