Commit c0596e0a authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

msi: The szLogFile parameter of MsiEnableLogW is optional, so handle the case of it being NULL.

parent 5700fe8a
......@@ -632,15 +632,20 @@ UINT WINAPI MsiEnableLogW(DWORD dwLogMode, LPCWSTR szLogFile, DWORD attributes)
TRACE("%08lx %s %08lx\n", dwLogMode, debugstr_w(szLogFile), attributes);
lstrcpyW(gszLogFile,szLogFile);
if (!(attributes & INSTALLLOGATTRIBUTES_APPEND))
DeleteFileW(szLogFile);
file = CreateFileW(szLogFile, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
if (file != INVALID_HANDLE_VALUE)
CloseHandle(file);
if (szLogFile)
{
lstrcpyW(gszLogFile,szLogFile);
if (!(attributes & INSTALLLOGATTRIBUTES_APPEND))
DeleteFileW(szLogFile);
file = CreateFileW(szLogFile, GENERIC_WRITE, 0, 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));
}
else
ERR("Unable to enable log %s\n",debugstr_w(szLogFile));
gszLogFile[0] = '\0';
return ERROR_SUCCESS;
}
......
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