-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathclientinfo.go
39 lines (34 loc) · 1021 Bytes
/
clientinfo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// +build windows
package winsession
import (
"github.com/gentlemanautomaton/winsession/colordepth"
"github.com/gentlemanautomaton/winsession/encryptionlevel"
)
// ClientInfo holds detailed information about a remote client connected to
// a windows session via RDP.
type ClientInfo struct {
ComputerName string
ComputerDomain string
EncryptionLevel encryptionlevel.Value
AddressFamily uint32
Address string
HRes uint16 // Horizontal resolution (pixels)
VRes uint16 // Vertical resolution (pixels)
ColorDepth colordepth.Value
BuildNumber uint32
}
// Computer returns the client computer in the form DOMAIN\NAME.
func (info ClientInfo) Computer() string {
switch {
case info.ComputerName == "":
return ""
case info.ComputerDomain == "":
return info.ComputerName
default:
return info.ComputerDomain + `\` + info.ComputerName
}
}
// IsZero returns true if the client info is unset.
func (info ClientInfo) IsZero() bool {
return info == ClientInfo{}
}