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

static int kldrModLXDestroy ( 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 536 of file kLdrModLX.c.

References KLDRMODLX_ASSERT, NULL, KLDRMODLX::pbFixupSection, KLDRMODLX::pbNonResNameTab, KLDRMOD::pOps, KLDRMOD::pRdr, KLDRMOD::pvData, KLDRMODLX::pvMapping, and KLDRMOD::u32Magic.

{
    PKLDRMODLX pModLX = (PKLDRMODLX)pMod->pvData;
    int rc = 0;
    KLDRMODLX_ASSERT(!pModLX->pvMapping);

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


Generated by  Doxygen 1.6.0   Back to index