Changeset 106732 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Oct 27, 2024 10:54:55 PM (6 months ago)
- svn:sync-xref-src-repo-rev:
- 165615
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp
r106726 r106732 4131 4131 * volatile everywhere! Trying to prevent the compiler being a smarta$$ and reorder stuff. 4132 4132 */ 4133 IMAGE_LOAD_CONFIG_DIRECTORY32_V13 volatile *pLoadCfg32 = (IMAGE_LOAD_CONFIG_DIRECTORY32_V13 volatile *)pLoadCfg; 4134 IMAGE_LOAD_CONFIG_DIRECTORY64_V13 volatile *pLoadCfg64 = pLoadCfg; 4135 4133 IMAGE_LOAD_CONFIG_DIRECTORY32_V14 volatile *pLoadCfg32 = (IMAGE_LOAD_CONFIG_DIRECTORY32_V14 volatile *)pLoadCfg; 4134 IMAGE_LOAD_CONFIG_DIRECTORY64_V14 volatile *pLoadCfg64 = pLoadCfg; 4135 4136 pLoadCfg64->GuardMemcpyFunctionPointer = pLoadCfg32->GuardMemcpyFunctionPointer; 4136 4137 pLoadCfg64->CastGuardOsDeterminedFailureMode = pLoadCfg32->CastGuardOsDeterminedFailureMode; 4137 4138 pLoadCfg64->GuardXFGTableDispatchFunctionPointer = pLoadCfg32->GuardXFGTableDispatchFunctionPointer; … … 4772 4773 if (Dir.Size) 4773 4774 { 4775 const size_t cbExpectV14 = !pModPe->f64Bit 4776 ? sizeof(IMAGE_LOAD_CONFIG_DIRECTORY32_V14) 4777 : sizeof(IMAGE_LOAD_CONFIG_DIRECTORY64_V14); 4774 4778 const size_t cbExpectV13 = !pModPe->f64Bit 4775 4779 ? sizeof(IMAGE_LOAD_CONFIG_DIRECTORY32_V13) … … 4815 4819 4816 4820 bool fNewerStructureHack = false; 4817 if ( Dir.Size != cbExpectV13 4821 if ( Dir.Size != cbExpectV14 4822 && Dir.Size != cbExpectV13 4818 4823 && Dir.Size != cbExpectV12 4819 4824 && Dir.Size != cbExpectV11 … … 4831 4836 fNewerStructureHack = Dir.Size > cbNewHack /* These structure changes are slowly getting to us! More futher down. */ 4832 4837 && Dir.Size <= sizeof(u); 4833 Log(("rtldrPEOpen: %s: load cfg dir: unexpected dir size of %u bytes, expected %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, or %zu.%s\n",4834 pszLogName, Dir.Size, cbExpectV1 3, cbExpectV12, cbExpectV11, cbExpectV10, cbExpectV9, cbExpectV8, cbExpectV7, cbExpectV6, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1,4838 Log(("rtldrPEOpen: %s: load cfg dir: unexpected dir size of %u bytes, expected %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, or %zu.%s\n", 4839 pszLogName, Dir.Size, cbExpectV14, cbExpectV13, cbExpectV12, cbExpectV11, cbExpectV10, cbExpectV9, cbExpectV8, cbExpectV7, cbExpectV6, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1, 4835 4840 fNewerStructureHack ? " Will try ignore extra bytes if all zero." : "")); 4836 4841 if (!fNewerStructureHack) 4837 4842 return RTErrInfoSetF(pErrInfo, VERR_LDRPE_LOAD_CONFIG_SIZE, 4838 "Unexpected load config dir size of %u bytes; supported sized: %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, or %zu",4839 Dir.Size, cbExpectV1 3, cbExpectV12, cbExpectV11, cbExpectV10, cbExpectV9, cbExpectV8, cbExpectV7, cbExpectV6, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1);4843 "Unexpected load config dir size of %u bytes; supported sized: %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, or %zu", 4844 Dir.Size, cbExpectV14, cbExpectV13, cbExpectV12, cbExpectV11, cbExpectV10, cbExpectV9, cbExpectV8, cbExpectV7, cbExpectV6, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1); 4840 4845 } 4841 4846 … … 4876 4881 /* Kludge #2: This happens a lot. Structure changes, but the linker doesn't get 4877 4882 updated and stores some old size in the directory. Use the header size. */ 4878 else if ( u.Cfg64.Size == cbExpectV13 4883 else if ( u.Cfg64.Size == cbExpectV14 4884 || u.Cfg64.Size == cbExpectV13 4879 4885 || u.Cfg64.Size == cbExpectV12 4880 4886 || u.Cfg64.Size == cbExpectV11
Note:
See TracChangeset
for help on using the changeset viewer.