summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2025-11-29 16:23:31 -0600
committerGitHub <noreply@github.com>2025-11-29 16:23:31 -0600
commit59d5e25f5f3dab24a9311035ea0339df82d40565 (patch)
tree7bc50a861eb25b3b7793c443eb1cfde2c2c6188c
parente8c512dfb5b26b464c70f6bb89475533d5351a94 (diff)
parent448d61f262ebd30506a37b0b12ee437e844391ec (diff)
Merge pull request #14190 from Dentomologist/directiofile_dont_request_delete_access_for_read_only_open
Windows/DirectIOFile: Don't request DELETE access for read-only Open
-rw-r--r--Source/Core/Common/DirectIOFile.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/Common/DirectIOFile.cpp b/Source/Core/Common/DirectIOFile.cpp
index d72e98fa3b..bfe598dc48 100644
--- a/Source/Core/Common/DirectIOFile.cpp
+++ b/Source/Core/Common/DirectIOFile.cpp
@@ -86,8 +86,11 @@ bool DirectIOFile::Open(const std::string& path, AccessMode access_mode, OpenMod
else if (access_mode == AccessMode::Write)
desired_access = GENERIC_WRITE;
- // Allow deleting and renaming through our handle.
- desired_access |= DELETE;
+ if (access_mode != AccessMode::Read)
+ {
+ // Allow deleting and renaming through our handle.
+ desired_access |= DELETE;
+ }
// All sharing is allowed to more closely match default behavior on other OSes.
constexpr DWORD share_mode = FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE;