wtsapi32

package
v0.0.0-...-4b128c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NOTIFY_FOR_ALL_SESSIONS uint32 = 1
	NOTIFY_FOR_THIS_SESSION uint32 = 0
)
View Source
const (
	WTS_CONSOLE_CONNECT        = 0x1
	WTS_CONSOLE_DISCONNECT     = 0x2
	WTS_REMOTE_CONNECT         = 0x3
	WTS_REMOTE_DISCONNECT      = 0x4
	WTS_SESSION_LOGON          = 0x5
	WTS_SESSION_LOGOFF         = 0x6
	WTS_SESSION_LOCK           = 0x7
	WTS_SESSION_UNLOCK         = 0x8
	WTS_SESSION_REMOTE_CONTROL = 0x9
	WTS_SESSION_CREATE         = 0xa
	WTS_SESSION_TERMINATE      = 0xb
)
View Source
const WM_WTSSESSION_CHANGE uint32 = 0x02b1
View Source
const WTS_CURRENT_SERVER windows.Handle = windows.Handle(0)
View Source
const WTS_CURRENT_SERVER_HANDLE windows.Handle = 0
View Source
const WTS_CURRENT_SESSION uint32 = 0xffffffff

Variables

This section is empty.

Functions

func EnumerateSessions

func EnumerateSessions(server windows.Handle) (map[uint32]Session, error)

func SessionId

func SessionId() (uint32, error)

SessionId returns local server current session ID.

func SessionName

func SessionName(server windows.Handle, sessionId uint32) (string, error)

SessionName returns session name for specified session.

func SessionUsername

func SessionUsername(server windows.Handle, sessionId uint32) (username string, domain string, err error)

SessionUsername returns domain\username for specified session.

Types

type Session

type Session struct {
	ExecEnvId   uint32
	State       WTS_CONNECTSTATE_CLASS
	SessionId   uint32
	SessionName string
	HostName    string
	UserName    string
	DomainName  string
	FarmName    string
}

type WTS_CONNECTSTATE_CLASS

type WTS_CONNECTSTATE_CLASS int32
const (
	WTSActive       WTS_CONNECTSTATE_CLASS = iota // User logged on to WinStation
	WTSConnected                                  // WinStation connected to client
	WTSConnectQuery                               // In the process of connecting to client
	WTSShadow                                     // Shadowing another WinStation
	WTSDisconnected                               // WinStation logged on without client
	WTSIdle                                       // Waiting for client to connect
	WTSListen                                     // WinStation is listening for connection
	WTSReset                                      // WinStation is being reset
	WTSDown                                       // WinStation is down due to error
	WTSInit                                       // WinStation in initialization
)

type WTS_INFO_CLASS

type WTS_INFO_CLASS uint32
const (
	WTSInitialProgram WTS_INFO_CLASS = iota
	WTSApplicationName
	WTSWorkingDirectory
	WTSOEMId
	WTSSessionId
	WTSUserName
	WTSWinStationName // Despite its name, specifying this type does not return the window station name. Rather, it returns the name of the Remote Desktop Services session.
	WTSDomainName
	WTSConnectState
	WTSClientBuildNumber
	WTSClientName
	WTSClientDirectory
	WTSClientProductId
	WTSClientHardwareId
	WTSClientAddress
	WTSClientDisplay
	WTSClientProtocolType
	WTSIdleTime
	WTSLogonTime
	WTSIncomingBytes
	WTSOutgoingBytes
	WTSIncomingFrames
	WTSOutgoingFrames
	WTSClientInfo
	WTSSessionInfo
	WTSSessionInfoEx
	WTSConfigInfo
	WTSValidationInfo // Info Class value used to fetch Validation Information through the WTSQuerySessionInformation
	WTSSessionAddressV4
	WTSIsRemoteSession
)

type WTS_SESSION_INFO_1W

type WTS_SESSION_INFO_1W struct {
	ExecEnvId uint32
	State     WTS_CONNECTSTATE_CLASS
	SessionId uint32
	// contains filtered or unexported fields
}

type WTS_TYPE_CLASS

type WTS_TYPE_CLASS int32
const (
	WTSTypeProcessInfoLevel0 WTS_TYPE_CLASS = iota
	WTSTypeProcessInfoLevel1
	WTSTypeSessionInfoLevel1
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL