kernel32: Fix the profile file sharing modes.
Based on a patch by Louis Lenders.
This commit is contained in:
parent
79b64fdc83
commit
8b97263dae
|
@ -666,7 +666,8 @@ static BOOL PROFILE_FlushFile(void)
|
|||
|
||||
if (!CurProfile->changed) return TRUE;
|
||||
|
||||
hFile = CreateFileW(CurProfile->filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
hFile = CreateFileW(CurProfile->filename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
|
@ -752,9 +753,10 @@ static BOOL PROFILE_Open( LPCWSTR filename )
|
|||
}
|
||||
|
||||
TRACE("path: %s\n", debugstr_w(buffer));
|
||||
|
||||
hFile = CreateFileW(buffer, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
|
||||
hFile = CreateFileW(buffer, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
if ((hFile == INVALID_HANDLE_VALUE) && (GetLastError() != ERROR_FILE_NOT_FOUND))
|
||||
{
|
||||
WARN("Error %d opening file %s\n", GetLastError(), debugstr_w(buffer));
|
||||
|
|
Loading…
Reference in New Issue