diff --git a/rpcs3/util/vm_native.cpp b/rpcs3/util/vm_native.cpp index 00323d73be..00af16f1e8 100644 --- a/rpcs3/util/vm_native.cpp +++ b/rpcs3/util/vm_native.cpp @@ -345,6 +345,16 @@ namespace utils if (DeviceIoControl(h, FSCTL_SET_SPARSE, nullptr, 0, nullptr, 0, nullptr, nullptr)) { + FILE_STANDARD_INFO info; + ensure(GetFileInformationByHandleEx(h, FileStandardInfo, &info, sizeof(info))); + + if (info.AllocationSize.QuadPart) + { + // Make sure the file is not "dirty" + FILE_END_OF_FILE_INFO _eof{}; + ensure(SetFileInformationByHandle(h, FileEndOfFileInfo, &_eof, sizeof(_eof))); + } + return true; }