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

static int kldrModPECallTerm ( PKLDRMOD  pMod,
KUPTR  uHandle 
) [static]

Call the module termination function of a mapped module (if any).

Returns:
0 on success or no term function, non-zero on invalid pMod.
Parameters:
pMod The module.
uHandle The module handle to use if any of the term functions requires the module handle.
Remarks:
Termination function failure will be ignored by the module interpreter.

Definition at line 1852 of file kLdrModPE.c.

References KLDRMODPE::Hdrs, KLDR_ERR_NOT_MAPPED, kldrModPEDoCallDLL(), kldrModPEDoCallTLS(), KLDRMOD::pvData, and KLDRMODPE::pvMapping.

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

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

    /*
     * Do TLS callbacks first.
     */
    kldrModPEDoCallTLS(pModPE, DLL_PROCESS_DETACH, uHandle);
    if (pModPE->Hdrs.FileHeader.Characteristics & IMAGE_FILE_DLL)
        kldrModPEDoCallDLL(pModPE, DLL_PROCESS_DETACH, uHandle);

    return 0;
}


Generated by  Doxygen 1.6.0   Back to index