Changeset 13835 in vbox for trunk/src/VBox/Devices/Storage/testcase/vditool.cpp
- Timestamp:
- Nov 5, 2008 2:34:43 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/testcase/vditool.cpp
r8155 r13835 71 71 { 72 72 int rc = RTStrCurrentCPToUtf8(pszUtf8Filename, pszFilename); 73 if ( VBOX_FAILURE(rc))73 if (RT_FAILURE(rc)) 74 74 RTPrintf("Error converting filename '%s' to UTF8! (rc=%Rrc)\n", 75 75 pszFilename, rc); … … 86 86 if (rc == VINF_SUCCESS) 87 87 RTPrintf("The operation completed successfully!\n"); 88 else if ( VBOX_SUCCESS(rc))88 else if (RT_SUCCESS(rc)) 89 89 RTPrintf("The operation completed successfully! (rc=%Rrc)\n", rc); 90 90 else … … 101 101 char *pszUtf8Filename; 102 102 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 103 if ( VBOX_FAILURE(rc))103 if (RT_FAILURE(rc)) 104 104 return rc; 105 105 … … 119 119 char *pszUtf8Filename, *pszUtf8DDFilename; 120 120 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 121 if ( VBOX_FAILURE(rc))121 if (RT_FAILURE(rc)) 122 122 return rc; 123 123 rc = FilenameToUtf8(&pszUtf8DDFilename, pszDDFilename); 124 if ( VBOX_FAILURE(rc))124 if (RT_FAILURE(rc)) 125 125 return rc; 126 126 … … 128 128 RTFILE File; 129 129 rc = RTFileOpen(&File, pszUtf8DDFilename, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE); 130 if ( VBOX_FAILURE(rc))130 if (RT_FAILURE(rc)) 131 131 { 132 132 RTPrintf("File=\"%s\" open error: %Rrf\n", pszDDFilename, rc); … … 137 137 uint64_t cbFile; 138 138 rc = RTFileGetSize(File, &cbFile); 139 if ( VBOX_SUCCESS(rc))139 if (RT_SUCCESS(rc)) 140 140 { 141 141 RTPrintf("Creating fixed image with size %u Bytes...\n", (unsigned)cbFile); … … 145 145 "Converted from DD test image", NULL, NULL); 146 146 PrintDone(rc); 147 if ( VBOX_SUCCESS(rc))147 if (RT_SUCCESS(rc)) 148 148 { 149 149 RTPrintf("Writing data...\n"); 150 150 PVDIDISK pVdi = VDIDiskCreate(); 151 151 rc = VDIDiskOpenImage(pVdi, pszUtf8Filename, VDI_OPEN_FLAGS_NORMAL); 152 if ( VBOX_SUCCESS(rc))152 if (RT_SUCCESS(rc)) 153 153 { 154 154 /* alloc work buffer. */ … … 161 161 size_t cbRead = 0; 162 162 rc = RTFileRead(File, pvBuf, VDIDiskGetBufferSize(pVdi), &cbRead); 163 if ( VBOX_FAILURE(rc) || !cbRead)163 if (RT_FAILURE(rc) || !cbRead) 164 164 break; 165 165 rc = VDIDiskWrite(pVdi, off, pvBuf, cbRead); 166 if ( VBOX_FAILURE(rc))166 if (RT_FAILURE(rc)) 167 167 break; 168 168 off += cbRead; … … 177 177 } 178 178 179 if ( VBOX_FAILURE(rc))179 if (RT_FAILURE(rc)) 180 180 { 181 181 /* delete image on error */ … … 215 215 char *pszUtf8Filename; 216 216 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 217 if ( VBOX_FAILURE(rc))217 if (RT_FAILURE(rc)) 218 218 return rc; 219 219 … … 232 232 char *pszUtf8Filename; 233 233 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 234 if ( VBOX_FAILURE(rc))234 if (RT_FAILURE(rc)) 235 235 return rc; 236 236 rc = VDIDiskOpenImage(pVdi, pszUtf8Filename, VDI_OPEN_FLAGS_READONLY); 237 if ( VBOX_SUCCESS(rc))237 if (RT_SUCCESS(rc)) 238 238 { 239 239 VDIDiskDumpImages(pVdi); … … 251 251 char *pszUtf8Filename; 252 252 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 253 if ( VBOX_FAILURE(rc))253 if (RT_FAILURE(rc)) 254 254 return rc; 255 255 256 256 rc = VDIDiskOpenImage(pVdi, pszUtf8Filename, VDI_OPEN_FLAGS_NORMAL); 257 if ( VBOX_SUCCESS(rc))257 if (RT_SUCCESS(rc)) 258 258 { 259 259 PDMMEDIAGEOMETRY LCHSGeometry = {0, 0, 0}; … … 273 273 char *pszUtf8SrcFile, *pszUtf8DstFile; 274 274 int rc = FilenameToUtf8(&pszUtf8SrcFile, pszSrcFile); 275 if ( VBOX_FAILURE(rc))275 if (RT_FAILURE(rc)) 276 276 return rc; 277 277 rc = FilenameToUtf8(&pszUtf8DstFile, pszDstFile); 278 if ( VBOX_FAILURE(rc))278 if (RT_FAILURE(rc)) 279 279 return rc; 280 280 … … 294 294 char *pszUtf8SrcFile, *pszUtf8DstFile; 295 295 int rc = FilenameToUtf8(&pszUtf8SrcFile, pszSrcFile); 296 if ( VBOX_FAILURE(rc))296 if (RT_FAILURE(rc)) 297 297 return rc; 298 298 rc = FilenameToUtf8(&pszUtf8DstFile, pszDstFile); 299 if ( VBOX_FAILURE(rc))299 if (RT_FAILURE(rc)) 300 300 return rc; 301 301 302 302 rc = VDIDiskOpenImage(pVdi, pszUtf8SrcFile, VDI_OPEN_FLAGS_NORMAL); 303 if ( VBOX_SUCCESS(rc))303 if (RT_SUCCESS(rc)) 304 304 { 305 305 RTFILE FileDst; 306 306 rc = RTFileOpen(&FileDst, pszUtf8DstFile, RTFILE_O_CREATE | RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE); 307 if ( VBOX_SUCCESS(rc))307 if (RT_SUCCESS(rc)) 308 308 { 309 309 uint64_t cbSrc = VDIDiskGetSize(pVdi); … … 316 316 { 317 317 rc = VDIDiskRead(pVdi, off, pvBuf, cbBuf); 318 if ( VBOX_FAILURE(rc))318 if (RT_FAILURE(rc)) 319 319 break; 320 320 rc = RTFileWrite(FileDst, pvBuf, cbBuf, NULL); 321 if ( VBOX_FAILURE(rc))321 if (RT_FAILURE(rc)) 322 322 break; 323 323 off += cbBuf; … … 341 341 char *pszUtf8Filename; 342 342 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 343 if ( VBOX_FAILURE(rc))343 if (RT_FAILURE(rc)) 344 344 return rc; 345 345 … … 384 384 uint32_t cMBs; 385 385 rc = RTStrToUInt32Ex(argv[3], NULL, 10, &cMBs); 386 if ( VBOX_FAILURE(rc))386 if (RT_FAILURE(rc)) 387 387 return SyntaxError("Invalid number!"); 388 388 if ( cMBs < 2 … … 442 442 443 443 RTLogFlush(NULL); 444 return ! VBOX_SUCCESS(rc);445 } 444 return !RT_SUCCESS(rc); 445 }
Note:
See TracChangeset
for help on using the changeset viewer.