Changeset 59620 in vbox for trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp
- Timestamp:
- Feb 10, 2016 12:47:33 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 105459
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp
r57358 r59620 2135 2135 2136 2136 2137 RTDECL(int) RTVfsIoStrmSgRead(RTVFSIOSTREAM hVfsIos, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbRead)2137 RTDECL(int) RTVfsIoStrmSgRead(RTVFSIOSTREAM hVfsIos, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbRead) 2138 2138 { 2139 2139 AssertPtrNullReturn(pcbRead, VERR_INVALID_POINTER); … … 2150 2150 int rc; 2151 2151 if (!(pThis->pOps->fFeatures & RTVFSIOSTREAMOPS_FEAT_NO_SG)) 2152 rc = pThis->pOps->pfnRead(pThis->Base.pvThis, -1 /*off*/, pSgBuf, fBlocking, pcbRead);2152 rc = pThis->pOps->pfnRead(pThis->Base.pvThis, off, pSgBuf, fBlocking, pcbRead); 2153 2153 else 2154 2154 { … … 2162 2162 2163 2163 size_t cbReadSeg = pcbRead ? 0 : pSgBuf->paSegs[iSeg].cbSeg; 2164 rc = pThis->pOps->pfnRead(pThis->Base.pvThis, -1 /*off*/, &SgBuf, fBlocking, pcbRead ? &cbReadSeg : NULL);2164 rc = pThis->pOps->pfnRead(pThis->Base.pvThis, off, &SgBuf, fBlocking, pcbRead ? &cbReadSeg : NULL); 2165 2165 if (RT_FAILURE(rc)) 2166 2166 break; … … 2168 2168 if ((pcbRead && cbReadSeg != SgBuf.paSegs[0].cbSeg) || rc != VINF_SUCCESS) 2169 2169 break; 2170 if (off != -1) 2171 off += cbReadSeg; 2170 2172 } 2171 2173 … … 2178 2180 2179 2181 2180 RTDECL(int) RTVfsIoStrmSgWrite(RTVFSIOSTREAM hVfsIos, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbWritten)2182 RTDECL(int) RTVfsIoStrmSgWrite(RTVFSIOSTREAM hVfsIos, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbWritten) 2181 2183 { 2182 2184 AssertPtrNullReturn(pcbWritten, VERR_INVALID_POINTER); … … 2193 2195 int rc; 2194 2196 if (!(pThis->pOps->fFeatures & RTVFSIOSTREAMOPS_FEAT_NO_SG)) 2195 rc = pThis->pOps->pfnWrite(pThis->Base.pvThis, -1 /*off*/, pSgBuf, fBlocking, pcbWritten);2197 rc = pThis->pOps->pfnWrite(pThis->Base.pvThis, off, pSgBuf, fBlocking, pcbWritten); 2196 2198 else 2197 2199 { … … 2205 2207 2206 2208 size_t cbWrittenSeg = 0; 2207 rc = pThis->pOps->pfnWrite(pThis->Base.pvThis, -1 /*off*/, &SgBuf, fBlocking, pcbWritten ? &cbWrittenSeg : NULL);2209 rc = pThis->pOps->pfnWrite(pThis->Base.pvThis, off, &SgBuf, fBlocking, pcbWritten ? &cbWrittenSeg : NULL); 2208 2210 if (RT_FAILURE(rc)) 2209 2211 break; … … 2213 2215 if (cbWrittenSeg != SgBuf.paSegs[0].cbSeg) 2214 2216 break; 2217 if (off != -1) 2218 off += cbWrittenSeg; 2215 2219 } 2220 else if (off != -1) 2221 off += pSgBuf->paSegs[iSeg].cbSeg; 2216 2222 } 2217 2223
Note:
See TracChangeset
for help on using the changeset viewer.