|
DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
|
Classes | |
| class | ActiveUserSession |
| Provides system inspection facilities for active and expired user logon sessions. More... | |
| struct | DiskInfo |
| Rate or aggregate count of disk read and write operations. More... | |
| struct | EtwEvent |
| Represents an individual Event Tracing for Windows (ETW) event record. More... | |
| struct | EtwEventLevelCounts |
| Aggregate counts of events partitioned by severity level within a channel. More... | |
| class | EtwLogReader |
| High-performance reader and real-time subscriber for Windows Event Log / ETW channels. More... | |
| class | EventLog |
| Provides interaction with Windows event logs and Linux syslog services. More... | |
| class | EventLogEntry |
| Encapsulates a single record in the event log. More... | |
| struct | MemoryInfo |
| Snapshot of physical and virtual memory utilization for the system or a specific process. More... | |
| struct | NetworkConnectionInfo |
| Telemetry describing an active TCP or UDP socket endpoint. More... | |
| struct | NetworkUsageInfo |
| Network throughput counters for bytes transmitted and received. More... | |
| class | Process |
| Provides access to local processes, starting/stopping processes, and querying process snapshots. More... | |
| class | ProcessBatchEventArgs |
| Event arguments containing a batch of process snapshots. More... | |
| class | ProcessEventArgs |
| Event arguments containing a single process snapshot. More... | |
| struct | ProcessInfo |
| Comprehensive telemetry snapshot for an operating system process. More... | |
| struct | ProcessNetworkConnectionInfo |
| Collection of open ports and active connections attributed to a specific process. More... | |
| class | ProcessStartInfo |
| Specifies a set of values that are used when you start a process. More... | |
| class | ProcessStreamer |
| Streams system process updates asynchronously with batching and event notifications. More... | |
| class | ProcessStreamErrorEventArgs |
| Event arguments containing error information encountered during streaming. More... | |
| struct | ProcessStreamOptions |
| Configuration options controlling the execution of a ProcessStreamer. More... | |
| struct | RdpSessionInfo |
| Contains extended telemetry for a Remote Desktop Protocol (RDP) session. More... | |
| struct | ServiceInfo |
| Telemetry snapshot for a system background service or daemon. More... | |
| class | Stopwatch |
| Provides a set of methods and properties that you can use to accurately measure elapsed time. More... | |
| class | SystemMetrics |
| Provides cross-platform diagnostic counters for CPU, memory, disk, network, processes, and services. More... | |
| class | TerminalSession |
| Provides querying and enumeration of Terminal Services and RDP sessions. More... | |
| struct | UserSessionInfo |
| Encapsulates details about an operating system interactive user session. More... | |
Typedefs | |
| using | TimeProviderPtr = SmartPointer<TimeProvider> |
Enumerations | |
| enum class | EtwEventLevel { All = 0 , Critical = 1 , Error = 2 , Warning = 3 , Info = 4 , Verbose = 5 } |
| Filter levels corresponding to standard Windows ETW severity classifications. More... | |
| enum class | EventLogEntryType { Error = 1 , Warning = 2 , Information = 4 , SuccessAudit = 8 , FailureAudit = 16 } |
| Defines the event type of an event log entry. More... | |
| enum class | ProcessMetricsDetail { FastDiscoveryOnly = 0 , Progressive = 1 , FullSynchronized = 2 } |
| Granularity level for streaming process metrics discovery. More... | |
| enum class | RdpSessionState { Active , Connected , ConnectQuery , Shadow , Disconnected , Idle , Listen , Reset , Down , Init , Unknown } |
| Represents the operational connection state of a Remote Desktop or Terminal session. More... | |
Functions | |
| static std::wstring | BuildCommandLine (const ProcessStartInfo &info) |
| static std::wstring | BuildLevelQuery (EtwEventLevel level) |
| static void | CollectTier1Processes (std::vector< ProcessInfo > &vecProcs, int iSessionId) |
| Collect process snapshot using Toolhelp32 on Windows. | |
| static bool | CreateWin32Process (const ProcessStartInfo &info, PROCESS_INFORMATION &pi) |
| static void | DeepEnrichProc (ProcessInfo &proc, bool bIncludeNetwork) |
| static void | EnumerateWin32Processes (Collections::Generic::List< SmartPointer< Process > > &lstProcs) |
| static void | ExtractLevelAndTime (PEVT_VARIANT pValues, EtwEvent &evt) |
| static void | ExtractProviderAndId (PEVT_VARIANT pValues, EtwEvent &evt) |
| static void | FastPopulateProc (PROCESSENTRY32W *pe32, ProcessInfo &proc) |
| Populate fast tier-1 process metadata on Windows. | |
| static void | FilterChannelEvents (const std::vector< EtwEvent > &events, EtwEventLevel level, int iStartIndex, int iMaxEvents, Collections::Generic::List< EtwEvent > &lstEvents) |
| static bool | FindProcessInSnapshot (int iProcessId, String &sOutName) |
| static void | HandleQueryFailure (DWORD err) |
| static void | KillProcessPlatform (void *pHandle) |
| static WORD | MapEventLogEntryTypeToWin32 (EventLogEntryType eType) |
| static bool | MatchEventLevelFilter (const EtwEvent &evt, EtwEventLevel level) |
| static bool | MatchProcessName (const String &sCandidate, const String &sTarget) |
| static HANDLE | OpenWin32EventLogHandle (const String &sLogName) |
| static void | PopulateEventProperties (EVT_HANDLE hContext, EVT_HANDLE hEvt, EtwEvent &evt) |
| static void | PopulateSessionInfo (const WTS_SESSION_INFOW &wtsInfo, UserSessionInfo &session) |
| static bool | QueryProcessNameById (int iProcessId, String &sOutName, HANDLE &hOutProc) |
| static bool | QueryWin32LogRecordCount (const std::wstring &wChannel, unsigned long long &uCount) |
| static bool | RefreshProcessPlatform (void *pHandle, int &iExitCode) |
| static HANDLE | RegisterWin32EventSourceHandle (const String &sSource) |
| static bool | RenderSystemProperties (EVT_HANDLE hContext, EVT_HANDLE hEvt, std::vector< BYTE > &vBuffer) |
| static bool | StartProcessPlatform (const ProcessStartInfo &info, int &iId, void *&pHandle, bool &bExited) |
| static void | ValidateWin32ReportResult (BOOL bReported, DWORD dwErr, const String &sSource) |
| static bool | WaitForExitPlatform (void *pHandle, int iMilliseconds) |
Variables | |
| static std::map< String, std::vector< EtwEvent > > | s_mapChannelEvents |
| static std::map< String, std::vector< EventLogStoreEntry > > | s_mapLogEntries |
| static std::map< int, ProcessCpuSample > | s_mapProcessCpuSamples |
| static std::map< String, String > | s_mapSourceToLog |
| static std::mutex | s_mtxEtw |
| static std::mutex | s_mtxEventLog |
| static std::vector< String > | s_vRegisteredChannels |
Definition at line 12 of file Stopwatch.h.
|
strong |
Filter levels corresponding to standard Windows ETW severity classifications.
Definition at line 34 of file EtwLogReader.h.
|
strong |
Defines the event type of an event log entry.
Modeled after .NET System.Diagnostics.EventLogEntryType.
Definition at line 22 of file EventLog.h.
|
strong |
Granularity level for streaming process metrics discovery.
Definition at line 10 of file ProcessStreamOptions.h.
|
strong |
Represents the operational connection state of a Remote Desktop or Terminal session.
Definition at line 15 of file TerminalSession.h.
|
static |
Definition at line 58 of file Process.cpp.
References DotNetDupe::System::Diagnostics::ProcessStartInfo::Arguments, BuildCommandLine(), DotNetDupe::System::Diagnostics::ProcessStartInfo::FileName, DotNetDupe::System::String::GetLength(), DotNetDupe::System::String::GetRawString(), and DotNetDupe::System::Internal::StringConvertInternal::Utf8ToWChar().
Referenced by BuildCommandLine(), and CreateWin32Process().
|
static |
Step: Build XPath query string for the requested severity level.
Definition at line 194 of file EtwLogReader.cpp.
References BuildLevelQuery(), Critical, Error, Info, Verbose, and Warning.
Referenced by BuildLevelQuery().
|
static |
Collect process snapshot using Toolhelp32 on Windows.
Definition at line 55 of file ProcessStreamer.cpp.
References DotNetDupe::System::SystemException::SystemException(), CollectTier1Processes(), FastPopulateProc(), DotNetDupe::System::Diagnostics::ProcessInfo::iProcessId, and DotNetDupe::System::Diagnostics::ProcessInfo::iSessionId.
Referenced by CollectTier1Processes().
|
static |
Definition at line 68 of file Process.cpp.
References DotNetDupe::System::UnauthorizedAccessException::UnauthorizedAccessException(), BuildCommandLine(), DotNetDupe::System::Diagnostics::ProcessStartInfo::CreateNoWindow, and CreateWin32Process().
Referenced by CreateWin32Process(), and StartProcessPlatform().
|
static |
Deep enrichment helper.
Definition at line 105 of file ProcessStreamer.cpp.
References DeepEnrichProc(), and DotNetDupe::System::Diagnostics::SystemMetrics::EnrichProcessInfo().
Referenced by DeepEnrichProc().
|
static |
Take atomic kernel snapshot of all active system processes via Toolhelp32.
Iterate snapshot entries via Process32FirstW and Process32NextW.
Release snapshot handle.
Definition at line 331 of file Process.cpp.
References EnumerateWin32Processes(), and DotNetDupe::System::SmartPointer< T >::NewShared().
Referenced by EnumerateWin32Processes(), and DotNetDupe::System::Diagnostics::Process::GetProcesses().
|
static |
Step: Extract event level and creation FILETIME.
Definition at line 79 of file EtwLogReader.cpp.
References DotNetDupe::System::DateTimeOffset::DateTimeOffset(), DotNetDupe::System::Diagnostics::EtwEvent::dtTimeCreated, ExtractLevelAndTime(), and DotNetDupe::System::Diagnostics::EtwEvent::iLevel.
Referenced by ExtractLevelAndTime(), and PopulateEventProperties().
|
static |
Step: Extract publishing provider name and event ID.
Definition at line 66 of file EtwLogReader.cpp.
References DotNetDupe::System::String::String(), ExtractProviderAndId(), DotNetDupe::System::Diagnostics::EtwEvent::iEventId, DotNetDupe::System::Diagnostics::EtwEvent::sProviderName, and DotNetDupe::System::Utils::StringConvert::WCharToUtf8().
Referenced by ExtractProviderAndId(), and PopulateEventProperties().
|
static |
Populate fast tier-1 process metadata on Windows.
Definition at line 34 of file ProcessStreamer.cpp.
References DotNetDupe::System::String::String(), FastPopulateProc(), DotNetDupe::System::Diagnostics::ProcessInfo::iProcessId, DotNetDupe::System::Diagnostics::ProcessInfo::iSessionId, DotNetDupe::System::Diagnostics::MemoryInfo::lPhysicalMemoryBytes, DotNetDupe::System::Diagnostics::MemoryInfo::lPrivateBytes, DotNetDupe::System::Diagnostics::ProcessInfo::memory, DotNetDupe::System::Diagnostics::ProcessInfo::sName, and DotNetDupe::System::Diagnostics::ProcessInfo::sPath.
Referenced by CollectTier1Processes(), and FastPopulateProc().
|
static |
Step: Filter and paginate channel events in memory.
Definition at line 346 of file EtwLogReader.cpp.
References DotNetDupe::System::Collections::Generic::List< T >::Add(), FilterChannelEvents(), DotNetDupe::System::Collections::Generic::List< T >::GetCount(), and MatchEventLevelFilter().
Referenced by FilterChannelEvents(), and DotNetDupe::System::Diagnostics::EtwLogReader::ReadEvents().
|
static |
Definition at line 381 of file Process.cpp.
References FindProcessInSnapshot(), and DotNetDupe::System::Diagnostics::Process::GetProcesses().
Referenced by FindProcessInSnapshot(), and DotNetDupe::System::Diagnostics::Process::GetProcessById().
|
static |
Step: Handle known query failures or propagate unauthorized access.
Definition at line 216 of file EtwLogReader.cpp.
References DotNetDupe::System::SystemException::SystemException(), DotNetDupe::System::UnauthorizedAccessException::UnauthorizedAccessException(), and HandleQueryFailure().
Referenced by HandleQueryFailure().
|
static |
Definition at line 147 of file Process.cpp.
References DotNetDupe::System::InvalidOperationException::InvalidOperationException(), DotNetDupe::System::UnauthorizedAccessException::UnauthorizedAccessException(), and KillProcessPlatform().
Referenced by DotNetDupe::System::Diagnostics::Process::Kill(), and KillProcessPlatform().
|
static |
Step: Map library EventLogEntryType enum to native EVENTLOG type.
Definition at line 109 of file EventLog.cpp.
References Error, FailureAudit, MapEventLogEntryTypeToWin32(), SuccessAudit, and Warning.
Referenced by MapEventLogEntryTypeToWin32().
|
static |
Step: Filter event based on standard severity level definitions.
Definition at line 43 of file EtwLogReader.cpp.
References All, Critical, Error, DotNetDupe::System::Diagnostics::EtwEvent::iLevel, Info, MatchEventLevelFilter(), Verbose, and Warning.
Referenced by FilterChannelEvents(), and MatchEventLevelFilter().
|
static |
Definition at line 413 of file Process.cpp.
References DotNetDupe::System::String::EndsWith(), DotNetDupe::System::String::Equals(), DotNetDupe::System::String::GetLength(), MatchProcessName(), DotNetDupe::System::String::Substring(), and DotNetDupe::System::String::ToLower().
Referenced by DotNetDupe::System::Diagnostics::Process::GetProcessesByName(), and MatchProcessName().
|
static |
Step: Open native event log handle via OpenEventLogW.
Definition at line 128 of file EventLog.cpp.
References DotNetDupe::System::ArgumentException::ArgumentException(), DotNetDupe::System::UnauthorizedAccessException::UnauthorizedAccessException(), DotNetDupe::System::String::GetRawString(), and OpenWin32EventLogHandle().
Referenced by OpenWin32EventLogHandle().
|
static |
Step: Render system properties and extract metadata fields.
Definition at line 96 of file EtwLogReader.cpp.
References ExtractLevelAndTime(), ExtractProviderAndId(), PopulateEventProperties(), and RenderSystemProperties().
Referenced by PopulateEventProperties().
|
static |
Step: Query username associated with WTS session.
Step: Populate session properties and status timestamps.
Definition at line 20 of file ActiveUserSession.cpp.
References DotNetDupe::System::String::String(), DotNetDupe::System::Diagnostics::UserSessionInfo::bIsActive, PopulateSessionInfo(), DotNetDupe::System::Diagnostics::UserSessionInfo::sLoginTimestamp, DotNetDupe::System::Diagnostics::UserSessionInfo::sLogoutTimestamp, DotNetDupe::System::Diagnostics::UserSessionInfo::sPrivilege, DotNetDupe::System::Diagnostics::UserSessionInfo::sUsername, and DotNetDupe::System::Diagnostics::UserSessionInfo::uSessionId.
Referenced by PopulateSessionInfo().
|
static |
Open limited query handle to inspect process image without elevated privileges.
Query full native executable image path and extract trailing file name.
Definition at line 298 of file Process.cpp.
References QueryProcessNameById(), and DotNetDupe::System::Internal::StringConvertInternal::WCharToUtf8().
Referenced by DotNetDupe::System::Diagnostics::Process::GetProcessById(), and QueryProcessNameById().
|
static |
Step: Open channel log and query number of log records.
Definition at line 258 of file EtwLogReader.cpp.
References QueryWin32LogRecordCount().
Referenced by DotNetDupe::System::Diagnostics::EtwLogReader::GetChannelEventCount(), and QueryWin32LogRecordCount().
|
static |
Definition at line 155 of file Process.cpp.
References RefreshProcessPlatform().
Referenced by RefreshProcessPlatform().
|
static |
Step: Register event source with Windows Event Log subsystem.
Definition at line 153 of file EventLog.cpp.
References DotNetDupe::System::UnauthorizedAccessException::UnauthorizedAccessException(), DotNetDupe::System::String::GetRawString(), and RegisterWin32EventSourceHandle().
Referenced by RegisterWin32EventSourceHandle().
|
static |
Step: Determine required buffer size and render system property variants.
Definition at line 55 of file EtwLogReader.cpp.
References RenderSystemProperties().
Referenced by PopulateEventProperties(), and RenderSystemProperties().
|
static |
Definition at line 130 of file Process.cpp.
References CreateWin32Process(), and StartProcessPlatform().
Referenced by DotNetDupe::System::Diagnostics::Process::Start(), and StartProcessPlatform().
|
static |
Step: Verify ReportEvent status and report Win32 errors.
Definition at line 118 of file EventLog.cpp.
References DotNetDupe::System::UnauthorizedAccessException::UnauthorizedAccessException(), and ValidateWin32ReportResult().
Referenced by ValidateWin32ReportResult().
|
static |
Definition at line 142 of file Process.cpp.
References WaitForExitPlatform().
Referenced by DotNetDupe::System::Diagnostics::Process::WaitForExit(), and WaitForExitPlatform().
Definition at line 25 of file EtwLogReader.cpp.
Referenced by DotNetDupe::System::Diagnostics::EtwLogReader::ReadEvents().
|
static |
Definition at line 40 of file EventLog.cpp.
Referenced by DotNetDupe::System::Diagnostics::EventLog::Clear(), DotNetDupe::System::Diagnostics::EventLog::CreateEventSource(), DotNetDupe::System::Diagnostics::EventLog::Delete(), DotNetDupe::System::Diagnostics::EventLog::Exists(), DotNetDupe::System::Diagnostics::EventLog::GetEntries(), and DotNetDupe::System::Diagnostics::EventLog::GetEventLogs().
|
static |
Definition at line 74 of file SystemMetrics.cpp.
Definition at line 39 of file EventLog.cpp.
Referenced by DotNetDupe::System::Diagnostics::EventLog::CreateEventSource(), DotNetDupe::System::Diagnostics::EventLog::DeleteEventSource(), and DotNetDupe::System::Diagnostics::EventLog::SourceExists().
|
static |
Definition at line 23 of file EtwLogReader.cpp.
Referenced by DotNetDupe::System::Diagnostics::EtwLogReader::GetChannelEventCount(), DotNetDupe::System::Diagnostics::EtwLogReader::GetChannelEventLevelCounts(), DotNetDupe::System::Diagnostics::EtwLogReader::GetEventChannels(), DotNetDupe::System::Diagnostics::EtwLogReader::ReadEvents(), DotNetDupe::System::Diagnostics::EtwLogReader::StartListening(), and DotNetDupe::System::Diagnostics::EtwLogReader::StopListening().
|
static |
Definition at line 38 of file EventLog.cpp.
Referenced by DotNetDupe::System::Diagnostics::EventLog::Clear(), DotNetDupe::System::Diagnostics::EventLog::CreateEventSource(), DotNetDupe::System::Diagnostics::EventLog::Delete(), DotNetDupe::System::Diagnostics::EventLog::DeleteEventSource(), DotNetDupe::System::Diagnostics::EventLog::Exists(), DotNetDupe::System::Diagnostics::EventLog::GetEntries(), DotNetDupe::System::Diagnostics::EventLog::GetEventLogs(), DotNetDupe::System::Diagnostics::EventLog::SourceExists(), and DotNetDupe::System::Diagnostics::EventLog::WriteEntry().
|
static |
Definition at line 24 of file EtwLogReader.cpp.
Referenced by DotNetDupe::System::Diagnostics::EtwLogReader::GetEventChannels().