- Timestamp:
- Feb 14, 2007, 11:12:44 AM (18 years ago)
- Location:
- trunk/kLdr
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kLdr/kLdr.h
r2965 r2974 114 114 115 115 116 /** The kLdr file offset type. */ 117 typedef long KLDRFOFF; 118 /** Pointer to a kLdr file offset type. */ 119 typedef KLDRFOFF *PKLDRFOFF; 120 /** Pointer to a const kLdr file offset type. */ 121 typedef const KLDRFOFF *PCKLDRFOFF; 122 123 /** @def PRI_KLDRFOFF 124 * printf format type. */ 125 #define PRI_KLDRFOFF "lx" 126 127 116 128 /** 117 129 * Union of all the integer types. … … 258 270 int (* pfnDestroy)( PKLDRRDR pRdr); 259 271 /** @copydoc kLdrRdrRead */ 260 int (* pfnRead)( PKLDRRDR pRdr, void *pvBuf, size_t cb, off_toff);272 int (* pfnRead)( PKLDRRDR pRdr, void *pvBuf, size_t cb, KLDRFOFF off); 261 273 /** @copydoc kLdrRdrAllMap */ 262 274 int (* pfnAllMap)( PKLDRRDR pRdr, const void **ppvBits); … … 264 276 int (* pfnAllUnmap)(PKLDRRDR pRdr, const void *pvBits); 265 277 /** @copydoc kLdrRdrSize */ 266 off_t(* pfnSize)( PKLDRRDR pRdr);278 KLDRFOFF (* pfnSize)( PKLDRRDR pRdr); 267 279 /** @copydoc kLdrRdrTell */ 268 off_t(* pfnTell)( PKLDRRDR pRdr);280 KLDRFOFF (* pfnTell)( PKLDRRDR pRdr); 269 281 /** @copydoc kLdrRdrName */ 270 282 const char * (* pfnName)(PKLDRRDR pRdr); … … 308 320 int kLdrRdrOpen( PPKLDRRDR ppRdr, const char *pszFilename); 309 321 int kLdrRdrClose( PKLDRRDR pRdr); 310 int kLdrRdrRead( PKLDRRDR pRdr, void *pvBuf, size_t cb, off_toff);322 int kLdrRdrRead( PKLDRRDR pRdr, void *pvBuf, size_t cb, KLDRFOFF off); 311 323 int kLdrRdrAllMap( PKLDRRDR pRdr, const void **ppvBits); 312 324 int kLdrRdrAllUnmap(PKLDRRDR pRdr, const void *pvBits); 313 off_tkLdrRdrSize( PKLDRRDR pRdr);314 off_tkLdrRdrTell( PKLDRRDR pRdr);325 KLDRFOFF kLdrRdrSize( PKLDRRDR pRdr); 326 KLDRFOFF kLdrRdrTell( PKLDRRDR pRdr); 315 327 const char *kLdrRdrName(PKLDRRDR pRdr); 316 328 size_t kLdrRdrPageSize(PKLDRRDR pRdr); … … 523 535 /** File offset of the segment. 524 536 * Set to -1 if no file backing (like BSS). */ 525 off_toffFile;537 KLDRFOFF offFile; 526 538 /** Size of the file bits of the segment. 527 539 * Set to -1 if no file backing (like BSS). */ 528 off_tcbFile;540 KLDRFOFF cbFile; 529 541 /** The relative virtual address when mapped. 530 542 * Set to NIL_KLDRADDR if the segment isn't supposed to be mapped. */ … … 810 822 */ 811 823 typedef int FNKLDRENUMDBG(PKLDRMOD pMod, uint32_t iDbgInfo, KLDRDBGINFOTYPE enmType, int16_t iMajorVer, int16_t iMinorVer, 812 off_toffFile, KLDRADDR LinkAddress, KLDRSIZE cb, const char *pszExtFile, void *pvUser);824 KLDRFOFF offFile, KLDRADDR LinkAddress, KLDRSIZE cb, const char *pszExtFile, void *pvUser); 813 825 /** Pointer to a debug info enumerator callback. */ 814 826 typedef FNKLDRENUMDBG *PFNKLDRENUMDBG; … … 932 944 * @param ppMod Where to store the module instance pointer. 933 945 */ 934 int (* pfnCreate)(PCKLDRMODOPS pOps, PKLDRRDR pRdr, off_toffNewHdr, PPKLDRMOD ppMod);946 int (* pfnCreate)(PCKLDRMODOPS pOps, PKLDRRDR pRdr, KLDRFOFF offNewHdr, PPKLDRMOD ppMod); 935 947 /** 936 948 * Destroys an loader module instance. -
trunk/kLdr/kLdrMod.c
r2954 r2974 144 144 uint16_t au16[2]; 145 145 uint8_t au8[4]; 146 } u;147 off_toffHdr = 0;148 int rc;146 } u; 147 KLDRFOFF offHdr = 0; 148 int rc; 149 149 150 150 /* … … 161 161 if (rc) 162 162 return rc; 163 if (( off_t)u.u32 < kLdrRdrSize(pRdr))163 if ((KLDRFOFF)u.u32 < kLdrRdrSize(pRdr)) 164 164 { 165 165 offHdr = u.u32; … … 259 259 */ 260 260 int kLdrModQuerySymbol(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t iSymbol, 261 const char *pchSymbol, size_t cchSymbol, const char *pszVersion, 261 const char *pchSymbol, size_t cchSymbol, const char *pszVersion, 262 262 PFNKLDRMODGETIMPORT pfnGetForwarder, void *pvUser, PKLDRADDR puValue, uint32_t *pfKind) 263 263 { … … 269 269 if (pfKind) 270 270 KLDRHLP_VALIDATE_FLAGS(*pfKind, KLDRSYMKIND_REQ_SEGMENTED); 271 return pMod->pOps->pfnQuerySymbol(pMod, pvBits, BaseAddress, iSymbol, pchSymbol, cchSymbol, pszVersion, 271 return pMod->pOps->pfnQuerySymbol(pMod, pvBits, BaseAddress, iSymbol, pchSymbol, cchSymbol, pszVersion, 272 272 pfnGetForwarder, pvUser, puValue, pfKind); 273 273 } … … 394 394 /** 395 395 * Queries info about a resource. 396 * 397 * If there are multiple resources matching the criteria, the best or 398 * first match will be return. 399 * 400 * 396 * 397 * If there are multiple resources matching the criteria, the best or 398 * first match will be return. 399 * 400 * 401 401 * @returns 0 on success. 402 402 * @returns Whatever non-zero status returned by pfnCallback (enumeration was stopped). 403 403 * @returns non-zero kLdr or native status code on failure. 404 * 404 * 405 405 * @param pMod The module. 406 406 * @param pvBits Optional pointer to bits returned by kLdrModGetBits() currently located at BaseAddress. … … 433 433 /** 434 434 * Enumerates the resources matching the specfied criteria. 435 * 436 * 435 * 436 * 437 437 * @returns 0 on success. 438 438 * @returns Whatever non-zero status returned by pfnCallback (enumeration was stopped). 439 439 * @returns non-zero kLdr or native status code on failure. 440 * 440 * 441 441 * @param pMod The module. 442 442 * @param pvBits Optional pointer to bits returned by kLdrModGetBits() currently located at BaseAddress. … … 453 453 * @param pvUser The user argument for the callback. 454 454 */ 455 int kLdrModEnumResources(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t idType, const char *pszType, 455 int kLdrModEnumResources(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t idType, const char *pszType, 456 456 uint32_t idName, const char *pszName, uint32_t idLang, PFNKLDRENUMRSRC pfnCallback, void *pvUser) 457 457 { … … 497 497 /** 498 498 * May free up some resources held by the module. 499 * 499 * 500 500 * @todo define exactly what it possible to do after this call. 501 * 501 * 502 502 * @returns 0 on success, KLDR_ERR_* on failure. 503 503 * @param pMod The module. -
trunk/kLdr/kLdrModLX.c
r2948 r2974 70 70 71 71 /** The offset of the LX header. */ 72 off_toffHdr;72 KLDRFOFF offHdr; 73 73 /** Copy of the LX header. */ 74 74 struct e32_exe Hdr; … … 116 116 static int kldrModLXRelocateBits(PKLDRMOD pMod, void *pvBits, KLDRADDR NewBaseAddress, KLDRADDR OldBaseAddress, 117 117 PFNKLDRMODGETIMPORT pfnGetImport, void *pvUser); 118 static int kldrModLXDoCreate(PKLDRRDR pRdr, off_toffNewHdr, PKLDRMODLX *ppModLX);118 static int kldrModLXDoCreate(PKLDRRDR pRdr, KLDRFOFF offNewHdr, PKLDRMODLX *ppModLX); 119 119 static const uint8_t *kldrModLXDoNameTableLookupByOrdinal(const uint8_t *pbNameTable, int32_t cbNameTable, uint32_t iOrdinal); 120 120 static int kldrModLXDoNameLookup(PKLDRMODLX pModLX, const char *pchSymbol, uint32_t cchSymbol, uint32_t *piSymbol); … … 133 133 static int kldrModLXDoLoadFixupSection(PKLDRMODLX pModLX); 134 134 static int32_t kldrModLXDoCall(uintptr_t uEntrypoint, uintptr_t uHandle, uint32_t uOp, void *pvReserved); 135 static int kldrModLXDoReloc(uint8_t *pbPage, int off, KLDRADDR PageAddress, const struct r32_rlc *prlc, 135 static int kldrModLXDoReloc(uint8_t *pbPage, int off, KLDRADDR PageAddress, const struct r32_rlc *prlc, 136 136 int iSelector, KLDRADDR uValue, uint32_t fKind); 137 137 … … 148 148 * @param ppMod Where to store the module instance pointer. 149 149 */ 150 static int kldrModLXCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, off_toffNewHdr, PPKLDRMOD ppMod)150 static int kldrModLXCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, KLDRFOFF offNewHdr, PPKLDRMOD ppMod) 151 151 { 152 152 PKLDRMODLX pModLX; … … 173 173 * simplify cleanup on failure. 174 174 */ 175 static int kldrModLXDoCreate(PKLDRRDR pRdr, off_toffNewHdr, PKLDRMODLX *ppModLX)175 static int kldrModLXDoCreate(PKLDRRDR pRdr, KLDRFOFF offNewHdr, PKLDRMODLX *ppModLX) 176 176 { 177 177 struct e32_exe Hdr; … … 208 208 209 209 /* Some rough sanity checks. */ 210 offEnd = kLdrRdrSize(pRdr) >= ( off_t)~(uint32_t)16 ? ~(uint32_t)16 : (uint32_t)kLdrRdrSize(pRdr);210 offEnd = kLdrRdrSize(pRdr) >= (KLDRFOFF)~(uint32_t)16 ? ~(uint32_t)16 : (uint32_t)kLdrRdrSize(pRdr); 211 211 if ( Hdr.e32_itermap > offEnd 212 212 || Hdr.e32_datapage > offEnd … … 249 249 && (Hdr.e32_fpagetab < off || Hdr.e32_fpagetab > offEnd)) 250 250 { 251 /* 251 /* 252 252 * wlink mixes the fixup section and the loader section. 253 253 */ … … 2105 2105 else 2106 2106 uValue = pMod->aSegments[iSeg].MapAddress; 2107 if ( (u.prlc->nr_stype & NRALIAS) 2107 if ( (u.prlc->nr_stype & NRALIAS) 2108 2108 || (pMod->aSegments[iSeg].fFlags & KLDRSEG_FLAG_16BIT)) 2109 2109 iSelector = pMod->aSegments[iSeg].Sel16bit; … … 2242 2242 2243 2243 /* common / simple */ 2244 if ( (u.prlc->nr_stype & NRSRCMASK) == NROFF32 2245 && off >= 0 2244 if ( (u.prlc->nr_stype & NRSRCMASK) == NROFF32 2245 && off >= 0 2246 2246 && off <= OBJPAGELEN - 4) 2247 2247 *(uint32_t *)&pbPage[off] = uValue; 2248 else if ( (u.prlc->nr_stype & NRSRCMASK) == NRSOFF32 2249 && off >= 0 2248 else if ( (u.prlc->nr_stype & NRSRCMASK) == NRSOFF32 2249 && off >= 0 2250 2250 && off <= OBJPAGELEN - 4) 2251 2251 *(uint32_t *)&pbPage[off] = uValue - (PageAddress + off); … … 2321 2321 /** 2322 2322 * Applies the relocation to one 'source' in a page. 2323 * 2324 * This takes care of the more esotic case while the common cases 2323 * 2324 * This takes care of the more esotic case while the common cases 2325 2325 * are dealt with seperately. 2326 2326 * … … 2331 2331 * @param fKind The target kind. 2332 2332 */ 2333 static int kldrModLXDoReloc(uint8_t *pbPage, int off, KLDRADDR PageAddress, const struct r32_rlc *prlc, 2333 static int kldrModLXDoReloc(uint8_t *pbPage, int off, KLDRADDR PageAddress, const struct r32_rlc *prlc, 2334 2334 int iSelector, KLDRADDR uValue, uint32_t fKind) 2335 2335 { 2336 static const uint8_t s_acb[16] = 2336 static const uint8_t s_acb[16] = 2337 2337 { 2338 2338 1, /* 0: NRSBYT */ … … 2340 2340 2, /* 2: NRSSEG - selector */ 2341 2341 4, /* 3: NRSPTR - 16:16 */ 2342 0, 2342 0, 2343 2343 2, /* 5: NRSOFF - 16-bit offset */ 2344 2344 6, /* 6: NRPTR48 - 16:32 */ … … 2348 2348 }; 2349 2349 #pragma pack(1) /* just to be sure */ 2350 union 2350 union 2351 2351 { 2352 2352 uint8_t ab[6]; … … 2354 2354 uint16_t off16; 2355 2355 uint8_t off8; 2356 struct 2356 struct 2357 2357 { 2358 2358 uint16_t off; 2359 2359 uint16_t Sel; 2360 2360 } Far16; 2361 struct 2361 struct 2362 2362 { 2363 2363 uint32_t off; … … 2375 2375 switch (prlc->nr_stype & NRSRCMASK) 2376 2376 { 2377 case NRSBYT: 2377 case NRSBYT: 2378 2378 uData.off8 = (uint8_t)uValue; 2379 2379 cb = 1; -
trunk/kLdr/kLdrModMachO.c
r2972 r2974 68 68 /** The file offset of this section. 69 69 * This is -1 if the section doesn't have a file backing. */ 70 off_toffFile;70 KLDRFOFF offFile; 71 71 /** The number of fixups. */ 72 72 uint32_t cFixups; … … 75 75 /** The file offset of the fixups for this section. 76 76 * This is -1 if the section doesn't have any fixups. */ 77 off_toffFixups;77 KLDRFOFF offFixups; 78 78 /** Mach-O section flags. */ 79 79 uint32_t fFlags; … … 128 128 129 129 /** The offset of the symbol table. */ 130 off_toffSymbols;130 KLDRFOFF offSymbols; 131 131 /** The number of symbols. */ 132 132 uint32_t cSymbols; … … 134 134 void *pvaSymbols; 135 135 /** The offset of the string table. */ 136 off_toffStrings;136 KLDRFOFF offStrings; 137 137 /** The size of the of the string table. */ 138 138 uint32_t cchStrings; … … 168 168 /*static int kldrModMachOLoadLoadCommands(PKLDRMODMACHO pModMachO);*/ 169 169 static int kldrModMachOLoadObjSymTab(PKLDRMODMACHO pModMachO); 170 static int kldrModMachOLoadFixups(PKLDRMODMACHO pModMachO, off_toffFixups, uint32_t cFixups, macho_relocation_info_t **ppaFixups);170 static int kldrModMachOLoadFixups(PKLDRMODMACHO pModMachO, KLDRFOFF offFixups, uint32_t cFixups, macho_relocation_info_t **ppaFixups); 171 171 static int kldrModMachOMapVirginBits(PKLDRMODMACHO pModMachO); 172 172 … … 197 197 * @param ppMod Where to store the module instance pointer. 198 198 */ 199 static int kldrModMachOCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, off_toffNewHdr, PPKLDRMOD ppMod)199 static int kldrModMachOCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, KLDRFOFF offNewHdr, PPKLDRMOD ppMod) 200 200 { 201 201 PKLDRMODMACHO pModMachO; … … 602 602 if ( pSect->nreloc 603 603 && ( pSect->reloff > cbFile 604 || (uint64_t)pSect->reloff + ( off_t)pSect->nreloc * sizeof(macho_relocation_info_t)) > cbFile)604 || (uint64_t)pSect->reloff + (KLDRFOFF)pSect->nreloc * sizeof(macho_relocation_info_t)) > cbFile) 605 605 return KLDR_ERR_MACHO_BAD_SECTION; 606 606 … … 904 904 /* more checks? */ 905 905 if (fOk) 906 pSeg[-1].cbFile = ( off_t)(pSect->addr - pSeg[-1].LinkAddress) + pSect->size;906 pSeg[-1].cbFile = (KLDRFOFF)(pSect->addr - pSeg[-1].LinkAddress) + pSect->size; 907 907 else 908 908 { … … 2205 2205 * @param ppaFixups Where to put the pointer to the allocated fixup array. 2206 2206 */ 2207 static int kldrModMachOLoadFixups(PKLDRMODMACHO pModMachO, off_toffFixups, uint32_t cFixups, macho_relocation_info_t **ppaFixups)2207 static int kldrModMachOLoadFixups(PKLDRMODMACHO pModMachO, KLDRFOFF offFixups, uint32_t cFixups, macho_relocation_info_t **ppaFixups) 2208 2208 { 2209 2209 macho_relocation_info_t *paFixups; -
trunk/kLdr/kLdrModNative.c
r2973 r2974 154 154 * @param ppMod Where to store the module instance pointer. 155 155 */ 156 static int kldrModNativeCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, off_toffNewHdr, PPKLDRMOD ppMod)156 static int kldrModNativeCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, KLDRFOFF offNewHdr, PPKLDRMOD ppMod) 157 157 { 158 158 int rc = kLdrModOpenNative(kLdrRdrName(pRdr), ppMod); -
trunk/kLdr/kLdrModPE.c
r2966 r2974 91 91 uint32_t cImportModules; 92 92 /** The offset of the NT headers. */ 93 off_toffHdrs;93 KLDRFOFF offHdrs; 94 94 /** Copy of the NT headers. */ 95 95 IMAGE_NT_HEADERS64 Hdrs; … … 106 106 PFNKLDRMODGETIMPORT pfnGetImport, void *pvUser); 107 107 108 static int kldrModPEDoCreate(PKLDRRDR pRdr, off_toffNewHdr, PKLDRMODPE *ppMod);108 static int kldrModPEDoCreate(PKLDRRDR pRdr, KLDRFOFF offNewHdr, PKLDRMODPE *ppMod); 109 109 /*static void kldrModPEDoLoadConfigConversion(PIMAGE_LOAD_CONFIG_DIRECTORY64 pLoadCfg); */ 110 110 static int kLdrModPEDoOptionalHeaderValidation(PKLDRMODPE pModPE); … … 135 135 * @param ppMod Where to store the module instance pointer. 136 136 */ 137 static int kldrModPECreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, off_toffNewHdr, PPKLDRMOD ppMod)137 static int kldrModPECreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, KLDRFOFF offNewHdr, PPKLDRMOD ppMod) 138 138 { 139 139 PKLDRMODPE pModPE; … … 160 160 * simplify cleanup on failure. 161 161 */ 162 static int kldrModPEDoCreate(PKLDRRDR pRdr, off_toffNewHdr, PKLDRMODPE *ppModPE)162 static int kldrModPEDoCreate(PKLDRRDR pRdr, KLDRFOFF offNewHdr, PKLDRMODPE *ppModPE) 163 163 { 164 164 struct … … 171 171 size_t cb; 172 172 size_t cchFilename; 173 off_toff;173 KLDRFOFF off; 174 174 uint32_t i; 175 175 int rc; -
trunk/kLdr/kLdrRdr.c
r2893 r2974 139 139 * @param off Where to start reading. 140 140 */ 141 int kLdrRdrRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, off_toff)141 int kLdrRdrRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, KLDRFOFF off) 142 142 { 143 143 KLDRRDR_VALIDATE(pRdr); … … 178 178 * @param pRdr The file provider instance. 179 179 */ 180 off_tkLdrRdrSize(PKLDRRDR pRdr)180 KLDRFOFF kLdrRdrSize(PKLDRRDR pRdr) 181 181 { 182 182 KLDRRDR_VALIDATE(pRdr); … … 190 190 * @param pRdr The file provider instance. 191 191 */ 192 off_tkLdrRdrTell(PKLDRRDR pRdr)192 KLDRFOFF kLdrRdrTell(PKLDRRDR pRdr) 193 193 { 194 194 KLDRRDR_VALIDATE(pRdr); -
trunk/kLdr/kLdrRdrFile.c
r2970 r2974 207 207 #endif 208 208 /** The current file offset. */ 209 off_toff;209 KLDRFOFF off; 210 210 /** The file size. */ 211 off_tcb;211 KLDRFOFF cb; 212 212 /** Array where we stuff the mapping area data. */ 213 213 KLDRRDRFILEPREP aPreps[4]; … … 237 237 static size_t kldrRdrFilePageSize(PKLDRRDR pRdr); 238 238 static const char *kldrRdrFileName(PKLDRRDR pRdr); 239 static off_tkldrRdrFileTell(PKLDRRDR pRdr);240 static off_tkldrRdrFileSize(PKLDRRDR pRdr);239 static KLDRFOFF kldrRdrFileTell(PKLDRRDR pRdr); 240 static KLDRFOFF kldrRdrFileSize(PKLDRRDR pRdr); 241 241 static int kldrRdrFileAllUnmap(PKLDRRDR pRdr, const void *pvBits); 242 242 static int kldrRdrFileAllMap(PKLDRRDR pRdr, const void **ppvBits); 243 static int kldrRdrFileRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, off_toff);243 static int kldrRdrFileRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, KLDRFOFF off); 244 244 static int kldrRdrFileDestroy(PKLDRRDR pRdr); 245 245 static int kldrRdrFileCreate(PPKLDRRDR ppRdr, const char *pszFilename); … … 836 836 837 837 /** @copydoc KLDRRDR::pfnTell */ 838 static off_tkldrRdrFileTell(PKLDRRDR pRdr)838 static KLDRFOFF kldrRdrFileTell(PKLDRRDR pRdr) 839 839 { 840 840 PKLDRRDRFILE pRdrFile = (PKLDRRDRFILE)pRdr; … … 862 862 if (rc) 863 863 return -1; 864 pRdrFile->off = (( off_t)offHigh << 32) | offLow;864 pRdrFile->off = ((KLDRFOFF)offHigh << 32) | offLow; 865 865 866 866 #else … … 873 873 874 874 /** @copydoc KLDRRDR::pfnSize */ 875 static off_tkldrRdrFileSize(PKLDRRDR pRdr)875 static KLDRFOFF kldrRdrFileSize(PKLDRRDR pRdr) 876 876 { 877 877 PKLDRRDRFILE pRdrFile = (PKLDRRDRFILE)pRdr; … … 915 915 { 916 916 int rc; 917 off_tcb = pRdrFile->Core.pOps->pfnSize(pRdr);917 KLDRFOFF cb = pRdrFile->Core.pOps->pfnSize(pRdr); 918 918 919 919 pRdrFile->pvMapping = kldrHlpAlloc(cb); … … 941 941 942 942 /** @copydoc KLDRRDR::pfnRead */ 943 static int kldrRdrFileRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, off_toff)943 static int kldrRdrFileRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, KLDRFOFF off) 944 944 { 945 945 PKLDRRDRFILE pRdrFile = (PKLDRRDRFILE)pRdr; … … 965 965 LONG offLow; 966 966 967 offHigh = sizeof( off_t) == 4 ? 0 : (off >> 32);967 offHigh = sizeof(KLDRFOFF) == 4 ? 0 : (off >> 32); 968 968 offLow = SetFilePointer(pRdrFile->File, (LONG)off, &offHigh, FILE_BEGIN); 969 969 if ( offLow != (LONG)off 970 || offHigh != (LONG)(sizeof( off_t) == 4 ? 0 : (off >> 32)))970 || offHigh != (LONG)(sizeof(KLDRFOFF) == 4 ? 0 : (off >> 32))) 971 971 { 972 972 int rc = GetLastError(); … … 1070 1070 APIRET rc; 1071 1071 HFILE File = 0; 1072 off_tcb;1072 KLDRFOFF cb; 1073 1073 char szFilename[CCHMAXPATH]; 1074 1074 … … 1109 1109 int rc; 1110 1110 HANDLE File; 1111 off_tcb;1111 KLDRFOFF cb; 1112 1112 char szFilename[MAX_PATH]; 1113 1113 … … 1134 1134 return rc; 1135 1135 } 1136 if (sizeof( off_t) == 4)1136 if (sizeof(KLDRFOFF) == 4) 1137 1137 cb = High ? 0x7fffffff : Low; 1138 1138 else 1139 cb = (( off_t)High << 32) | Low;1139 cb = ((KLDRFOFF)High << 32) | Low; 1140 1140 1141 1141 #else -
trunk/kLdr/tstkLdrMod.c
r2959 r2974 250 250 */ 251 251 static int BasicTestEnumDbgInfoCallback(PKLDRMOD pMod, uint32_t iDbgInfo, KLDRDBGINFOTYPE enmType, 252 int16_t iMajorVer, int16_t iMinorVer, off_toffFile, KLDRADDR LinkAddress,252 int16_t iMajorVer, int16_t iMinorVer, KLDRFOFF offFile, KLDRADDR LinkAddress, 253 253 KLDRSIZE cb, const char *pszExtFile, void *pvUser) 254 254 {
Note:
See TracChangeset
for help on using the changeset viewer.