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

static int kldrModLXDoNameLookup ( PKLDRMODLX  pModLX,
const char *  pchSymbol,
KU32  cchSymbol,
KU32 *  piSymbol 
) [static]

Do name lookup.

Returns:
See kLdrModQuerySymbol.
Parameters:
pModLX The module to lookup the symbol in.
pchSymbol The symbol to lookup.
cchSymbol The symbol name length.
piSymbol Where to store the symbol ordinal.

Todo:
hash name table for speed.

Todo:
non-resident name table.

Definition at line 708 of file kLdrModLX.c.

References KLDR_ERR_SYMBOL_NOT_FOUND, kldrModLXDoNameTableLookupByName(), KLDRMODLX::pbLoaderSectionLast, KLDRMODLX::pbNonResNameTab, KLDRMODLX::pbNonResNameTabLast, and KLDRMODLX::pbResNameTab.

Referenced by kldrModLXQuerySymbol().

{

    /*
     * First do a hash table lookup.
     */
    /** @todo hash name table for speed. */

    /*
     * Search the name tables.
     */
    const KU8 *pbName = kldrModLXDoNameTableLookupByName(pModLX->pbResNameTab,
                                                         pModLX->pbLoaderSectionLast - pModLX->pbResNameTab + 1,
                                                         pchSymbol, cchSymbol);
    if (!pbName)
    {
        if (!pModLX->pbNonResNameTab)
        {
            /* lazy load it */
            /** @todo non-resident name table. */
        }
        if (pModLX->pbNonResNameTab)
            pbName = kldrModLXDoNameTableLookupByName(pModLX->pbResNameTab,
                                                      pModLX->pbNonResNameTabLast - pModLX->pbResNameTab + 1,
                                                      pchSymbol, cchSymbol);
    }
    if (!pbName)
        return KLDR_ERR_SYMBOL_NOT_FOUND;

    *piSymbol = *(const KU16 *)(pbName + 1 + *pbName);
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index