mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
vm_native: try to workaround another bug (Win32)
Resize sparse file gradually.
This commit is contained in:
parent
dcfd29c2d9
commit
613777afde
1 changed files with 11 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
ensure(f.trunc(m_size));
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
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())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue