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

static int kldrModPEAllocTLS ( PKLDRMOD  pMod  )  [static]

Allocates Thread Local Storage for module mapped by kLdrModMap().

Calling kLdrModAllocTLS() more than once without calling kLdrModFreeTLS() between each invocation is not supported.

0 on success, non-zero OS or kLdr status code on failure.
pMod The module.

implement TLS.

Definition at line 1277 of file kLdrModPE.c.

References KLDRMODPE::Hdrs, KLDR_ERR_NOT_MAPPED, KLDRMOD::pvData, and KLDRMODPE::pvMapping.

    PKLDRMODPE  pModPE = (PKLDRMODPE)pMod->pvData;

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

     * If no TLS directory then there is nothing to do.
    if (    !pModPE->Hdrs.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].Size
        ||  !pModPE->Hdrs.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress)
        return 0;
    /** @todo implement TLS. */
    return -1;

Generated by  Doxygen 1.6.0   Back to index