Changeset 2974 for trunk/kLdr/kLdrRdrFile.c
- Timestamp:
- Feb 14, 2007, 11:12:44 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.