4 eventlog interface definition
7 import
"lsa.idl", "security.idl";
9 [ uuid("82273fdc-e32a-18c3-3f78-827929dc23ea"),
11 helpstring("Event Logger")
14 typedef [bitmap32bit
] bitmap
{
15 EVENTLOG_SEQUENTIAL_READ
= 0x0001,
16 EVENTLOG_SEEK_READ
= 0x0002,
17 EVENTLOG_FORWARDS_READ
= 0x0004,
18 EVENTLOG_BACKWARDS_READ
= 0x0008
21 typedef [public] enum {
22 EVENTLOG_SUCCESS
= 0x0000,
23 EVENTLOG_ERROR_TYPE
= 0x0001,
24 EVENTLOG_WARNING_TYPE
= 0x0002,
25 EVENTLOG_INFORMATION_TYPE
= 0x0004,
26 EVENTLOG_AUDIT_SUCCESS
= 0x0008,
27 EVENTLOG_AUDIT_FAILURE
= 0x0010
33 } eventlog_OpenUnknown0
;
35 /* compat structure for samba3 on-disc eventlog format,
36 this is *NOT* used on the wire. - gd */
38 typedef [flag
(NDR_NOALIGN|NDR_PAHEX
),public] struct {
40 [charset
(DOS
),value
("eLfL")] uint8 reserved
[4];
42 time_t time_generated
;
45 eventlogEventTypes event_type
;
46 [range(0,256)] uint16 num_of_strings
;
47 uint16 event_category
;
48 uint16 reserved_flags
;
49 uint32 closing_record_number
;
51 [value
(sid.length
)] uint32 sid_length
;
53 [value
(data.length
)] uint32 data_length
;
55 [value
(2*strlen_m_term
(source_name
))] uint32 source_name_len
;
57 [value
(2*strlen_m_term
(computer_name
))] uint32 computer_name_len
;
58 nstring computer_name
;
61 [value
(2*ndr_size_string_array
(strings
, num_of_strings
, STR_NULLTERM
))] uint32 strings_len
;
62 nstring strings
[num_of_strings
];
65 } eventlog_Record_tdb
;
67 typedef [v1_enum] enum {
68 ELF_LOGFILE_HEADER_DIRTY
= 0x0001,
69 ELF_LOGFILE_HEADER_WRAP
= 0x0002,
70 ELF_LOGFILE_LOGFULL_WRITTEN
= 0x0004,
71 ELF_LOGFILE_ARCHIVE_SET
= 0x0008
72 } EVENTLOG_HEADER_FLAGS
;
74 typedef [public] struct {
75 [value
(0x30)] uint32 HeaderSize
;
76 [charset
(DOS
),value
("LfLe")] uint8 Signature
[4];
77 [value
(1)] uint32 MajorVersion
;
78 [value
(1)] uint32 MinorVersion
;
81 uint32 CurrentRecordNumber
;
82 uint32 OldestRecordNumber
;
84 EVENTLOG_HEADER_FLAGS Flags
;
86 [value
(0x30)] uint32 EndHeaderSize
;
89 typedef [public,gensize
] struct {
91 [charset
(DOS
),value
("LfLe")] uint8 Reserved
[4];
96 eventlogEventTypes EventType
;
100 uint32 ClosingRecordNumber
;
101 [value
(56+2*(strlen_m_term
(SourceName
)+strlen_m_term
(Computername
))+UserSidLength
)] uint32 StringOffset
;
102 [value
(ndr_size_dom_sid0
(&UserSid
, ndr
->flags
))] uint32 UserSidLength
;
103 [value
(56+2*(strlen_m_term
(SourceName
)+strlen_m_term
(Computername
)))] uint32 UserSidOffset
;
105 [value
(56+2*(strlen_m_term
(SourceName
)+strlen_m_term
(Computername
))+UserSidLength
+(2*ndr_size_string_array
(Strings
, NumStrings
, STR_NULLTERM
)))] uint32 DataOffset
;
107 nstring Computername
;
108 [flag
(NDR_ALIGN4
),subcontext
(0),subcontext_size
(UserSidLength
)] dom_sid0 UserSid
;
109 nstring Strings
[NumStrings
];
110 [flag
(NDR_PAHEX
)] uint8 Data
[DataLength
];
112 [value
(Length
)] uint32 Length2
;
115 typedef [public] struct {
116 [value
(0x28)] uint32 RecordSizeBeginning
;
117 [value
(0x11111111)] uint32 One
;
118 [value
(0x22222222)] uint32 Two
;
119 [value
(0x33333333)] uint32 Three
;
120 [value
(0x44444444)] uint32 Four
;
123 uint32 CurrentRecordNumber
;
124 uint32 OldestRecordNumber
;
125 [value
(0x28)] uint32 RecordSizeEnd
;
128 /* the following is true for a non-wrapped evt file (e.g. backups
129 * generated and viewed with eventvwr) */
131 typedef [public] struct {
133 EVENTLOGRECORD records
[hdr.CurrentRecordNumber
-hdr.OldestRecordNumber
];
139 NTSTATUS eventlog_ClearEventLogW
(
140 [in] policy_handle
*handle,
141 [in,unique] lsa_String
*backupfile
146 NTSTATUS eventlog_BackupEventLogW
(
147 [in] policy_handle
*handle,
148 [in,ref] lsa_String
*backup_filename
153 NTSTATUS eventlog_CloseEventLog
(
154 [in,out] policy_handle
*handle
159 NTSTATUS eventlog_DeregisterEventSource
(
160 [in,out] policy_handle
*handle
165 NTSTATUS eventlog_GetNumRecords
(
166 [in] policy_handle
*handle,
167 [out,ref] uint32
*number
172 NTSTATUS eventlog_GetOldestRecord
(
173 [in] policy_handle
*handle,
174 [out,ref] uint32
*oldest_entry
179 [todo
] NTSTATUS eventlog_ChangeNotify
();
183 NTSTATUS eventlog_OpenEventLogW
(
184 [in,unique] eventlog_OpenUnknown0
*unknown0
,
185 [in,ref] lsa_String
*logname
,
186 [in,ref] lsa_String
*servername
,
187 [in] uint32 major_version
,
188 [in] uint32 minor_version
,
189 [out] policy_handle
*handle
194 NTSTATUS eventlog_RegisterEventSourceW
(
195 [in,unique] eventlog_OpenUnknown0
*unknown0
,
196 [in,ref] lsa_String
*module_name
,
197 [in,ref] lsa_String
*reg_module_name
,
198 [in] uint32 major_version
,
199 [in] uint32 minor_version
,
200 [out] policy_handle
*log_handle
205 NTSTATUS eventlog_OpenBackupEventLogW
(
206 [in,unique] eventlog_OpenUnknown0
*unknown0
,
207 [in,ref] lsa_String
*backup_logname
,
208 [in] uint32 major_version
,
209 [in] uint32 minor_version
,
210 [out] policy_handle
*handle
215 NTSTATUS eventlog_ReadEventLogW
(
216 [in] policy_handle
*handle,
217 [in] eventlogReadFlags flags
,
219 [in] [range(0,0x7FFFF)] uint32 number_of_bytes
,
220 [out,ref,size_is(number_of_bytes
)] uint8
*data
,
221 [out,ref] uint32
*sent_size
,
222 [out,ref] uint32
*real_size
227 NTSTATUS eventlog_ReportEventW
(
228 [in] policy_handle
*handle,
229 [in] time_t timestamp
,
230 [in] eventlogEventTypes event_type
,
231 [in] uint16 event_category
,
232 [in] uint32 event_id
,
233 [in] [range(0,256)] uint16 num_of_strings
,
234 [in] [range(0,0x3FFFF)] uint32 data_size
,
235 [in,ref] lsa_String
*servername
,
236 [in,unique] dom_sid
*user_sid
,
237 [in,unique] [size_is(num_of_strings
)] lsa_String
**strings
,
238 [in,unique] [size_is(data_size
)] uint8
*data
,
240 [in,out,unique] uint32
*record_number
,
241 [in,out,unique] time_t
*time_written
246 [todo
] NTSTATUS eventlog_ClearEventLogA
();
250 [todo
] NTSTATUS eventlog_BackupEventLogA
();
254 [todo
] NTSTATUS eventlog_OpenEventLogA
();
258 [todo
] NTSTATUS eventlog_RegisterEventSourceA
();
262 [todo
] NTSTATUS eventlog_OpenBackupEventLogA
();
266 [todo
] NTSTATUS eventlog_ReadEventLogA
();
270 [todo
] NTSTATUS eventlog_ReportEventA
();
274 [todo
] NTSTATUS eventlog_RegisterClusterSvc
();
278 [todo
] NTSTATUS eventlog_DeregisterClusterSvc
();
282 [todo
] NTSTATUS eventlog_WriteClusterEvents
();
289 } EVENTLOG_FULL_INFORMATION
;
291 NTSTATUS eventlog_GetLogInformation
(
292 [in] policy_handle
*handle,
294 [out,ref] [size_is(buf_size
)] uint8
*buffer
,
295 [in] [range(0,1024)] uint32 buf_size
,
296 [out,ref] uint32
*bytes_needed
301 NTSTATUS eventlog_FlushEventLog
(
302 [in] policy_handle
*handle
307 NTSTATUS eventlog_ReportEventAndSourceW
(
308 [in] policy_handle
*handle,
309 [in] time_t timestamp
,
310 [in] eventlogEventTypes event_type
,
311 [in] uint16 event_category
,
312 [in] uint32 event_id
,
313 [in,ref] lsa_String
*sourcename
,
314 [in] [range(0,256)] uint16 num_of_strings
,
315 [in] [range(0,0x3FFFF)] uint32 data_size
,
316 [in,ref] lsa_String
*servername
,
317 [in,unique] dom_sid
*user_sid
,
318 [in,unique] [size_is(num_of_strings
)] lsa_String
**strings
,
319 [in,unique] [size_is(data_size
)] uint8
*data
,
321 [in,out,unique] uint32
*record_number
,
322 [in,out,unique] time_t
*time_written