Changeset 25 for trunk/kLdr/kLdrModPE.c
- Timestamp:
- Feb 19, 2009, 1:56:15 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kLdr/kLdrModPE.c
r2 r25 136 136 * @param pOps Pointer to the registered method table. 137 137 * @param pRdr The file provider instance to use. 138 * @param fFlags Flags, MBZ. 139 * @param enmCpuArch The desired CPU architecture. KCPUARCH_UNKNOWN means 140 * anything goes, but with a preference for the current 141 * host architecture. 138 142 * @param offNewHdr The offset of the new header in MZ files. -1 if not found. 139 143 * @param ppMod Where to store the module instance pointer. 140 144 */ 141 static int kldrModPECreate(PCKLDRMODOPS pOps, PKRDR pRdr, K LDRFOFF offNewHdr, PPKLDRMOD ppMod)145 static int kldrModPECreate(PCKLDRMODOPS pOps, PKRDR pRdr, KU32 fFlags, KCPUARCH enmCpuArch, KLDRFOFF offNewHdr, PPKLDRMOD ppMod) 142 146 { 143 147 PKLDRMODPE pModPE; … … 150 154 if (!rc) 151 155 { 152 pModPE->pMod->pOps = pOps; 153 pModPE->pMod->u32Magic = KLDRMOD_MAGIC; 154 *ppMod = pModPE->pMod; 155 return 0; 156 /* 157 * Match up against the requested CPU architecture. 158 */ 159 if ( enmCpuArch == KCPUARCH_UNKNOWN 160 || pModPE->pMod->enmArch == enmCpuArch) 161 { 162 pModPE->pMod->pOps = pOps; 163 pModPE->pMod->u32Magic = KLDRMOD_MAGIC; 164 *ppMod = pModPE->pMod; 165 return 0; 166 } 167 rc = KLDR_ERR_CPU_ARCH_MISMATCH; 156 168 } 157 169 kHlpFree(pModPE);
Note:
See TracChangeset
for help on using the changeset viewer.