Lines Matching refs:off

58  * @param   off      Offset to start reading from.
62 static int vdReadHelper(PVBOXHDD pDisk, uint64_t off, void *pvBuf, size_t cbRead)
67 if ( off % 512 == 0
69 rc = VDRead(pDisk, off, pvBuf, cbRead);
76 if (off % 512 != 0)
78 uint64_t offAligned = off & ~(uint64_t)(512 - 1);
79 size_t cbToCopy = 512 - (off - offAligned);
83 memcpy(pbBuf, &abBuf[off - offAligned], cbToCopy);
85 off += cbToCopy;
95 Assert(!(off % 512));
96 rc = VDRead(pDisk, off, pbBuf, cbReadAligned);
100 off += cbReadAligned;
109 Assert(!(off % 512));
111 rc = VDRead(pDisk, off, abBuf, 512);
126 * @param off Offset to start writing to.
130 static int vdWriteHelper(PVBOXHDD pDisk, uint64_t off, const void *pvBuf, size_t cbWrite)
135 if ( off % 512 == 0
137 rc = VDWrite(pDisk, off, pvBuf, cbWrite);
144 if (off % 512 != 0)
146 uint64_t offAligned = off & ~(uint64_t)(512 - 1);
147 size_t cbToCopy = 512 - (off - offAligned);
151 memcpy(&abBuf[off - offAligned], pbBuf, cbToCopy);
155 off += cbToCopy;
165 Assert(!(off % 512));
166 rc = VDWrite(pDisk, off, pbBuf, cbWriteAligned);
170 off += cbWriteAligned;
179 Assert(!(off % 512));
181 rc = VDRead(pDisk, off, abBuf, 512);
185 rc = VDWrite(pDisk, off, abBuf, 512);
224 static DECLCALLBACK(int) vdVfsFile_Read(void *pvThis, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbRead)
235 uint64_t offUnsigned = off < 0 ? pThis->offCurPos : (uint64_t)off;
266 rc = vdReadHelper(pThis->pDisk, (uint64_t)off, pSgBuf->paSegs[0].pvSeg, cbLeftToRead);
279 static DECLCALLBACK(int) vdVfsFile_Write(void *pvThis, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbWritten)
291 uint64_t offUnsigned = off < 0 ? pThis->offCurPos : (uint64_t)off;
321 rc = vdWriteHelper(pThis->pDisk, (uint64_t)off, pSgBuf->paSegs[0].pvSeg, cbLeftToWrite);