DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
TerminalSession.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
Common.h
"
4
#include "
System/Object.h
"
5
#include "
System/String.h
"
6
#include "
System/SmartPointer.h
"
7
#include "
System/Collections/Generic/List.h
"
8
9
namespace
DotNetDupe
{
10
namespace
System
{
11
namespace
Diagnostics
{
12
15
enum class
RdpSessionState
{
16
Active
,
17
Connected
,
18
ConnectQuery
,
19
Shadow
,
20
Disconnected
,
21
Idle
,
22
Listen
,
23
Reset
,
24
Down
,
25
Init
,
26
Unknown
27
};
28
31
struct
RdpSessionInfo
{
32
unsigned
long
uSessionId
;
33
String
sSessionName
;
34
String
sUserName
;
35
String
sDomainName
;
36
String
sClientName
;
37
String
sClientIpAddress
;
38
RdpSessionState
eState
;
39
bool
bIsRdpSession
;
40
42
RdpSessionInfo
()
43
:
uSessionId
(0),
44
eState
(
RdpSessionState
::
Unknown
),
45
bIsRdpSession
(false) {}
46
};
47
53
class
TerminalSession
:
public
Object
{
54
public
:
56
DOTNETDUPE_API
TerminalSession
();
57
59
DOTNETDUPE_API
virtual
~TerminalSession
();
60
64
DOTNETDUPE_API
static
Collections::Generic::List<RdpSessionInfo>
GetSessions
();
65
68
DOTNETDUPE_API
static
Collections::Generic::List<RdpSessionInfo>
GetActiveSessions
();
69
72
DOTNETDUPE_API
static
Collections::Generic::List<RdpSessionInfo>
GetDisconnectedSessions
();
73
74
private
:
75
#if defined(_WIN32)
76
static
void
QuerySessionDetails(
unsigned
long
uSessionId,
const
String
& sSessionName,
RdpSessionState
eState,
RdpSessionInfo
& info);
77
static
String
QueryWtsString(
unsigned
long
uSessionId,
unsigned
int
eInfoClass);
78
static
RdpSessionState
ConvertWtsState(
int
iState);
79
#endif
80
};
81
82
}
83
}
84
}
Common.h
Defines common cross-platform macros, export decorators, and fundamental types.
DOTNETDUPE_API
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition
Common.h:20
List.h
Represents a strongly typed list of objects that can be accessed by index mirroring ....
Object.h
Base object class for DotNetDupe mirroring .NET System.Object.
SmartPointer.h
Provides reference-counted and weak pointer memory management primitives ensuring zero raw ownership.
String.h
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
DotNetDupe::System::Collections::Generic::List
Represents a strongly typed list of objects accessible by index.
Definition
List.h:29
DotNetDupe::System::Diagnostics::TerminalSession::GetSessions
static Collections::Generic::List< RdpSessionInfo > GetSessions()
Enumerates all terminal sessions on the local system.
Definition
TerminalSession.cpp:69
DotNetDupe::System::Diagnostics::TerminalSession::GetDisconnectedSessions
static Collections::Generic::List< RdpSessionInfo > GetDisconnectedSessions()
Enumerates disconnected terminal sessions available for reconnection.
Definition
TerminalSession.cpp:104
DotNetDupe::System::Diagnostics::TerminalSession::GetActiveSessions
static Collections::Generic::List< RdpSessionInfo > GetActiveSessions()
Enumerates only actively connected terminal sessions.
Definition
TerminalSession.cpp:94
DotNetDupe::System::Diagnostics::TerminalSession::TerminalSession
TerminalSession()
Initializes a new instance of TerminalSession.
Definition
TerminalSession.cpp:18
DotNetDupe::System::Object
Supports all classes in the DotNetDupe class hierarchy.
Definition
Object.h:18
DotNetDupe::System::String
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition
String.h:74
DotNetDupe::System::Diagnostics
Definition
ActiveUserSession.h:11
DotNetDupe::System::Diagnostics::RdpSessionState
RdpSessionState
Represents the operational connection state of a Remote Desktop or Terminal session.
Definition
TerminalSession.h:15
DotNetDupe::System::Diagnostics::RdpSessionState::Down
@ Down
Session is down or non-operational.
Definition
TerminalSession.h:24
DotNetDupe::System::Diagnostics::RdpSessionState::Connected
@ Connected
Client is connected to terminal session but logon not yet completed.
Definition
TerminalSession.h:17
DotNetDupe::System::Diagnostics::RdpSessionState::Shadow
@ Shadow
Session is being shadowed by another session.
Definition
TerminalSession.h:19
DotNetDupe::System::Diagnostics::RdpSessionState::Active
@ Active
User is logged on and actively interacting with the session.
Definition
TerminalSession.h:16
DotNetDupe::System::Diagnostics::RdpSessionState::Reset
@ Reset
Session is being reset.
Definition
TerminalSession.h:23
DotNetDupe::System::Diagnostics::RdpSessionState::Unknown
@ Unknown
State could not be determined.
Definition
TerminalSession.h:26
DotNetDupe::System::Diagnostics::RdpSessionState::Init
@ Init
Session is initializing.
Definition
TerminalSession.h:25
DotNetDupe::System::Diagnostics::RdpSessionState::Listen
@ Listen
Session is listening for incoming client connections.
Definition
TerminalSession.h:22
DotNetDupe::System::Diagnostics::RdpSessionState::Idle
@ Idle
Session is waiting for connection.
Definition
TerminalSession.h:21
DotNetDupe::System::Diagnostics::RdpSessionState::Disconnected
@ Disconnected
Session is disconnected but state preserved for reconnection.
Definition
TerminalSession.h:20
DotNetDupe::System::Diagnostics::RdpSessionState::ConnectQuery
@ ConnectQuery
Session is in process of connecting to client.
Definition
TerminalSession.h:18
DotNetDupe::System
Definition
Action.h:11
DotNetDupe
Definition
IServiceCollection.h:7
DotNetDupe::System::Diagnostics::RdpSessionInfo
Contains extended telemetry for a Remote Desktop Protocol (RDP) session.
Definition
TerminalSession.h:31
DotNetDupe::System::Diagnostics::RdpSessionInfo::sDomainName
String sDomainName
Domain of the authenticated user account.
Definition
TerminalSession.h:35
DotNetDupe::System::Diagnostics::RdpSessionInfo::eState
RdpSessionState eState
Current RDP connection state.
Definition
TerminalSession.h:38
DotNetDupe::System::Diagnostics::RdpSessionInfo::sClientName
String sClientName
NetBIOS or DNS name of connecting client endpoint.
Definition
TerminalSession.h:36
DotNetDupe::System::Diagnostics::RdpSessionInfo::RdpSessionInfo
RdpSessionInfo()
Default constructor initializing default state.
Definition
TerminalSession.h:42
DotNetDupe::System::Diagnostics::RdpSessionInfo::bIsRdpSession
bool bIsRdpSession
True if session is an active or disconnected RDP remote session.
Definition
TerminalSession.h:39
DotNetDupe::System::Diagnostics::RdpSessionInfo::sUserName
String sUserName
User account associated with session.
Definition
TerminalSession.h:34
DotNetDupe::System::Diagnostics::RdpSessionInfo::sClientIpAddress
String sClientIpAddress
IPv4 or IPv6 client address.
Definition
TerminalSession.h:37
DotNetDupe::System::Diagnostics::RdpSessionInfo::uSessionId
unsigned long uSessionId
Terminal Services session ID.
Definition
TerminalSession.h:32
DotNetDupe::System::Diagnostics::RdpSessionInfo::sSessionName
String sSessionName
Name of the WinStation (e.g. "Console", "RDP-Tcp#0").
Definition
TerminalSession.h:33
Include
System
Diagnostics
TerminalSession.h
Generated by
1.18.0