Fixed type info in module logchannel

This commit is contained in:
fermin831 2018-07-31 11:25:08 +02:00
parent 2dc5bc1139
commit 6efa86c4d5
2 changed files with 16 additions and 9 deletions

View File

@ -67,16 +67,16 @@ Pandora_Module_Logchannel::Pandora_Module_Logchannel (string name, string source
// Set the type filter
int type_number = -1;
if (upper_type.compare("ERROR") == 0) {
type_number = EVENTLOG_ERROR_TYPE;
if (upper_type.compare("CRITICAL") == 0) {
type_number = WINEVENT_LEVEL_CRITICAL;
} else if (upper_type.compare("ERROR") == 0) {
type_number = WINEVENT_LEVEL_ERROR;
} else if (upper_type.compare("WARNING") == 0) {
type_number = EVENTLOG_WARNING_TYPE;
} else if (upper_type.compare("INFORMATION") == 0) {
type_number = EVENTLOG_INFORMATION_TYPE;
} else if (upper_type.compare("AUDIT SUCCESS") == 0) {
type_number = EVENTLOG_AUDIT_SUCCESS;
} else if (upper_type.compare("AUDIT FAILURE") == 0) {
type_number = EVENTLOG_AUDIT_FAILURE;
type_number = WINEVENT_LEVEL_WARNING;
} else if (upper_type.compare("INFO") == 0) {
type_number = WINEVENT_LEVEL_INFO;
} else if (upper_type.compare("VERBOSE") == 0) {
type_number = WINEVENT_LEVEL_VERBOSE;
}
// Append type to log query
if (type_number != -1) {

View File

@ -29,6 +29,13 @@
// Log event read buffer size
#define BUFFER_SIZE 1024
// WINEVENT consts
#define WINEVENT_LEVEL_CRITICAL 1
#define WINEVENT_LEVEL_ERROR 2
#define WINEVENT_LEVEL_WARNING 3
#define WINEVENT_LEVEL_INFO 4
#define WINEVENT_LEVEL_VERBOSE 5
// Types for pointers to Wevtapi.dll functions
typedef EVT_HANDLE WINAPI (*EvtQueryT) (EVT_HANDLE Session, LPCWSTR Path, LPCWSTR Query, DWORD Flags);
typedef WINBOOL WINAPI (*EvtNextT) (EVT_HANDLE ResultSet, DWORD EventArraySize, EVT_HANDLE* EventArray, DWORD Timeout, DWORD Flags, PDWORD Returned);