Changeset 58727 in vbox
- Timestamp:
- Nov 18, 2015 12:28:21 AM (9 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/ldr/ldrEx.cpp
r57358 r58727 730 730 } 731 731 732 733 /** 734 * Translates a RTLDRARCH value to a string. 735 * 736 * @returns Name corresponding to @a enmArch 737 * @param enmArch The value to name. 738 */ 739 DECLHIDDEN(const char *) rtLdrArchName(RTLDRARCH enmArch) 740 { 741 switch (enmArch) 742 { 743 case RTLDRARCH_INVALID: return "INVALID"; 744 case RTLDRARCH_WHATEVER: return "WHATEVER"; 745 case RTLDRARCH_HOST: return "HOST"; 746 case RTLDRARCH_AMD64: return "AMD64"; 747 case RTLDRARCH_X86_32: return "X86_32"; 748 749 case RTLDRARCH_END: 750 case RTLDRARCH_32BIT_HACK: 751 break; 752 } 753 return "UNKNOWN"; 754 } -
trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp
r57974 r58727 3623 3623 3624 3624 3625 static const char *rtldrPEGetArchName(uint16_t uMachine) 3626 { 3627 switch (uMachine) 3628 { 3629 case IMAGE_FILE_MACHINE_I386: return "X86_32"; 3630 case IMAGE_FILE_MACHINE_AMD64: return "AMD64"; 3631 default: return "Unknown"; 3632 } 3633 } 3634 3635 3636 3625 3637 /** 3626 3638 * Open a PE image. … … 3659 3671 { 3660 3672 if (!(fFlags & RTLDR_O_IGNORE_ARCH_IF_NO_CODE)) 3661 return VERR_LDR_ARCH_MISMATCH; 3673 return RTErrInfoSetF(pErrInfo, VERR_LDR_ARCH_MISMATCH, "Image is for '%s', only accepting images for '%s'.", 3674 rtldrPEGetArchName(FileHdr.Machine), rtLdrArchName(enmArch)); 3662 3675 fArchNoCodeCheckPending = true; 3663 3676 } … … 3676 3689 return rc; 3677 3690 if (fArchNoCodeCheckPending && OptHdr.SizeOfCode != 0) 3678 return VERR_LDR_ARCH_MISMATCH; 3691 return RTErrInfoSetF(pErrInfo, VERR_LDR_ARCH_MISMATCH, 3692 "Image is for '%s' and contains code (%#x), only accepting images for '%s' with code.", 3693 rtldrPEGetArchName(FileHdr.Machine), OptHdr.SizeOfCode, rtLdrArchName(enmArch)); 3679 3694 3680 3695 /* -
trunk/src/VBox/Runtime/include/internal/ldr.h
r57974 r58727 497 497 498 498 DECLHIDDEN(int) rtLdrReadAt(RTLDRMOD hLdrMod, void *pvBuf, uint32_t iDbgInfo, RTFOFF off, size_t cb); 499 DECLHIDDEN(const char *) rtLdrArchName(RTLDRARCH enmArch); 499 500 500 501 RT_C_DECLS_END
Note:
See TracChangeset
for help on using the changeset viewer.