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

int kLdrDyldFindByAddress ( KUPTR  Address,
PHKLDRMOD  phMod,
KU32 *  piSegment,
KUPTR *  poffSegment 
)

Finds a module by address.

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 on failure.

Parameters:
Address The address believed to be within some module.
phMod Where to store the module handle on success.
piSegment Where to store the segment number. (optional)
poffSegment Where to store the offset into the segment. (optional)

Definition at line 440 of file kLdrDyld.c.

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

Referenced by main().

{
    int rc;

    /* validate & initialize */
    *phMod = NIL_HKLDRMOD;
    if (piSegment)
        *piSegment = ~(KU32)0;
    if (poffSegment)
        *poffSegment = ~(KUPTR)0;

    /* get sem & do work */
    rc = kLdrDyldSemRequest();
    if (!rc)
    {
        PKLDRDYLDMOD pMod = NULL;
        rc = kldrDyldDoFindByAddress(Address, &pMod, piSegment, poffSegment);
        kLdrDyldSemRelease();
        *phMod = pMod ? pMod->hMod : NIL_HKLDRMOD;
    }
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index