vm_native: try to workaround another bug (Win32)
Resize sparse file gradually.
This commit is contained in:
@@ -375,7 +375,17 @@ namespace utils
|
|||||||
MessageBoxW(0, L"Failed to initialize sparse file.", L"RPCS3", MB_ICONERROR);
|
MessageBoxW(0, L"Failed to initialize sparse file.", L"RPCS3", MB_ICONERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (f.size() != m_size)
|
||||||
|
{
|
||||||
|
// Resize the file gradually (bug workaround)
|
||||||
|
for (usz i = 0; i < m_size / (1024 * 1024 * 256); i++)
|
||||||
|
{
|
||||||
|
ensure(f.trunc((i + 1) * (1024 * 1024 * 256)));
|
||||||
|
}
|
||||||
|
|
||||||
ensure(f.trunc(m_size));
|
ensure(f.trunc(m_size));
|
||||||
|
}
|
||||||
|
|
||||||
m_handle = ensure(::CreateFileMappingW(f.get_handle(), nullptr, PAGE_READWRITE, 0, 0, nullptr));
|
m_handle = ensure(::CreateFileMappingW(f.get_handle(), nullptr, PAGE_READWRITE, 0, 0, nullptr));
|
||||||
#else
|
#else
|
||||||
if (!storage.empty())
|
if (!storage.empty())
|
||||||
|
|||||||
Reference in New Issue
Block a user