[core] ensure AutoMount is enabled while the app is running

* Having AutoMount disabled when a Fixed drive is being used can
  result in a failure during formatting (issue #386).
* Also set explicit FILE_ATTRIBUTE_NORMAL flag an normalize CreateFile usage
* Closes #386
This commit is contained in:
Pete Batard 2014-11-11 19:17:39 +00:00
parent c6fee8709e
commit d46342c16c
10 changed files with 98 additions and 26 deletions

View file

@ -450,7 +450,7 @@ BOOL FileIO(BOOL save, char* path, char** buffer, DWORD* size)
*buffer = NULL;
}
handle = CreateFileU(path, save?GENERIC_WRITE:GENERIC_READ, FILE_SHARE_READ,
ps, save?CREATE_ALWAYS:OPEN_EXISTING, 0, NULL);
ps, save?CREATE_ALWAYS:OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (handle == INVALID_HANDLE_VALUE) {
uprintf("Could not %s file '%s'\n", save?"create":"open", path);