mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-27 12:05:43 +00:00
Merge pull request #5465 from chinhodado/master
fix the "No disk" dialog when starting up ppsspp
This commit is contained in:
commit
c81a08eed7
@ -133,6 +133,10 @@ static void StripTailDirSlashes(std::wstring &fname)
|
||||
// Returns true if file filename exists
|
||||
bool Exists(const std::string &filename)
|
||||
{
|
||||
// Make sure Windows will no longer handle critical errors, which means no annoying "No disk" dialog
|
||||
// Save the old error mode
|
||||
int OldMode = SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||
|
||||
struct stat64 file_info;
|
||||
#if defined(_WIN32) && defined(UNICODE)
|
||||
std::wstring copy = ConvertUTF8ToWString(filename);
|
||||
@ -145,6 +149,10 @@ bool Exists(const std::string &filename)
|
||||
|
||||
int result = stat64(copy.c_str(), &file_info);
|
||||
#endif
|
||||
|
||||
// Set the old error mode
|
||||
SetErrorMode(OldMode);
|
||||
|
||||
return (result == 0);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user