126 references to NativeWrapper
System.Diagnostics.EventLog (126)
System\Diagnostics\Reader\EventLogConfiguration.cs (32)
59
_handle =
NativeWrapper
.EvtOpenChannelConfig(_session.Handle, LogName, 0);
68
return (EventLogType)((uint)
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigType)!);
76
return (EventLogIsolation)((uint)
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigIsolation)!);
84
return (bool)
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigEnabled)!;
88
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigEnabled, (object)value);
96
return (bool)
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigClassicEventlog)!;
104
var descriptor =
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigAccess);
110
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigAccess, (object?)value);
118
var logFilePath =
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigLogFilePath);
124
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigLogFilePath, (object?)value);
132
return (long)((ulong)
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigMaxSize)!);
136
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigMaxSize, (object)value);
144
object? nativeRetentionObject =
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigRetention);
145
object? nativeAutoBackupObject =
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigAutoBackup);
163
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigAutoBackup, (object)false);
164
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigRetention, (object)false);
167
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigAutoBackup, (object)true);
168
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigRetention, (object)true);
171
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigAutoBackup, (object)false);
172
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigRetention, (object)true);
182
var owningProviderName =
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigOwningPublisher);
192
var providerNames =
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublisherList);
202
return (int?)((uint?)
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigLevel));
206
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigLevel, (object?)value);
214
return (long?)((ulong?)
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigKeywords));
218
NativeWrapper
.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigKeywords, (object?)value);
226
return (int?)((uint?)
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigBufferSize));
234
return (int?)((uint?)
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigMinBuffers));
242
return (int?)((uint?)
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigMaxBuffers));
250
return (int?)((uint?)
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigLatency));
258
return (Guid?)(
NativeWrapper
.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigControlGuid));
264
NativeWrapper
.EvtSaveChannelConfig(_handle, 0);
System\Diagnostics\Reader\EventLogHandle.cs (1)
35
NativeWrapper
.EvtClose(handle);
System\Diagnostics\Reader\EventLogInformation.cs (9)
16
EventLogHandle logHandle =
NativeWrapper
.EvtOpenLog(session.Handle, channelName, pathType);
20
CreationTime = (DateTime?)
NativeWrapper
.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogCreationTime);
21
LastAccessTime = (DateTime?)
NativeWrapper
.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogLastAccessTime);
22
LastWriteTime = (DateTime?)
NativeWrapper
.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogLastWriteTime);
23
FileSize = (long?)((ulong?)
NativeWrapper
.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogFileSize));
24
Attributes = (int?)((uint?)
NativeWrapper
.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogAttributes));
25
RecordCount = (long?)((ulong?)
NativeWrapper
.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogNumberOfLogRecords));
26
OldestRecordNumber = (long?)((ulong?)
NativeWrapper
.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogOldestRecordNumber));
27
IsLogFull = (bool?)
NativeWrapper
.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogFull);
System\Diagnostics\Reader\EventLogPropertySelector.cs (1)
34
Handle =
NativeWrapper
.EvtCreateRenderContext(paths.Length, paths, UnsafeNativeMethods.EvtRenderContextFlags.EvtRenderContextValues);
System\Diagnostics\Reader\EventLogReader.cs (13)
98
_handle =
NativeWrapper
.EvtQuery(_eventQuery.Session.Handle,
108
NativeWrapper
.EvtSeek(_handle, 1, bookmarkHandle, 0, UnsafeNativeMethods.EvtSeekFlags.EvtSeekRelativeToBookmark);
138
bool results =
NativeWrapper
.EvtNext(_handle, _batchSize, _eventsBuffer, timeout, 0, ref newEventCount);
189
NativeWrapper
.EvtClose(_eventsBuffer[_currentIndex]);
204
NativeWrapper
.EvtClose(_eventsBuffer[_currentIndex]);
225
NativeWrapper
.EvtSeek(_handle, offset, EventLogHandle.Zero, 0, UnsafeNativeMethods.EvtSeekFlags.EvtSeekRelativeToCurrent);
240
NativeWrapper
.EvtSeek(_handle, offset, bookmarkHandle, 0, UnsafeNativeMethods.EvtSeekFlags.EvtSeekRelativeToBookmark);
251
NativeWrapper
.EvtSeek(_handle, offset, EventLogHandle.Zero, 0, UnsafeNativeMethods.EvtSeekFlags.EvtSeekRelativeToFirst);
257
NativeWrapper
.EvtSeek(_handle, offset, EventLogHandle.Zero, 0, UnsafeNativeMethods.EvtSeekFlags.EvtSeekRelativeToLast);
274
NativeWrapper
.EvtClose(_eventsBuffer[index]);
297
NativeWrapper
.EvtCancel(_handle);
309
string?[] channelNames = (string?[])
NativeWrapper
.EvtGetQueryInfo(queryHandle, UnsafeNativeMethods.EvtQueryPropertyId.EvtQueryNames)!;
310
int[] errorStatuses = (int[])
NativeWrapper
.EvtGetQueryInfo(queryHandle, UnsafeNativeMethods.EvtQueryPropertyId.EvtQueryStatuses)!;
System\Diagnostics\Reader\EventLogRecord.cs (12)
14
private readonly
NativeWrapper
.SystemProperties _systemProperties;
39
_systemProperties = new
NativeWrapper
.SystemProperties();
60
NativeWrapper
.EvtRenderBufferWithContextSystem(_session.renderContextHandleSystem, Handle, UnsafeNativeMethods.EvtRenderFlags.EvtRenderEventValues, _systemProperties);
238
return _containerChannel ??= (string?)
NativeWrapper
.EvtGetEventInfo(this.Handle, UnsafeNativeMethods.EvtEventPropertyId.EvtEventPath);
251
return _matchedQueryIds ??= (int[]?)
NativeWrapper
.EvtGetEventInfo(this.Handle, UnsafeNativeMethods.EvtEventPropertyId.EvtEventQueryIDs);
260
using (EventLogHandle bookmarkHandle =
NativeWrapper
.EvtCreateBookmark(null))
262
NativeWrapper
.EvtUpdateBookmark(bookmarkHandle, Handle);
263
string bookmarkText =
NativeWrapper
.EvtRenderBookmark(bookmarkHandle);
371
IList<object?> properties =
NativeWrapper
.EvtRenderBufferWithContextUserOrValues(_session.renderContextHandleUser, Handle);
385
return
NativeWrapper
.EvtRenderBufferWithContextUserOrValues(propertySelector.Handle, Handle);
391
return
NativeWrapper
.EvtRenderXml(EventLogHandle.Zero, Handle, renderBuffer);
411
EventLogHandle handle =
NativeWrapper
.EvtCreateBookmark(bookmark.BookmarkXml);
System\Diagnostics\Reader\EventLogSession.cs (12)
66
this.renderContextHandleSystem =
NativeWrapper
.EvtCreateRenderContext(0, null, UnsafeNativeMethods.EvtRenderContextFlags.EvtRenderContextSystem);
78
this.renderContextHandleUser =
NativeWrapper
.EvtCreateRenderContext(0, null, UnsafeNativeMethods.EvtRenderContextFlags.EvtRenderContextUser);
116
Handle =
NativeWrapper
.EvtOpenSession(UnsafeNativeMethods.EvtLoginClass.EvtRpcLogin, ref erLogin, 0, 0);
154
NativeWrapper
.EvtCancel(Handle);
167
using (EventLogHandle ProviderEnum =
NativeWrapper
.EvtOpenProviderEnum(this.Handle, 0))
173
string? s =
NativeWrapper
.EvtNextPublisherId(ProviderEnum, ref finish);
190
using (EventLogHandle channelEnum =
NativeWrapper
.EvtOpenChannelEnum(this.Handle, 0))
196
string? s =
NativeWrapper
.EvtNextChannelPath(channelEnum, ref finish);
233
NativeWrapper
.EvtExportLog(this.Handle, path, query, targetFilePath, (int)flag);
235
NativeWrapper
.EvtExportLog(this.Handle, path, query, targetFilePath, (int)flag | (int)UnsafeNativeMethods.EvtExportLogFlags.EvtExportLogTolerateQueryErrors);
247
NativeWrapper
.EvtArchiveExportedLog(this.Handle, targetFilePath, 0, 0);
259
NativeWrapper
.EvtClearLog(this.Handle, logName, backupPath, 0);
System\Diagnostics\Reader\EventLogWatcher.cs (2)
240
results =
NativeWrapper
.EvtNext(_handle, _eventsBuffer.Length, _eventsBuffer, 0, 0, ref _numEventsInBuffer);
304
NativeWrapper
.EvtClose(_eventsBuffer[i]);
System\Diagnostics\Reader\ProviderMetadata.cs (38)
66
_handle =
NativeWrapper
.EvtOpenProviderMetadata(_session.Handle, _providerName, _logFilePath, 0);
88
return (Guid)
NativeWrapper
.EvtGetPublisherMetadataProperty(_handle, UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataPublisherGuid)!;
96
return (string?)
NativeWrapper
.EvtGetPublisherMetadataProperty(_handle, UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataMessageFilePath);
104
return (string?)
NativeWrapper
.EvtGetPublisherMetadataProperty(_handle, UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataResourceFilePath);
112
return (string?)
NativeWrapper
.EvtGetPublisherMetadataProperty(_handle, UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataParameterFilePath);
120
string? helpLinkStr = (string?)
NativeWrapper
.EvtGetPublisherMetadataProperty(_handle, UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataHelpLink);
131
return (uint)
NativeWrapper
.EvtGetPublisherMetadataProperty(_handle, UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataPublisherMessageID)!;
144
return
NativeWrapper
.EvtFormatMessage(_handle, msgId);
160
elHandle =
NativeWrapper
.EvtGetPublisherMetadataPropertyHandle(_handle, UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataChannelReferences);
162
int arraySize =
NativeWrapper
.EvtGetObjectArraySize(elHandle);
168
string? channelName = (string?)
NativeWrapper
.EvtGetObjectArrayProperty(elHandle, index, (int)UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataChannelReferencePath);
170
uint channelId = (uint)
NativeWrapper
.EvtGetObjectArrayProperty(elHandle, index, (int)UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataChannelReferenceID)!;
172
uint flag = (uint)
NativeWrapper
.EvtGetObjectArrayProperty(elHandle, index, (int)UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataChannelReferenceFlags)!;
180
int channelRefMessageId = unchecked((int)((uint)
NativeWrapper
.EvtGetObjectArrayProperty(elHandle, index, (int)UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataChannelReferenceMessageID)!));
190
channelRefDisplayName =
NativeWrapper
.EvtFormatMessage(_handle, unchecked((uint)channelRefMessageId));
208
_defaultProviderHandle =
NativeWrapper
.EvtOpenProviderMetadata(_session.Handle, null, null, 0);
211
channelRefDisplayName =
NativeWrapper
.EvtFormatMessage(_defaultProviderHandle, unchecked((uint)channelRefMessageId));
295
elHandle =
NativeWrapper
.EvtGetPublisherMetadataPropertyHandle(providerHandle, metadataProperty);
297
int arraySize =
NativeWrapper
.EvtGetObjectArraySize(elHandle);
338
string? generalName = (string?)
NativeWrapper
.EvtGetObjectArrayProperty(elHandle, index, (int)propName);
344
generalValue = (uint)
NativeWrapper
.EvtGetObjectArrayProperty(elHandle, index, (int)propValue)!;
348
generalValueKeyword = unchecked((long)((ulong)
NativeWrapper
.EvtGetObjectArrayProperty(elHandle, index, (int)propValue)!));
351
int generalMessageId = unchecked((int)((uint)
NativeWrapper
.EvtGetObjectArrayProperty(elHandle, index, (int)propMessageId)!));
361
_defaultProviderHandle =
NativeWrapper
.EvtOpenProviderMetadata(_session.Handle, null, null, 0);
376
generalDisplayName =
NativeWrapper
.EvtFormatMessage(providerHandle, unchecked((uint)generalMessageId));
391
Guid taskGuid = (Guid)
NativeWrapper
.EvtGetObjectArrayProperty(elHandle, index, (int)UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataTaskEventGuid)!;
488
EventLogHandle emEnumHandle =
NativeWrapper
.EvtOpenEventMetadataEnum(_handle, 0);
494
EventLogHandle? emHandle =
NativeWrapper
.EvtNextEventMetadata(emEnumHandle, 0);
502
uint emId = (uint)
NativeWrapper
.EvtGetEventMetadataProperty(emHandle, UnsafeNativeMethods.EvtEventMetadataPropertyId.EventMetadataEventID)!;
503
byte emVersion = (byte)((uint)(
NativeWrapper
.EvtGetEventMetadataProperty(emHandle, UnsafeNativeMethods.EvtEventMetadataPropertyId.EventMetadataEventVersion))!);
504
byte emChannelId = (byte)((uint)
NativeWrapper
.EvtGetEventMetadataProperty(emHandle, UnsafeNativeMethods.EvtEventMetadataPropertyId.EventMetadataEventChannel)!);
505
byte emLevel = (byte)((uint)
NativeWrapper
.EvtGetEventMetadataProperty(emHandle, UnsafeNativeMethods.EvtEventMetadataPropertyId.EventMetadataEventLevel)!);
506
byte emOpcode = (byte)((uint)
NativeWrapper
.EvtGetEventMetadataProperty(emHandle, UnsafeNativeMethods.EvtEventMetadataPropertyId.EventMetadataEventOpcode)!);
507
short emTask = (short)((uint)
NativeWrapper
.EvtGetEventMetadataProperty(emHandle, UnsafeNativeMethods.EvtEventMetadataPropertyId.EventMetadataEventTask)!);
508
long emKeywords = (long)(ulong)
NativeWrapper
.EvtGetEventMetadataProperty(emHandle, UnsafeNativeMethods.EvtEventMetadataPropertyId.EventMetadataEventKeyword)!;
509
string? emTemplate = (string?)
NativeWrapper
.EvtGetEventMetadataProperty(emHandle, UnsafeNativeMethods.EvtEventMetadataPropertyId.EventMetadataEventTemplate);
510
int messageId = (int)((uint)
NativeWrapper
.EvtGetEventMetadataProperty(emHandle, UnsafeNativeMethods.EvtEventMetadataPropertyId.EventMetadataEventMessageID)!);
514
:
NativeWrapper
.EvtFormatMessage(_handle, (uint)messageId);
System\Diagnostics\Reader\ProviderMetadataCachedInformation.cs (6)
188
return
NativeWrapper
.EvtFormatMessageRenderName(pm.Handle, eventHandle, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageEvent);
205
return
NativeWrapper
.EvtFormatMessageFormatDescription(pm.Handle, eventHandle, values);
220
return
NativeWrapper
.EvtFormatMessageRenderName(pm.Handle, eventHandle, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageLevel);
230
return
NativeWrapper
.EvtFormatMessageRenderName(pm.Handle, eventHandle, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageOpcode);
240
return
NativeWrapper
.EvtFormatMessageRenderName(pm.Handle, eventHandle, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageTask);
250
return
NativeWrapper
.EvtFormatMessageRenderKeywords(pm.Handle, eventHandle, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageKeyword);