diff --git a/assets/files.wxs b/assets/files.wxs
index 86fbe7ac4d..5e9cb96970 100644
--- a/assets/files.wxs
+++ b/assets/files.wxs
@@ -3042,6 +3042,15 @@
+
+
+
+
+
+
+
+
+
@@ -3876,6 +3885,9 @@
+
+
+
diff --git a/build.psm1 b/build.psm1
index 20e67b4472..7e6e21bb21 100644
--- a/build.psm1
+++ b/build.psm1
@@ -2191,7 +2191,6 @@ function Start-CrossGen {
"Microsoft.PowerShell.Commands.Utility.dll",
"Microsoft.PowerShell.Commands.Management.dll",
"Microsoft.PowerShell.Security.dll",
- "Microsoft.PowerShell.CoreCLR.Eventing.dll",
"Microsoft.PowerShell.ConsoleHost.dll",
"System.Management.Automation.dll"
)
@@ -2199,6 +2198,7 @@ function Start-CrossGen {
# Add Windows specific libraries
if ($Environment.IsWindows) {
$psCoreAssemblyList += @(
+ "Microsoft.PowerShell.CoreCLR.Eventing.dll",
"Microsoft.WSMan.Management.dll",
"Microsoft.WSMan.Runtime.dll",
"Microsoft.PowerShell.Commands.Diagnostics.dll",
diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj
index f69a49c55b..09a7c35452 100644
--- a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj
+++ b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj
@@ -27,4 +27,9 @@
+
+
+
+
+
diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj
index 67503da2cf..e53680cc23 100644
--- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj
+++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj
@@ -57,7 +57,7 @@
-
+
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventBookmark.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventBookmark.cs
deleted file mode 100644
index bc937391a2..0000000000
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventBookmark.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/*============================================================
-**
-**
-** Purpose:
-** This public class represents an opaque Event Bookmark obtained
-** from an EventRecord. The bookmark denotes a unique identifier
-** for the event instance as well as marks the location in the
-** the result set of the EventReader that the event instance was
-** obtained from.
-**
-============================================================*/
-
-namespace System.Diagnostics.Eventing.Reader
-{
- //
- // NOTE: This class must be generic enough to be used across
- // eventing base implementations. Cannot add anything
- // that ties it to one particular implementation.
- //
-
- ///
- /// Represents an opaque Event Bookmark obtained from an EventRecord.
- /// The bookmark denotes a unique identifier for the event instance as
- /// well as marks the location in the the result set of the EventReader
- /// that the event instance was obtained from.
- ///
- public class EventBookmark
- {
- private string _bookmark;
-
- internal EventBookmark(string bookmarkText)
- {
- if (bookmarkText == null)
- throw new ArgumentNullException("bookmarkText");
- _bookmark = bookmarkText;
- }
-
- internal string BookmarkText { get { return _bookmark; } }
- }
-}
-
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventKeyword.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventKeyword.cs
deleted file mode 100644
index bc4d3c701a..0000000000
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventKeyword.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/*============================================================
-**
-**
-** Purpose:
-** This public class describes the metadata for a specific Keyword
-** defined by a Provider. An instance of this class is obtained from
-** a ProviderMetadata object.
-**
-============================================================*/
-
-using System.Collections.Generic;
-
-namespace System.Diagnostics.Eventing.Reader
-{
- ///
- /// Describes the metadata for a specific Keyword defined by a Provider.
- /// An instance of this class is obtained from a ProviderMetadata object.
- ///
- public sealed class EventKeyword
- {
- private long _value;
- private string _name;
- private string _displayName;
- private bool _dataReady;
- private ProviderMetadata _pmReference;
- private object _syncObject;
-
- // called from EventMetadata
- internal EventKeyword(long value, ProviderMetadata pmReference)
- {
- _value = value;
- _pmReference = pmReference;
- _syncObject = new object();
- }
-
- // called from ProviderMetadata
- internal EventKeyword(string name, long value, string displayName)
- {
- _value = value;
- _name = name;
- _displayName = displayName;
- _dataReady = true;
- _syncObject = new object();
- }
-
- internal void PrepareData()
- {
- if (_dataReady == true) return;
-
- lock (_syncObject)
- {
- if (_dataReady == true) return;
-
- IEnumerable result = _pmReference.Keywords;
-
- _name = null;
- _displayName = null;
- _dataReady = true;
-
- foreach (EventKeyword key in result)
- {
- if (key.Value == _value)
- {
- _name = key.Name;
- _displayName = key.DisplayName;
- break;
- }
- }
- }
- }
-
- public string Name
- {
- get
- {
- PrepareData();
- return _name;
- }
- }
-
- public long Value
- {
- get
- {
- return _value;
- }
- }
-
- public string DisplayName
- {
- get
- {
- PrepareData();
- return _displayName;
- }
- }
- }
-}
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLevel.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLevel.cs
deleted file mode 100644
index 795891e1fa..0000000000
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLevel.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/*============================================================
-**
-**
-** Purpose:
-** This public class describes the metadata for a specific Level
-** defined by a Provider. An instance of this class is obtained from
-** a ProviderMetadata object.
-**
-============================================================*/
-
-using System.Collections.Generic;
-
-namespace System.Diagnostics.Eventing.Reader
-{
- ///
- /// Describes the metadata for a specific Level defined by a Provider.
- /// An instance of this class is obtained from a ProviderMetadata object.
- ///
- public sealed class EventLevel
- {
- private int _value;
- private string _name;
- private string _displayName;
- private bool _dataReady;
- private ProviderMetadata _pmReference;
- private object _syncObject;
-
- // called from EventMetadata
- internal EventLevel(int value, ProviderMetadata pmReference)
- {
- _value = value;
- _pmReference = pmReference;
- _syncObject = new object();
- }
-
- // called from ProviderMetadata
- internal EventLevel(string name, int value, string displayName)
- {
- _value = value;
- _name = name;
- _displayName = displayName;
- _dataReady = true;
- _syncObject = new object();
- }
-
- internal void PrepareData()
- {
- if (_dataReady == true) return;
-
- lock (_syncObject)
- {
- if (_dataReady == true) return;
-
- IEnumerable result = _pmReference.Levels;
- _name = null;
- _displayName = null;
- _dataReady = true;
- foreach (EventLevel lev in result)
- {
- if (lev.Value == _value)
- {
- _name = lev.Name;
- _displayName = lev.DisplayName;
- break;
- }
- }
- }
- }
-
- public string Name
- {
- get
- {
- PrepareData();
- return _name;
- }
- }
-
- public int Value
- {
- get
- {
- return _value;
- }
- }
-
- public string DisplayName
- {
- get
- {
- PrepareData();
- return _displayName;
- }
- }
- }
-}
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogConfiguration.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogConfiguration.cs
deleted file mode 100644
index 52a91ca680..0000000000
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogConfiguration.cs
+++ /dev/null
@@ -1,303 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/*============================================================
-**
-**
-** Purpose:
-** This public class allows accessing static channel information and
-** configures channel publishing and logging properties. An instance
-** of this class is obtained from EventLogManagement class.
-**
-============================================================*/
-
-using System.Collections.Generic;
-
-namespace System.Diagnostics.Eventing.Reader
-{
- ///
- /// Log Type.
- ///
- public enum EventLogType
- {
- Administrative = 0,
- Operational,
- Analytical,
- Debug
- }
-
- ///
- /// Log Isolation.
- ///
- public enum EventLogIsolation
- {
- Application = 0,
- System,
- Custom
- }
-
- ///
- /// Log Mode.
- ///
- public enum EventLogMode
- {
- Circular = 0,
- AutoBackup,
- Retain
- }
-
- ///
- /// Provides access to static log information and configures
- /// log publishing and log file properties.
- ///
- public class EventLogConfiguration : IDisposable
- {
- //
- // access to the data member reference is safe, while
- // invoking methods on it is marked SecurityCritical as appropriate.
- //
- private EventLogHandle _handle = EventLogHandle.Zero;
-
- private EventLogSession _session = null;
- private string _channelName;
-
- public EventLogConfiguration(string logName) : this(logName, null) { }
-
- // marked as SecurityCritical because allocates SafeHandles.
- // marked as Safe because performs Demand check.
- [System.Security.SecurityCritical]
- public EventLogConfiguration(string logName, EventLogSession session)
- {
- if (session == null)
- session = EventLogSession.GlobalSession;
-
- _session = session;
- _channelName = logName;
-
- _handle = NativeWrapper.EvtOpenChannelConfig(_session.Handle, _channelName, 0);
- }
-
- public string LogName
- {
- get
- {
- return _channelName;
- }
- }
-
- public EventLogType LogType
- {
- get
- {
- return (EventLogType)((uint)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigType));
- }
- }
-
- public EventLogIsolation LogIsolation
- {
- get
- {
- return (EventLogIsolation)((uint)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigIsolation));
- }
- }
-
- public bool IsEnabled
- {
- get
- {
- return (bool)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigEnabled);
- }
-
- set
- {
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigEnabled, (object)value);
- }
- }
-
- public bool IsClassicLog
- {
- get
- {
- return (bool)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigClassicEventlog);
- }
- }
-
- public string SecurityDescriptor
- {
- get
- {
- return (string)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigAccess);
- }
-
- set
- {
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigAccess, (object)value);
- }
- }
-
- public string LogFilePath
- {
- get
- {
- return (string)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigLogFilePath);
- }
-
- set
- {
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigLogFilePath, (object)value);
- }
- }
-
- public long MaximumSizeInBytes
- {
- get
- {
- return (long)((ulong)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigMaxSize));
- }
-
- set
- {
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigMaxSize, (object)value);
- }
- }
-
- public EventLogMode LogMode
- {
- get
- {
- object nativeRetentionObject = NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigRetention);
- object nativeAutoBackupObject = NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigAutoBackup);
-
- bool nativeRetention = nativeRetentionObject == null ? false : (bool)nativeRetentionObject;
- bool nativeAutoBackup = nativeAutoBackupObject == null ? false : (bool)nativeAutoBackupObject;
-
- if (nativeAutoBackup)
- return EventLogMode.AutoBackup;
-
- if (nativeRetention)
- return EventLogMode.Retain;
-
- return EventLogMode.Circular;
- }
-
- set
- {
- switch (value)
- {
- case EventLogMode.Circular:
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigAutoBackup, (object)false);
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigRetention, (object)false);
- break;
- case EventLogMode.AutoBackup:
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigAutoBackup, (object)true);
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigRetention, (object)true);
- break;
- case EventLogMode.Retain:
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigAutoBackup, (object)false);
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelLoggingConfigRetention, (object)true);
- break;
- }
- }
- }
-
- public string OwningProviderName
- {
- get
- {
- return (string)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelConfigOwningPublisher);
- }
- }
-
- public IEnumerable ProviderNames
- {
- get
- {
- return (string[])NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublisherList);
- }
- }
-
- public int? ProviderLevel
- {
- get
- {
- return (int?)((uint?)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigLevel));
- }
-
- set
- {
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigLevel, (object)value);
- }
- }
-
- public long? ProviderKeywords
- {
- get
- {
- return (long?)((ulong?)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigKeywords));
- }
-
- set
- {
- NativeWrapper.EvtSetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigKeywords, (object)value);
- }
- }
-
- public int? ProviderBufferSize
- {
- get
- {
- return (int?)((uint?)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigBufferSize));
- }
- }
-
- public int? ProviderMinimumNumberOfBuffers
- {
- get
- {
- return (int?)((uint?)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigMinBuffers));
- }
- }
-
- public int? ProviderMaximumNumberOfBuffers
- {
- get
- {
- return (int?)((uint?)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigMaxBuffers));
- }
- }
-
- public int? ProviderLatency
- {
- get
- {
- return (int?)((uint?)NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigLatency));
- }
- }
-
- public Guid? ProviderControlGuid
- {
- get
- {
- return (Guid?)(NativeWrapper.EvtGetChannelConfigProperty(_handle, UnsafeNativeMethods.EvtChannelConfigPropertyId.EvtChannelPublishingConfigControlGuid));
- }
- }
-
- public void SaveChanges()
- {
- NativeWrapper.EvtSaveChannelConfig(_handle, 0);
- }
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- [System.Security.SecuritySafeCritical]
- protected virtual void Dispose(bool disposing)
- {
- if (_handle != null && !_handle.IsInvalid)
- _handle.Dispose();
- }
- }
-}
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogException.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogException.cs
deleted file mode 100644
index 80e1299d29..0000000000
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogException.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/*============================================================
-**
-**
-** Purpose:
-** This public class describes an exception thrown from Event
-** Log related classes.
-**
-============================================================*/
-
-using System.ComponentModel;
-
-namespace System.Diagnostics.Eventing.Reader
-{
- public class EventLogException : Exception
- {
- internal static void Throw(int errorCode)
- {
- switch (errorCode)
- {
- case 2:
- case 3:
- case 15007:
- case 15027:
- case 15028:
- case 15002:
- throw new EventLogNotFoundException(errorCode);
-
- case 13:
- case 15005:
- throw new EventLogInvalidDataException(errorCode);
-
- case 1818: // RPC_S_CALL_CANCELED is converted to ERROR_CANCELLED
- case 1223:
- throw new OperationCanceledException();
-
- case 15037:
- throw new EventLogProviderDisabledException(errorCode);
-
- case 5:
- throw new UnauthorizedAccessException();
-
- case 15011:
- case 15012:
- throw new EventLogReadingException(errorCode);
-
- default: throw new EventLogException(errorCode);
- }
- }
-
- public EventLogException() { }
-
- public EventLogException(string message) : base(message) { }
-
- public EventLogException(string message, Exception innerException) : base(message, innerException) { }
-
- protected EventLogException(int errorCode) { _errorCode = errorCode; }
-
- public override string Message
- {
- // marked as SecurityCritical because it uses Win32Exception.
- // marked as TreatAsSafe because it performs Demand.
- [System.Security.SecurityCritical]
- get
- {
- Win32Exception win32Exception = new Win32Exception(_errorCode);
- return win32Exception.Message;
- }
- }
-
- private int _errorCode;
- }
-
- ///
- /// The object requested by the operation is not found.
- ///
- public class EventLogNotFoundException : EventLogException
- {
- public EventLogNotFoundException() { }
-
- public EventLogNotFoundException(string message) : base(message) { }
-
- public EventLogNotFoundException(string message, Exception innerException) : base(message, innerException) { }
-
- internal EventLogNotFoundException(int errorCode) : base(errorCode) { }
- }
-
- ///
- /// The state of the reader cursor has become invalid, most likely due to the fact
- /// that the log has been cleared. User needs to obtain a new reader object if
- /// they wish to continue navigating result set.
- ///
- public class EventLogReadingException : EventLogException
- {
- public EventLogReadingException() { }
-
- public EventLogReadingException(string message) : base(message) { }
-
- public EventLogReadingException(string message, Exception innerException) : base(message, innerException) { }
-
- internal EventLogReadingException(int errorCode) : base(errorCode) { }
- }
-
- ///
- /// Provider has been uninstalled while ProviderMetadata operations are being performed.
- /// Obtain a new ProviderMetadata object, when provider is reinstalled, to continue navigating
- /// provider's metadata.
- ///
- public class EventLogProviderDisabledException : EventLogException
- {
- public EventLogProviderDisabledException() { }
-
- public EventLogProviderDisabledException(string message) : base(message) { }
-
- public EventLogProviderDisabledException(string message, Exception innerException) : base(message, innerException) { }
-
- internal EventLogProviderDisabledException(int errorCode) : base(errorCode) { }
- }
-
- ///
- /// Data obtained from the eventlog service, for the current operation, is invalid .
- ///
- public class EventLogInvalidDataException : EventLogException
- {
- public EventLogInvalidDataException() { }
-
- public EventLogInvalidDataException(string message) : base(message) { }
-
- public EventLogInvalidDataException(string message, Exception innerException) : base(message, innerException) { }
-
- internal EventLogInvalidDataException(int errorCode) : base(errorCode) { }
- }
-}
-
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogInformation.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogInformation.cs
deleted file mode 100644
index 95350eab81..0000000000
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogInformation.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/*============================================================
-**
-**
-** Purpose:
-** The objects of this class allow access to the run-time
-** properties of logs and external log files. An instance of this
-** class is obtained from EventLogSession.
-**
-============================================================*/
-
-namespace System.Diagnostics.Eventing.Reader
-{
- ///
- /// Describes the run-time properties of logs and external log files. An instance
- /// of this class is obtained from EventLogSession.
- ///
- public sealed class EventLogInformation
- {
- private DateTime? _creationTime;
- private DateTime? _lastAccessTime;
- private DateTime? _lastWriteTime;
- private long? _fileSize;
- private int? _fileAttributes;
- private long? _recordCount;
- private long? _oldestRecordNumber;
- private bool? _isLogFull;
-
- [System.Security.SecuritySafeCritical]
- internal EventLogInformation(EventLogSession session, string channelName, PathType pathType)
- {
- EventLogHandle logHandle = NativeWrapper.EvtOpenLog(session.Handle, channelName, pathType);
-
- using (logHandle)
- {
- _creationTime = (DateTime?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogCreationTime);
- _lastAccessTime = (DateTime?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogLastAccessTime);
- _lastWriteTime = (DateTime?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogLastWriteTime);
- _fileSize = (long?)((ulong?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogFileSize));
- _fileAttributes = (int?)((uint?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogAttributes));
- _recordCount = (long?)((ulong?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogNumberOfLogRecords));
- _oldestRecordNumber = (long?)((ulong?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogOldestRecordNumber));
- _isLogFull = (bool?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogFull);
- }
- }
-
- public DateTime? CreationTime { get { return _creationTime; } }
-
- public DateTime? LastAccessTime { get { return _lastAccessTime; } }
-
- public DateTime? LastWriteTime { get { return _lastWriteTime; } }
-
- public long? FileSize { get { return _fileSize; } }
-
- public int? Attributes { get { return _fileAttributes; } }
-
- public long? RecordCount { get { return _recordCount; } }
-
- public long? OldestRecordNumber { get { return _oldestRecordNumber; } }
-
- public bool? IsLogFull { get { return _isLogFull; } }
- }
-}
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogLink.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogLink.cs
deleted file mode 100644
index 5941775028..0000000000
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogLink.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/*============================================================
-**
-**
-** Purpose:
-** This public class describes the metadata for a specific Log
-** Reference defined by a Provider. An instance of this class is obtained from
-** a ProviderMetadata object.
-**
-============================================================*/
-
-using System.Collections.Generic;
-
-namespace System.Diagnostics.Eventing.Reader
-{
- ///
- /// Describes the metadata for a specific Log Reference defined
- /// by a Provider. An instance of this class is obtained from
- /// a ProviderMetadata object.
- ///
- public sealed class EventLogLink
- {
- private string _channelName;
- private bool _isImported;
- private string _displayName;
- private uint _channelId;
-
- private bool _dataReady;
- private ProviderMetadata _pmReference;
- private object _syncObject;
-
- internal EventLogLink(uint channelId, ProviderMetadata pmReference)
- {
- _channelId = channelId;
- _pmReference = pmReference;
- _syncObject = new object();
- }
-
- internal EventLogLink(string channelName, bool isImported, string displayName, uint channelId)
- {
- _channelName = channelName;
- _isImported = isImported;
- _displayName = displayName;
- _channelId = channelId;
-
- _dataReady = true;
- _syncObject = new object();
- }
-
- private void PrepareData()
- {
- if (_dataReady == true) return;
-
- lock (_syncObject)
- {
- if (_dataReady == true) return;
-
- IEnumerable result = _pmReference.LogLinks;
-
- _channelName = null;
- _isImported = false;
- _displayName = null;
- _dataReady = true;
-
- foreach (EventLogLink ch in result)
- {
- if (ch.ChannelId == _channelId)
- {
- _channelName = ch.LogName;
- _isImported = ch.IsImported;
- _displayName = ch.DisplayName;
-
- _dataReady = true;
-
- break;
- }
- }
- }
- }
-
- public string LogName
- {
- get
- {
- this.PrepareData();
- return _channelName;
- }
- }
-
- public bool IsImported
- {
- get
- {
- this.PrepareData();
- return _isImported;
- }
- }
-
- public string DisplayName
- {
- get
- {
- this.PrepareData();
- return _displayName;
- }
- }
-
- internal uint ChannelId
- {
- get
- {
- return _channelId;
- }
- }
- }
-}
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogPropertySelector.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogPropertySelector.cs
deleted file mode 100644
index b86ba48aca..0000000000
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogPropertySelector.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/*============================================================
-**
-**
-** Purpose:
-** Public class that encapsulates the information for fast
-** access to Event Values of an EventLogRecord. Implements
-** the EventPropertyContext abstract class. An instance of this
-** class is constructed and then passed to
-** EventLogRecord.GetEventPropertyValues.
-**
-============================================================*/
-
-using System.Collections.Generic;
-
-namespace System.Diagnostics.Eventing.Reader
-{
- ///
- /// Encapsulates the information for fast access to Event Values
- /// of an EventLogRecord. An instance of this class is constructed
- /// and then passed to EventLogRecord.GetEventPropertyValues.
- ///
- public class EventLogPropertySelector : IDisposable
- {
- //
- // access to the data member reference is safe, while
- // invoking methods on it is marked SecurityCritical as appropriate.
- //
- private EventLogHandle _renderContextHandleValues;
-
- [System.Security.SecurityCritical]
- public EventLogPropertySelector(IEnumerable propertyQueries)
- {
- if (propertyQueries == null)
- throw new ArgumentNullException("propertyQueries");
-
- string[] paths;
-
- ICollection coll = propertyQueries as ICollection;
- if (coll != null)
- {
- paths = new string[coll.Count];
- coll.CopyTo(paths, 0);
- }
- else
- {
- List queries;
- queries = new List(propertyQueries);
- paths = queries.ToArray();
- }
-
- _renderContextHandleValues = NativeWrapper.EvtCreateRenderContext(paths.Length, paths, UnsafeNativeMethods.EvtRenderContextFlags.EvtRenderContextValues);
- }
-
- internal EventLogHandle Handle
- {
- // just returning reference to security critical type, the methods
- // of that type are protected by SecurityCritical as appropriate.
- get
- {
- return _renderContextHandleValues;
- }
- }
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- [System.Security.SecuritySafeCritical]
- protected virtual void Dispose(bool disposing)
- {
- if (_renderContextHandleValues != null && !_renderContextHandleValues.IsInvalid)
- _renderContextHandleValues.Dispose();
- }
- }
-}
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogQuery.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogQuery.cs
deleted file mode 100644
index fd827890a3..0000000000
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogQuery.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/*============================================================
-**
-**
-** Purpose:
-** This public class allows a user to define events of interest.
-** An instance of this class is passed to an EventReader to actually
-** obtain the EventRecords. The EventLogQuery can be as
-** simple specifying that all events are of interest, or it can contain
-** query / xpath expressions that indicate exactly what characteristics
-** events should have.
-**
-============================================================*/
-
-namespace System.Diagnostics.Eventing.Reader
-{
- ///
- /// Allows a user to define events of interest. An instance of this
- /// class is passed to an EventReader to actually obtain the EventRecords.
- /// The EventLogQuery can be as simple specifying that all events are of
- /// interest, or it can contain query / xpath expressions that indicate exactly
- /// what characteristics events should have.
- ///
- public class EventLogQuery
- {
- private string _query;
- private string _path;
- private EventLogSession _session;
- private PathType _pathType;
- private bool _tolerateErrors = false;
- private bool _reverseDirection = false;
-
- public EventLogQuery(string path, PathType pathType)
- : this(path, pathType, null)
- {
- }
-
- public EventLogQuery(string path, PathType pathType, string query)
- {
- _session = EventLogSession.GlobalSession;
- _path = path; // can be null
- _pathType = pathType;
-
- if (query == null)
- {
- if (path == null)
- throw new ArgumentNullException("path");
- }
- else
- {
- _query = query;
- }
- }
-
- public EventLogSession Session
- {
- get
- {
- return _session;
- }
-
- set
- {
- _session = value;
- }
- }
-
- public bool TolerateQueryErrors
- {
- get
- {
- return _tolerateErrors;
- }
-
- set
- {
- _tolerateErrors = value;
- }
- }
-
- public bool ReverseDirection
- {
- get
- {
- return _reverseDirection;
- }
-
- set
- {
- _reverseDirection = value;
- }
- }
-
- internal string Path
- {
- get
- {
- return _path;
- }
- }
-
- internal PathType ThePathType
- {
- get
- {
- return _pathType;
- }
- }
-
- internal string Query
- {
- get
- {
- return _query;
- }
- }
- }
-}
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogReader.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogReader.cs
deleted file mode 100644
index 372e7ab898..0000000000
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogReader.cs
+++ /dev/null
@@ -1,353 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/*============================================================
-**
-**
-** Purpose:
-** This public class is used for reading event records from event log.
-**
-============================================================*/
-
-using System.IO;
-using System.Collections.Generic;
-
-namespace System.Diagnostics.Eventing.Reader
-{
- ///
- /// This public class is used for reading event records from event log.
- ///
- public class EventLogReader : IDisposable
- {
- private EventLogQuery _eventQuery;
-
- private int _batchSize;
-
- //
- // access to the data member reference is safe, while
- // invoking methods on it is marked SecurityCritical as appropriate.
- //
- private EventLogHandle _handle;
-
- ///
- /// Events buffer holds batched event (handles).
- ///
- private IntPtr[] _eventsBuffer;
- ///
- /// The current index where the function GetNextEvent is (inside the eventsBuffer).
- ///
- private int _currentIndex;
- ///
- /// The number of events read from the batch into the eventsBuffer.
- ///
- private int _eventCount;
-
- ///
- /// When the reader finishes (will always return only ERROR_NO_MORE_ITEMS).
- /// For subscription, this means we need to wait for next event.
- ///
- private bool _isEof;
-
- ///
- /// Maintains cached display / metadata information returned from
- /// EventRecords that were obtained from this reader.
- ///
- private ProviderMetadataCachedInformation _cachedMetadataInformation;
-
- public EventLogReader(string path)
- : this(new EventLogQuery(path, PathType.LogName), null)
- {
- }
-
- public EventLogReader(string path, PathType pathType)
- : this(new EventLogQuery(path, pathType), null)
- {
- }
-
- public EventLogReader(EventLogQuery eventQuery)
- : this(eventQuery, null)
- {
- }
-
- [System.Security.SecurityCritical]
- public EventLogReader(EventLogQuery eventQuery, EventBookmark bookmark)
- {
- if (eventQuery == null)
- throw new ArgumentNullException("eventQuery");
-
- string logfile = null;
- if (eventQuery.ThePathType == PathType.FilePath)
- logfile = eventQuery.Path;
-
- _cachedMetadataInformation = new ProviderMetadataCachedInformation(eventQuery.Session, logfile, 50);
-
- // explicit data
- _eventQuery = eventQuery;
-
- // implicit
- _batchSize = 64;
- _eventsBuffer = new IntPtr[_batchSize];
-
- //
- // compute the flag.
- //
- int flag = 0;
-
- if (_eventQuery.ThePathType == PathType.LogName)
- flag |= (int)UnsafeNativeMethods.EvtQueryFlags.EvtQueryChannelPath;
- else
- flag |= (int)UnsafeNativeMethods.EvtQueryFlags.EvtQueryFilePath;
-
- if (_eventQuery.ReverseDirection)
- flag |= (int)UnsafeNativeMethods.EvtQueryFlags.EvtQueryReverseDirection;
-
- if (_eventQuery.TolerateQueryErrors)
- flag |= (int)UnsafeNativeMethods.EvtQueryFlags.EvtQueryTolerateQueryErrors;
-
- _handle = NativeWrapper.EvtQuery(_eventQuery.Session.Handle,
- _eventQuery.Path, _eventQuery.Query,
- flag);
-
- EventLogHandle bookmarkHandle = EventLogRecord.GetBookmarkHandleFromBookmark(bookmark);
-
- if (!bookmarkHandle.IsInvalid)
- {
- using (bookmarkHandle)
- {
- NativeWrapper.EvtSeek(_handle, 1, bookmarkHandle, 0, UnsafeNativeMethods.EvtSeekFlags.EvtSeekRelativeToBookmark);
- }
- }
- }
-
- public int BatchSize
- {
- get
- {
- return _batchSize;
- }
-
- set
- {
- if (value < 1)
- throw new ArgumentOutOfRangeException("value");
- _batchSize = value;
- }
- }
-
- [System.Security.SecurityCritical]
- private bool GetNextBatch(TimeSpan ts)
- {
- int timeout;
- if (ts == TimeSpan.MaxValue)
- timeout = -1;
- else
- timeout = (int)ts.TotalMilliseconds;
-
- // batchSize was changed by user, reallocate buffer.
- if (_batchSize != _eventsBuffer.Length) _eventsBuffer = new IntPtr[_batchSize];
-
- int newEventCount = 0;
- bool results = NativeWrapper.EvtNext(_handle, _batchSize, _eventsBuffer, timeout, 0, ref newEventCount);
-
- if (!results)
- {
- _eventCount = 0;
- _currentIndex = 0;
- return false; // no more events in the result set
- }
-
- _currentIndex = 0;
- _eventCount = newEventCount;
- return true;
- }
-
- public EventRecord ReadEvent()
- {
- return ReadEvent(TimeSpan.MaxValue);
- }
-
- // security critical because allocates SafeHandle.
- // marked as safe because performs Demand check.
- [System.Security.SecurityCritical]
- public EventRecord ReadEvent(TimeSpan timeout)
- {
- if (_isEof)
- throw new InvalidOperationException();
-
- if (_currentIndex >= _eventCount)
- {
- // buffer is empty, get next batch.
- GetNextBatch(timeout);
-
- if (_currentIndex >= _eventCount)
- {
- _isEof = true;
- return null;
- }
- }
-
- EventLogRecord eventInstance = new EventLogRecord(new EventLogHandle(_eventsBuffer[_currentIndex], true), _eventQuery.Session, _cachedMetadataInformation);
- _currentIndex++;
- return eventInstance;
- }
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- [System.Security.SecuritySafeCritical]
- protected virtual void Dispose(bool disposing)
- {
- while (_currentIndex < _eventCount)
- {
- NativeWrapper.EvtClose(_eventsBuffer[_currentIndex]);
- _currentIndex++;
- }
-
- if (_handle != null && !_handle.IsInvalid)
- _handle.Dispose();
- }
-
- [System.Security.SecurityCritical]
- internal void SeekReset()
- {
- //
- // close all unread event handles in the buffer
- //
- while (_currentIndex < _eventCount)
- {
- NativeWrapper.EvtClose(_eventsBuffer[_currentIndex]);
- _currentIndex++;
- }
-
- // reset the indexes used by Next
- _currentIndex = 0;
- _eventCount = 0;
- _isEof = false;
- }
-
- // marked as SecurityCritical because it allocates SafeHandle.
- [System.Security.SecurityCritical]
- internal void SeekCommon(long offset)
- {
- //
- // modify offset that we're going to send to service to account for the
- // fact that we've already read some events in our buffer that the user
- // hasn't seen yet.
- //
- offset = offset - (_eventCount - _currentIndex);
-
- SeekReset();
-
- NativeWrapper.EvtSeek(_handle, offset, EventLogHandle.Zero, 0, UnsafeNativeMethods.EvtSeekFlags.EvtSeekRelativeToCurrent);
- }
-
- public void Seek(EventBookmark bookmark)
- {
- Seek(bookmark, 0);
- }
-
- [System.Security.SecurityCritical]
- public void Seek(EventBookmark bookmark, long offset)
- {
- if (bookmark == null)
- throw new ArgumentNullException("bookmark");
-
- SeekReset();
- using (EventLogHandle bookmarkHandle = EventLogRecord.GetBookmarkHandleFromBookmark(bookmark))
- {
- NativeWrapper.EvtSeek(_handle, offset, bookmarkHandle, 0, UnsafeNativeMethods.EvtSeekFlags.EvtSeekRelativeToBookmark);
- }
- }
-
- [System.Security.SecurityCritical]
- public void Seek(SeekOrigin origin, long offset)
- {
- switch (origin)
- {
- case SeekOrigin.Begin:
-
- SeekReset();
- NativeWrapper.EvtSeek(_handle, offset, EventLogHandle.Zero, 0, UnsafeNativeMethods.EvtSeekFlags.EvtSeekRelativeToFirst);
- return;
-
- case SeekOrigin.End:
-
- SeekReset();
- NativeWrapper.EvtSeek(_handle, offset, EventLogHandle.Zero, 0, UnsafeNativeMethods.EvtSeekFlags.EvtSeekRelativeToLast);
- return;
-
- case SeekOrigin.Current:
- if (offset >= 0)
- {
- // we can reuse elements in the batch.
- if (_currentIndex + offset < _eventCount)
- {
- //
- // We don't call Seek here, we can reposition within the batch.
- //
-
- // close all event handles between [currentIndex, currentIndex + offset)
- int index = _currentIndex;
- while (index < _currentIndex + offset)
- {
- NativeWrapper.EvtClose(_eventsBuffer[index]);
- index++;
- }
-
- _currentIndex = (int)(_currentIndex + offset);
- // leave the eventCount unchanged
- // leave the same Eof
- }
- else
- {
- SeekCommon(offset);
- }
- }
- else
- {
- SeekCommon(offset);
- }
-
- return;
- }
- }
-
- public void CancelReading()
- {
- NativeWrapper.EvtCancel(_handle);
- }
-
- public IList LogStatus
- {
- [System.Security.SecurityCritical]
- get
- {
- List list = null;
- string[] channelNames = null;
- int[] errorStatuses = null;
- EventLogHandle queryHandle = _handle;
-
- if (queryHandle.IsInvalid)
- throw new InvalidOperationException();
-
- channelNames = (string[])NativeWrapper.EvtGetQueryInfo(queryHandle, UnsafeNativeMethods.EvtQueryPropertyId.EvtQueryNames);
- errorStatuses = (int[])NativeWrapper.EvtGetQueryInfo(queryHandle, UnsafeNativeMethods.EvtQueryPropertyId.EvtQueryStatuses);
-
- if (channelNames.Length != errorStatuses.Length)
- throw new InvalidOperationException();
-
- list = new List(channelNames.Length);
- for (int i = 0; i < channelNames.Length; i++)
- {
- EventLogStatus cs = new EventLogStatus(channelNames[i], errorStatuses[i]);
- list.Add(cs);
- }
-
- return list.AsReadOnly();
- }
- }
- }
-}
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogRecord.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogRecord.cs
deleted file mode 100644
index ab0701c9c4..0000000000
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogRecord.cs
+++ /dev/null
@@ -1,457 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/*============================================================
-**
-**
-** Purpose:
-** This public class is an EventLog implementation of EventRecord. An
-** instance of this is obtained from an EventLogReader.
-**
-============================================================*/
-
-using System.Collections.Generic;
-using System.Text;
-
-namespace System.Diagnostics.Eventing.Reader
-{
- public class EventLogRecord : EventRecord
- {
- private const int SYSTEM_PROPERTY_COUNT = 18;
-
- //
- // access to the data member reference is safe, while
- // invoking methods on it is marked SecurityCritical as appropriate.
- //
- [System.Security.SecuritySafeCritical]
- private EventLogHandle _handle;
-
- private EventLogSession _session;
-
- private NativeWrapper.SystemProperties _systemProperties;
- private string _containerChannel;
- private int[] _matchedQueryIds;
-
- // a dummy object which is used only for the locking.
- private object _syncObject;
-
- // cached DisplayNames for each instance
- private string _levelName = null;
- private string _taskName = null;
- private string _opcodeName = null;
- private IEnumerable _keywordsNames = null;
-
- // cached DisplayNames for each instance
- private bool _levelNameReady;
- private bool _taskNameReady;
- private bool _opcodeNameReady;
-
- private ProviderMetadataCachedInformation _cachedMetadataInformation;
-
- // marking as TreatAsSafe because just passing around a reference to an EventLogHandle is safe.
- [System.Security.SecuritySafeCritical]
- internal EventLogRecord(EventLogHandle handle, EventLogSession session, ProviderMetadataCachedInformation cachedMetadataInfo)
- {
- _cachedMetadataInformation = cachedMetadataInfo;
- _handle = handle;
- _session = session;
- _systemProperties = new NativeWrapper.SystemProperties();
- _syncObject = new object();
- }
-
- internal EventLogHandle Handle
- {
- // just returning reference to security critical type, the methods
- // of that type are protected by SecurityCritical as appropriate.
- [System.Security.SecuritySafeCritical]
- get
- {
- return _handle;
- }
- }
-
- internal void PrepareSystemData()
- {
- if (_systemProperties.filled)
- return;
-
- // prepare the System Context, if it is not already initialized.
- _session.SetupSystemContext();
-
- lock (_syncObject)
- {
- if (_systemProperties.filled == false)
- {
- NativeWrapper.EvtRenderBufferWithContextSystem(_session.renderContextHandleSystem, _handle, UnsafeNativeMethods.EvtRenderFlags.EvtRenderEventValues, _systemProperties, SYSTEM_PROPERTY_COUNT);
- _systemProperties.filled = true;
- }
- }
- }
-
- public override int Id
- {
- get
- {
- PrepareSystemData();
- if (_systemProperties.Id == null)
- return 0;
- return (int)_systemProperties.Id;
- }
- }
-
- public override byte? Version
- {
- get
- {
- PrepareSystemData();
- return _systemProperties.Version;
- }
- }
-
- public override int? Qualifiers
- {
- get
- {
- PrepareSystemData();
- return (int?)(uint?)_systemProperties.Qualifiers;
- }
- }
-
- public override byte? Level
- {
- get
- {
- PrepareSystemData();
- return _systemProperties.Level;
- }
- }
-
- public override int? Task
- {
- get
- {
- PrepareSystemData();
- return (int?)(uint?)_systemProperties.Task;
- }
- }
-
- public override short? Opcode
- {
- get
- {
- PrepareSystemData();
- return (short?)(ushort?)_systemProperties.Opcode;
- }
- }
-
- public override long? Keywords
- {
- get
- {
- PrepareSystemData();
- return (long?)_systemProperties.Keywords;
- }
- }
-
- public override long? RecordId
- {
- get
- {
- PrepareSystemData();
- return (long?)_systemProperties.RecordId;
- }
- }
-
- public override string ProviderName
- {
- get
- {
- PrepareSystemData();
- return _systemProperties.ProviderName;
- }
- }
-
- public override Guid? ProviderId
- {
- get
- {
- PrepareSystemData();
- return _systemProperties.ProviderId;
- }
- }
-
- public override string LogName
- {
- get
- {
- PrepareSystemData();
- return _systemProperties.ChannelName;
- }
- }
-
- public override int? ProcessId
- {
- get
- {
- PrepareSystemData();
- return (int?)_systemProperties.ProcessId;
- }
- }
-
- public override int? ThreadId
- {
- get
- {
- PrepareSystemData();
- return (int?)_systemProperties.ThreadId;
- }
- }
-
- public override string MachineName
- {
- get
- {
- PrepareSystemData();
- return _systemProperties.ComputerName;
- }
- }
-
- public override System.Security.Principal.SecurityIdentifier UserId
- {
- get
- {
- PrepareSystemData();
- return _systemProperties.UserId;
- }
- }
-
- public override DateTime? TimeCreated
- {
- get
- {
- PrepareSystemData();
- return _systemProperties.TimeCreated;
- }
- }
-
- public override Guid? ActivityId
- {
- get
- {
- PrepareSystemData();
- return _systemProperties.ActivityId;
- }
- }
-
- public override Guid? RelatedActivityId
- {
- get
- {
- PrepareSystemData();
- return _systemProperties.RelatedActivityId;
- }
- }
-
- public string ContainerLog
- {
- get
- {
- if (_containerChannel != null)
- return _containerChannel;
- lock (_syncObject)
- {
- if (_containerChannel == null)
- {
- _containerChannel = (string)NativeWrapper.EvtGetEventInfo(this.Handle, UnsafeNativeMethods.EvtEventPropertyId.EvtEventPath);
- }
-
- return _containerChannel;
- }
- }
- }
-
- public IEnumerable MatchedQueryIds
- {
- get
- {
- if (_matchedQueryIds != null)
- return _matchedQueryIds;
- lock (_syncObject)
- {
- if (_matchedQueryIds == null)
- {
- _matchedQueryIds = (int[])NativeWrapper.EvtGetEventInfo(this.Handle, UnsafeNativeMethods.EvtEventPropertyId.EvtEventQueryIDs);
- }
-
- return _matchedQueryIds;
- }
- }
- }
-
- public override EventBookmark Bookmark
- {
- [System.Security.SecuritySafeCritical]
- get
- {
- EventLogHandle bookmarkHandle = NativeWrapper.EvtCreateBookmark(null);
- NativeWrapper.EvtUpdateBookmark(bookmarkHandle, _handle);
- string bookmarkText = NativeWrapper.EvtRenderBookmark(bookmarkHandle);
-
- return new EventBookmark(bookmarkText);
- }
- }
-
- public override string FormatDescription()
- {
- return _cachedMetadataInformation.GetFormatDescription(this.ProviderName, _handle);
- }
-
- public override string FormatDescription(IEnumerable