Changeset 27623 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Mar 23, 2010 12:06:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp
r27533 r27623 477 477 { 478 478 /* File where the data is stored. */ 479 RTFILE File;479 PVMDKFILE File; 480 480 /* Total size of the data to read. */ 481 481 size_t cbSize; … … 490 490 { 491 491 /* File where the data is to be stored. */ 492 RTFILE File;492 PVMDKFILE File; 493 493 /* Offset in the file to write at. */ 494 494 uint64_t uFileOffset; … … 812 812 } 813 813 cbBuf = RT_MIN(cbBuf, pInflateState->cbSize); 814 int rc = RTFileReadAt(pInflateState->File, pInflateState->uFileOffset, pvBuf, cbBuf, NULL);814 int rc = vmdkFileReadAt(pInflateState->File, pInflateState->uFileOffset, pvBuf, cbBuf, NULL); 815 815 if (RT_FAILURE(rc)) 816 816 return rc; … … 849 849 if (uMarker == VMDK_MARKER_IGNORE) 850 850 cbMarker -= sizeof(Marker.uType); 851 rc = RTFileReadAt(pVmdkFile->File, uOffset, &Marker, cbMarker, NULL);851 rc = vmdkFileReadAt(pVmdkFile, uOffset, &Marker, cbMarker, NULL); 852 852 if (RT_FAILURE(rc)) 853 853 return rc; … … 891 891 } 892 892 } 893 InflateState.File = pVmdkFile ->File;893 InflateState.File = pVmdkFile; 894 894 InflateState.cbSize = cbComp; 895 895 InflateState.uFileOffset = uCompOffset; … … 926 926 if (!cbBuf) 927 927 return VINF_SUCCESS; 928 int rc = RTFileWriteAt(pDeflateState->File, pDeflateState->uFileOffset, pvBuf, cbBuf, NULL);928 int rc = vmdkFileWriteAt(pDeflateState->File, pDeflateState->uFileOffset, pvBuf, cbBuf, NULL); 929 929 if (RT_FAILURE(rc)) 930 930 return rc; … … 969 969 return VERR_NOT_IMPLEMENTED; 970 970 } 971 DeflateState.File = pVmdkFile ->File;971 DeflateState.File = pVmdkFile; 972 972 DeflateState.uFileOffset = uCompOffset; 973 973 DeflateState.iOffset = -1; … … 988 988 * guarantees that data gets only appended. */ 989 989 Assert(DeflateState.uFileOffset > uCompOffset); 990 rc = RTFileSetSize(pVmdkFile->File, DeflateState.uFileOffset);990 rc = vmdkFileSetSize(pVmdkFile, DeflateState.uFileOffset); 991 991 992 992 if (uMarker == VMDK_MARKER_IGNORE) … … 994 994 /* Compressed grain marker. */ 995 995 Marker.cbSize = RT_H2LE_U32(DeflateState.iOffset); 996 rc = RTFileWriteAt(pVmdkFile->File, uOffset, &Marker, 12, NULL);996 rc = vmdkFileWriteAt(pVmdkFile, uOffset, &Marker, 12, NULL); 997 997 if (RT_FAILURE(rc)) 998 998 return rc; … … 1029 1029 pVmdkFile->pStorage); 1030 1030 else 1031 rc2 = RTFileClose(pVmdkFile->File); 1032 1033 if (RT_SUCCESS(rc) && pVmdkFile->fDelete) 1034 rc2 = RTFileDelete(pVmdkFile->pszFilename); 1035 RTStrFree((char *)(void *)pVmdkFile->pszFilename); 1036 RTMemFree(pVmdkFile); 1031 rc2 = vmdkFileClose(pImage, &pVmdkFile, pVmdkFile->fDelete); 1032 1037 1033 if (RT_SUCCESS(rc)) 1038 1034 rc = rc2;
Note:
See TracChangeset
for help on using the changeset viewer.