Hans Leidekker : msi: Open the log file in shared write mode.

Alexandre Julliard julliard at winehq.org
Tue Oct 26 12:34:52 CDT 2010


Module: wine
Branch: master
Commit: 29ee65402bd4a67c2cd088c8254be57a47b8d837
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=29ee65402bd4a67c2cd088c8254be57a47b8d837

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Oct 26 12:42:16 2010 +0200

msi: Open the log file in shared write mode.

---

 dlls/msi/msi.c     |    6 +++---
 dlls/msi/package.c |    5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 29c639c..11d1174 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -1775,12 +1775,12 @@ UINT WINAPI MsiEnableLogW(DWORD dwLogMode, LPCWSTR szLogFile, DWORD attributes)
         lstrcpyW(gszLogFile,szLogFile);
         if (!(attributes & INSTALLLOGATTRIBUTES_APPEND))
             DeleteFileW(szLogFile);
-        file = CreateFileW(szLogFile, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS,
-                               FILE_ATTRIBUTE_NORMAL, NULL);
+        file = CreateFileW(szLogFile, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_ALWAYS,
+                           FILE_ATTRIBUTE_NORMAL, NULL);
         if (file != INVALID_HANDLE_VALUE)
             CloseHandle(file);
         else
-            ERR("Unable to enable log %s\n",debugstr_w(szLogFile));
+            ERR("Unable to enable log %s (%u)\n", debugstr_w(szLogFile), GetLastError());
     }
     else
         gszLogFile[0] = '\0';
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index ac11e69..8fcf6ff 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -1773,11 +1773,10 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
         MsiCloseHandle( rec );
     }
 
-    if ((!rc) && (gszLogFile[0]) && !((eMessageType & 0xff000000) ==
-                                      INSTALLMESSAGE_PROGRESS))
+    if (!rc && gszLogFile[0] && (eMessageType & 0xff000000) != INSTALLMESSAGE_PROGRESS)
     {
         DWORD write;
-        HANDLE log_file = CreateFileW(gszLogFile,GENERIC_WRITE, 0, NULL,
+        HANDLE log_file = CreateFileW(gszLogFile, GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
                                   OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
 
         if (log_file != INVALID_HANDLE_VALUE)




More information about the wine-cvs mailing list