Index: libs/iostreams/src/mapped_file.cpp =================================================================== --- libs/iostreams/src/mapped_file.cpp (revision 59992) +++ libs/iostreams/src/mapped_file.cpp (working copy) @@ -197,8 +197,10 @@ if (p.new_file_size != 0 && !readonly) { LONG sizehigh = (p.new_file_size >> (sizeof(LONG) * 8)); LONG sizelow = (p.new_file_size & 0xffffffff); - ::SetFilePointer(handle_, sizelow, &sizehigh, FILE_BEGIN); - if (::GetLastError() != NO_ERROR || !::SetEndOfFile(handle_)) + DWORD result = ::SetFilePointer(handle_, sizelow, &sizehigh, FILE_BEGIN); + if ( result == INVALID_SET_FILE_POINTER + && ::GetLastError() != NO_ERROR + || !::SetEndOfFile(handle_)) cleanup_and_throw("failed setting file size"); }