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

static int kldrModPEDoCallDLL ( PKLDRMODPE  pModPE,
unsigned  uOp,
KUPTR  uHandle 
) [static]

Call the DLL entrypoint.

Returns:
0 on success.

KLDR_ERR_MODULE_INIT_FAILED or KLDR_ERR_THREAD_ATTACH_FAILED on failure.

Parameters:
pModPE The PE module interpreter instance.
uOp The operation (DLL_*).
uHandle The module handle to present.

Definition at line 1739 of file kLdrModPE.c.

References KLDRMODPE::Hdrs, KLDR_ERR_MODULE_INIT_FAILED, KLDR_ERR_THREAD_ATTACH_FAILED, kldrModPEDoCall(), NULL, and KLDRMODPE::pvMapping.

Referenced by kldrModPECallInit(), kldrModPECallTerm(), and kldrModPECallThread().

{
    int rc;

    /*
     * If no entrypoint there isn't anything to be done.
     */
    if (!pModPE->Hdrs.OptionalHeader.AddressOfEntryPoint)
        return 0;

    /*
     * Invoke the entrypoint and convert the boolean result to a kLdr status code.
     */
    rc = kldrModPEDoCall((KUPTR)pModPE->pvMapping + pModPE->Hdrs.OptionalHeader.AddressOfEntryPoint,
                         uHandle, uOp, NULL);
    if (rc)
        rc = 0;
    else if (uOp == DLL_PROCESS_ATTACH)
        rc = KLDR_ERR_MODULE_INIT_FAILED;
    else if (uOp == DLL_THREAD_ATTACH)
        rc = KLDR_ERR_THREAD_ATTACH_FAILED;
    else /* detach: ignore failures */
        rc = 0;
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index