Changeset 1532 in vbox for trunk/src/VBox
- Timestamp:
- Mar 16, 2007 2:54:40 PM (18 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r1021 r1532 1375 1375 1376 1376 1377 static void ataWarningFileTooBig(PPDMDEVINS pDevIns) 1378 { 1379 int rc; 1380 LogRel(("PIIX3 ATA: File too big\n")); 1381 rc = VMSetRuntimeError(PDMDevHlpGetVM(pDevIns), 1382 false, "DevATA_FILETOOBIG", 1383 N_("Host system reported that the file size limit has been exceeded. VM execution is suspended. You need to move the file to a filesystem which allows bigger files")); 1384 AssertRC(rc); 1385 } 1386 1387 1377 1388 static void ataWarningISCSI(PPDMDEVINS pDevIns) 1378 1389 { … … 1411 1422 return true; 1412 1423 } 1424 if (rc == VERR_FILE_TOO_BIG) 1425 { 1426 ataWarningFileTooBig(ATADEVSTATE_2_DEVINS(s)); 1427 return true; 1428 } 1413 1429 if (rc == VERR_BROKEN_PIPE || rc == VERR_NET_CONNECTION_REFUSED) 1414 1430 { … … 1451 1467 { 1452 1468 ataWarningDiskFull(ATADEVSTATE_2_DEVINS(s)); 1469 return true; 1470 } 1471 if (rc == VERR_FILE_TOO_BIG) 1472 { 1473 ataWarningFileTooBig(ATADEVSTATE_2_DEVINS(s)); 1453 1474 return true; 1454 1475 } -
trunk/src/VBox/Runtime/RTErrConvertFromErrno.cpp
r1 r1532 130 130 #endif 131 131 #ifdef EFBIG 132 //case EFBIG:132 case EFBIG: return VERR_FILE_TOO_BIG; 133 133 #endif 134 134 #ifdef ENOSPC -
trunk/src/VBox/Runtime/r3/win32/fileio-win32.cpp
r1 r1532 74 74 return fRc; 75 75 } 76 77 78 /** 79 * This is a helper to check if an attempt is made to grow a file beyond the 80 * limit of the filesystem. 81 * 82 * @returns true for file size limit exceeded. 83 * @param File Filehandle. 84 * @param offSeek Offset to seek. 85 */ 86 inline bool IsBeyondLimit(RTFILE File, uint64_t offSeek, unsigned uMethod) 87 { 88 bool fIsBeyondLimit = false; 89 /* 90 * Get current file pointer. 91 */ 92 uint64_t offCurrent; 93 if (MySetFilePointer(File, 0, &offCurrent, FILE_CURRENT)) 94 { 95 /* 96 * Set new file pointer. 97 */ 98 if (!MySetFilePointer(File, offSeek, NULL, uMethod)) 99 { 100 /* 101 * Failed to set new file pointer. 102 */ 103 fIsBeyondLimit = (GetLastError() == ERROR_SEEK); 104 } 105 else 106 { 107 /* 108 * Restore file pointer. 109 */ 110 MySetFilePointer(File, offCurrent, NULL, FILE_BEGIN); 111 } 112 } 113 114 return fIsBeyondLimit; 115 } 116 117 76 118 77 119 … … 307 349 ULONG cbWrittenPart = 0; 308 350 if (!WriteFile((HANDLE)File, (char*)pvBuf + cbWritten, cbToWrite - cbWritten, &cbWrittenPart, NULL)) 309 return RTErrConvertFromWin32(GetLastError()); 351 { 352 int rc = RTErrConvertFromWin32(GetLastError()); 353 if ( rc == VERR_DISK_FULL 354 && IsBeyondLimit(File, cbToWrite - cbWritten, FILE_CURRENT) 355 ) 356 rc = VERR_FILE_TOO_BIG; 357 return rc; 358 } 310 359 if (cbWrittenPart == 0) 311 360 return VERR_WRITE_ERROR; … … 315 364 return VINF_SUCCESS; 316 365 } 317 return RTErrConvertFromWin32(GetLastError()); 366 int rc = RTErrConvertFromWin32(GetLastError()); 367 if ( rc == VERR_DISK_FULL 368 && IsBeyondLimit(File, cbToWrite - cbWritten, FILE_CURRENT) 369 ) 370 rc = VERR_FILE_TOO_BIG; 371 return rc; 318 372 } 319 373
Note:
See TracChangeset
for help on using the changeset viewer.