mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-20 09:55:11 -04:00
[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:
parent
c6fee8709e
commit
d46342c16c
10 changed files with 98 additions and 26 deletions
|
@ -251,7 +251,7 @@ static BOOL ExtractFAT(int entry, const char* path)
|
|||
|
||||
/* Create a file, using the same attributes as found in the FAT */
|
||||
hFile = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
||||
NULL, CREATE_ALWAYS, dir_entry->Attributes, 0);
|
||||
NULL, CREATE_ALWAYS, dir_entry->Attributes, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
uprintf("Unable to create file '%s': %s.\n", filename, WindowsErrorString());
|
||||
return FALSE;
|
||||
|
@ -379,8 +379,8 @@ BOOL ExtractFreeDOS(const char* path)
|
|||
safe_strcpy(filename, sizeof(filename), ((i<2)?path:locale_path));
|
||||
safe_strcat(filename, sizeof(filename), res_name[i]);
|
||||
|
||||
hFile = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
||||
NULL, CREATE_ALWAYS, (i<2)?(FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM):0, 0);
|
||||
hFile = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
|
||||
CREATE_ALWAYS, (i<2)?(FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM):FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
uprintf("Unable to create file '%s': %s.\n", filename, WindowsErrorString());
|
||||
return FALSE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue