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

static int kldrModPEDestroy ( PKLDRMOD  pMod  )  [static]

Destroys an loader module instance.

The caller is responsible for calling kLdrModUnmap() and kLdrFreeTLS() first.

Returns:
0 on success, non-zero on failure. The module instance state is unknown on failure, it's best not to touch it.
Parameters:
pMod The module.

Definition at line 539 of file kLdrModPE.c.

References KLDRMODPE_ASSERT, NULL, KLDRMOD::pOps, KLDRMOD::pRdr, KLDRMOD::pvData, KLDRMODPE::pvMapping, and KLDRMOD::u32Magic.

{
    PKLDRMODPE pModPE = (PKLDRMODPE)pMod->pvData;
    int rc = 0;
    KLDRMODPE_ASSERT(!pModPE->pvMapping);

    if (pMod->pRdr)
    {
        rc = kRdrClose(pMod->pRdr);
        pMod->pRdr = NULL;
    }
    pMod->u32Magic = 0;
    pMod->pOps = NULL;
    kHlpFree(pModPE);
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index