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

static int kldrModPEMap ( PKLDRMOD  pMod  )  [static]

Maps the module into the memory of the caller.

On success the actual addresses for the segments can be found in MapAddress member of each segment in the segment array.

Returns:
0 on success, non-zero OS or kLdr status code on failure.
Parameters:
pMod The module to be mapped.
Remarks:
kLdr only supports one mapping at a time of a module.

Definition at line 1230 of file kLdrModPE.c.

References KLDR_ERR_ALREADY_MAPPED, KLDRMODPE_ASSERT, kldrModPEDoMap(), KLDRMOD::pvData, and KLDRMODPE::pvMapping.

{
    PKLDRMODPE  pModPE = (PKLDRMODPE)pMod->pvData;
    int         rc;

    /*
     * Already mapped?
     */
    if (pModPE->pvMapping)
        return KLDR_ERR_ALREADY_MAPPED;

    /*
     * We've got a common worker which does this.
     */
    rc = kldrModPEDoMap(pModPE, 1 /* the real thing */);
    if (rc)
        return rc;
    KLDRMODPE_ASSERT(pModPE->pvMapping);
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index