Author: dreimer
Date: Wed Oct 17 18:38:52 2007
New Revision: 29643
URL:
http://svn.reactos.org/svn/reactos?rev=29643&view=rev
Log:
Bug 2749: Small fixes to eventvwr (marc.piulachs(a)codexchange.net)
Modified:
trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c
trunk/reactos/base/applications/mscutils/eventvwr/lang/de-DE.rc
trunk/reactos/base/applications/mscutils/eventvwr/lang/en-US.rc
trunk/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc
trunk/reactos/base/applications/mscutils/eventvwr/lang/ru-RU.rc
trunk/reactos/base/applications/mscutils/eventvwr/resource.h
Modified: trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c (original)
+++ trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c Wed Oct 17 18:38:52 2007
@@ -41,6 +41,7 @@
static const TCHAR szWindowClass[] = _T("EVENTVWR"); // the main window class
name
//MessageFile message buffer size
+#define EVENT_MESSAGE_EVENTTEXT_BUFFER 1024*10
#define EVENT_MESSAGE_FILE_BUFFER 1024*10
#define EVENT_DLL_SEPARATOR ";"
#define EVENT_MESSAGE_FILE "EventMessageFile"
@@ -381,27 +382,31 @@
return FALSE;
}
-char* GetEventType (WORD dwEventType)
+VOID
+GetEventType (WORD dwEventType, OUT LPSTR eventTypeText)
{
switch(dwEventType)
{
case EVENTLOG_ERROR_TYPE:
- return "Error";
+ LoadString(hInst, IDC_EVENTLOG_ERROR_TYPE, eventTypeText, MAX_LOADSTRING);
break;
case EVENTLOG_WARNING_TYPE:
- return "Warning";
+ LoadString(hInst, IDC_EVENTLOG_WARNING_TYPE, eventTypeText, MAX_LOADSTRING);
break;
case EVENTLOG_INFORMATION_TYPE:
- return "Information";
+ LoadString(hInst, IDC_EVENTLOG_INFORMATION_TYPE, eventTypeText,
MAX_LOADSTRING);
break;
case EVENTLOG_AUDIT_SUCCESS:
- return "Audit Success";
+ LoadString(hInst, IDC_EVENTLOG_AUDIT_SUCCESS, eventTypeText,
MAX_LOADSTRING);
break;
case EVENTLOG_AUDIT_FAILURE:
- return "Audit Failure";
+ LoadString(hInst, IDC_EVENTLOG_AUDIT_FAILURE, eventTypeText,
MAX_LOADSTRING);
+ break;
+ case EVENTLOG_SUCCESS:
+ LoadString(hInst, IDC_EVENTLOG_SUCCESS, eventTypeText, MAX_LOADSTRING);
break;
default:
- return "Unknown Event";
+ LoadString(hInst, IDC_EVENTLOG_UNKNOWN_TYPE, eventTypeText, MAX_LOADSTRING);
break;
}
}
@@ -489,6 +494,7 @@
char szLocalDate[MAX_PATH];
char szLocalTime[MAX_PATH];
char szEventID[MAX_PATH];
+ char szEventTypeText[MAX_PATH];
char szCategoryID[MAX_PATH];
char szUsername[MAX_PATH];
char szEventText[EVENT_MESSAGE_FILE_BUFFER];
@@ -596,9 +602,9 @@
GetDateFormat( LOCALE_USER_DEFAULT, DATE_SHORTDATE, &time, NULL, szLocalDate,
MAX_PATH );
GetTimeFormat( LOCALE_USER_DEFAULT, TIME_NOSECONDS, &time, NULL, szLocalTime,
MAX_PATH );
-
+
+ GetEventType (pevlr->EventType , szEventTypeText);
GetEventCategory (lpLogName , lpSourceName , pevlr , szCategory);
- //GetEventMessage (lpLogName , lpSourceName , pevlr , szEventText);
wsprintf (szEventID, "%u", (DWORD)(pevlr->EventID & 0xFFFF));
wsprintf (szCategoryID, "%u", (DWORD)(pevlr->EventCategory));
@@ -607,31 +613,26 @@
lviEventItem.iItem = 0;
lviEventItem.iSubItem = 0;
lviEventItem.lParam = (LPARAM)pevlr;
+ lviEventItem.pszText = szEventTypeText;
switch(pevlr->EventType)
{
case EVENTLOG_ERROR_TYPE:
- lviEventItem.pszText = "Error";
lviEventItem.iImage = 2;
break;
case EVENTLOG_AUDIT_FAILURE:
- lviEventItem.pszText = "Audit Failure";
lviEventItem.iImage = 2;
break;
case EVENTLOG_WARNING_TYPE:
- lviEventItem.pszText = "Warning";
lviEventItem.iImage = 1;
break;
case EVENTLOG_INFORMATION_TYPE:
- lviEventItem.pszText = "Information";
lviEventItem.iImage = 0;
break;
case EVENTLOG_AUDIT_SUCCESS:
- lviEventItem.pszText = "Audit Success";
lviEventItem.iImage = 0;
break;
case EVENTLOG_SUCCESS:
- lviEventItem.pszText = "Success";
lviEventItem.iImage = 0;
break;
}
@@ -999,7 +1000,7 @@
char szSource[MAX_PATH];
char szCategory[MAX_PATH];
char szEventID[MAX_PATH];
- char szEventText[MAX_PATH*10];
+ char szEventText[EVENT_MESSAGE_EVENTTEXT_BUFFER];
char szEventData[MAX_PATH];
BOOL bEventData = FALSE;
LVITEM li;
@@ -1012,7 +1013,7 @@
li.iItem = iIndex;
li.iSubItem = 0;
- ListView_GetItem(hwndListView, &li);
+ (void)ListView_GetItem(hwndListView, &li);
pevlr = (EVENTLOGRECORD*)li.lParam;
Modified: trunk/reactos/base/applications/mscutils/eventvwr/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/eventvwr/lang/de-DE.rc (original)
+++ trunk/reactos/base/applications/mscutils/eventvwr/lang/de-DE.rc Wed Oct 17 18:38:52
2007
@@ -86,4 +86,11 @@
BEGIN
IDS_APP_TITLE "Ereignisanzeige"
IDC_EVENTSTRINGIDNOTFOUND "Die Bezeichnung für die Ereignis-ID ( %lu ) in der
Quelle ( %s ) kann nicht gefunden werden. Es könnte sein, dass der Lokale Computer die
notwendigen Registry Einträge oder Nachrichten DLLs, um Nachrichten von Remoten Computern
anzuzeigen, nicht besitzt."
+ IDC_EVENTLOG_ERROR_TYPE "Fehler"
+ IDC_EVENTLOG_WARNING_TYPE "Warnung"
+ IDC_EVENTLOG_INFORMATION_TYPE "Informationen"
+ IDC_EVENTLOG_AUDIT_SUCCESS "Audit Erfolgreich"
+ IDC_EVENTLOG_AUDIT_FAILURE "Audit Fehlgeschlagen"
+ IDC_EVENTLOG_SUCCESS "Erfolgreich"
+ IDC_EVENTLOG_UNKNOWN_TYPE "Unbekanntes Ereignis"
END
Modified: trunk/reactos/base/applications/mscutils/eventvwr/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/eventvwr/lang/en-US.rc (original)
+++ trunk/reactos/base/applications/mscutils/eventvwr/lang/en-US.rc Wed Oct 17 18:38:52
2007
@@ -86,4 +86,11 @@
BEGIN
IDS_APP_TITLE "Event Viewer"
IDC_EVENTSTRINGIDNOTFOUND "The description for Event ID ( %lu ) in Source ( %s )
cannot be found. The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer."
+ IDC_EVENTLOG_ERROR_TYPE "Error"
+ IDC_EVENTLOG_WARNING_TYPE "Warning"
+ IDC_EVENTLOG_INFORMATION_TYPE "Information"
+ IDC_EVENTLOG_AUDIT_SUCCESS "Audit Success"
+ IDC_EVENTLOG_AUDIT_FAILURE "Audit Failure"
+ IDC_EVENTLOG_SUCCESS "Success"
+ IDC_EVENTLOG_UNKNOWN_TYPE "Unknown Event"
END
Modified: trunk/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc (original)
+++ trunk/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc Wed Oct 17 18:38:52
2007
@@ -86,4 +86,11 @@
BEGIN
IDS_APP_TITLE "Visionneuse d'événements"
IDC_EVENTSTRINGIDNOTFOUND "La description pour l'événement d'ID ( %lu )
dans la source ( %s ) ne peut être trouvée. L'ordinateur local pourrait ne pas avoir
les informations registres nécéssaires ou les fichiers DLL de message pour afficher les
messages depuis un ordinateur distant."
+ IDC_EVENTLOG_ERROR_TYPE "Error"
+ IDC_EVENTLOG_WARNING_TYPE "Warning"
+ IDC_EVENTLOG_INFORMATION_TYPE "Information"
+ IDC_EVENTLOG_AUDIT_SUCCESS "Audit Success"
+ IDC_EVENTLOG_AUDIT_FAILURE "Audit Failure"
+ IDC_EVENTLOG_SUCCESS "Success"
+ IDC_EVENTLOG_UNKNOWN_TYPE "Unknown Event"
END
Modified: trunk/reactos/base/applications/mscutils/eventvwr/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/eventvwr/lang/ru-RU.rc (original)
+++ trunk/reactos/base/applications/mscutils/eventvwr/lang/ru-RU.rc Wed Oct 17 18:38:52
2007
@@ -86,4 +86,11 @@
BEGIN
IDS_APP_TITLE "Ïðîñìîòð ñîáûòèé"
IDC_EVENTSTRINGIDNOTFOUND "The description for Event ID ( %lu ) in Source
( %s ) cannot be found. The local computer may not have the necessary registry information
or message DLL files to display messages from a remote computer."
+ IDC_EVENTLOG_ERROR_TYPE "Error"
+ IDC_EVENTLOG_WARNING_TYPE "Warning"
+ IDC_EVENTLOG_INFORMATION_TYPE "Information"
+ IDC_EVENTLOG_AUDIT_SUCCESS "Audit Success"
+ IDC_EVENTLOG_AUDIT_FAILURE "Audit Failure"
+ IDC_EVENTLOG_SUCCESS "Success"
+ IDC_EVENTLOG_UNKNOWN_TYPE "Unknown Event"
END
Modified: trunk/reactos/base/applications/mscutils/eventvwr/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/eventvwr/resource.h (original)
+++ trunk/reactos/base/applications/mscutils/eventvwr/resource.h Wed Oct 17 18:38:52 2007
@@ -15,7 +15,14 @@
#define IDI_SMALL 108
#define IDC_EVENTVWR 109
#define IDC_EVENTSTRINGIDNOTFOUND 209
-#define IDC_PROCESSPROGRESS 250
+#define IDC_PROCESSPROGRESS 250
+#define IDC_EVENTLOG_ERROR_TYPE 251
+#define IDC_EVENTLOG_WARNING_TYPE 252
+#define IDC_EVENTLOG_INFORMATION_TYPE 253
+#define IDC_EVENTLOG_AUDIT_SUCCESS 254
+#define IDC_EVENTLOG_AUDIT_FAILURE 255
+#define IDC_EVENTLOG_SUCCESS 256
+#define IDC_EVENTLOG_UNKNOWN_TYPE 257
#define IDR_MAINFRAME 128
#define IDI_WARNINGICON 129
#define IDI_INFORMATIONICON 130