Changeset 2974 for trunk


Ignore:
Timestamp:
Feb 14, 2007, 11:12:44 AM (18 years ago)
Author:
bird
Message:

off_t -> KLDRFOFF.

Location:
trunk/kLdr
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/kLdr.h

    r2965 r2974  
    114114
    115115
     116/** The kLdr file offset type. */
     117typedef long KLDRFOFF;
     118/** Pointer to a kLdr file offset type. */
     119typedef KLDRFOFF *PKLDRFOFF;
     120/** Pointer to a const kLdr file offset type. */
     121typedef const KLDRFOFF *PCKLDRFOFF;
     122
     123/** @def PRI_KLDRFOFF
     124 * printf format type. */
     125#define PRI_KLDRFOFF     "lx"
     126
     127
    116128/**
    117129 * Union of all the integer types.
     
    258270    int     (* pfnDestroy)( PKLDRRDR pRdr);
    259271    /** @copydoc kLdrRdrRead */
    260     int     (* pfnRead)(    PKLDRRDR pRdr, void *pvBuf, size_t cb, off_t off);
     272    int     (* pfnRead)(    PKLDRRDR pRdr, void *pvBuf, size_t cb, KLDRFOFF off);
    261273    /** @copydoc kLdrRdrAllMap */
    262274    int     (* pfnAllMap)(  PKLDRRDR pRdr, const void **ppvBits);
     
    264276    int     (* pfnAllUnmap)(PKLDRRDR pRdr, const void *pvBits);
    265277    /** @copydoc kLdrRdrSize */
    266     off_t  (* pfnSize)(    PKLDRRDR pRdr);
     278    KLDRFOFF (* pfnSize)(    PKLDRRDR pRdr);
    267279    /** @copydoc kLdrRdrTell */
    268     off_t  (* pfnTell)(    PKLDRRDR pRdr);
     280    KLDRFOFF (* pfnTell)(    PKLDRRDR pRdr);
    269281    /** @copydoc kLdrRdrName */
    270282    const char * (* pfnName)(PKLDRRDR pRdr);
     
    308320int     kLdrRdrOpen(    PPKLDRRDR ppRdr, const char *pszFilename);
    309321int     kLdrRdrClose(   PKLDRRDR pRdr);
    310 int     kLdrRdrRead(    PKLDRRDR pRdr, void *pvBuf, size_t cb, off_t off);
     322int     kLdrRdrRead(    PKLDRRDR pRdr, void *pvBuf, size_t cb, KLDRFOFF off);
    311323int     kLdrRdrAllMap(  PKLDRRDR pRdr, const void **ppvBits);
    312324int     kLdrRdrAllUnmap(PKLDRRDR pRdr, const void *pvBits);
    313 off_t  kLdrRdrSize(    PKLDRRDR pRdr);
    314 off_t  kLdrRdrTell(    PKLDRRDR pRdr);
     325KLDRFOFF kLdrRdrSize(    PKLDRRDR pRdr);
     326KLDRFOFF kLdrRdrTell(    PKLDRRDR pRdr);
    315327const char *kLdrRdrName(PKLDRRDR pRdr);
    316328size_t  kLdrRdrPageSize(PKLDRRDR pRdr);
     
    523535    /** File offset of the segment.
    524536     * Set to -1 if no file backing (like BSS). */
    525     off_t           offFile;
     537    KLDRFOFF        offFile;
    526538    /** Size of the file bits of the segment.
    527539     * Set to -1 if no file backing (like BSS). */
    528     off_t           cbFile;
     540    KLDRFOFF        cbFile;
    529541    /** The relative virtual address when mapped.
    530542     * Set to NIL_KLDRADDR if the segment isn't supposed to be mapped. */
     
    810822 */
    811823typedef int FNKLDRENUMDBG(PKLDRMOD pMod, uint32_t iDbgInfo, KLDRDBGINFOTYPE enmType, int16_t iMajorVer, int16_t iMinorVer,
    812                           off_t offFile, KLDRADDR LinkAddress, KLDRSIZE cb, const char *pszExtFile, void *pvUser);
     824                          KLDRFOFF offFile, KLDRADDR LinkAddress, KLDRSIZE cb, const char *pszExtFile, void *pvUser);
    813825/** Pointer to a debug info enumerator callback. */
    814826typedef FNKLDRENUMDBG *PFNKLDRENUMDBG;
     
    932944     * @param   ppMod           Where to store the module instance pointer.
    933945     */
    934     int (* pfnCreate)(PCKLDRMODOPS pOps, PKLDRRDR pRdr, off_t offNewHdr, PPKLDRMOD ppMod);
     946    int (* pfnCreate)(PCKLDRMODOPS pOps, PKLDRRDR pRdr, KLDRFOFF offNewHdr, PPKLDRMOD ppMod);
    935947    /**
    936948     * Destroys an loader module instance.
  • trunk/kLdr/kLdrMod.c

    r2954 r2974  
    144144        uint16_t    au16[2];
    145145        uint8_t     au8[4];
    146     }       u;
    147     off_t   offHdr = 0;
    148     int     rc;
     146    }           u;
     147    KLDRFOFF    offHdr = 0;
     148    int         rc;
    149149
    150150    /*
     
    161161        if (rc)
    162162            return rc;
    163         if ((off_t)u.u32 < kLdrRdrSize(pRdr))
     163        if ((KLDRFOFF)u.u32 < kLdrRdrSize(pRdr))
    164164        {
    165165            offHdr = u.u32;
     
    259259 */
    260260int     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,
    262262                           PFNKLDRMODGETIMPORT pfnGetForwarder, void *pvUser, PKLDRADDR puValue, uint32_t *pfKind)
    263263{
     
    269269    if (pfKind)
    270270        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,
    272272                                      pfnGetForwarder, pvUser, puValue, pfKind);
    273273}
     
    394394/**
    395395 * 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 *
    401401 * @returns 0 on success.
    402402 * @returns Whatever non-zero status returned by pfnCallback (enumeration was stopped).
    403403 * @returns non-zero kLdr or native status code on failure.
    404  * 
     404 *
    405405 * @param   pMod            The module.
    406406 * @param   pvBits          Optional pointer to bits returned by kLdrModGetBits() currently located at BaseAddress.
     
    433433/**
    434434 * Enumerates the resources matching the specfied criteria.
    435  * 
    436  * 
     435 *
     436 *
    437437 * @returns 0 on success.
    438438 * @returns Whatever non-zero status returned by pfnCallback (enumeration was stopped).
    439439 * @returns non-zero kLdr or native status code on failure.
    440  * 
     440 *
    441441 * @param   pMod            The module.
    442442 * @param   pvBits          Optional pointer to bits returned by kLdrModGetBits() currently located at BaseAddress.
     
    453453 * @param   pvUser          The user argument for the callback.
    454454 */
    455 int     kLdrModEnumResources(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t idType, const char *pszType, 
     455int     kLdrModEnumResources(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t idType, const char *pszType,
    456456                             uint32_t idName, const char *pszName, uint32_t idLang, PFNKLDRENUMRSRC pfnCallback, void *pvUser)
    457457{
     
    497497/**
    498498 * May free up some resources held by the module.
    499  * 
     499 *
    500500 * @todo define exactly what it possible to do after this call.
    501  * 
     501 *
    502502 * @returns 0 on success, KLDR_ERR_* on failure.
    503503 * @param   pMod    The module.
  • trunk/kLdr/kLdrModLX.c

    r2948 r2974  
    7070
    7171    /** The offset of the LX header. */
    72     off_t                   offHdr;
     72    KLDRFOFF                offHdr;
    7373    /** Copy of the LX header. */
    7474    struct e32_exe          Hdr;
     
    116116static int kldrModLXRelocateBits(PKLDRMOD pMod, void *pvBits, KLDRADDR NewBaseAddress, KLDRADDR OldBaseAddress,
    117117                                 PFNKLDRMODGETIMPORT pfnGetImport, void *pvUser);
    118 static int kldrModLXDoCreate(PKLDRRDR pRdr, off_t offNewHdr, PKLDRMODLX *ppModLX);
     118static int kldrModLXDoCreate(PKLDRRDR pRdr, KLDRFOFF offNewHdr, PKLDRMODLX *ppModLX);
    119119static const uint8_t *kldrModLXDoNameTableLookupByOrdinal(const uint8_t *pbNameTable, int32_t cbNameTable, uint32_t iOrdinal);
    120120static int kldrModLXDoNameLookup(PKLDRMODLX pModLX, const char *pchSymbol, uint32_t cchSymbol, uint32_t *piSymbol);
     
    133133static int kldrModLXDoLoadFixupSection(PKLDRMODLX pModLX);
    134134static 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, 
     135static int kldrModLXDoReloc(uint8_t *pbPage, int off, KLDRADDR PageAddress, const struct r32_rlc *prlc,
    136136                            int iSelector, KLDRADDR uValue, uint32_t fKind);
    137137
     
    148148 * @param   ppMod           Where to store the module instance pointer.
    149149 */
    150 static int kldrModLXCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, off_t offNewHdr, PPKLDRMOD ppMod)
     150static int kldrModLXCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, KLDRFOFF offNewHdr, PPKLDRMOD ppMod)
    151151{
    152152    PKLDRMODLX pModLX;
     
    173173 * simplify cleanup on failure.
    174174 */
    175 static int kldrModLXDoCreate(PKLDRRDR pRdr, off_t offNewHdr, PKLDRMODLX *ppModLX)
     175static int kldrModLXDoCreate(PKLDRRDR pRdr, KLDRFOFF offNewHdr, PKLDRMODLX *ppModLX)
    176176{
    177177    struct e32_exe Hdr;
     
    208208
    209209    /* 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);
    211211    if (    Hdr.e32_itermap > offEnd
    212212        ||  Hdr.e32_datapage > offEnd
     
    249249        &&  (Hdr.e32_fpagetab < off || Hdr.e32_fpagetab > offEnd))
    250250    {
    251         /* 
     251        /*
    252252         * wlink mixes the fixup section and the loader section.
    253253         */
     
    21052105                        else
    21062106                            uValue = pMod->aSegments[iSeg].MapAddress;
    2107                         if (    (u.prlc->nr_stype & NRALIAS) 
     2107                        if (    (u.prlc->nr_stype & NRALIAS)
    21082108                            ||  (pMod->aSegments[iSeg].fFlags & KLDRSEG_FLAG_16BIT))
    21092109                            iSelector = pMod->aSegments[iSeg].Sel16bit;
     
    22422242
    22432243                    /* common / simple */
    2244                     if (    (u.prlc->nr_stype & NRSRCMASK) == NROFF32 
    2245                         &&  off >= 0 
     2244                    if (    (u.prlc->nr_stype & NRSRCMASK) == NROFF32
     2245                        &&  off >= 0
    22462246                        &&  off <= OBJPAGELEN - 4)
    22472247                        *(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
    22502250                            &&  off <= OBJPAGELEN - 4)
    22512251                        *(uint32_t *)&pbPage[off] = uValue - (PageAddress + off);
     
    23212321/**
    23222322 * 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
    23252325 * are dealt with seperately.
    23262326 *
     
    23312331 * @param   fKind       The target kind.
    23322332 */
    2333 static int kldrModLXDoReloc(uint8_t *pbPage, int off, KLDRADDR PageAddress, const struct r32_rlc *prlc, 
     2333static int kldrModLXDoReloc(uint8_t *pbPage, int off, KLDRADDR PageAddress, const struct r32_rlc *prlc,
    23342334                            int iSelector, KLDRADDR uValue, uint32_t fKind)
    23352335{
    2336     static const uint8_t s_acb[16] = 
     2336    static const uint8_t s_acb[16] =
    23372337    {
    23382338        1, /* 0: NRSBYT */
     
    23402340        2, /* 2: NRSSEG - selector */
    23412341        4, /* 3: NRSPTR - 16:16 */
    2342         0, 
     2342        0,
    23432343        2, /* 5: NRSOFF - 16-bit offset */
    23442344        6, /* 6: NRPTR48 - 16:32 */
     
    23482348    };
    23492349#pragma pack(1) /* just to be sure */
    2350     union 
     2350    union
    23512351    {
    23522352        uint8_t     ab[6];
     
    23542354        uint16_t    off16;
    23552355        uint8_t     off8;
    2356         struct 
     2356        struct
    23572357        {
    23582358            uint16_t off;
    23592359            uint16_t Sel;
    23602360        }           Far16;
    2361         struct 
     2361        struct
    23622362        {
    23632363            uint32_t off;
     
    23752375    switch (prlc->nr_stype & NRSRCMASK)
    23762376    {
    2377         case NRSBYT:       
     2377        case NRSBYT:
    23782378            uData.off8 = (uint8_t)uValue;
    23792379            cb = 1;
  • trunk/kLdr/kLdrModMachO.c

    r2972 r2974  
    6868    /** The file offset of this section.
    6969     * This is -1 if the section doesn't have a file backing. */
    70     off_t                   offFile;
     70    KLDRFOFF                offFile;
    7171    /** The number of fixups. */
    7272    uint32_t                cFixups;
     
    7575    /** The file offset of the fixups for this section.
    7676     * This is -1 if the section doesn't have any fixups. */
    77     off_t                   offFixups;
     77    KLDRFOFF                offFixups;
    7878    /** Mach-O section flags. */
    7979    uint32_t                fFlags;
     
    128128
    129129    /** The offset of the symbol table. */
    130     off_t                   offSymbols;
     130    KLDRFOFF                offSymbols;
    131131    /** The number of symbols. */
    132132    uint32_t                cSymbols;
     
    134134    void                   *pvaSymbols;
    135135    /** The offset of the string table. */
    136     off_t                   offStrings;
     136    KLDRFOFF                offStrings;
    137137    /** The size of the of the string table. */
    138138    uint32_t                cchStrings;
     
    168168/*static int  kldrModMachOLoadLoadCommands(PKLDRMODMACHO pModMachO);*/
    169169static int  kldrModMachOLoadObjSymTab(PKLDRMODMACHO pModMachO);
    170 static int  kldrModMachOLoadFixups(PKLDRMODMACHO pModMachO, off_t offFixups, uint32_t cFixups, macho_relocation_info_t **ppaFixups);
     170static int  kldrModMachOLoadFixups(PKLDRMODMACHO pModMachO, KLDRFOFF offFixups, uint32_t cFixups, macho_relocation_info_t **ppaFixups);
    171171static int  kldrModMachOMapVirginBits(PKLDRMODMACHO pModMachO);
    172172
     
    197197 * @param   ppMod           Where to store the module instance pointer.
    198198 */
    199 static int kldrModMachOCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, off_t offNewHdr, PPKLDRMOD ppMod)
     199static int kldrModMachOCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, KLDRFOFF offNewHdr, PPKLDRMOD ppMod)
    200200{
    201201    PKLDRMODMACHO pModMachO;
     
    602602                    if (    pSect->nreloc
    603603                        &&  (   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)
    605605                        return KLDR_ERR_MACHO_BAD_SECTION;
    606606
     
    904904                                    /* more checks? */
    905905                                    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;
    907907                                    else
    908908                                    {
     
    22052205 * @param   ppaFixups       Where to put the pointer to the allocated fixup array.
    22062206 */
    2207 static int  kldrModMachOLoadFixups(PKLDRMODMACHO pModMachO, off_t offFixups, uint32_t cFixups, macho_relocation_info_t **ppaFixups)
     2207static int  kldrModMachOLoadFixups(PKLDRMODMACHO pModMachO, KLDRFOFF offFixups, uint32_t cFixups, macho_relocation_info_t **ppaFixups)
    22082208{
    22092209    macho_relocation_info_t *paFixups;
  • trunk/kLdr/kLdrModNative.c

    r2973 r2974  
    154154 * @param   ppMod           Where to store the module instance pointer.
    155155 */
    156 static int kldrModNativeCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, off_t offNewHdr, PPKLDRMOD ppMod)
     156static int kldrModNativeCreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, KLDRFOFF offNewHdr, PPKLDRMOD ppMod)
    157157{
    158158    int rc = kLdrModOpenNative(kLdrRdrName(pRdr), ppMod);
  • trunk/kLdr/kLdrModPE.c

    r2966 r2974  
    9191    uint32_t                cImportModules;
    9292    /** The offset of the NT headers. */
    93     off_t                   offHdrs;
     93    KLDRFOFF                offHdrs;
    9494    /** Copy of the NT headers. */
    9595    IMAGE_NT_HEADERS64      Hdrs;
     
    106106                                  PFNKLDRMODGETIMPORT pfnGetImport, void *pvUser);
    107107
    108 static int  kldrModPEDoCreate(PKLDRRDR pRdr, off_t offNewHdr, PKLDRMODPE *ppMod);
     108static int  kldrModPEDoCreate(PKLDRRDR pRdr, KLDRFOFF offNewHdr, PKLDRMODPE *ppMod);
    109109/*static void kldrModPEDoLoadConfigConversion(PIMAGE_LOAD_CONFIG_DIRECTORY64 pLoadCfg); */
    110110static int  kLdrModPEDoOptionalHeaderValidation(PKLDRMODPE pModPE);
     
    135135 * @param   ppMod           Where to store the module instance pointer.
    136136 */
    137 static int kldrModPECreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, off_t offNewHdr, PPKLDRMOD ppMod)
     137static int kldrModPECreate(PCKLDRMODOPS pOps, PKLDRRDR pRdr, KLDRFOFF offNewHdr, PPKLDRMOD ppMod)
    138138{
    139139    PKLDRMODPE pModPE;
     
    160160 * simplify cleanup on failure.
    161161 */
    162 static int kldrModPEDoCreate(PKLDRRDR pRdr, off_t offNewHdr, PKLDRMODPE *ppModPE)
     162static int kldrModPEDoCreate(PKLDRRDR pRdr, KLDRFOFF offNewHdr, PKLDRMODPE *ppModPE)
    163163{
    164164    struct
     
    171171    size_t cb;
    172172    size_t cchFilename;
    173     off_t off;
     173    KLDRFOFF off;
    174174    uint32_t i;
    175175    int rc;
  • trunk/kLdr/kLdrRdr.c

    r2893 r2974  
    139139 * @param   off         Where to start reading.
    140140 */
    141 int kLdrRdrRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, off_t off)
     141int kLdrRdrRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, KLDRFOFF off)
    142142{
    143143    KLDRRDR_VALIDATE(pRdr);
     
    178178 * @param   pRdr        The file provider instance.
    179179 */
    180 off_t kLdrRdrSize(PKLDRRDR pRdr)
     180KLDRFOFF kLdrRdrSize(PKLDRRDR pRdr)
    181181{
    182182    KLDRRDR_VALIDATE(pRdr);
     
    190190 * @param   pRdr        The file provider instance.
    191191 */
    192 off_t kLdrRdrTell(PKLDRRDR pRdr)
     192KLDRFOFF kLdrRdrTell(PKLDRRDR pRdr)
    193193{
    194194    KLDRRDR_VALIDATE(pRdr);
  • trunk/kLdr/kLdrRdrFile.c

    r2970 r2974  
    207207#endif
    208208    /** The current file offset. */
    209     off_t               off;
     209    KLDRFOFF            off;
    210210    /** The file size. */
    211     off_t               cb;
     211    KLDRFOFF            cb;
    212212    /** Array where we stuff the mapping area data. */
    213213    KLDRRDRFILEPREP     aPreps[4];
     
    237237static size_t   kldrRdrFilePageSize(PKLDRRDR pRdr);
    238238static const char *kldrRdrFileName(PKLDRRDR pRdr);
    239 static off_t    kldrRdrFileTell(PKLDRRDR pRdr);
    240 static off_t    kldrRdrFileSize(PKLDRRDR pRdr);
     239static KLDRFOFF kldrRdrFileTell(PKLDRRDR pRdr);
     240static KLDRFOFF kldrRdrFileSize(PKLDRRDR pRdr);
    241241static int      kldrRdrFileAllUnmap(PKLDRRDR pRdr, const void *pvBits);
    242242static int      kldrRdrFileAllMap(PKLDRRDR pRdr, const void **ppvBits);
    243 static int      kldrRdrFileRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, off_t off);
     243static int      kldrRdrFileRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, KLDRFOFF off);
    244244static int      kldrRdrFileDestroy(PKLDRRDR pRdr);
    245245static int      kldrRdrFileCreate(PPKLDRRDR ppRdr, const char *pszFilename);
     
    836836
    837837/** @copydoc KLDRRDR::pfnTell */
    838 static off_t kldrRdrFileTell(PKLDRRDR pRdr)
     838static KLDRFOFF kldrRdrFileTell(PKLDRRDR pRdr)
    839839{
    840840    PKLDRRDRFILE pRdrFile = (PKLDRRDRFILE)pRdr;
     
    862862        if (rc)
    863863            return -1;
    864         pRdrFile->off = ((off_t)offHigh << 32) | offLow;
     864        pRdrFile->off = ((KLDRFOFF)offHigh << 32) | offLow;
    865865
    866866#else
     
    873873
    874874/** @copydoc KLDRRDR::pfnSize */
    875 static off_t kldrRdrFileSize(PKLDRRDR pRdr)
     875static KLDRFOFF kldrRdrFileSize(PKLDRRDR pRdr)
    876876{
    877877    PKLDRRDRFILE pRdrFile = (PKLDRRDRFILE)pRdr;
     
    915915    {
    916916        int rc;
    917         off_t cb = pRdrFile->Core.pOps->pfnSize(pRdr);
     917        KLDRFOFF cb = pRdrFile->Core.pOps->pfnSize(pRdr);
    918918
    919919        pRdrFile->pvMapping = kldrHlpAlloc(cb);
     
    941941
    942942/** @copydoc KLDRRDR::pfnRead */
    943 static int kldrRdrFileRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, off_t off)
     943static int kldrRdrFileRead(PKLDRRDR pRdr, void *pvBuf, size_t cb, KLDRFOFF off)
    944944{
    945945    PKLDRRDRFILE pRdrFile = (PKLDRRDRFILE)pRdr;
     
    965965        LONG offLow;
    966966
    967         offHigh = sizeof(off_t) == 4 ? 0 : (off >> 32);
     967        offHigh = sizeof(KLDRFOFF) == 4 ? 0 : (off >> 32);
    968968        offLow = SetFilePointer(pRdrFile->File, (LONG)off, &offHigh, FILE_BEGIN);
    969969        if (    offLow != (LONG)off
    970             ||  offHigh != (LONG)(sizeof(off_t) == 4 ? 0 : (off >> 32)))
     970            ||  offHigh != (LONG)(sizeof(KLDRFOFF) == 4 ? 0 : (off >> 32)))
    971971        {
    972972            int rc = GetLastError();
     
    10701070    APIRET          rc;
    10711071    HFILE           File = 0;
    1072     off_t           cb;
     1072    KLDRFOFF        cb;
    10731073    char            szFilename[CCHMAXPATH];
    10741074
     
    11091109    int                 rc;
    11101110    HANDLE              File;
    1111     off_t               cb;
     1111    KLDRFOFF            cb;
    11121112    char                szFilename[MAX_PATH];
    11131113
     
    11341134        return rc;
    11351135    }
    1136     if (sizeof(off_t) == 4)
     1136    if (sizeof(KLDRFOFF) == 4)
    11371137        cb = High ? 0x7fffffff : Low;
    11381138    else
    1139         cb = ((off_t)High << 32) | Low;
     1139        cb = ((KLDRFOFF)High << 32) | Low;
    11401140
    11411141#else
  • trunk/kLdr/tstkLdrMod.c

    r2959 r2974  
    250250 */
    251251static int BasicTestEnumDbgInfoCallback(PKLDRMOD pMod, uint32_t iDbgInfo, KLDRDBGINFOTYPE enmType,
    252                                         int16_t iMajorVer, int16_t iMinorVer, off_t offFile, KLDRADDR LinkAddress,
     252                                        int16_t iMajorVer, int16_t iMinorVer, KLDRFOFF offFile, KLDRADDR LinkAddress,
    253253                                        KLDRSIZE cb, const char *pszExtFile, void *pvUser)
    254254{
Note: See TracChangeset for help on using the changeset viewer.