mirror of
https://github.com/microsoft/WSL.git
synced 2026-02-04 02:06:49 -06:00
Set MOVEFILE_WRITE_THROUGH when moving distribution VHD's
This commit is contained in:
parent
456b68125f
commit
34e5a39e00
@ -940,10 +940,11 @@ HRESULT LxssUserSessionImpl::MoveDistribution(_In_ LPCGUID DistroGuid, _In_ LPCW
|
||||
}
|
||||
|
||||
// Move the VHD to the new location.
|
||||
THROW_IF_WIN32_BOOL_FALSE(MoveFileEx(distro.VhdFilePath.c_str(), newVhdPath.c_str(), MOVEFILE_COPY_ALLOWED));
|
||||
THROW_IF_WIN32_BOOL_FALSE(MoveFileEx(distro.VhdFilePath.c_str(), newVhdPath.c_str(), MOVEFILE_COPY_ALLOWED | MOVEFILE_WRITE_THROUGH));
|
||||
|
||||
auto revert = wil::scope_exit_log(WI_DIAGNOSTICS_INFO, [&]() {
|
||||
THROW_IF_WIN32_BOOL_FALSE(MoveFileEx(newVhdPath.c_str(), distro.VhdFilePath.c_str(), MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING));
|
||||
THROW_IF_WIN32_BOOL_FALSE(MoveFileEx(
|
||||
newVhdPath.c_str(), distro.VhdFilePath.c_str(), MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH));
|
||||
|
||||
// Write the location back to the original path in case the second registry write failed. Otherwise this is a no-op.
|
||||
registration.Write(Property::BasePath, distro.BasePath.c_str());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user