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

int kLdrDyldFindByName ( const char *  pszDll,
const char *  pszPrefix,
const char *  pszSuffix,
KLDRDYLDSEARCH  enmSearch,
unsigned  fFlags,
PHKLDRMOD  phMod 
)

Finds a module by name or filename.

This call does not increase any reference counters and must not be paired with kLdrDyldUnload() like kLdrDyldLoad().

Returns:
0 on success.

KLDR_ERR_MODULE_NOT_FOUND or some I/O error on failure.

Parameters:
pszDll The name of the dll to look for.
pszPrefix Prefix than can be used when searching.
pszSuffix Suffix than can be used when searching.
enmSearch Method to use when locating the module.
fFlags Flags, a combintation of the KLDRYDLD_LOAD_FLAGS_* #defines.
phMod Where to store the handle of the module on success.

Definition at line 405 of file kLdrDyld.c.

References KLDRDYLDMOD::hMod, K_VALIDATE_STRING, kldrDyldDoFindByName(), kLdrDyldSemRelease(), kLdrDyldSemRequest(), NIL_HKLDRMOD, and NULL.

Referenced by main().

{
    int rc;

    /* validate & initialize */
    *phMod = NIL_HKLDRMOD;
    K_VALIDATE_STRING(pszDll);

    /* get sem & do work */
    rc = kLdrDyldSemRequest();
    if (!rc)
    {
        PKLDRDYLDMOD pMod = NULL;
        rc = kldrDyldDoFindByName(pszDll, pszPrefix, pszSuffix, enmSearch, fFlags, &pMod);
        kLdrDyldSemRelease();
        *phMod = pMod ? pMod->hMod : NIL_HKLDRMOD;
    }
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index