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.
This commit is contained in:
Connor McLaughlin 2022-06-06 22:47:09 +10:00 committed by refractionpcsx2
parent afa29facc6
commit 3dc4aea053
1 changed files with 3 additions and 3 deletions

View File

@ -342,11 +342,11 @@ void FileMemoryCard::Open()
} }
// store the original filename // 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 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]) if (!m_file[slot])
@ -805,7 +805,7 @@ static bool IsMemoryCardFolder(const std::string& path)
static bool IsMemoryCardFormatted(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) if (!fp)
return false; return false;