Skip to content

Commit

Permalink
Always open in binary mode
Browse files Browse the repository at this point in the history
  • Loading branch information
momo5502 committed Oct 22, 2024
1 parent af529a6 commit 45a4dfc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/windows-emulator/syscalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1525,35 +1525,35 @@ namespace

const wchar_t* map_mode(const ACCESS_MASK desired_access, const ULONG create_disposition)
{
const wchar_t* mode = L"";
const auto* mode = L"";

switch (create_disposition)
{
case FILE_CREATE:
case FILE_SUPERSEDE:
if (desired_access & GENERIC_WRITE)
{
mode = L"w";
mode = L"wb";
}
break;

case FILE_OPEN:
case FILE_OPEN_IF:
if (desired_access & GENERIC_WRITE)
{
mode = L"r+";
mode = L"r+b";
}
else if (desired_access & GENERIC_READ)
{
mode = L"r";
mode = L"rb";
}
break;

case FILE_OVERWRITE:
case FILE_OVERWRITE_IF:
if (desired_access & GENERIC_WRITE)
{
mode = L"w+";
mode = L"w+b";
}
break;

Expand All @@ -1564,7 +1564,7 @@ namespace

if (desired_access & FILE_APPEND_DATA)
{
mode = L"a";
mode = L"a+b";
}

return mode;
Expand Down

0 comments on commit 45a4dfc

Please sign in to comment.