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

static int kldrModLXUnmap ( PKLDRMOD  pMod  )  [static]

Unmaps a module previously mapped by kLdrModMap().

Returns:
0 on success, non-zero OS or kLdr status code on failure.
Parameters:
pMod The module to unmap.

Definition at line 1900 of file kLdrModLX.c.

References KLDRMOD::aSegments, KLDRMODLX::cbMapped, KLDRMOD::cSegments, KLDR_ERR_NOT_MAPPED, KLDRMODLX_ASSERT, KLDRSEG::MapAddress, NULL, KLDRMOD::pvData, and KLDRMODLX::pvMapping.

{
    PKLDRMODLX  pModLX = (PKLDRMODLX)pMod->pvData;
    KU32        i;
    int         rc;

    /*
     * Mapped?
     */
    if (!pModLX->pvMapping)
        return KLDR_ERR_NOT_MAPPED;

    /*
     * Free the mapping and update the segments.
     */
    rc = kHlpPageFree((void *)pModLX->pvMapping, pModLX->cbMapped);
    KLDRMODLX_ASSERT(!rc);
    pModLX->pvMapping = NULL;

    for (i = 0; i < pMod->cSegments; i++)
        pMod->aSegments[i].MapAddress = 0;

    return rc;
}


Generated by  Doxygen 1.6.0   Back to index