[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

@ -101,7 +101,7 @@ static BOOL SaveIcon(const char* filename)
icondir = (GRPICONDIR*)GetResource(hMainInstance, MAKEINTRESOURCEA(IDI_ICON), _RT_GROUP_ICON, "icon", &res_size, FALSE);
hFile = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, CREATE_NEW, 0, 0);
NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
uprintf("Unable to create icon '%s': %s.\n", filename, WindowsErrorString());
goto out;