Changeset 1581 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Mar 20, 2007 8:21:21 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win32/fileio-win32.cpp
r1532 r1581 77 77 78 78 /** 79 * This is a helper to check if an attempt is made to grow a file beyond the79 * This is a helper to check if an attempt was made to grow a file beyond the 80 80 * limit of the filesystem. 81 81 * … … 84 84 * @param offSeek Offset to seek. 85 85 */ 86 inline boolIsBeyondLimit(RTFILE File, uint64_t offSeek, unsigned uMethod)86 DECLINLINE(bool) IsBeyondLimit(RTFILE File, uint64_t offSeek, unsigned uMethod) 87 87 { 88 88 bool fIsBeyondLimit = false; 89 /* 90 * Get current file pointer. 91 */ 92 uint64_t offCurrent; 89 90 /* 91 * Get the current file position and try set the new one. 92 * If it fails with a seek error it's because we hit the file system limit. 93 */ 94 uint64_t offCurrent; 93 95 if (MySetFilePointer(File, 0, &offCurrent, FILE_CURRENT)) 94 96 { 95 /*96 * Set new file pointer.97 */98 97 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 */ 98 fIsBeyondLimit = GetLastError() == ERROR_SEEK; 99 else /* Restore file pointer on success. */ 110 100 MySetFilePointer(File, offCurrent, NULL, FILE_BEGIN); 111 }112 101 } 113 102 114 103 return fIsBeyondLimit; 115 104 } 116 117 118 105 119 106
Note:
See TracChangeset
for help on using the changeset viewer.