ReactOS 0.4.15-dev-5666-gc548b97
eventlog.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS EventLog Service
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: base/services/eventlog/eventlog.h
5 * PURPOSE: Precompiled Header for the Event logging service
6 * COPYRIGHT: Copyright 2005 Saveliy Tretiakov
7 */
8
9#ifndef __EVENTLOG_H__
10#define __EVENTLOG_H__
11
12#include <stdarg.h>
13
14/* PSDK/NDK Headers */
15#define WIN32_NO_STATUS
16#include <windef.h>
17#include <winbase.h>
18
19#define NTOS_MODE_USER
20#include <ndk/rtlfuncs.h>
21#include <ndk/obfuncs.h>
22
23#define ROUND_DOWN(n, align) (((ULONG)n) & ~((align) - 1l))
24#define ROUND_UP(n, align) ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
25
26#include <evtlib.h>
27
28#include <eventlogrpc_s.h>
29#include <strsafe.h>
30
31/* Defined in evtlib.h */
32// #define LOGFILE_SIGNATURE 0x654c664c // "LfLe"
33
34typedef struct _LOGFILE
35{
43
44typedef struct _EVENTSOURCE
45{
50
51
52/* Log Handle Flags */
53#define LOG_HANDLE_BACKUP_FILE 1
54
55typedef struct _LOGHANDLE
56{
64
65
66/* eventlog.c */
68
70
71
72/* eventsource.c */
74
75BOOL
77 PLOGFILE pLogFile);
78
81
82
83/* file.c */
88// DWORD LogfListItemIndexByName(WCHAR * Name);
89
91LogfCreate(PLOGFILE* LogFile,
92 PCWSTR LogName,
94 ULONG MaxSize,
95 ULONG Retention,
96 BOOLEAN Permanent,
97 BOOLEAN Backup);
98
99VOID
100LogfClose(PLOGFILE LogFile,
101 BOOLEAN ForceClose);
102
104
106LogfClearFile(PLOGFILE LogFile,
107 PUNICODE_STRING BackupFileName);
108
111 PUNICODE_STRING BackupFileName);
112
115 ULONG Flags,
116 PULONG RecordNumber,
120 PULONG BytesNeeded,
121 BOOLEAN Ansi);
122
127
130 ULONG Time,
131 USHORT wType,
132 USHORT wCategory,
133 ULONG dwEventId,
135 PUNICODE_STRING ComputerName,
136 ULONG dwSidLength,
137 PSID pUserSid,
138 USHORT wNumStrings,
139 PWSTR pStrings,
140 ULONG dwDataSize,
141 PVOID pRawData);
142
144{
146}
147
148VOID
150 USHORT wCategory,
151 ULONG dwEventId,
152 USHORT wNumStrings,
153 PWSTR pStrings,
154 ULONG dwDataSize,
155 PVOID pRawData);
156
157
158/* logport.c */
160
162
164
165/* rpc.c */
167
168#endif /* __EVENTLOG_H__ */
#define BufSize
Definition: FsRtlTunnel.c:28
unsigned char BOOLEAN
WCHAR SourceName[256]
Definition: arping.c:28
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
Definition: bufpool.h:45
#define GetProcessHeap()
Definition: compat.h:736
VOID PRINT_RECORD(PEVENTLOGRECORD pRec)
Definition: eventlog.c:544
VOID LogfReportEvent(USHORT wType, USHORT wCategory, ULONG dwEventId, USHORT wNumStrings, PWSTR pStrings, ULONG dwDataSize, PVOID pRawData)
Definition: file.c:1037
NTSTATUS LogfClearFile(PLOGFILE LogFile, PUNICODE_STRING BackupFileName)
Definition: file.c:467
NTSTATUS LogfCreate(PLOGFILE *LogFile, PCWSTR LogName, PUNICODE_STRING FileName, ULONG MaxSize, ULONG Retention, BOOLEAN Permanent, BOOLEAN Backup)
Definition: file.c:294
NTSTATUS ProcessPortMessage(VOID)
Definition: logport.c:104
BOOL LoadEventSources(HKEY hKey, PLOGFILE pLogFile)
Definition: eventsource.c:82
NTSTATUS LogfReadEvents(PLOGFILE LogFile, ULONG Flags, PULONG RecordNumber, ULONG BufSize, PBYTE Buffer, PULONG BytesRead, PULONG BytesNeeded, BOOLEAN Ansi)
Definition: file.c:721
PEVENTSOURCE EventLogSource
Definition: eventlog.c:35
PLOGFILE LogfListItemByName(LPCWSTR Name)
Definition: file.c:33
VOID InitEventSourceList(VOID)
Definition: eventsource.c:22
NTSTATUS LogfWriteRecord(PLOGFILE LogFile, PEVENTLOGRECORD Record, SIZE_T BufSize)
Definition: file.c:858
VOID LogfListInitialize(VOID)
Definition: file.c:27
VOID LogfClose(PLOGFILE LogFile, BOOLEAN ForceClose)
Definition: file.c:428
NTSTATUS InitLogPort(VOID)
Definition: logport.c:47
struct _EVENTSOURCE * PEVENTSOURCE
PLOGFILE LogfListItemByIndex(DWORD Index)
Definition: file.c:93
PEVENTLOGRECORD LogfAllocAndBuildNewRecord(PSIZE_T pRecSize, ULONG Time, USHORT wType, USHORT wCategory, ULONG dwEventId, PUNICODE_STRING SourceName, PUNICODE_STRING ComputerName, ULONG dwSidLength, PSID pUserSid, USHORT wNumStrings, PWSTR pStrings, ULONG dwDataSize, PVOID pRawData)
Definition: file.c:896
NTSTATUS WINAPI PortThreadRoutine(PVOID Param)
Definition: logport.c:27
PEVENTSOURCE GetEventSourceByName(LPCWSTR Name)
Definition: eventsource.c:202
struct _EVENTSOURCE EVENTSOURCE
struct _LOGFILE * PLOGFILE
NTSTATUS LogfBackupFile(PLOGFILE LogFile, PUNICODE_STRING BackupFileName)
Definition: file.c:499
VOID LogfCloseAll(VOID)
Definition: file.c:452
DWORD LogfListItemCount(VOID)
Definition: file.c:118
DWORD WINAPI RpcThreadRoutine(LPVOID lpParameter)
Definition: rpcserver.c:20
struct _LOGHANDLE LOGHANDLE
struct _LOGHANDLE * PLOGHANDLE
static __inline void LogfFreeRecord(PEVENTLOGRECORD Record)
Definition: eventlog.h:143
struct _LOGFILE LOGFILE
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
static PLARGE_INTEGER Time
Definition: time.c:105
BYTE * PBYTE
Definition: pedump.c:66
unsigned short USHORT
Definition: pedump.c:61
WCHAR szName[1]
Definition: eventlog.h:48
LIST_ENTRY EventSourceListEntry
Definition: eventlog.h:46
PLOGFILE LogFile
Definition: eventlog.h:47
Definition: typedefs.h:120
RTL_RESOURCE Lock
Definition: eventlog.h:39
EVTLOGFILE LogFile
Definition: eventlog.h:36
LIST_ENTRY ListEntry
Definition: eventlog.h:41
BOOL Permanent
Definition: eventlog.h:40
HANDLE FileHandle
Definition: eventlog.h:37
WCHAR * LogName
Definition: eventlog.h:38
ULONG CurrentRecord
Definition: eventlog.h:60
PLOGFILE LogFile
Definition: eventlog.h:59
LIST_ENTRY LogHandleListEntry
Definition: eventlog.h:57
ULONG Flags
Definition: eventlog.h:61
WCHAR szName[1]
Definition: eventlog.h:62
PEVENTSOURCE EventSource
Definition: eventlog.h:58
ULONG_PTR * PSIZE_T
Definition: typedefs.h:80
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
ULONG_PTR SIZE_T
Definition: typedefs.h:80
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:870
#define WINAPI
Definition: msvc.h:6
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ struct _KBUGCHECK_REASON_CALLBACK_RECORD * Record
Definition: ketypes.h:256
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185