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

static int kldrModPEDoUnmap ( PKLDRMODPE  pModPE,
const void *  pvMapping 
) [static]

Unmaps a image mapping.

This can be used to do the internal mapping as well as the user requested mapping. fForReal indicates which is desired.

0 on success, non-zero OS or kLdr status code on failure.
pModPE The interpreter module instance
pvMapping The mapping to unmap.

Definition at line 624 of file kLdrModPE.c.

References KLDRMOD::aSegments, KLDRMOD::cSegments, KLDRSEG::MapAddress, NULL, KLDRMODPE::pMod, KLDRMOD::pRdr, KLDRMODPE::pvBits, and KLDRMODPE::pvMapping.

Referenced by kldrModPEUnmap().

    PKLDRMOD    pMod = pModPE->pMod;
    int         rc;
    KU32        i;

     * Try unmap the image.
    rc = kRdrUnmap(pMod->pRdr, (void *)pvMapping, pMod->cSegments, pMod->aSegments);
    if (rc)
        return rc;

     * Update the segments to reflect that they aren't mapped any longer.
    if (pModPE->pvMapping == pvMapping)
        pModPE->pvMapping = NULL;
        for (i = 0; i < pMod->cSegments; i++)
            pMod->aSegments[i].MapAddress = 0;
    if (pModPE->pvBits == pvMapping)
        pModPE->pvBits = NULL;

    return 0;

Generated by  Doxygen 1.6.0   Back to index