From 3dc4aea0538dd59413e24df35b79395db95c0762 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 6 Jun 2022 22:47:09 +1000 Subject: [PATCH] MemoryCardFile: Open file memcards in read share mode Fixes cards showing up as "missing" in Qt's settings dialog if you opened the dialog after starting a game. --- pcsx2/MemoryCardFile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pcsx2/MemoryCardFile.cpp b/pcsx2/MemoryCardFile.cpp index 91fc9a1d4a..cdebeff940 100644 --- a/pcsx2/MemoryCardFile.cpp +++ b/pcsx2/MemoryCardFile.cpp @@ -342,11 +342,11 @@ void FileMemoryCard::Open() } // store the original filename - m_file[slot] = FileSystem::OpenCFile(newname.c_str(), "r+b"); + m_file[slot] = FileSystem::OpenSharedCFile(newname.c_str(), "r+b", FileSystem::FileShareMode::DenyWrite); } else { - m_file[slot] = FileSystem::OpenCFile(fname.c_str(), "r+b"); + m_file[slot] = FileSystem::OpenSharedCFile(fname.c_str(), "r+b", FileSystem::FileShareMode::DenyWrite); } if (!m_file[slot]) @@ -805,7 +805,7 @@ static bool IsMemoryCardFolder(const std::string& path) static bool IsMemoryCardFormatted(const std::string& path) { - auto fp = FileSystem::OpenManagedCFile(path.c_str(), "rb"); + auto fp = FileSystem::OpenManagedSharedCFile(path.c_str(), "rb", FileSystem::FileShareMode::DenyNone); if (!fp) return false;