Changeset 2854 for trunk/kLdr/kLdr.h


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/kLdr.h

    r2851 r2854  
    341341    /** Variable free to use for the kLdr user. */
    342342    void           *pvUser;
    343     /** The segment name. */
    344     const char     *pszName;
     343    /** The segment name. (Might not be zero terminated!) */
     344    const char     *pchName;
     345    /** The length of the segment name. */
     346    uint32_t        cchName;
    345347    /** The size of the segment. */
    346348    KLDRSIZE        cb;
    347     /** The link time load address. */
     349    /** The required segment alignment. */
     350    KLDRADDR        Alignment;
     351    /** The link address.
     352     * Set to NIL_KLDRADDR if the segment isn't supposed to be mapped. */
    348353    KLDRADDR        LinkAddress;
    349354    /** The address the segment was mapped at by kLdrModMap().
     
    569574     * Not meant for calling directly thru! */
    570575    PCKLDRMODOPS        pOps;
     576    /** Pointer to the read instance. (Can be NULL after kLdrModDone().)*/
     577    PKLDRRDR            pRdr;
    571578    /** The module data. */
    572579    void               *pvData;
     
    617624/** Weak symbol. */
    618625#define KLDRSYMKIND_WEAK                    0x00000100
     626/** Forwarder symbol. */
     627#define KLDRSYMKIND_FORWARDER               0x00000200
    619628/** @} */
    620629
     
    691700
    692701int     kLdrModQuerySymbol(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t uSymbol,
    693                            const char *pszSymbol, PKLDRADDR puValue, uint32_t *pfKind);
    694 int     kLdrModEnumSymbols(PKLDRMOD pMod, uint32_t fFlags, const void *pvBits, KLDRADDR BaseAddress,
    695                            PFNKLDRMODENUMSYMS pfnCallback, void *pvUser);
     702                           const char *pszSymbol, PFNKLDRMODGETIMPORT pfnGetForwarder, void *pvUser,
     703                           PKLDRADDR puValue, uint32_t *pfKind);
     704int     kLdrModEnumSymbols(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress,
     705                           uint32_t fFlags, PFNKLDRMODENUMSYMS pfnCallback, void *pvUser);
    696706int     kLdrModGetImport(PKLDRMOD pMod, void *pvBits, uint32_t iImport, const char *pszName, size_t cchName);
    697707int32_t kLdrModNumberOfImports(PKLDRMOD pMod, void *pvBits);
     
    761771    /** @copydoc kLdrModQuerySymbol */
    762772    int (* pfnQuerySymbol)(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t uSymbol,
    763                            const char *pszSymbol, PKLDRADDR puValue, uint32_t *pfKind);
     773                           const char *pszSymbol, PFNKLDRMODGETIMPORT pfnGetForwarder, void *pvUser,
     774                           PKLDRADDR puValue, uint32_t *pfKind);
    764775    /** @copydoc kLdrModEnumSymbols */
    765     int (* pfnEnumSymbols)(PKLDRMOD pMod, uint32_t fFlags, const void *pvBits, KLDRADDR BaseAddress,
     776    int (* pfnEnumSymbols)(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t fFlags,
    766777                           PFNKLDRMODENUMSYMS pfnCallback, void *pvUser);
    767778    /** @copydoc kLdrModGetImport */
     
    10161027/** Symbol not found. */
    10171028#define KLDR_ERR_SYMBOL_NOT_FOUND                           (KLDR_ERR_BASE + 46)
    1018 
     1029/** A forward symbol was encountered but the caller didn't provide any means to resolve it. */
     1030#define KLDR_ERR_FORWARDER_SYMBOL                           (KLDR_ERR_BASE + 47)
    10191031/** Encountered a bad fixup. */
    10201032#define KLDR_ERR_BAD_FIXUP                                  (KLDR_ERR_BASE + 48)
    1021 
    10221033/** A memory allocation failed. */
    1023 #define KLDR_ERR_NO_MEMORY                                  (KLDR_ERR_BASE + 64)
     1034#define KLDR_ERR_NO_MEMORY                                  (KLDR_ERR_BASE + 49)
     1035
     1036
     1037/** @name kLdrModPE status codes
     1038 * @{ */
     1039#define KLDR_ERR_BASE_PE                                    (KLDR_ERR_BASE + 96)
     1040/** The machine isn't supported by the interpreter. */
     1041#define KLDR_ERR_PE_UNSUPPORTED_MACHINE                     (KLDR_ERR_BASE_PE + 0)
     1042/** The file handler isn't valid. */
     1043#define KLDR_ERR_PE_BAD_FILE_HEADER                         (KLDR_ERR_BASE_PE + 1)
     1044/** The the optional headers isn't valid. */
     1045#define KLDR_ERR_PE_BAD_OPTIONAL_HEADER                     (KLDR_ERR_BASE_PE + 2)
     1046/** One of the section headers aren't valid. */
     1047#define KLDR_ERR_PE_BAD_SECTION_HEADER                      (KLDR_ERR_BASE_PE + 3)
     1048/** Bad forwarder entry. */
     1049#define KLDR_ERR_PE_BAD_FORWARDER                           (KLDR_ERR_BASE_PE + 4)
     1050/** Forwarder module not found in the import descriptor table. */
     1051#define KLDR_ERR_PE_FORWARDER_IMPORT_NOT_FOUND              (KLDR_ERR_BASE_PE + 5)
     1052/** @} */
     1053
    10241054
    10251055/** @} */
Note: See TracChangeset for help on using the changeset viewer.