ReactOS  0.4.11-dev-946-g431643b
eventvwr.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Event Log Viewer
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: base/applications/mscutils/eventvwr/eventvwr.h
5  * PURPOSE: Event Log Viewer header
6  * PROGRAMMERS: Marc Piulachs (marc.piulachs at codexchange [dot] net)
7  * Eric Kohl
8  * Hermes Belusca-Maito
9  */
10 
11 #ifndef _EVENTVWR_PCH_
12 #define _EVENTVWR_PCH_
13 
14 // #pragma once
15 
16 #include <stdio.h>
17 #include <stdlib.h>
18 
19 #define WIN32_NO_STATUS
20 
21 #include <windef.h>
22 #include <winbase.h>
23 #include <wingdi.h>
24 #include <winuser.h>
25 #include <winnls.h>
26 #include <winreg.h>
27 
28 #include <ndk/rtlfuncs.h>
29 
30 #define ROUND_DOWN(n, align) (((ULONG)n) & ~((align) - 1l))
31 #define ROUND_UP(n, align) ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
32 
33 #include <strsafe.h>
34 
35 #include <commctrl.h>
36 #include <commdlg.h>
37 
38 #include <richedit.h>
39 
40 /* Missing RichEdit flags in our richedit.h */
41 #define AURL_ENABLEURL 1
42 #define AURL_ENABLEEMAILADDR 2
43 #define AURL_ENABLETELNO 4
44 #define AURL_ENABLEEAURLS 8
45 #define AURL_ENABLEDRIVELETTERS 16
46 
47 #include <windowsx.h>
48 
49 /*
50  * windowsx.h extensions
51  */
52 #define EnableDlgItem(hDlg, nID, bEnable) \
53  EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable))
54 
55 #define ProgressBar_SetPos(hwndCtl,pos) \
56  ((int)SNDMSG((hwndCtl),PBM_SETPOS,(WPARAM)(int)(pos),(LPARAM)0))
57 #define ProgressBar_SetRange(hwndCtl,range) \
58  ((int)SNDMSG((hwndCtl),PBM_SETRANGE,(WPARAM)0,(LPARAM)(range)))
59 #define ProgressBar_SetStep(hwndCtl,inc) \
60  ((int)SNDMSG((hwndCtl),PBM_SETSTEP,(WPARAM)(int)(inc),(LPARAM)0))
61 #define ProgressBar_StepIt(hwndCtl) \
62  ((int)SNDMSG((hwndCtl),PBM_STEPIT,(WPARAM)0,(LPARAM)0))
63 
64 #define StatusBar_GetItemRect(hwndCtl,index,lprc) \
65  ((BOOL)SNDMSG((hwndCtl),SB_GETRECT,(WPARAM)(int)(index),(LPARAM)(RECT*)(lprc)))
66 #define StatusBar_SetText(hwndCtl,index,data) \
67  ((BOOL)SNDMSG((hwndCtl),SB_SETTEXT,(WPARAM)(index),(LPARAM)(data)))
68 
69 #ifndef WM_APP
70  #define WM_APP 0x8000
71 #endif
72 
73 #include "resource.h"
74 
75 extern HINSTANCE hInst;
76 
77 
78 /*
79  * Structure that caches information about an opened event log.
80  */
81 typedef struct _EVENTLOG
82 {
84 
85  // 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.
86 
87  PWSTR ComputerName; // Computer where the log resides
88 
90  PWSTR LogName; // Internal name (from registry, or file path for user logs)
91  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)
92  // PWSTR DisplayName; // The default value is the one computed; can be modified by the user for this local session only.
93  // We can use the TreeView' item name for the DisplayName...
94  BOOL Permanent; // TRUE: system log; FALSE: user log
95 
97  // ULONG Flags;
98  // ULONG MaxSize; // Always retrieved from registry (only valid for system logs)
99  // ULONG Retention; // Always retrieved from registry (only valid for system logs)
100 } EVENTLOG, *PEVENTLOG;
101 
102 typedef struct _EVENTLOGFILTER
103 {
105 
107 
108  // HANDLE hEnumEventsThread;
109  // HANDLE hStopEnumEvent;
110 
111  // PWSTR DisplayName; // The default value is the one computed; can be modified by the user for this local session only.
112  // We can use the TreeView' item name for the DisplayName...
113 
119 
120  // ULONG Category;
122 
123  /*
124  * The following three string filters are multi-strings that enumerate
125  * the list of sources/users/computers to be shown. If a string points
126  * to an empty string: "\0", it filters for an empty source/user/computer.
127  * If a string points to NULL, it filters for all sources/users/computers.
128  */
132 
133  /* List of event logs maintained by this filter */
135  PEVENTLOG EventLogs[ANYSIZE_ARRAY];
137 
138 #endif /* _EVENTVWR_PCH_ */
BOOL AuditSuccess
Definition: eventvwr.h:117
LIST_ENTRY ListEntry
Definition: eventvwr.h:104
PWSTR LogName
Definition: eventvwr.h:90
BOOL Information
Definition: eventvwr.h:114
#define ANYSIZE_ARRAY
Definition: typedefs.h:45
uint16_t * PWSTR
Definition: typedefs.h:54
ULONG NumOfEventLogs
Definition: eventvwr.h:134
BOOL AuditFailure
Definition: eventvwr.h:118
struct _EVENTLOGFILTER EVENTLOGFILTER
PWSTR ComputerNames
Definition: eventvwr.h:131
long LONG
Definition: pedump.c:60
PWSTR ComputerName
Definition: eventvwr.h:87
struct _EVENTLOGFILTER * PEVENTLOGFILTER
unsigned int BOOL
Definition: ntddk_ex.h:94
LIST_ENTRY ListEntry
Definition: eventvwr.h:83
struct _EVENTLOG * PEVENTLOG
PWSTR FileName
Definition: eventvwr.h:91
Definition: typedefs.h:117
BOOL Permanent
Definition: eventvwr.h:94
LONG ReferenceCount
Definition: eventvwr.h:106
unsigned int ULONG
Definition: retypes.h:1
HINSTANCE hInst
Definition: dxdiag.c:13
struct _EVENTLOG EVENTLOG