VirtualBox

Changeset 46023 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
May 13, 2013 3:34:54 PM (12 years ago)
Author:
vboxsync
Message:

RTLdrOpen: Defined the first flag RTLDR_O_FOR_DEBUG for use with RTDbgMod.

Location:
trunk/src/VBox/Runtime/common/ldr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/ldr/ldrFile.cpp

    r44528 r46023  
    254254    LogFlow(("RTLdrOpen: pszFilename=%p:{%s} fFlags=%#x enmArch=%d phLdrMod=%p\n",
    255255             pszFilename, pszFilename, fFlags, enmArch, phLdrMod));
    256     AssertMsgReturn(!fFlags, ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
     256    AssertMsgReturn(!(fFlags & ~RTLDR_O_VALID_MASK), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
    257257    AssertMsgReturn(enmArch > RTLDRARCH_INVALID && enmArch < RTLDRARCH_END, ("%d\n", enmArch), VERR_INVALID_PARAMETER);
    258258
     
    306306    LogFlow(("RTLdrOpenkLdr: pszFilename=%p:{%s} fFlags=%#x enmArch=%d phLdrMod=%p\n",
    307307             pszFilename, pszFilename, fFlags, enmArch, phLdrMod));
     308    AssertMsgReturn(!(fFlags & ~RTLDR_O_VALID_MASK), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
    308309
    309310    /*
  • trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp

    r45996 r46023  
    11531153 * @returns iprt status code.
    11541154 * @param   pFileHdr    Pointer to the file header that needs validating.
     1155 * @param   fFlags      Valid RTLDR_O_XXX combination.
    11551156 * @param   pszLogName  The log name to  prefix the errors with.
    11561157 * @param   penmArch    Where to store the CPU architecture.
    11571158 */
    1158 int rtldrPEValidateFileHeader(PIMAGE_FILE_HEADER pFileHdr, const char *pszLogName, PRTLDRARCH penmArch)
     1159static int rtldrPEValidateFileHeader(PIMAGE_FILE_HEADER pFileHdr, uint32_t fFlags, const char *pszLogName, PRTLDRARCH penmArch)
    11591160{
    11601161    size_t cbOptionalHeader;
     
    11831184    }
    11841185    /* This restriction needs to be implemented elsewhere. */
    1185     if (pFileHdr->Characteristics & IMAGE_FILE_RELOCS_STRIPPED)
     1186    if (   (pFileHdr->Characteristics & IMAGE_FILE_RELOCS_STRIPPED)
     1187        && !(fFlags & RTLDR_O_FOR_DEBUG))
    11861188    {
    11871189        Log(("rtldrPEOpen: %s: IMAGE_FILE_RELOCS_STRIPPED\n", pszLogName));
     
    17121714int rtldrPEOpen(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, RTFOFF offNtHdrs, PRTLDRMOD phLdrMod)
    17131715{
    1714     AssertReturn(!fFlags, VERR_INVALID_PARAMETER);
    1715 
    17161716    /*
    17171717     * Read and validate the file header.
     
    17231723    RTLDRARCH enmArchImage;
    17241724    const char *pszLogName = pReader->pfnLogName(pReader);
    1725     rc = rtldrPEValidateFileHeader(&FileHdr, pszLogName, &enmArchImage);
     1725    rc = rtldrPEValidateFileHeader(&FileHdr, fFlags, pszLogName, &enmArchImage);
    17261726    if (RT_FAILURE(rc))
    17271727        return rc;
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