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

int kldrDyldModMap ( PKLDRDYLDMOD  pMod  ) 

Maps an open module.

On success the module will be in the MAPPED state.

Returns:
0 on success, non-zero native OS or kLdr status code on failure.
Parameters:
pMod The module which needs to be unmapped and set pending for destruction.

Todo:
TLS

Definition at line 808 of file kLdrDyldMod.c.

References KLDRDYLDMOD::enmState, KLDRDYLDMOD::fMapped, KLDRDYLDMOD_ASSERT, kLdrModAllocTLS(), kLdrModMap(), kLdrModUnmap(), KLDRSTATE_MAPPED, KLDRSTATE_OPEN, and KLDRDYLDMOD::pMod.

Referenced by kldrDyldDoLoad(), kldrDyldGetPrerequisite(), and kLdrDyldLoadExe().

{
    int rc;

    /* sanity */
    KLDRDYLDMOD_ASSERT(pMod->enmState == KLDRSTATE_OPEN);
    KLDRDYLDMOD_ASSERT(!pMod->fMapped);
    if (pMod->fMapped)
        return 0;

    /* do the job. */
    rc = kLdrModMap(pMod->pMod);
    if (!rc)
    {
        rc = kLdrModAllocTLS(pMod->pMod);
        if (!rc)
        {
            /** @todo TLS */
            pMod->fMapped = 1;
            pMod->enmState = KLDRSTATE_MAPPED;
        }
        else
            kLdrModUnmap(pMod->pMod);
    }
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index