VirtualBox

Changeset 74654 in vbox for trunk/src


Ignore:
Timestamp:
Oct 7, 2018 1:00:04 PM (6 years ago)
Author:
vboxsync
Message:

IPRT: More kStuff cleanup. bugref:9232

Location:
trunk/src/VBox/Runtime
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r74653 r74654  
    19671967## @todo change this to EXTEND the RuntimeR3 target.
    19681968RuntimeGuestR3_SDKS.win                 := $(RuntimeR3_SDKS.win)
    1969 RuntimeGuestR3_DEFS                     := $(filter-out RTCRITSECT_STRICT RT_NO_GIP IPRT_WITH_OPENSSL LDR_WITH_KLDR, $(RuntimeR3_DEFS))
    1970 RuntimeGuestR3_DEFS                     := $(filter-out IN_SUP_R3, $(RuntimeGuestR3_DEFS)) ## @todo r=andy Needed to make cross-building with RTLdr API work.
     1969RuntimeGuestR3_DEFS                     := $(filter-out RTCRITSECT_STRICT RT_NO_GIP IPRT_WITH_OPENSSL, $(RuntimeR3_DEFS))
     1970RuntimeGuestR3_DEFS                     := $(filter-out IN_SUP_R3, $(RuntimeGuestR3_DEFS))
    19711971RuntimeGuestR3_DEFS.$(KBUILD_TARGET)    := $(RuntimeR3_DEFS.$(KBUILD_TARGET))
    19721972RuntimeGuestR3_DEFS.$(KBUILD_HOST)      := $(RuntimeR3_DEFS.$(KBUILD_HOST))
  • trunk/src/VBox/Runtime/VBox/VBoxRTImp.def

    r74329 r74654  
    11661166    RTLdrLoadAppPriv
    11671167    RTLdrOpen
    1168     RTLdrOpenkLdr
    11691168    RTLdrRelocate
    11701169    RTLdrSize
  • trunk/src/VBox/Runtime/common/ldr/ldrEx.cpp

    r74638 r74654  
    4747#ifdef LDR_ONLY_PE
    4848# undef LDR_WITH_PE
    49 # undef LDR_WITH_KLDR
    5049# undef LDR_WITH_ELF
    5150# undef LDR_WITH_LX
    5251# undef LDR_WITH_LE
     52# undef LDR_WITH_MACHO
    5353# undef LDR_WITH_NE
    5454# undef LDR_WITH_MZ
     
    7878    if (RT_FAILURE(rc))
    7979        return rc;
    80 #ifndef LDR_WITH_KLDR
    8180    if (    uSign.au16[0] != IMAGE_DOS_SIGNATURE
    8281        &&  uSign.u32     != IMAGE_NT_SIGNATURE
     
    9392        return VERR_INVALID_EXE_SIGNATURE;
    9493    }
    95 #endif
    9694    uint32_t offHdr = 0;
    9795    if (uSign.au16[0] == IMAGE_DOS_SIGNATURE)
     
    184182    else
    185183    {
    186 #ifndef LDR_WITH_KLDR
    187184        Log(("rtldrOpenWithReader: %s: the format isn't implemented %#x / '%.4s\n", pReader->pfnLogName(pReader), uSign.u32, &uSign.ach[0]));
    188 #endif
    189185        rc = VERR_INVALID_EXE_SIGNATURE;
    190186    }
    191 
    192 #ifdef LDR_WITH_KLDR
    193     /* Try kLdr if it's a format we don't recognize. */
    194     if (rc <= VERR_INVALID_EXE_SIGNATURE && rc > VERR_BAD_EXE_FORMAT)
    195     {
    196         int rc2 = rtldrkLdrOpen(pReader, fFlags, enmArch, phMod, pErrInfo);
    197         if (   RT_SUCCESS(rc2)
    198             || (rc == VERR_INVALID_EXE_SIGNATURE && rc2 != VERR_MZ_EXE_NOT_SUPPORTED /* Quick fix for bad return code. */)
    199             || rc2 >  VERR_INVALID_EXE_SIGNATURE
    200             || rc2 <= VERR_BAD_EXE_FORMAT)
    201             rc = rc2;
    202     }
    203 #endif
    204187
    205188    LogFlow(("rtldrOpenWithReader: %s: returns %Rrc *phMod=%p\n", pReader->pfnLogName(pReader), rc, *phMod));
  • trunk/src/VBox/Runtime/common/ldr/ldrFile.cpp

    r69111 r74654  
    296296RT_EXPORT_SYMBOL(RTLdrOpenEx);
    297297
    298 
    299 /**
    300  * Opens a binary image file using kLdr.
    301  *
    302  * @returns iprt status code.
    303  * @param   pszFilename Image filename.
    304  * @param   fFlags      Reserved, MBZ.
    305  * @param   enmArch     CPU architecture specifier for the image to be loaded.
    306  * @param   phLdrMod    Where to store the handle to the loaded module.
    307  * @remark  Primarily for testing the loader.
    308  */
    309 RTDECL(int) RTLdrOpenkLdr(const char *pszFilename, uint32_t fFlags, RTLDRARCH enmArch, PRTLDRMOD phLdrMod)
    310 {
    311 #ifdef LDR_WITH_KLDR
    312     LogFlow(("RTLdrOpenkLdr: pszFilename=%p:{%s} fFlags=%#x enmArch=%d phLdrMod=%p\n",
    313              pszFilename, pszFilename, fFlags, enmArch, phLdrMod));
    314     AssertMsgReturn(!(fFlags & ~RTLDR_O_VALID_MASK), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
    315 
    316     /*
    317      * Create file reader & invoke worker which identifies and calls the image interpreter.
    318      */
    319     PRTLDRREADER pReader;
    320     int rc = rtldrFileCreate(&pReader, pszFilename);
    321     if (RT_SUCCESS(rc))
    322     {
    323         rc = rtldrkLdrOpen(pReader, fFlags, enmArch, phLdrMod, NULL);
    324         if (RT_SUCCESS(rc))
    325         {
    326             LogFlow(("RTLdrOpenkLdr: return %Rrc *phLdrMod=%p\n", rc, *phLdrMod));
    327             return rc;
    328         }
    329         pReader->pfnDestroy(pReader);
    330     }
    331     *phLdrMod = NIL_RTLDRMOD;
    332     LogFlow(("RTLdrOpenkLdr: return %Rrc\n", rc));
    333     return rc;
    334 
    335 #else
    336     return RTLdrOpen(pszFilename, fFlags, enmArch, phLdrMod);
    337 #endif
    338 }
    339 RT_EXPORT_SYMBOL(RTLdrOpenkLdr);
    340 
  • trunk/src/VBox/Runtime/common/ldr/ldrVfsFile.cpp

    r73097 r74654  
    278278                                  PRTLDRMOD phLdrMod, uint32_t *poffError, PRTERRINFO pErrInfo)
    279279{
    280 #ifdef LDR_WITH_KLDR
    281     LogFlow(("RTLdrOpenVfsChainkLdr: pszFilename=%p:{%s} fFlags=%#x enmArch=%d phLdrMod=%p\n",
    282              pszFilename, pszFilename, fFlags, enmArch, phLdrMod));
    283     AssertMsgReturn(!(fFlags & ~RTLDR_O_VALID_MASK), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
    284 
    285     /*
    286      * Create file reader & invoke worker which identifies and calls the image interpreter.
    287      */
    288     PRTLDRREADER pReader;
    289     int rc = rtldrVfsFileCreate(pszFilename, &pReader, poffError, pErrInfo);
    290     if (RT_SUCCESS(rc))
    291     {
    292         if (poffError)
    293             *poffError = 0;
    294         rc = rtldrkLdrOpen(pReader, fFlags, enmArch, phLdrMod, pErrInfo);
    295         if (RT_SUCCESS(rc))
    296         {
    297             LogFlow(("RTLdrOpenkLdr: return %Rrc *phLdrMod=%p\n", rc, *phLdrMod));
    298             return rc;
    299         }
    300         pReader->pfnDestroy(pReader);
    301     }
    302     *phLdrMod = NIL_RTLDRMOD;
    303     LogFlow(("RTLdrOpenVfsChainkLdr: return %Rrc\n", rc));
    304     return rc;
    305 
    306 #else
    307280    return RTLdrOpenVfsChain(pszFilename, fFlags, enmArch, phLdrMod, poffError, pErrInfo);
    308 #endif
    309281}
    310282RT_EXPORT_SYMBOL(RTLdrOpenVfsChainkLdr);
  • trunk/src/VBox/Runtime/testcase/tstLdr-4.cpp

    r69111 r74654  
    117117        { NULL, NULL, 0, "bar" },
    118118        { NULL, NULL, 0, "foobar" },
    119         { NULL, NULL, 0, "kLdr-foo" },
    120         { NULL, NULL, 0, "kLdr-bar" },
    121         { NULL, NULL, 0, "kLdr-foobar" }
    122119    };
    123120    unsigned i;
     
    129126    for (i = 0; i < RT_ELEMENTS(aLoads); i++)
    130127    {
    131         if (!strncmp(aLoads[i].pszName, RT_STR_TUPLE("kLdr-")))
    132         {
    133             rc = RTLdrOpenkLdr(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod);
    134             if (rc == VERR_ELF_EXE_NOT_SUPPORTED)
    135                 continue;
    136         }
    137         else
    138             rc = RTLdrOpen(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod);
     128        rc = RTLdrOpen(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod);
    139129        if (RT_FAILURE(rc))
    140130        {
  • trunk/src/VBox/Runtime/testcase/tstLdr.cpp

    r69111 r74654  
    106106        { NULL, NULL, (RTUINTPTR)0x40404040, "bar" },
    107107        { NULL, NULL, (RTUINTPTR)0xefefef00, "foobar" },
    108         { NULL, NULL, (RTUINTPTR)0xefefef00, "kLdr-foo" },
    109         { NULL, NULL, (RTUINTPTR)0x40404040, "kLdr-bar" },
    110         { NULL, NULL, (RTUINTPTR)0xefefef00, "kLdr-foobar" }
    111108    };
    112109    unsigned i;
     
    123120
    124121        /* open it */
    125         int rc;
    126         if (!strncmp(aLoads[i].pszName, RT_STR_TUPLE("kLdr-")))
    127             rc = RTLdrOpenkLdr(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod);
    128         else
    129             rc = RTLdrOpen(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod);
     122        int rc = RTLdrOpen(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod);
    130123        if (RT_FAILURE(rc))
    131124        {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette