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

static int kldrModNativeDestroy ( 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 517 of file kLdrModNative.c.

References KLDRMODNATIVE::hmod, K_OS_OS2, NULL, KLDRMOD::pOps, KLDRMOD::pvData, and KLDRMOD::u32Magic.

{
    PKLDRMODNATIVE pModNative = (PKLDRMODNATIVE)pMod->pvData;
    int rc;

#if K_OS == K_OS_OS2
    rc = DosFreeModule(pModNative->hmod);

#elif K_OS == K_OS_WINDOWS
    if (FreeLibrary(pModNative->hmod))
        rc = 0;
    else
        rc = GetLastError();

#elif K_OS == K_OS_DARWIN
    dlclose(pModNative->pvMod);

#else
# error "Port me"
#endif

    pMod->u32Magic = 0;
    pMod->pOps = NULL;
    kHlpFree(pModNative);
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index