Changeset 60715 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Apr 27, 2016 11:27:20 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 106899
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp
r60699 r60715 3577 3577 } 3578 3578 /* Kludge #2: This happens a lot. Structure changes, but the linker doesn't get 3579 itupdated and stores some old size in the directory. Use the header size. */3579 updated and stores some old size in the directory. Use the header size. */ 3580 3580 else if ( u.Cfg64.Size == cbExpectV5 3581 3581 || u.Cfg64.Size == cbExpectV4 3582 3582 || u.Cfg64.Size == cbExpectV3 3583 3583 || u.Cfg64.Size == cbExpectV2 3584 || u.Cfg64.Size == cbExpectV1) 3584 || u.Cfg64.Size == cbExpectV1 3585 || (fNewerStructureHack = (u.Cfg64.Size > cbExpectV5 && u.Cfg64.Size <= sizeof(u))) ) 3585 3586 { 3586 3587 Log(("rtldrPEOpen: %s: load cfg dir: Header (%d) and directory (%d) size mismatch, applying the old linker kludge.\n", 3587 3588 pszLogName, u.Cfg64.Size, Dir.Size)); 3589 3588 3590 Dir.Size = u.Cfg64.Size; 3591 uint32_t const uOrgDir = Dir.Size; 3589 3592 RT_ZERO(u.Cfg64); 3590 3593 rc = rtldrPEReadRVA(pModPe, &u.Cfg64, Dir.Size, Dir.VirtualAddress); 3591 3594 if (RT_FAILURE(rc)) 3592 3595 return rc; 3596 if ( fNewerStructureHack 3597 && !ASMMemIsZero(&u.abZeros[cbExpectV5], Dir.Size - cbExpectV5)) 3598 { 3599 Log(("rtldrPEOpen: %s: load cfg dir: Unknown bytes are non-zero (%u bytes of which %u expected to be zero): %.*Rhxs\n", 3600 pszLogName, Dir.Size, Dir.Size - cbExpectV5, Dir.Size - cbExpectV5, &u.abZeros[cbExpectV5])); 3601 return RTErrInfoSetF(pErrInfo, VERR_LDRPE_LOAD_CONFIG_SIZE, 3602 "Grown load config (%u to %u bytes, dir %u) includes non-zero bytes: %.*Rhxs", 3603 cbExpectV5, Dir.Size, uOrgDir, Dir.Size - cbExpectV5, &u.abZeros[cbExpectV5]); 3604 } 3593 3605 rtldrPEConvert32BitLoadConfigTo64Bit(&u.Cfg64); 3594 3606 AssertReturn(u.Cfg64.Size == Dir.Size, … … 3601 3613 pszLogName, u.Cfg64.Size, Dir.Size, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1)); 3602 3614 return RTErrInfoSetF(pErrInfo, VERR_LDRPE_LOAD_CONFIG_SIZE, 3603 "Unexpected load config dir size of %u bytes (dir %u); supported sized: %zu, %zu, %zu, %zu, or %zu",3615 "Unexpected load config header size of %u bytes (dir %u); supported sized: %zu, %zu, %zu, %zu, or %zu", 3604 3616 u.Cfg64.Size, Dir.Size, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1); 3605 3617 }
Note:
See TracChangeset
for help on using the changeset viewer.