Savestates: Fixup file write

This commit is contained in:
Elad Ashkenazi 2024-05-05 04:37:49 +03:00
parent 0fcb0b7d8e
commit 91a54c11eb
3 changed files with 11 additions and 8 deletions

View file

@ -2479,10 +2479,13 @@ bool fs::pending_file::commit(bool overwrite)
#endif
#ifdef _WIN32
// Disable auto-delete
FILE_DISPOSITION_INFO disp;
disp.DeleteFileW = false;
SetFileInformationByHandle(file.get_handle(), FileDispositionInfo, &disp, sizeof(disp));
if (file)
{
// Disable auto-delete
FILE_DISPOSITION_INFO disp;
disp.DeleteFileW = false;
ensure(SetFileInformationByHandle(file.get_handle(), FileDispositionInfo, &disp, sizeof(disp)));
}
#endif
file.close();