mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-25 01:00:01 +00:00
fix the "No disk" dialog when starting up ppsspp
This commit is contained in:
parent
0ebce17e7f
commit
f02ea25ea6
@ -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…
Reference in New Issue
Block a user