ReactOS 0.4.15-dev-7958-gcd0bb1a
eventvwr.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Event Log Viewer
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Event Log Viewer header.
5 * COPYRIGHT: Copyright 2007 Marc Piulachs <marc.piulachs@codexchange.net>
6 * Copyright 2008-2016 Eric Kohl <eric.kohl@reactos.org>
7 * Copyright 2016-2022 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
8 */
9
10#ifndef _EVENTVWR_PCH_
11#define _EVENTVWR_PCH_
12
13#pragma once
14
15/* C Headers */
16#include <stdio.h>
17#include <stdlib.h>
18
19#include <assert.h>
20#define ASSERT(x) assert(x)
21
22/* PSDK Headers */
23#define WIN32_NO_STATUS
24#include <windef.h>
25#include <winbase.h>
26#include <wingdi.h>
27#include <winuser.h>
28#include <winnls.h>
29#include <winreg.h>
30
31#include <ndk/rtlfuncs.h> // For linked-lists.
32
33#define ROUND_DOWN(n, align) (((ULONG)n) & ~((align) - 1l))
34#define ROUND_UP(n, align) ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
35
36#include <strsafe.h>
37
38#include <commctrl.h>
39#include <commdlg.h>
40
41#include <richedit.h>
42
43/* Missing RichEdit flags in our richedit.h */
44#define AURL_ENABLEURL 1
45#define AURL_ENABLEEMAILADDR 2
46#define AURL_ENABLETELNO 4
47#define AURL_ENABLEEAURLS 8
48#define AURL_ENABLEDRIVELETTERS 16
49
50#include <windowsx.h>
51
52/*
53 * windowsx.h extensions
54 */
55#define EnableDlgItem(hDlg, nID, bEnable) \
56 EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable))
57
58#define ProgressBar_SetPos(hwndCtl,pos) \
59 ((int)SNDMSG((hwndCtl),PBM_SETPOS,(WPARAM)(int)(pos),(LPARAM)0))
60#define ProgressBar_SetRange(hwndCtl,range) \
61 ((int)SNDMSG((hwndCtl),PBM_SETRANGE,(WPARAM)0,(LPARAM)(range)))
62#define ProgressBar_SetStep(hwndCtl,inc) \
63 ((int)SNDMSG((hwndCtl),PBM_SETSTEP,(WPARAM)(int)(inc),(LPARAM)0))
64#define ProgressBar_StepIt(hwndCtl) \
65 ((int)SNDMSG((hwndCtl),PBM_STEPIT,(WPARAM)0,(LPARAM)0))
66
67#define StatusBar_GetItemRect(hwndCtl,index,lprc) \
68 ((BOOL)SNDMSG((hwndCtl),SB_GETRECT,(WPARAM)(int)(index),(LPARAM)(RECT*)(lprc)))
69#define StatusBar_SetText(hwndCtl,index,data) \
70 ((BOOL)SNDMSG((hwndCtl),SB_SETTEXT,(WPARAM)(index),(LPARAM)(data)))
71
72#ifndef WM_APP
73 #define WM_APP 0x8000
74#endif
75
76#include "resource.h"
77
78extern HINSTANCE hInst;
79
80
81/*
82 * Structure that caches information about an opened event log.
83 */
84typedef struct _EVENTLOG
85{
87
88 // HANDLE hEventLog; // At least for user logs, a handle is kept opened (by eventlog service) as long as the event viewer has the focus on this log.
89
90 PWSTR ComputerName; // Computer where the log resides
91
93 PWSTR LogName; // Internal name (from registry, or file path for user logs)
94 PWSTR FileName; // Cached, for user logs; retrieved once (at startup) from registry for system logs (i.e. may be different from the one opened by the eventlog service)
95 // PWSTR DisplayName; // The default value is the one computed; can be modified by the user for this local session only.
96 // We can use the TreeView' item name for the DisplayName...
97 BOOL Permanent; // TRUE: system log; FALSE: user log
98
100 // ULONG Flags;
101 // ULONG MaxSize; // Always retrieved from registry (only valid for system logs)
102 // ULONG Retention; // Always retrieved from registry (only valid for system logs)
104
105typedef struct _EVENTLOGFILTER
106{
108
110
111 // HANDLE hEnumEventsThread;
112 // HANDLE hStopEnumEvent;
113
114 // PWSTR DisplayName; // The default value is the one computed; can be modified by the user for this local session only.
115 // We can use the TreeView' item name for the DisplayName...
116
122
123 // ULONG Category;
125
126 /*
127 * The following three string filters are multi-strings that enumerate
128 * the list of sources/users/computers to be shown. If a string points
129 * to an empty string: "\0", it filters for an empty source/user/computer.
130 * If a string points to NULL, it filters for all sources/users/computers.
131 */
135
136 /* List of event logs maintained by this filter */
140
141#endif /* _EVENTVWR_PCH_ */
struct _EVENTLOG EVENTLOG
HINSTANCE hInst
Definition: dxdiag.c:13
struct _EVENTLOGFILTER EVENTLOGFILTER
struct _EVENTLOG * PEVENTLOG
struct _EVENTLOGFILTER * PEVENTLOGFILTER
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
PEVENTLOG EventLogs[ANYSIZE_ARRAY]
Definition: eventvwr.h:138
ULONG NumOfEventLogs
Definition: eventvwr.h:137
BOOL AuditSuccess
Definition: eventvwr.h:120
BOOL Information
Definition: eventvwr.h:117
PWSTR ComputerNames
Definition: eventvwr.h:134
LIST_ENTRY ListEntry
Definition: eventvwr.h:107
BOOL AuditFailure
Definition: eventvwr.h:121
LONG ReferenceCount
Definition: eventvwr.h:109
PWSTR LogName
Definition: eventvwr.h:93
PWSTR ComputerName
Definition: eventvwr.h:90
BOOL Permanent
Definition: eventvwr.h:97
PWSTR FileName
Definition: eventvwr.h:94
LIST_ENTRY ListEntry
Definition: eventvwr.h:86
Definition: typedefs.h:120
uint16_t * PWSTR
Definition: typedefs.h:56
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
uint32_t ULONG
Definition: typedefs.h:59