Somewhere the file access mode is messed up...

This commit is contained in:
Ben Vanik 2015-03-15 00:18:18 -07:00
parent 613fdac71d
commit 1a9ce6edfa
1 changed files with 3 additions and 1 deletions

View File

@ -137,8 +137,10 @@ std::unique_ptr<MemoryMapping> HostPathEntry::CreateMemoryMapping(
X_STATUS HostPathEntry::Open(KernelState* kernel_state, Mode mode, bool async,
XFile** out_file) {
// TODO(benvanik): plumb through proper disposition/access mode.
DWORD desired_access =
mode == Mode::READ ? GENERIC_READ : (GENERIC_READ | GENERIC_WRITE);
is_read_only() ? GENERIC_READ : (GENERIC_READ | GENERIC_WRITE);
// mode == Mode::READ ? GENERIC_READ : (GENERIC_READ | GENERIC_WRITE);
DWORD share_mode = FILE_SHARE_READ;
DWORD creation_disposition = mode == Mode::READ ? OPEN_EXISTING : OPEN_ALWAYS;
DWORD flags_and_attributes = async ? FILE_FLAG_OVERLAPPED : 0;