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

static int kldrModPECallThread ( PKLDRMOD  pMod,
KUPTR  uHandle,
unsigned  fAttachingOrDetaching 
) [static]

Call the thread attach or detach function of a mapped module (if any).

Any per-thread TLS initialization/termination will have to be done at this time too.

0 on success or no attach/detach function, non-zero on attach failure or invalid pMod.
pMod The module.
uHandle The module handle to use if any of the thread attach/detach functions requires the module handle.
Detach function failure will be ignored by the module interpreter.

Definition at line 1864 of file kLdrModPE.c.

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

    PKLDRMODPE  pModPE = (PKLDRMODPE)pMod->pvData;
    unsigned    uOp = fAttachingOrDetaching ? DLL_THREAD_ATTACH : DLL_THREAD_DETACH;
    int         rc;

     * Do TLS callbacks first and then call the init/term function if it's a DLL.
    rc = kldrModPEDoCallTLS(pModPE, uOp, uHandle);
    if (!fAttachingOrDetaching)
        rc = 0;
    if (    !rc
        &&  (pModPE->Hdrs.FileHeader.Characteristics & IMAGE_FILE_DLL))
        rc = kldrModPEDoCallDLL(pModPE, uOp, uHandle);
        if (!fAttachingOrDetaching)
            rc = 0;
        if (rc)
            kldrModPEDoCallTLS(pModPE, uOp, uHandle);

    return rc;

Generated by  Doxygen 1.6.0   Back to index