Alexandre Julliard : kernel32: Fix the profile file sharing modes.
Alexandre Julliard
julliard at winehq.org
Wed May 21 16:31:51 CDT 2008
Module: wine
Branch: master
Commit: 8b97263daee7f17fdb2e9f47e654096c6d82aed8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8b97263daee7f17fdb2e9f47e654096c6d82aed8
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed May 21 14:23:29 2008 +0200
kernel32: Fix the profile file sharing modes.
Based on a patch by Louis Lenders.
---
dlls/kernel32/profile.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c
index f58a989..a412e1e 100644
--- a/dlls/kernel32/profile.c
+++ b/dlls/kernel32/profile.c
@@ -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));
More information about the wine-cvs
mailing list