msi: The szLogFile parameter of MsiEnableLogW is optional, so handle the case of it being NULL.
This commit is contained in:
parent
5700fe8a61
commit
c0596e0ae9
|
@ -632,15 +632,20 @@ UINT WINAPI MsiEnableLogW(DWORD dwLogMode, LPCWSTR szLogFile, DWORD attributes)
|
||||||
|
|
||||||
TRACE("%08lx %s %08lx\n", dwLogMode, debugstr_w(szLogFile), attributes);
|
TRACE("%08lx %s %08lx\n", dwLogMode, debugstr_w(szLogFile), attributes);
|
||||||
|
|
||||||
lstrcpyW(gszLogFile,szLogFile);
|
if (szLogFile)
|
||||||
if (!(attributes & INSTALLLOGATTRIBUTES_APPEND))
|
{
|
||||||
DeleteFileW(szLogFile);
|
lstrcpyW(gszLogFile,szLogFile);
|
||||||
file = CreateFileW(szLogFile, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS,
|
if (!(attributes & INSTALLLOGATTRIBUTES_APPEND))
|
||||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
DeleteFileW(szLogFile);
|
||||||
if (file != INVALID_HANDLE_VALUE)
|
file = CreateFileW(szLogFile, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS,
|
||||||
CloseHandle(file);
|
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
if (file != INVALID_HANDLE_VALUE)
|
||||||
|
CloseHandle(file);
|
||||||
|
else
|
||||||
|
ERR("Unable to enable log %s\n",debugstr_w(szLogFile));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ERR("Unable to enable log %s\n",debugstr_w(szLogFile));
|
gszLogFile[0] = '\0';
|
||||||
|
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue