Author: hpoussin
Date: Wed Jul 11 13:04:22 2007
New Revision: 27587
URL:
http://svn.reactos.org/svn/reactos?rev=27587&view=rev
Log:
Write source file and line in the setup install log
Modified:
trunk/reactos/dll/win32/syssetup/logfile.c
trunk/reactos/dll/win32/syssetup/syssetup.def
trunk/reactos/dll/win32/syssetup/wizard.c
trunk/reactos/include/reactos/libs/syssetup/syssetup.h
Modified: trunk/reactos/dll/win32/syssetup/logfile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/logfile…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/logfile.c (original)
+++ trunk/reactos/dll/win32/syssetup/logfile.c Wed Jul 11 13:04:22 2007
@@ -16,8 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- *
+/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* PURPOSE: Log file functions
@@ -33,7 +32,6 @@
#include <syssetup/syssetup.h>
-
/* GLOBALS ******************************************************************/
HANDLE hLogFile = NULL;
@@ -41,28 +39,26 @@
/* FUNCTIONS ****************************************************************/
-BOOL STDCALL
+BOOL WINAPI
InitializeSetupActionLog (BOOL bDeleteOldLogFile)
{
WCHAR szFileName[MAX_PATH];
- GetWindowsDirectoryW (szFileName,
- MAX_PATH);
-
- if (szFileName[wcslen (szFileName)] != L'\\')
+ GetWindowsDirectoryW(szFileName, MAX_PATH);
+
+ if (szFileName[wcslen(szFileName)] != L'\\')
{
wcsncat(szFileName,
- L"\\",
- MAX_PATH);
+ L"\\",
+ MAX_PATH);
}
wcsncat(szFileName,
L"setuplog.txt",
- MAX_PATH);
-
- if (bDeleteOldLogFile != FALSE)
- {
- SetFileAttributesW(szFileName,
- FILE_ATTRIBUTE_NORMAL);
+ MAX_PATH);
+
+ if (bDeleteOldLogFile)
+ {
+ SetFileAttributesW(szFileName, FILE_ATTRIBUTE_NORMAL);
DeleteFileW(szFileName);
}
@@ -83,8 +79,8 @@
}
-VOID STDCALL
-TerminateSetupActionLog (VOID)
+VOID WINAPI
+TerminateSetupActionLog(VOID)
{
if (hLogFile != NULL)
{
@@ -94,16 +90,19 @@
}
-BOOL STDCALL
-LogItem(DWORD dwSeverity,
- LPWSTR lpMessageText)
+BOOL WINAPI
+SYSSETUP_LogItem(IN const LPSTR lpFileName,
+ IN DWORD dwLineNumber,
+ IN DWORD dwSeverity,
+ IN LPWSTR lpMessageText)
{
- LPSTR lpNewLine = "\r\n";
- LPSTR lpSeverityString;
+ const LPCSTR lpNewLine = "\r\n";
+ LPCSTR lpSeverityString;
LPSTR lpMessageString;
DWORD dwMessageLength;
DWORD dwMessageSize;
DWORD dwWritten;
+ CHAR Buffer[6];
/* Get the severity code string */
switch (dwSeverity)
@@ -136,13 +135,11 @@
dwMessageLength);
/* Allocate message string buffer */
- lpMessageString = (LPSTR) HeapAlloc(GetProcessHeap (),
+ lpMessageString = (LPSTR) HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
dwMessageSize);
- if (lpMessageString == NULL)
- {
+ if (!lpMessageString)
return FALSE;
- }
/* Convert unicode to ansi */
RtlUnicodeToMultiByteN(lpMessageString,
@@ -157,6 +154,27 @@
NULL,
FILE_END);
+ /* Write file name */
+ WriteFile(hLogFile,
+ lpFileName,
+ strlen(lpFileName),
+ &dwWritten,
+ NULL);
+
+ /* Write comma */
+ WriteFile(hLogFile, ",", 1, &dwWritten, NULL);
+
+ /* Write line number */
+ snprintf(Buffer, sizeof(Buffer), "%lu", dwLineNumber);
+ WriteFile(hLogFile,
+ Buffer,
+ strlen(Buffer),
+ &dwWritten,
+ NULL);
+
+ /* Write comma */
+ WriteFile(hLogFile, ",", 1, &dwWritten, NULL);
+
/* Write severity code */
WriteFile(hLogFile,
lpSeverityString,
@@ -174,7 +192,7 @@
/* Write newline */
WriteFile(hLogFile,
lpNewLine,
- 2,
+ sizeof(lpNewLine),
&dwWritten,
NULL);
Modified: trunk/reactos/dll/win32/syssetup/syssetup.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/syssetu…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/syssetup.def (original)
+++ trunk/reactos/dll/win32/syssetup/syssetup.def Wed Jul 11 13:04:22 2007
@@ -7,7 +7,7 @@
InstallLiveCD@4
InstallReactOS@4
KeyboardClassInstaller@12
-LogItem@8
+;LogItem@8
;LogItem0
;LogItem1
;LogItem2
Modified: trunk/reactos/dll/win32/syssetup/wizard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/wizard.…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/wizard.c (original)
+++ trunk/reactos/dll/win32/syssetup/wizard.c Wed Jul 11 13:04:22 2007
@@ -572,7 +572,7 @@
TCHAR Password2[15];
PWCHAR Password;
WCHAR Title[64];
- WCHAR EmptyComputerName[256], EmptyPassword[256], NotMatchPassword[256],
WrongPassword[256];
+ WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256];
DWORD Length;
LPNMHDR lpnm;
Modified: trunk/reactos/include/reactos/libs/syssetup/syssetup.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/sysse…
==============================================================================
--- trunk/reactos/include/reactos/libs/syssetup/syssetup.h (original)
+++ trunk/reactos/include/reactos/libs/syssetup/syssetup.h Wed Jul 11 13:04:22 2007
@@ -39,16 +39,20 @@
#define SYSSETUP_SEVERITY_FATAL_ERROR 3
-BOOL STDCALL
-InitializeSetupActionLog (BOOL bDeleteOldLogFile);
+BOOL WINAPI
+InitializeSetupActionLog(IN BOOL bDeleteOldLogFile);
-VOID STDCALL
-TerminateSetupActionLog (VOID);
+VOID WINAPI
+TerminateSetupActionLog(VOID);
-BOOL STDCALL
-LogItem (DWORD dwSeverity,
- LPWSTR lpMessageText);
+BOOL WINAPI
+SYSSETUP_LogItem(IN const LPSTR lpFileName,
+ IN DWORD dwLineNumber,
+ IN DWORD dwSeverity,
+ IN LPWSTR lpMessageText);
+#define LogItem(dwSeverity, lpMessageText) \
+ SYSSETUP_LogItem(__FILE__, __LINE__, dwSeverity, lpMessageText)
#endif /* __SYSSETUP_H_INCLUDED__ */