- Timestamp:
- Aug 24, 2007 9:21:51 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/file.h
r4071 r4372 188 188 * If NULL an error will be returned for a partial read. 189 189 */ 190 RTR3DECL(int) RTFileRead(RTFILE File, void *pvBuf, unsigned cbToRead, unsigned*pcbRead);190 RTR3DECL(int) RTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcbRead); 191 191 192 192 /** … … 202 202 * If NULL an error will be returned for a partial read. 203 203 */ 204 RTR3DECL(int) RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, unsigned cbToRead, unsigned*pcbRead);204 RTR3DECL(int) RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, size_t cbToRead, size_t *pcbRead); 205 205 206 206 /** … … 214 214 * If NULL an error will be returned for a partial write. 215 215 */ 216 RTR3DECL(int) RTFileWrite(RTFILE File, const void *pvBuf, unsigned cbToWrite, unsigned*pcbWritten);216 RTR3DECL(int) RTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten); 217 217 218 218 /** … … 228 228 * If NULL an error will be returned for a partial write. 229 229 */ 230 RTR3DECL(int) RTFileWriteAt(RTFILE File, RTFOFF off, const void *pvBuf, unsigned cbToWrite, unsigned*pcbWritten);230 RTR3DECL(int) RTFileWriteAt(RTFILE File, RTFOFF off, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten); 231 231 232 232 /** -
trunk/src/VBox/Devices/Network/DrvTAP.cpp
r4071 r4372 247 247 */ 248 248 char achBuf[4096]; 249 unsignedcbRead = 0;249 size_t cbRead = 0; 250 250 rc = RTFileRead(pData->FileDevice, achBuf, sizeof(achBuf), &cbRead); 251 251 if (VBOX_SUCCESS(rc)) … … 318 318 /* drain the pipe */ 319 319 char ch; 320 unsignedcbRead;320 size_t cbRead; 321 321 RTFileRead(pData->PipeRead, &ch, 1, &cbRead); 322 322 } … … 369 369 /* data waiting, read it. */ 370 370 char achBuf[4096]; 371 unsignedcbRead = 0;371 size_t cbRead = 0; 372 372 int rc = RTFileRead(pData->FileDevice, achBuf, RT_MIN(sizeof(achBuf), cbMax), &cbRead); 373 373 if (VBOX_SUCCESS(rc)) -
trunk/src/VBox/Devices/Network/DrvTAPOs2.cpp
r4071 r4372 281 281 else 282 282 { 283 LogFlow(("drvTAPOs2AsyncIoThread: RTFileRead-> %Vrc\n", rc));283 LogFlow(("drvTAPOs2AsyncIoThread: DoDevIOCtl -> %Vrc\n", rc)); 284 284 if (rc == VERR_INVALID_HANDLE) 285 285 break; -
trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp
r4254 r4372 441 441 { 442 442 /* Get a block of data from the host serial device. */ 443 unsignedcbRead;443 size_t cbRead; 444 444 rc = RTFileRead(pData->DeviceFile, abBuffer, sizeof(abBuffer), &cbRead); 445 445 if (VBOX_FAILURE(rc)) -
trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp
r4071 r4372 140 140 if (VBOX_FAILURE(rc)) 141 141 { 142 Log(("drvNamedPipeRead: RTFileRead returned %Vrc fShutdown=%d\n", rc, pData->fShutdown));142 Log(("drvNamedPipeRead: FileRead returned %Vrc fShutdown=%d\n", rc, pData->fShutdown)); 143 143 if ( !pData->fShutdown 144 144 && ( rc == VERR_EOF -
trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp
r4071 r4372 1844 1844 } 1845 1845 1846 /*size_t*/unsignedcbRead;1846 size_t cbRead; 1847 1847 rc = RTFileReadAt(pImage->File, 0, pImage->pDescData, 1848 1848 pImage->cbDescAlloc, &cbRead); -
trunk/src/VBox/Devices/Storage/testcase/vditool.cpp
r4355 r4372 127 127 while (off < cbFile) 128 128 { 129 unsignedcbRead = 0;129 size_t cbRead = 0; 130 130 rc = RTFileRead(File, pvBuf, VDIDiskGetBufferSize(pVdi), &cbRead); 131 131 if (VBOX_FAILURE(rc) || !cbRead) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r4370 r4372 2482 2482 while (off < cbFile) 2483 2483 { 2484 unsignedcbRead = 0;2484 size_t cbRead = 0; 2485 2485 rc = RTFileRead(File, pvBuf, VDIDiskGetBufferSize(pVdi), &cbRead); 2486 2486 if (VBOX_FAILURE(rc) || !cbRead) -
trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp
r4071 r4372 1035 1035 { 1036 1036 SHFLFILEHANDLE *pHandle = (SHFLFILEHANDLE *)vbsfQueryHandle(Handle, SHFL_HF_TYPE_FILE); 1037 unsignedcount = 0;1037 size_t count = 0; 1038 1038 int rc; 1039 1039 … … 1058 1058 1059 1059 rc = RTFileRead(pHandle->file.Handle, pBuffer, *pcbBuffer, &count); 1060 *pcbBuffer = count;1060 *pcbBuffer = (uint32_t)count; 1061 1061 Log(("RTFileRead returned %Vrc bytes read %x\n", rc, count)); 1062 1062 return rc; … … 1066 1066 { 1067 1067 SHFLFILEHANDLE *pHandle = (SHFLFILEHANDLE *)vbsfQueryHandle(Handle, SHFL_HF_TYPE_FILE); 1068 unsignedcount = 0;1068 size_t count = 0; 1069 1069 int rc; 1070 1070 … … 1078 1078 1079 1079 if (*pcbBuffer == 0) 1080 return VINF_SUCCESS; /* @todo correct? */1080 return VINF_SUCCESS; /** @todo correct? */ 1081 1081 1082 1082 rc = RTFileSeek(pHandle->file.Handle, offset, RTFILE_SEEK_BEGIN, NULL); … … 1088 1088 1089 1089 rc = RTFileWrite(pHandle->file.Handle, pBuffer, *pcbBuffer, &count); 1090 *pcbBuffer = count;1090 *pcbBuffer = (uint32_t)count; 1091 1091 Log(("RTFileWrite returned %Vrc bytes written %x\n", rc, count)); 1092 1092 return rc; -
trunk/src/VBox/Main/xml/cfgldr.cpp
r4337 r4372 593 593 594 594 // read from the file 595 unsignedcbRead = 0;595 size_t cbRead = 0; 596 596 rc = RTFileRead (m_hFileHandle, toFill, maxToRead, &cbRead); 597 597 AssertRC (rc); … … 603 603 AssertRC (rc); 604 604 605 return cbRead;605 return (unsigned int)cbRead; 606 606 } 607 607 -
trunk/src/VBox/Runtime/fileio.cpp
r4071 r4372 154 154 * If NULL an error will be returned for a partial read. 155 155 */ 156 RTR3DECL(int) RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, unsigned cbToRead, unsigned*pcbRead)156 RTR3DECL(int) RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, size_t cbToRead, size_t *pcbRead) 157 157 { 158 158 int rc = RTFileSeek(File, off, RTFILE_SEEK_BEGIN, NULL); … … 175 175 * If NULL an error will be returned for a partial write. 176 176 */ 177 RTR3DECL(int) RTFileWriteAt(RTFILE File, RTFOFF off, const void *pvBuf, unsigned cbToWrite, unsigned*pcbWritten)177 RTR3DECL(int) RTFileWriteAt(RTFILE File, RTFOFF off, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten) 178 178 { 179 179 int rc = RTFileSeek(File, off, RTFILE_SEEK_BEGIN, NULL); -
trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp
r4071 r4372 254 254 255 255 256 RTR3DECL(int) RTFileRead(RTFILE File, void *pvBuf, unsigned cbToRead, unsigned*pcbRead)256 RTR3DECL(int) RTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcbRead) 257 257 { 258 258 if (cbToRead <= 0) … … 278 278 if (cbReadPart == 0) 279 279 return VERR_EOF; 280 else 281 return RTErrConvertFromErrno(errno); 280 return RTErrConvertFromErrno(errno); 282 281 } 283 282 cbRead += cbReadPart; … … 291 290 292 291 293 RTR3DECL(int) RTFileWrite(RTFILE File, const void *pvBuf, unsigned cbToWrite, unsigned*pcbWritten)292 RTR3DECL(int) RTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten) 294 293 { 295 294 if (cbToWrite <= 0) -
trunk/src/VBox/Runtime/r3/win32/fileio-win32.cpp
r4071 r4372 284 284 285 285 286 RTR3DECL(int) RTFileRead(RTFILE File, void *pvBuf, unsigned cbToRead, unsigned*pcbRead)286 RTR3DECL(int) RTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcbRead) 287 287 { 288 288 if (cbToRead <= 0) … … 314 314 315 315 316 RTR3DECL(int) RTFileWrite(RTFILE File, const void *pvBuf, unsigned cbToWrite, unsigned*pcbWritten)316 RTR3DECL(int) RTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten) 317 317 { 318 318 if (cbToWrite <= 0) -
trunk/src/VBox/Runtime/testcase/tstFile.cpp
r4071 r4372 75 75 } 76 76 static const char szTestBuf[] = "Sausages and bacon for breakfast again!"; 77 unsignedcbWritten = 0;77 size_t cbWritten = 0; 78 78 while (cbWritten < sizeof(szTestBuf)) 79 79 { 80 unsignedcbWrittenPart;80 size_t cbWrittenPart; 81 81 rc = RTFileWrite(File, &szTestBuf[cbWritten], sizeof(szTestBuf) - cbWritten, &cbWrittenPart); 82 82 if (RT_FAILURE(rc)) … … 101 101 { 102 102 char szReadBuf[sizeof(szTestBuf)]; 103 unsignedcbRead = 0;103 size_t cbRead = 0; 104 104 while (cbRead < sizeof(szTestBuf)) 105 105 { 106 unsignedcbReadPart;106 size_t cbReadPart; 107 107 rc = RTFileRead(File, &szReadBuf[cbRead], sizeof(szTestBuf) - cbRead, &cbReadPart); 108 108 if (RT_FAILURE(rc)) … … 147 147 else 148 148 { 149 unsignedcbWritten = 0;149 size_t cbWritten = 0; 150 150 while (cbWritten < sizeof(szTestBuf)) 151 151 { 152 unsignedcbWrittenPart;152 size_t cbWrittenPart; 153 153 rc = RTFileWrite(File, &szTestBuf[cbWritten], sizeof(szTestBuf) - cbWritten, &cbWrittenPart); 154 154 if (RT_FAILURE(rc)) … … 172 172 { 173 173 char szReadBuf[sizeof(szTestBuf)]; 174 unsignedcbRead = 0;174 size_t cbRead = 0; 175 175 while (cbRead < sizeof(szTestBuf)) 176 176 { 177 unsignedcbReadPart;177 size_t cbReadPart; 178 178 rc = RTFileRead(File, &szReadBuf[cbRead], sizeof(szTestBuf) - cbRead, &cbReadPart); 179 179 if (RT_FAILURE(rc)) -
trunk/src/VBox/VMM/testcase/tstAnimate.cpp
r4206 r4372 284 284 285 285 /* read a page from the file */ 286 unsignedcbRead = 0;286 size_t cbRead = 0; 287 287 uint8_t au8Page[PAGE_SIZE * 16]; 288 288 rc = RTFileRead(File, &au8Page, sizeof(au8Page), &cbRead);
Note:
See TracChangeset
for help on using the changeset viewer.