From 1a9ce6edfa0362812eeff6e282a3365d594f0a30 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 15 Mar 2015 00:18:18 -0700 Subject: [PATCH] Somewhere the file access mode is messed up... --- src/xenia/kernel/fs/devices/host_path_entry.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/fs/devices/host_path_entry.cc b/src/xenia/kernel/fs/devices/host_path_entry.cc index f8257fd63..459206093 100644 --- a/src/xenia/kernel/fs/devices/host_path_entry.cc +++ b/src/xenia/kernel/fs/devices/host_path_entry.cc @@ -137,8 +137,10 @@ std::unique_ptr 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;