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

static KI32 kldrModPEDoCall ( KUPTR  uEntrypoint,
KUPTR  uHandle,
KU32  uOp,
void *  pvReserved 
) [static]

Do a 3 parameter callback.

Returns:
32-bit callback return.
Parameters:
uEntrypoint The address of the function to be called.
uHandle The first argument, the module handle.
uOp The second argumnet, the reason we're calling.
pvReserved The third argument, reserved argument. (figure this one out)

Todo:
try/except

Definition at line 1791 of file kLdrModPE.c.

References NULL.

Referenced by kldrModPEDoCallDLL().

{
    KI32 rc;

/** @todo try/except */
#if defined(__X86__) || defined(__i386__) || defined(_M_IX86)
    /*
     * Be very careful.
     * Not everyone will have got the calling convention right.
     */
# ifdef __GNUC__
    __asm__ __volatile__(
        "pushl  %2\n\t"
        "pushl  %1\n\t"
        "pushl  %0\n\t"
        "lea   12(%%esp), %2\n\t"
        "call  *%3\n\t"
        "movl   %2, %%esp\n\t"
        : "=a" (rc)
        : "d" (uOp),
          "S" (0),
          "c" (uEntrypoint),
          "0" (uHandle));
# elif defined(_MSC_VER)
    __asm {
        mov     eax, [uHandle]
        mov     edx, [uOp]
        mov     ecx, 0
        mov     ebx, [uEntrypoint]
        push    edi
        mov     edi, esp
        push    ecx
        push    edx
        push    eax
        call    ebx
        mov     esp, edi
        pop     edi
        mov     [rc], eax
    }
# else
#  error "port me!"
# endif

#elif defined(__AMD64__) || defined(__x86_64__) || defined(_M_IX86)
    /*
     * For now, let's just get the work done...
     */
    /** @todo Deal with GCC / MSC differences in some sensible way. */
    int (*pfn)(KUPTR uHandle, KU32 uOp, void *pvReserved);
    pfn = (int (*)(KUPTR uHandle, KU32 uOp, void *pvReserved))uEntrypoint;
    rc = pfn(uHandle, uOp, NULL);

#else
# error "port me"
#endif

    return rc;
}


Generated by  Doxygen 1.6.0   Back to index