merged fix from R_0_16

This commit is contained in:
Arvid Norberg 2012-05-27 18:17:51 +00:00
parent db500b674b
commit f2c89cd770
1 changed files with 5 additions and 1 deletions

View File

@ -894,8 +894,12 @@ namespace libtorrent
open_mode_t const& m = mode_array[mode & rw_mask];
DWORD a = attrib_array[(mode & attribute_mask) >> 12];
// one might think it's a good idea to pass in FILE_FLAG_RANDOM_ACCESS. It
// turns out that it isn't. That flag will break your operating system:
// http://support.microsoft.com/kb/2549369
DWORD flags
= ((mode & random_access) ? FILE_FLAG_RANDOM_ACCESS : 0)
= ((mode & random_access) ? 0 : FILE_FLAG_SEQUENTIAL_SCAN)
| (a ? a : FILE_ATTRIBUTE_NORMAL)
| ((mode & no_buffer) ? FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING : 0);