[core] avoid the use of FILE_SHARE_WRITE

* Not having FILE_SHARE_WRITE on a disk or volume handle helps
  prevent spurious accesses from the OS or other apps while we
  are repartitioning/refomatting.
This commit is contained in:
Pete Batard 2017-02-16 14:13:30 +00:00
parent c877284d2a
commit 2f81e4f177
11 changed files with 50 additions and 31 deletions

View file

@ -413,7 +413,7 @@ BOOL WimExtractFile_API(const char* image, int index, const char* src, const cha
uprintf(" Could not access WIM info: %s", WindowsErrorString());
goto out;
}
hFile = CreateFileW(wdst, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
hFile = CreateFileW(wdst, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if ((hFile == INVALID_HANDLE_VALUE) || (!WriteFile(hFile, wim_info, dw, &dw, NULL))) {
uprintf(" Could not extract file: %s", WindowsErrorString());