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

static int kldrModLXCreate ( PCKLDRMODOPS  pOps,
PKRDR  pRdr,
KU32  fFlags,
KCPUARCH  enmCpuArch,
KLDRFOFF  offNewHdr,
PPKLDRMOD  ppMod 
) [static]

Create a loader module instance interpreting the executable image found in the specified file provider instance.

Returns:
0 on success and *ppMod pointing to a module instance. On failure, a non-zero OS specific error code is returned.
Parameters:
pOps Pointer to the registered method table.
pRdr The file provider instance to use.
fFlags Flags, MBZ.
enmCpuArch The desired CPU architecture. KCPUARCH_UNKNOWN means anything goes, but with a preference for the current host architecture.
offNewHdr The offset of the new header in MZ files. -1 if not found.
ppMod Where to store the module instance pointer.

Definition at line 154 of file kLdrModLX.c.

References KLDRMOD::enmArch, KCPUARCH_UNKNOWN, KLDR_ERR_CPU_ARCH_MISMATCH, KLDRMOD_MAGIC, kldrModLXDoCreate(), KLDRMODLX::pMod, KLDRMOD::pOps, and KLDRMOD::u32Magic.

{
    PKLDRMODLX pModLX;
    int rc;

    /*
     * Create the instance data and do a minimal header validation.
     */
    rc = kldrModLXDoCreate(pRdr, offNewHdr, &pModLX);
    if (!rc)
    {
        /*
         * Match up against the requested CPU architecture.
         */
        if (    enmCpuArch == KCPUARCH_UNKNOWN
            ||  pModLX->pMod->enmArch == enmCpuArch)
        {
            pModLX->pMod->pOps = pOps;
            pModLX->pMod->u32Magic = KLDRMOD_MAGIC;
            *ppMod = pModLX->pMod;
            return 0;
        }
        rc = KLDR_ERR_CPU_ARCH_MISMATCH;
    }
    kHlpFree(pModLX);
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index