Commit 8b97263d authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Fix the profile file sharing modes.

Based on a patch by Louis Lenders.
parent 79b64fdc
...@@ -666,7 +666,8 @@ static BOOL PROFILE_FlushFile(void) ...@@ -666,7 +666,8 @@ static BOOL PROFILE_FlushFile(void)
if (!CurProfile->changed) return TRUE; 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) if (hFile == INVALID_HANDLE_VALUE)
{ {
...@@ -752,9 +753,10 @@ static BOOL PROFILE_Open( LPCWSTR filename ) ...@@ -752,9 +753,10 @@ static BOOL PROFILE_Open( LPCWSTR filename )
} }
TRACE("path: %s\n", debugstr_w(buffer)); 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)) if ((hFile == INVALID_HANDLE_VALUE) && (GetLastError() != ERROR_FILE_NOT_FOUND))
{ {
WARN("Error %d opening file %s\n", GetLastError(), debugstr_w(buffer)); WARN("Error %d opening file %s\n", GetLastError(), debugstr_w(buffer));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment