Skip to content

Commit f3ebc0f

Browse files
authored
fix nt no_block (#1204)
1 parent 81e3259 commit f3ebc0f

File tree

1 file changed

+5
-2
lines changed
  • include/fast_io_hosted/platforms

1 file changed

+5
-2
lines changed

include/fast_io_hosted/platforms/nt.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ inline constexpr nt_open_mode calculate_nt_open_mode(open_mode_perms ompm) noexc
9696
}
9797
if ((value & open_mode::no_shared_write) == open_mode::none)
9898
{
99-
mode.ShareAccess |= 2; // FILE_SHARE_DELETE
99+
mode.ShareAccess |= 2; // FILE_SHARE_WRITE
100100
}
101101
if ((value & open_mode::shared_delete) != open_mode::none)
102102
{
103-
mode.ShareAccess |= 4; // FILE_SHARE_WRITE
103+
mode.ShareAccess |= 4; // FILE_SHARE_DELETE
104104
}
105105
bool generic_write{};
106106
if ((value & open_mode::app) != open_mode::none)
@@ -282,14 +282,17 @@ inline constexpr nt_open_mode calculate_nt_open_mode(open_mode_perms ompm) noexc
282282
mode.DesiredAccess |= default_write_attribute | default_read_attribute; // GENERIC_READ | GENERIC_WRITE
283283
}
284284
}
285+
285286
if ((value & open_mode::no_block) == open_mode::none)
286287
{
287288
mode.CreateOptions |= 0x00000020; // FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
288289
}
290+
#if 0
289291
else
290292
{
291293
mode.CreateOptions |= 0x00000010; // FILE_SYNCHRONOUS_IO_ALERT 0x00000010
292294
}
295+
#endif
293296

294297
if ((value & open_mode::random_access) == open_mode::none)
295298
{

0 commit comments

Comments
 (0)