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

static int BasicTestsSubMap2 ( PKLDRMOD  pMod  )  [static]

Tests the mapping related api, after mapping.

Definition at line 527 of file tstkLdrMod.c.

References BasicTestsGetImport(), BasicTestsSub2(), Failure(), kLdrModAllocTLS(), kLdrModFixupMapping(), kLdrModFreeTLS(), kLdrModReload(), and NULL.

Referenced by BasicTestsSubMap().

{
    int rc;

    rc = kLdrModFixupMapping(pMod, BasicTestsGetImport, NULL);
    if (rc)
        return Failure("kLdrModFixupMapping (a) failed, rc=%d (%s)", rc, kErrName(rc));

    rc = kLdrModReload(pMod);
    if (rc)
        return Failure("kLdrModReload (a) failed, rc=%d (%s)", rc, kErrName(rc));

    rc = kLdrModReload(pMod);
    if (rc)
        return Failure("kLdrModReload (b) failed, rc=%d (%s)", rc, kErrName(rc));

    rc = kLdrModFixupMapping(pMod, BasicTestsGetImport, NULL);
    if (rc)
        return Failure("kLdrModFixupMapping (b) failed, rc=%d (%s)", rc, kErrName(rc));

    rc = kLdrModAllocTLS(pMod);
    if (rc)
        return Failure("kLdrModAllocTLS (a) failed, rc=%d (%s)", rc, kErrName(rc));
    kLdrModFreeTLS(pMod);

    rc = kLdrModAllocTLS(pMod);
    if (rc)
        return Failure("kLdrModAllocTLS (b) failed, rc=%d (%s)", rc, kErrName(rc));
    kLdrModFreeTLS(pMod);

    /*
     * Repeat the BasicTestsSub2 with pvBits as NULL to test module
     * interpreters that can utilize the mapping.
     */
    rc = BasicTestsSub2(pMod, NULL);
    if (rc)
        return Failure("BasicTestsSub2 in Map2 failed, rc=%d (%s)", rc, kErrName(rc));
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index