Showing preview only (534K chars total). Download the full file or copy to clipboard to get everything.
Repository: go-playground/stats
Branch: v1
Commit: 02c0e2b6980a
Files: 150
Total size: 491.2 KB
Directory structure:
gitextract_a633ijnj/
├── .gitignore
├── LICENSE
├── README.md
├── client.go
├── examples/
│ ├── client/
│ │ └── client.go
│ └── server/
│ └── server.go
├── http.go
├── server.go
├── stats.go
├── stats_test.go
├── vendor/
│ └── github.com/
│ ├── StackExchange/
│ │ └── wmi/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── wmi.go
│ ├── go-ole/
│ │ └── go-ole/
│ │ ├── ChangeLog.md
│ │ ├── README.md
│ │ ├── appveyor.yml
│ │ ├── com.go
│ │ ├── com_func.go
│ │ ├── connect.go
│ │ ├── constants.go
│ │ ├── error.go
│ │ ├── error_func.go
│ │ ├── error_windows.go
│ │ ├── guid.go
│ │ ├── iconnectionpoint.go
│ │ ├── iconnectionpoint_func.go
│ │ ├── iconnectionpoint_windows.go
│ │ ├── iconnectionpointcontainer.go
│ │ ├── iconnectionpointcontainer_func.go
│ │ ├── iconnectionpointcontainer_windows.go
│ │ ├── idispatch.go
│ │ ├── idispatch_func.go
│ │ ├── idispatch_windows.go
│ │ ├── ienumvariant.go
│ │ ├── ienumvariant_func.go
│ │ ├── ienumvariant_windows.go
│ │ ├── iinspectable.go
│ │ ├── iinspectable_func.go
│ │ ├── iinspectable_windows.go
│ │ ├── iprovideclassinfo.go
│ │ ├── iprovideclassinfo_func.go
│ │ ├── iprovideclassinfo_windows.go
│ │ ├── itypeinfo.go
│ │ ├── itypeinfo_func.go
│ │ ├── itypeinfo_windows.go
│ │ ├── iunknown.go
│ │ ├── iunknown_func.go
│ │ ├── iunknown_windows.go
│ │ ├── ole.go
│ │ ├── oleutil/
│ │ │ ├── connection.go
│ │ │ ├── connection_func.go
│ │ │ ├── connection_windows.go
│ │ │ ├── go-get.go
│ │ │ └── oleutil.go
│ │ ├── safearray.go
│ │ ├── safearray_func.go
│ │ ├── safearray_windows.go
│ │ ├── safearrayconversion.go
│ │ ├── safearrayslices.go
│ │ ├── utility.go
│ │ ├── variables.go
│ │ ├── variant.go
│ │ ├── variant_386.go
│ │ ├── variant_amd64.go
│ │ ├── vt_string.go
│ │ ├── winrt.go
│ │ └── winrt_doc.go
│ └── shirou/
│ ├── gopsutil/
│ │ ├── LICENSE
│ │ ├── README.rst
│ │ ├── circle.yml
│ │ ├── coverall.sh
│ │ ├── cpu/
│ │ │ ├── cpu.go
│ │ │ ├── cpu_darwin.go
│ │ │ ├── cpu_darwin_cgo.go
│ │ │ ├── cpu_darwin_nocgo.go
│ │ │ ├── cpu_freebsd.go
│ │ │ ├── cpu_linux.go
│ │ │ ├── cpu_unix.go
│ │ │ └── cpu_windows.go
│ │ ├── doc.go
│ │ ├── host/
│ │ │ ├── host.go
│ │ │ ├── host_darwin.go
│ │ │ ├── host_darwin_amd64.go
│ │ │ ├── host_freebsd.go
│ │ │ ├── host_freebsd_amd64.go
│ │ │ ├── host_linux.go
│ │ │ ├── host_linux_386.go
│ │ │ ├── host_linux_amd64.go
│ │ │ ├── host_linux_arm.go
│ │ │ ├── host_windows.go
│ │ │ ├── types_darwin.go
│ │ │ ├── types_freebsd.go
│ │ │ └── types_linux.go
│ │ ├── internal/
│ │ │ └── common/
│ │ │ ├── binary.go
│ │ │ ├── common.go
│ │ │ ├── common_darwin.go
│ │ │ ├── common_freebsd.go
│ │ │ ├── common_linux.go
│ │ │ ├── common_unix.go
│ │ │ └── common_windows.go
│ │ ├── mem/
│ │ │ ├── mem.go
│ │ │ ├── mem_darwin.go
│ │ │ ├── mem_freebsd.go
│ │ │ ├── mem_linux.go
│ │ │ └── mem_windows.go
│ │ ├── mktypes.sh
│ │ ├── net/
│ │ │ ├── net.go
│ │ │ ├── net_darwin.go
│ │ │ ├── net_freebsd.go
│ │ │ ├── net_linux.go
│ │ │ ├── net_unix.go
│ │ │ └── net_windows.go
│ │ ├── process/
│ │ │ ├── process.go
│ │ │ ├── process_darwin.go
│ │ │ ├── process_darwin_amd64.go
│ │ │ ├── process_freebsd.go
│ │ │ ├── process_freebsd_386.go
│ │ │ ├── process_freebsd_amd64.go
│ │ │ ├── process_linux.go
│ │ │ ├── process_linux_386.go
│ │ │ ├── process_linux_amd64.go
│ │ │ ├── process_linux_arm.go
│ │ │ ├── process_posix.go
│ │ │ ├── process_windows.go
│ │ │ └── types_darwin.go
│ │ └── windows_memo.rst
│ └── w32/
│ ├── AUTHORS
│ ├── LICENSE
│ ├── README.md
│ ├── advapi32.go
│ ├── comctl32.go
│ ├── comdlg32.go
│ ├── constants.go
│ ├── dwmapi.go
│ ├── gdi32.go
│ ├── gdiplus.go
│ ├── idispatch.go
│ ├── istream.go
│ ├── iunknown.go
│ ├── kernel32.go
│ ├── ole32.go
│ ├── oleaut32.go
│ ├── opengl32.go
│ ├── psapi.go
│ ├── shell32.go
│ ├── typedef.go
│ ├── user32.go
│ ├── utils.go
│ └── vars.go
└── vendor.yml
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof
# Custom Ignores
stats
*.profile
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2015 Dean Karn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
Package stats
=============

[](https://semaphoreci.com/joeybloggs/stats)
[](https://godoc.org/gopkg.in/go-playground/stats.v1)
Package stats allows for gathering of statistics regarding your Go application and system it is running on and
sent them via UDP to a server where you can do whatever you wish to the stats; display, store in database or
send off to a logging service.
###### We currently gather the following Go related information:
* # of Garbabage collects
* Last Garbage Collection
* Last Garbage Collection Pause Duration
* Memory Allocated
* Memory Heap Allocated
* Memory Heap System Allocated
* Go version
* Number of goroutines
* HTTP request logging; when implemented via middleware
###### And the following System Information:
* Host Information; hostname, OS....
* CPU Information; type, model, # of cores...
* Total CPU Timings
* Per Core CPU Timings
* Memory + Swap Information
Installation
------------
Use go get.
go get gopkg.in/go-playground/stats.v1
or to update
go get -u gopkg.in/go-playground/stats.v1
Then import the validator package into your own code.
import "gopkg.in/go-playground/stats.v1"
#### Example
Server
```go
package main
import (
"fmt"
"gopkg.in/go-playground/stats.v1"
)
func main() {
config := &stats.ServerConfig{
Domain: "",
Port: 3008,
Debug: false,
}
server, err := stats.NewServer(config)
if err != nil {
panic(err)
}
for stat := range server.Run() {
// calculate CPU times
// totalCPUTimes := stat.CalculateTotalCPUTimes()
// perCoreCPUTimes := stat.CalculateCPUTimes()
// Do whatever you want with the data
// * Save to database
// * Stream elsewhere
// * Print to console
//
fmt.Println(stat)
}
}
```
Client
```go
package main
import (
"fmt"
"net/http"
"runtime"
"gopkg.in/go-playground/stats.v1"
)
var statsClient *stats.ClientStats
func main() {
serverConfig := &stats.ServerConfig{
Domain: "remoteserver",
Port: 3008,
Debug: false,
}
clientConfig := &stats.ClientConfig{
Domain: "",
Port: 3009,
PollInterval: 1000,
Debug: false,
LogHostInfo: true,
LogCPUInfo: true,
LogTotalCPUTimes: true,
LogPerCPUTimes: true,
LogMemory: true,
LogGoMemory: true,
}
client, err := stats.NewClient(clientConfig, serverConfig)
if err != nil {
panic(err)
}
go client.Run()
// if you want to capture HTTP requests in a middleware you'll have
// to have access to the client.
// see below for middleware example
statsClient = client
}
// LoggingRecoveryHandler ...
//
//
// Middleware example for capturing HTTP Request info
// NOTE: this is standard go middlware, but could be adapted to other types/styles easily
//
func LoggingRecoveryHandler(next http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
// log incoming request
logReq := statsClient.NewHTTPRequest(w, r)
defer func() {
if err := recover(); err != nil {
trace := make([]byte, 1<<16)
n := runtime.Stack(trace, true)
// log failure
logReq.Failure(fmt.Sprintf("%s\n%s", err, trace[:n]))
http.Error(w, "Friendly error message", 500)
return
}
}()
next.ServeHTTP(logReq.Writer(), r)
// log completion
logReq.Complete()
}
return http.HandlerFunc(fn)
}
```
License
------
- [MIT License](https://github.com/go-playground/stats/blob/v1/LICENSE), Copyright (c) 2015 Dean Karn
- [BSD License](https://github.com/go-playground/stats/tree/v1/vendor/github.com/shirou/gopsutil/LICENSE)
- Copyright (c) 2014, WAKAYAMA Shirou
- Copyright (c) 2009 The Go Authors. All rights reserved.
- [BSD License](https://github.com/go-playground/stats/tree/v1/vendor/github.com/shirou/w32/LICENSE), Copyright (c) 2010-2012 The w32 Authors. All rights reserved.
================================================
FILE: client.go
================================================
package stats
import (
"encoding/json"
"fmt"
"net"
"strconv"
"sync"
"time"
)
type httpStats struct {
lock sync.RWMutex
requests []*HTTPRequest
}
func (h *httpStats) add(r *HTTPRequest) {
h.lock.Lock()
defer h.lock.Unlock()
h.requests = append(h.requests, r)
}
func (h *httpStats) extract() []*HTTPRequest {
h.lock.Lock()
defer h.lock.Unlock()
old := h.requests
h.requests = []*HTTPRequest{}
return old
}
// ClientConfig is used to initialize a new ClientStats object
type ClientConfig struct {
Domain string
Port int
PollInterval int
Debug bool
LogHostInfo bool
LogCPUInfo bool
LogTotalCPUTimes bool
LogPerCPUTimes bool
LogMemory bool
LogGoMemory bool
CustomBufferSize int
}
// ClientStats is the object used to collect and send data to the server for processing
type ClientStats struct {
localAddr string
serverAddr string
stop chan struct{}
interval int
debug bool
httpStats *httpStats
logHostInfo bool
logCPUInfo bool
logTotalCPUTimes bool
logPerCPUTimes bool
logMemory bool
logGoMemory bool
bufferSize int
}
// NewClient create a new client object for use
func NewClient(clientConfig *ClientConfig, serverConfig *ServerConfig) (*ClientStats, error) {
bSize := clientConfig.CustomBufferSize
if bSize == 0 {
bSize = defaultBufferSize
}
return &ClientStats{
localAddr: clientConfig.Domain + ":" + strconv.Itoa(clientConfig.Port),
serverAddr: serverConfig.Domain + ":" + strconv.Itoa(serverConfig.Port),
interval: clientConfig.PollInterval,
stop: make(chan struct{}),
debug: clientConfig.Debug,
httpStats: new(httpStats),
logHostInfo: clientConfig.LogHostInfo,
logCPUInfo: clientConfig.LogCPUInfo,
logTotalCPUTimes: clientConfig.LogTotalCPUTimes,
logPerCPUTimes: clientConfig.LogPerCPUTimes,
logMemory: clientConfig.LogMemory,
logGoMemory: clientConfig.LogGoMemory,
bufferSize: bSize,
}, nil
}
// Run starts sending the profiling stats to the server
// NOTE: the server must be running prior to starting
func (c *ClientStats) Run() {
var localAddr *net.UDPAddr
var serverAddr *net.UDPAddr
var client *net.UDPConn
var err error
serverAddr, err = net.ResolveUDPAddr(udp, c.serverAddr)
if err != nil {
panic(err)
}
localAddr, err = net.ResolveUDPAddr(udp, c.localAddr)
if err != nil {
panic(err)
}
client, err = net.DialUDP(udp, localAddr, serverAddr)
if err != nil {
panic(err)
}
defer client.Close()
client.SetWriteBuffer(c.bufferSize)
stats := new(Stats)
if c.logHostInfo {
stats.GetHostInfo()
}
if c.logCPUInfo {
stats.GetCPUInfo()
}
var bytesWritten int
var bytes []byte
ticker := time.NewTicker(time.Millisecond * time.Duration(c.interval))
defer ticker.Stop()
for {
select {
case <-ticker.C:
if c.logTotalCPUTimes {
stats.GetTotalCPUTimes()
}
if c.logPerCPUTimes {
stats.GetCPUTimes()
}
stats.GetMemoryInfo(c.logMemory, c.logGoMemory)
stats.HTTPRequests = c.httpStats.extract()
bytes, err = json.Marshal(stats)
bytesWritten, err = client.Write(bytes)
if err != nil {
fmt.Println(err)
continue
}
if c.debug {
fmt.Println("Wrote:", bytesWritten, "bytes")
}
case <-c.stop:
fmt.Println("done")
return
}
}
}
// Stop halts the client from sending any more data to the server,
// but may be run again at any time.
func (c *ClientStats) Stop() {
c.stop <- struct{}{}
}
================================================
FILE: examples/client/client.go
================================================
package main
import (
"fmt"
"net/http"
"runtime"
"gopkg.in/go-playground/stats.v1"
)
var statsClient *stats.ClientStats
func main() {
serverConfig := &stats.ServerConfig{
Domain: "localhost",
Port: 3008,
Debug: false,
}
clientConfig := &stats.ClientConfig{
Domain: "",
Port: 3009,
PollInterval: 1000,
Debug: false,
LogHostInfo: true,
LogCPUInfo: true,
LogTotalCPUTimes: true,
LogPerCPUTimes: true,
LogMemory: true,
LogGoMemory: true,
}
client, err := stats.NewClient(clientConfig, serverConfig)
if err != nil {
panic(err)
}
go client.Run()
// if you want to capture HTTP requests in a middleware you'll have
// to have access to the client.
// see below for middleware example
statsClient = client
<-make(chan struct{})
}
// LoggingRecoveryHandler ...
//
//
// Middleware example for capturing HTTP Request info
// NOTE: this is standard go middlware, but could be adapted to other types/styles easily
//
func LoggingRecoveryHandler(next http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
// log incoming request
logReq := statsClient.NewHTTPRequest(w, r)
defer func() {
if err := recover(); err != nil {
trace := make([]byte, 1<<16)
n := runtime.Stack(trace, true)
// log failure
logReq.Failure(fmt.Sprintf("%s\n%s", err, trace[:n]))
http.Error(w, "Friendly error message", 500)
return
}
}()
next.ServeHTTP(logReq.Writer(), r)
// log completion
logReq.Complete()
}
return http.HandlerFunc(fn)
}
================================================
FILE: examples/server/server.go
================================================
package main
import (
"fmt"
"gopkg.in/go-playground/stats.v1"
)
func main() {
config := &stats.ServerConfig{
Domain: "",
Port: 3008,
Debug: false,
}
server, err := stats.NewServer(config)
if err != nil {
panic(err)
}
for stat := range server.Run() {
// calculate CPU times
// totalCPUTimes := stat.CalculateTotalCPUTimes()
// perCoreCPUTimes := stat.CalculateCPUTimes()
// Do whatever you want with the data
// * Save to database
// * Stream elsewhere
// * Print to console
//
fmt.Println(stat)
}
}
================================================
FILE: http.go
================================================
package stats
import (
"net/http"
"time"
)
// LogResponseWritter wraps the standard http.ResponseWritter allowing for more
// verbose logging
type LogResponseWritter struct {
status int
size int
http.ResponseWriter
}
// Status provides an easy way to retrieve the status code
func (w *LogResponseWritter) Status() int {
return w.status
}
// Size provides an easy way to retrieve the response size in bytes
func (w *LogResponseWritter) Size() int {
return w.size
}
// Header returns & satisfies the http.ResponseWriter interface
func (w *LogResponseWritter) Header() http.Header {
return w.ResponseWriter.Header()
}
// Write satisfies the http.ResponseWriter interface and
// captures data written, in bytes
func (w *LogResponseWritter) Write(data []byte) (int, error) {
written, err := w.ResponseWriter.Write(data)
w.size += written
return written, err
}
// WriteHeader satisfies the http.ResponseWriter interface and
// allows us to cach the status code
func (w *LogResponseWritter) WriteHeader(statusCode int) {
w.status = statusCode
w.ResponseWriter.WriteHeader(statusCode)
}
// HTTPRequest contains information about the life of an http request
type HTTPRequest struct {
URL string `json:"url"`
Method string `json:"method"`
RequestContentLength int64 `json:"reqContent"`
Headers http.Header `json:"headers"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
Duration int64 `json:"duration"`
ResponseContentLength int64 `json:"resContent"`
StatusCode int `json:"status"`
HasErrors bool `json:"hasErrs"`
Error string `json:"err"`
writer *LogResponseWritter
clientStats *ClientStats
}
// NewHTTPRequest creates a new HTTPRequest for monitoring which wraps the ResponseWriter in order
// to collect stats so you need to call the Writer() function from the HTTPRequest created by this call
func (s *ClientStats) NewHTTPRequest(w http.ResponseWriter, r *http.Request) *HTTPRequest {
return &HTTPRequest{
Start: time.Now().UTC(),
URL: r.URL.String(),
Method: r.Method,
RequestContentLength: r.ContentLength,
Headers: r.Header,
writer: &LogResponseWritter{status: 200, ResponseWriter: w},
clientStats: s,
}
}
// Writer returns a wrapped http.ResponseWriter for logging purposes
func (r *HTTPRequest) Writer() http.ResponseWriter {
return r.writer
}
// Failure records an HTTP failure and automatically completes the request
func (r *HTTPRequest) Failure(err string) {
r.HasErrors = true
r.Error = err
r.Complete()
}
// Complete finalizes an HTTPRequest and logs it.
func (r *HTTPRequest) Complete() {
r.End = time.Now().UTC()
r.Duration = r.End.Sub(r.Start).Nanoseconds()
r.ResponseContentLength = int64(r.writer.Size())
r.StatusCode = r.writer.Status()
r.clientStats.httpStats.add(r)
}
================================================
FILE: server.go
================================================
package stats
import (
"encoding/json"
"fmt"
"net"
"strconv"
)
// ServerConfig is used to initialize a new ServerStats object
type ServerConfig struct {
Domain string
Port int
Debug bool
CustomBufferSize int
}
// ServerStats is the object used to receive, store and send data for usage
type ServerStats struct {
addr string
debug bool
bufferSize int
}
// NewServer create a new server object for use
func NewServer(config *ServerConfig) (*ServerStats, error) {
bSize := config.CustomBufferSize
if bSize == 0 {
bSize = defaultBufferSize
}
return &ServerStats{
addr: config.Domain + ":" + strconv.Itoa(config.Port),
debug: config.Debug,
bufferSize: bSize,
}, nil
}
// Run starts receiving the profiling stats for storage and usage
func (s *ServerStats) Run() <-chan *Stats {
results := make(chan *Stats)
go func(results chan<- *Stats) {
var serverAddr *net.UDPAddr
var server *net.UDPConn
var err error
serverAddr, err = net.ResolveUDPAddr(udp, s.addr)
if err != nil {
panic(err)
}
server, err = net.ListenUDP(udp, serverAddr)
if err != nil {
panic(err)
}
defer server.Close()
server.SetReadBuffer(s.bufferSize)
var addr *net.UDPAddr
var bytesRead int
buff := make([]byte, s.bufferSize)
stats := new(Stats)
for {
bytesRead, addr, err = server.ReadFromUDP(buff)
if err != nil {
fmt.Printf("Error:%s bytes read %d\n", err, bytesRead)
continue
}
if s.debug {
fmt.Printf("Recieved: %s from %s Read %d bytes\n", string(buff[0:bytesRead]), addr, bytesRead)
}
if err := json.Unmarshal(buff[0:bytesRead], &stats); err != nil {
fmt.Println("Error Unmarshalling:", err)
}
results <- stats
}
}(results)
return results
}
================================================
FILE: stats.go
================================================
package stats
import (
"runtime"
"github.com/shirou/gopsutil/cpu"
"github.com/shirou/gopsutil/host"
"github.com/shirou/gopsutil/mem"
)
const (
udp = "udp"
defaultBufferSize = 1024 * 1000
)
// CPUPercentages contains the CPU percentage information
type CPUPercentages struct {
CPU string
User float64
System float64
Idle float64
Nice float64
IOWait float64
IRQ float64
SoftIRQ float64
Steal float64
Guest float64
GuestNice float64
Stolen float64
Total float64
}
// GoMemory contains go specific memory metrics
type GoMemory struct {
NumGC uint32 `json:"numgc"`
LastGC uint64 `json:"lastgc"`
LastGCPauseDuration uint64 `json:"lastgcpause"`
Alloc uint64 `json:"alloc"`
HeapAlloc uint64 `json:"heap"`
HeapSys uint64 `json:"sys"`
lastNumGC uint32
mem *runtime.MemStats
}
// GoInfo contains go specific metrics and stats
type GoInfo struct {
Version string `json:"gover"`
Memory GoMemory `json:"gomem"`
GoRoutines int `json:"goroutines"`
}
// MemInfo contains memory info including swap information
type MemInfo struct {
Memory *mem.VirtualMemoryStat `json:"mem,omitempty"`
Swap *mem.SwapMemoryStat `json:"swap,omitempty"`
}
// CPUInfo contains CPU information
type CPUInfo struct {
CPU []cpu.CPUInfoStat `json:"cpu,omitempty"`
PerCPUTimes []cpu.CPUTimesStat `json:"percputimes,omitempty"`
TotalTimes []cpu.CPUTimesStat `json:"totaltimes,omitempty"`
PrevCPUTimes []cpu.CPUTimesStat `json:"prevpercputimes,omitempty"`
PrevTotalTimes []cpu.CPUTimesStat `json:"prevtotaltimes,omitempty"`
}
// Stats contains all of the statistics to be passed and Encoded/Decoded on the Client and Server sides
type Stats struct {
HostInfo *host.HostInfoStat `json:"hostInfo,omitempty"`
CPUInfo *CPUInfo `json:"cpu,omitempty"`
MemInfo *MemInfo `json:"memInfo,omitempty"`
GoInfo *GoInfo `json:"goInfo,omitempty"`
HTTPRequests []*HTTPRequest `json:"http"`
}
func (s *Stats) initGoInfo() {
s.GoInfo = new(GoInfo)
s.GoInfo.Memory.mem = new(runtime.MemStats)
}
// GetHostInfo populates Stats with host system information
func (s *Stats) GetHostInfo() {
if s.GoInfo == nil {
s.initGoInfo()
}
info, _ := host.HostInfo()
s.HostInfo = info
s.GoInfo.Version = runtime.Version()
}
// GetCPUInfo populates Stats with hosts CPU information
func (s *Stats) GetCPUInfo() {
if s.CPUInfo == nil {
s.CPUInfo = new(CPUInfo)
}
s.CPUInfo.CPU, _ = cpu.CPUInfo()
}
// GetCPUTimes populates Stats with hosts CPU timing information
func (s *Stats) GetCPUTimes() {
if s.CPUInfo == nil {
s.CPUInfo = new(CPUInfo)
}
s.CPUInfo.PrevCPUTimes = s.CPUInfo.PerCPUTimes
s.CPUInfo.PerCPUTimes, _ = cpu.CPUTimes(true)
if len(s.CPUInfo.PrevCPUTimes) == 0 {
s.CPUInfo.PrevCPUTimes = s.CPUInfo.PerCPUTimes
}
}
// CalculateCPUTimes calculates the total CPU times percentages per core
func (s *Stats) CalculateCPUTimes() []CPUPercentages {
percentages := make([]CPUPercentages, len(s.CPUInfo.PerCPUTimes))
if len(s.CPUInfo.PrevCPUTimes) == 0 || len(s.CPUInfo.PerCPUTimes) == 0 {
return percentages
}
var diff float64
var total float64
var prevTotal float64
var prevStat cpu.CPUTimesStat
var cpuStat *CPUPercentages
for i, t := range s.CPUInfo.PerCPUTimes {
cpuStat = &percentages[i]
prevStat = s.CPUInfo.PrevCPUTimes[i]
total = t.User + t.System + t.Idle + t.Nice + t.Iowait + t.Irq + t.Softirq + t.Steal + t.Guest + t.GuestNice + t.Stolen
prevTotal = prevStat.User + prevStat.System + prevStat.Idle + prevStat.Nice + prevStat.Iowait + prevStat.Irq + prevStat.Softirq + prevStat.Steal + prevStat.Guest + prevStat.GuestNice + prevStat.Stolen
diff = total - prevTotal
cpuStat.CPU = t.CPU
cpuStat.User = (t.User - prevStat.User) / diff * 100
cpuStat.System = (t.System - prevStat.System) / diff * 100
cpuStat.Idle = (t.Idle - prevStat.Idle) / diff * 100
cpuStat.Nice = (t.Nice - prevStat.Nice) / diff * 100
cpuStat.IOWait = (t.Iowait - prevStat.Iowait) / diff * 100
cpuStat.IRQ = (t.Irq - prevStat.Irq) / diff * 100
cpuStat.SoftIRQ = (t.Softirq - prevStat.Softirq) / diff * 100
cpuStat.Steal = (t.Steal - prevStat.Steal) / diff * 100
cpuStat.Guest = (t.Guest - prevStat.Guest) / diff * 100
cpuStat.GuestNice = (t.GuestNice - prevStat.GuestNice) / diff * 100
cpuStat.Stolen = (t.Stolen - prevStat.Stolen) / diff * 100
cpuStat.Total = 100 * (diff - (t.Idle - prevStat.Idle)) / diff
}
return percentages
}
// GetAllCPUInfo populates Stats with hosts CPU information and Timings
func (s *Stats) GetAllCPUInfo() {
s.GetCPUInfo()
s.GetCPUTimes()
}
// GetTotalCPUTimes populates Stats with hosts CPU timing information
func (s *Stats) GetTotalCPUTimes() {
if s.CPUInfo == nil {
s.CPUInfo = new(CPUInfo)
}
s.CPUInfo.PrevTotalTimes = s.CPUInfo.TotalTimes
s.CPUInfo.TotalTimes, _ = cpu.CPUTimes(false)
if len(s.CPUInfo.PrevTotalTimes) == 0 {
s.CPUInfo.PrevTotalTimes = s.CPUInfo.TotalTimes
}
}
// CalculateTotalCPUTimes calculates the total CPU times percentages
func (s *Stats) CalculateTotalCPUTimes() []CPUPercentages {
percentages := make([]CPUPercentages, len(s.CPUInfo.TotalTimes))
if len(s.CPUInfo.PrevTotalTimes) == 0 || len(s.CPUInfo.TotalTimes) == 0 {
return percentages
}
var diff float64
var total float64
var prevTotal float64
var prevStat cpu.CPUTimesStat
var cpuStat *CPUPercentages
for i, t := range s.CPUInfo.TotalTimes {
cpuStat = &percentages[i]
prevStat = s.CPUInfo.PrevTotalTimes[i]
total = t.User + t.System + t.Idle + t.Nice + t.Iowait + t.Irq + t.Softirq + t.Steal + t.Guest + t.GuestNice + t.Stolen
prevTotal = prevStat.User + prevStat.System + prevStat.Idle + prevStat.Nice + prevStat.Iowait + prevStat.Irq + prevStat.Softirq + prevStat.Steal + prevStat.Guest + prevStat.GuestNice + prevStat.Stolen
diff = total - prevTotal
cpuStat.CPU = t.CPU
cpuStat.User = (t.User - prevStat.User) / diff * 100
cpuStat.System = (t.System - prevStat.System) / diff * 100
cpuStat.Idle = (t.Idle - prevStat.Idle) / diff * 100
cpuStat.Nice = (t.Nice - prevStat.Nice) / diff * 100
cpuStat.IOWait = (t.Iowait - prevStat.Iowait) / diff * 100
cpuStat.IRQ = (t.Irq - prevStat.Irq) / diff * 100
cpuStat.SoftIRQ = (t.Softirq - prevStat.Softirq) / diff * 100
cpuStat.Steal = (t.Steal - prevStat.Steal) / diff * 100
cpuStat.Guest = (t.Guest - prevStat.Guest) / diff * 100
cpuStat.GuestNice = (t.GuestNice - prevStat.GuestNice) / diff * 100
cpuStat.Stolen = (t.Stolen - prevStat.Stolen) / diff * 100
cpuStat.Total = 100 * (diff - (t.Idle - prevStat.Idle)) / diff
}
return percentages
}
// GetMemoryInfo populates Stats with host and go process memory information
func (s *Stats) GetMemoryInfo(logMemory, logGoMemory bool) {
if logGoMemory {
if s.GoInfo == nil {
s.initGoInfo()
}
runtime.ReadMemStats(s.GoInfo.Memory.mem)
s.GoInfo.GoRoutines = runtime.NumGoroutine()
s.GoInfo.Memory.Alloc = s.GoInfo.Memory.mem.Alloc
s.GoInfo.Memory.HeapAlloc = s.GoInfo.Memory.mem.HeapAlloc
s.GoInfo.Memory.HeapSys = s.GoInfo.Memory.mem.HeapSys
if s.GoInfo.Memory.LastGC != s.GoInfo.Memory.mem.LastGC {
s.GoInfo.Memory.LastGC = s.GoInfo.Memory.mem.LastGC
s.GoInfo.Memory.NumGC = s.GoInfo.Memory.mem.NumGC - s.GoInfo.Memory.lastNumGC
s.GoInfo.Memory.lastNumGC = s.GoInfo.Memory.mem.NumGC
s.GoInfo.Memory.LastGCPauseDuration = s.GoInfo.Memory.mem.PauseNs[(s.GoInfo.Memory.mem.NumGC+255)%256]
} else {
s.GoInfo.Memory.NumGC = 0
s.GoInfo.Memory.LastGCPauseDuration = 0
}
}
if logMemory {
if s.MemInfo == nil {
s.MemInfo = new(MemInfo)
}
s.MemInfo.Memory, _ = mem.VirtualMemory()
s.MemInfo.Swap, _ = mem.SwapMemory()
}
}
================================================
FILE: stats_test.go
================================================
package stats
import (
"os"
"testing"
"time"
. "gopkg.in/go-playground/assert.v1"
)
// NOTES:
// - Run "go test" to run tests
// - Run "gocov test | gocov report" to report on test converage by file
// - Run "gocov test | gocov annotate -" to report on all code and functions, those ,marked with "MISS" were never called
//
// or
//
// -- may be a good idea to change to output path to somewherelike /tmp
// go test -coverprofile cover.out && go tool cover -html=cover.out -o cover.html
//
func TestMain(m *testing.M) {
// setup
//
// setup server for tests
config := &ServerConfig{
Domain: "",
Port: 3010,
}
server, err := NewServer(config)
if err != nil {
panic(err)
}
go server.Run()
<-time.Tick(time.Second * 1)
os.Exit(m.Run())
// teardown
}
func TestClientSendingData(t *testing.T) {
serverConfig := &ServerConfig{
Domain: "",
Port: 3010,
}
localConfig := &ClientConfig{
Domain: "",
Port: 3011,
PollInterval: 1000,
LogHostInfo: true,
LogCPUInfo: true,
LogTotalCPUTimes: true,
LogPerCPUTimes: true,
LogMemory: true,
LogGoMemory: true,
}
client, err := NewClient(localConfig, serverConfig)
Equal(t, err, nil)
go client.Run()
ticker := time.NewTicker(time.Second * 1)
i := 0
for range ticker.C {
if i == 1 {
client.Stop()
return
}
i++
}
}
================================================
FILE: vendor/github.com/StackExchange/wmi/LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2013 Stack Exchange
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: vendor/github.com/StackExchange/wmi/README.md
================================================
wmi
===
Package wmi provides a WQL interface for WMI on Windows.
================================================
FILE: vendor/github.com/StackExchange/wmi/wmi.go
================================================
// +build windows
/*
Package wmi provides a WQL interface for WMI on Windows.
Example code to print names of running processes:
type Win32_Process struct {
Name string
}
func main() {
var dst []Win32_Process
q := wmi.CreateQuery(&dst, "")
err := wmi.Query(q, &dst)
if err != nil {
log.Fatal(err)
}
for i, v := range dst {
println(i, v.Name)
}
}
*/
package wmi
import (
"bytes"
"errors"
"fmt"
"log"
"os"
"reflect"
"runtime"
"strconv"
"strings"
"sync"
"time"
"github.com/go-ole/go-ole"
"github.com/go-ole/go-ole/oleutil"
)
var l = log.New(os.Stdout, "", log.LstdFlags)
var (
ErrInvalidEntityType = errors.New("wmi: invalid entity type")
// ErrNilCreateObject is the error returned if CreateObject returns nil even
// if the error was nil.
ErrNilCreateObject = errors.New("wmi: create object returned nil")
lock sync.Mutex
)
// S_FALSE is returned by CoInitializeEx if it was already called on this thread.
const S_FALSE = 0x00000001
// QueryNamespace invokes Query with the given namespace on the local machine.
func QueryNamespace(query string, dst interface{}, namespace string) error {
return Query(query, dst, nil, namespace)
}
// Query runs the WQL query and appends the values to dst.
//
// dst must have type *[]S or *[]*S, for some struct type S. Fields selected in
// the query must have the same name in dst. Supported types are all signed and
// unsigned integers, time.Time, string, bool, or a pointer to one of those.
// Array types are not supported.
//
// By default, the local machine and default namespace are used. These can be
// changed using connectServerArgs. See
// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details.
//
// Query is a wrapper around DefaultClient.Query.
func Query(query string, dst interface{}, connectServerArgs ...interface{}) error {
return DefaultClient.Query(query, dst, connectServerArgs...)
}
// A Client is an WMI query client.
//
// Its zero value (DefaultClient) is a usable client.
type Client struct {
// NonePtrZero specifies if nil values for fields which aren't pointers
// should be returned as the field types zero value.
//
// Setting this to true allows stucts without pointer fields to be used
// without the risk failure should a nil value returned from WMI.
NonePtrZero bool
// PtrNil specifies if nil values for pointer fields should be returned
// as nil.
//
// Setting this to true will set pointer fields to nil where WMI
// returned nil, otherwise the types zero value will be returned.
PtrNil bool
// AllowMissingFields specifies that struct fields not present in the
// query result should not result in an error.
//
// Setting this to true allows custom queries to be used with full
// struct definitions instead of having to define multiple structs.
AllowMissingFields bool
}
// DefaultClient is the default Client and is used by Query, QueryNamespace
var DefaultClient = &Client{}
// Query runs the WQL query and appends the values to dst.
//
// dst must have type *[]S or *[]*S, for some struct type S. Fields selected in
// the query must have the same name in dst. Supported types are all signed and
// unsigned integers, time.Time, string, bool, or a pointer to one of those.
// Array types are not supported.
//
// By default, the local machine and default namespace are used. These can be
// changed using connectServerArgs. See
// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details.
func (c *Client) Query(query string, dst interface{}, connectServerArgs ...interface{}) error {
dv := reflect.ValueOf(dst)
if dv.Kind() != reflect.Ptr || dv.IsNil() {
return ErrInvalidEntityType
}
dv = dv.Elem()
mat, elemType := checkMultiArg(dv)
if mat == multiArgTypeInvalid {
return ErrInvalidEntityType
}
lock.Lock()
defer lock.Unlock()
runtime.LockOSThread()
defer runtime.UnlockOSThread()
err := ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED)
if err != nil {
oleCode := err.(*ole.OleError).Code()
if oleCode != ole.S_OK && oleCode != S_FALSE {
return err
}
}
defer ole.CoUninitialize()
unknown, err := oleutil.CreateObject("WbemScripting.SWbemLocator")
if err != nil {
return err
} else if unknown == nil {
return ErrNilCreateObject
}
defer unknown.Release()
wmi, err := unknown.QueryInterface(ole.IID_IDispatch)
if err != nil {
return err
}
defer wmi.Release()
// service is a SWbemServices
serviceRaw, err := oleutil.CallMethod(wmi, "ConnectServer", connectServerArgs...)
if err != nil {
return err
}
service := serviceRaw.ToIDispatch()
defer serviceRaw.Clear()
// result is a SWBemObjectSet
resultRaw, err := oleutil.CallMethod(service, "ExecQuery", query)
if err != nil {
return err
}
result := resultRaw.ToIDispatch()
defer resultRaw.Clear()
count, err := oleInt64(result, "Count")
if err != nil {
return err
}
enumProperty, err := result.GetProperty("_NewEnum")
if err != nil {
return err
}
defer enumProperty.Clear()
enum, err := enumProperty.ToIUnknown().IEnumVARIANT(ole.IID_IEnumVariant)
if err != nil {
return err
}
if enum == nil {
return fmt.Errorf("can't get IEnumVARIANT, enum is nil")
}
defer enum.Release()
// Initialize a slice with Count capacity
dv.Set(reflect.MakeSlice(dv.Type(), 0, int(count)))
var errFieldMismatch error
for itemRaw, length, err := enum.Next(1); length > 0; itemRaw, length, err = enum.Next(1) {
if err != nil {
return err
}
err := func() error {
// item is a SWbemObject, but really a Win32_Process
item := itemRaw.ToIDispatch()
defer item.Release()
ev := reflect.New(elemType)
if err = c.loadEntity(ev.Interface(), item); err != nil {
if _, ok := err.(*ErrFieldMismatch); ok {
// We continue loading entities even in the face of field mismatch errors.
// If we encounter any other error, that other error is returned. Otherwise,
// an ErrFieldMismatch is returned.
errFieldMismatch = err
} else {
return err
}
}
if mat != multiArgTypeStructPtr {
ev = ev.Elem()
}
dv.Set(reflect.Append(dv, ev))
return nil
}()
if err != nil {
return err
}
}
return errFieldMismatch
}
// ErrFieldMismatch is returned when a field is to be loaded into a different
// type than the one it was stored from, or when a field is missing or
// unexported in the destination struct.
// StructType is the type of the struct pointed to by the destination argument.
type ErrFieldMismatch struct {
StructType reflect.Type
FieldName string
Reason string
}
func (e *ErrFieldMismatch) Error() string {
return fmt.Sprintf("wmi: cannot load field %q into a %q: %s",
e.FieldName, e.StructType, e.Reason)
}
var timeType = reflect.TypeOf(time.Time{})
// loadEntity loads a SWbemObject into a struct pointer.
func (c *Client) loadEntity(dst interface{}, src *ole.IDispatch) (errFieldMismatch error) {
v := reflect.ValueOf(dst).Elem()
for i := 0; i < v.NumField(); i++ {
f := v.Field(i)
of := f
isPtr := f.Kind() == reflect.Ptr
if isPtr {
ptr := reflect.New(f.Type().Elem())
f.Set(ptr)
f = f.Elem()
}
n := v.Type().Field(i).Name
if !f.CanSet() {
return &ErrFieldMismatch{
StructType: of.Type(),
FieldName: n,
Reason: "CanSet() is false",
}
}
prop, err := oleutil.GetProperty(src, n)
if err != nil {
if !c.AllowMissingFields {
errFieldMismatch = &ErrFieldMismatch{
StructType: of.Type(),
FieldName: n,
Reason: "no such struct field",
}
}
continue
}
defer prop.Clear()
switch val := prop.Value().(type) {
case int8, int16, int32, int64, int:
v := reflect.ValueOf(val).Int()
switch f.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
f.SetInt(v)
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
f.SetUint(uint64(v))
default:
return &ErrFieldMismatch{
StructType: of.Type(),
FieldName: n,
Reason: "not an integer class",
}
}
case uint8, uint16, uint32, uint64:
v := reflect.ValueOf(val).Uint()
switch f.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
f.SetInt(int64(v))
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
f.SetUint(v)
default:
return &ErrFieldMismatch{
StructType: of.Type(),
FieldName: n,
Reason: "not an integer class",
}
}
case string:
switch f.Kind() {
case reflect.String:
f.SetString(val)
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
iv, err := strconv.ParseInt(val, 10, 64)
if err != nil {
return err
}
f.SetInt(iv)
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
uv, err := strconv.ParseUint(val, 10, 64)
if err != nil {
return err
}
f.SetUint(uv)
case reflect.Struct:
switch f.Type() {
case timeType:
if len(val) == 25 {
mins, err := strconv.Atoi(val[22:])
if err != nil {
return err
}
val = val[:22] + fmt.Sprintf("%02d%02d", mins/60, mins%60)
}
t, err := time.Parse("20060102150405.000000-0700", val)
if err != nil {
return err
}
f.Set(reflect.ValueOf(t))
}
}
case bool:
switch f.Kind() {
case reflect.Bool:
f.SetBool(val)
default:
return &ErrFieldMismatch{
StructType: of.Type(),
FieldName: n,
Reason: "not a bool",
}
}
case float32:
switch f.Kind() {
case reflect.Float32:
f.SetFloat(float64(val))
default:
return &ErrFieldMismatch{
StructType: of.Type(),
FieldName: n,
Reason: "not a Float32",
}
}
default:
typeof := reflect.TypeOf(val)
if typeof == nil && (isPtr || c.NonePtrZero) {
if (isPtr && c.PtrNil) || (!isPtr && c.NonePtrZero) {
of.Set(reflect.Zero(of.Type()))
}
break
}
return &ErrFieldMismatch{
StructType: of.Type(),
FieldName: n,
Reason: fmt.Sprintf("unsupported type (%T)", val),
}
}
}
return errFieldMismatch
}
type multiArgType int
const (
multiArgTypeInvalid multiArgType = iota
multiArgTypeStruct
multiArgTypeStructPtr
)
// checkMultiArg checks that v has type []S, []*S for some struct type S.
//
// It returns what category the slice's elements are, and the reflect.Type
// that represents S.
func checkMultiArg(v reflect.Value) (m multiArgType, elemType reflect.Type) {
if v.Kind() != reflect.Slice {
return multiArgTypeInvalid, nil
}
elemType = v.Type().Elem()
switch elemType.Kind() {
case reflect.Struct:
return multiArgTypeStruct, elemType
case reflect.Ptr:
elemType = elemType.Elem()
if elemType.Kind() == reflect.Struct {
return multiArgTypeStructPtr, elemType
}
}
return multiArgTypeInvalid, nil
}
func oleInt64(item *ole.IDispatch, prop string) (int64, error) {
v, err := oleutil.GetProperty(item, prop)
if err != nil {
return 0, err
}
defer v.Clear()
i := int64(v.Val)
return i, nil
}
// CreateQuery returns a WQL query string that queries all columns of src. where
// is an optional string that is appended to the query, to be used with WHERE
// clauses. In such a case, the "WHERE" string should appear at the beginning.
func CreateQuery(src interface{}, where string) string {
var b bytes.Buffer
b.WriteString("SELECT ")
s := reflect.Indirect(reflect.ValueOf(src))
t := s.Type()
if s.Kind() == reflect.Slice {
t = t.Elem()
}
if t.Kind() != reflect.Struct {
return ""
}
var fields []string
for i := 0; i < t.NumField(); i++ {
fields = append(fields, t.Field(i).Name)
}
b.WriteString(strings.Join(fields, ", "))
b.WriteString(" FROM ")
b.WriteString(t.Name())
b.WriteString(" " + where)
return b.String()
}
================================================
FILE: vendor/github.com/go-ole/go-ole/ChangeLog.md
================================================
# Version 1.x.x
* **Add more test cases and reference new test COM server project.** (Placeholder for future additions)
# Version 1.2.0-alphaX
**Minimum supported version is now Go 1.4. Go 1.1 support is deprecated, but should still build.**
* Added CI configuration for Travis-CI and AppVeyor.
* Added test InterfaceID and ClassID for the COM Test Server project.
* Added more inline documentation (#83).
* Added IEnumVARIANT implementation (#88).
* Added IEnumVARIANT test cases (#99, #100, #101).
* Added support for retrieving `time.Time` from VARIANT (#92).
* Added test case for IUnknown (#64).
* Added test case for IDispatch (#64).
* Added test cases for scalar variants (#64, #76).
# Version 1.1.1
* Fixes for Linux build.
* Fixes for Windows build.
# Version 1.1.0
The change to provide building on all platforms is a new feature. The increase in minor version reflects that and allows those who wish to stay on 1.0.x to continue to do so. Support for 1.0.x will be limited to bug fixes.
* Move GUID out of variables.go into its own file to make new documentation available.
* Move OleError out of ole.go into its own file to make new documentation available.
* Add documentation to utility functions.
* Add documentation to variant receiver functions.
* Add documentation to ole structures.
* Make variant available to other systems outside of Windows.
* Make OLE structures available to other systems outside of Windows.
## New Features
* Library should now be built on all platforms supported by Go. Library will NOOP on any platform that is not Windows.
* More functions are now documented and available on godoc.org.
# Version 1.0.1
1. Fix package references from repository location change.
# Version 1.0.0
This version is stable enough for use. The COM API is still incomplete, but provides enough functionality for accessing COM servers using IDispatch interface.
There is no changelog for this version. Check commits for history.
================================================
FILE: vendor/github.com/go-ole/go-ole/README.md
================================================
#Go OLE
[](https://ci.appveyor.com/project/jacobsantos/go-ole-jgs28)
[](https://travis-ci.org/go-ole/go-ole)
[](https://godoc.org/github.com/go-ole/go-ole)
Go bindings for Windows COM using shared libraries instead of cgo.
By Yasuhiro Matsumoto.
## Install
To experiment with go-ole, you can just compile and run the example program:
```
go get github.com/go-ole/go-ole
cd /path/to/go-ole/
go test
cd /path/to/go-ole/example/excel
go run excel.go
```
## Continuous Integration
Continuous integration configuration has been added for both Travis-CI and AppVeyor. You will have to add these to your own account for your fork in order for it to run.
**Travis-CI**
Travis-CI was added to check builds on Linux to ensure that `go get` works when cross building. Currently, Travis-CI is not used to test cross-building, but this may be changed in the future. It is also not currently possible to test the library on Linux, since COM API is specific to Windows and it is not currently possible to run a COM server on Linux or even connect to a remote COM server.
**AppVeyor**
AppVeyor is used to build on Windows using the (in-development) test COM server. It is currently only used to test the build and ensure that the code works on Windows. It will be used to register a COM server and then run the test cases based on the test COM server.
The tests currently do run and do pass and this should be maintained with commits.
##Versioning
Go OLE uses [semantic versioning](http://semver.org) for version numbers, which is similar to the version contract of the Go language. Which means that the major version will always maintain backwards compatibility with minor versions. Minor versions will only add new additions and changes. Fixes will always be in patch.
This contract should allow you to upgrade to new minor and patch versions without breakage or modifications to your existing code. Leave a ticket, if there is breakage, so that it could be fixed.
##LICENSE
Under the MIT License: http://mattn.mit-license.org/2013
================================================
FILE: vendor/github.com/go-ole/go-ole/appveyor.yml
================================================
# Notes:
# - Minimal appveyor.yml file is an empty file. All sections are optional.
# - Indent each level of configuration with 2 spaces. Do not use tabs!
# - All section names are case-sensitive.
# - Section names should be unique on each level.
version: "1.3.0.{build}-alpha-{branch}"
os: Windows Server 2012 R2
branches:
only:
- master
- v1.2
- v1.1
- v1.0
skip_tags: true
clone_folder: c:\gopath\src\github.com\go-ole\go-ole
environment:
GOPATH: c:\gopath
matrix:
- GOARCH: amd64
GOVERSION: 1.4
GOROOT: c:\go
DOWNLOADPLATFORM: "x64"
install:
- choco install mingw
- SET PATH=c:\tools\mingw64\bin;%PATH%
# - Download COM Server
- ps: Start-FileDownload "https://github.com/go-ole/test-com-server/releases/download/v1.0.2/test-com-server-${env:DOWNLOADPLATFORM}.zip"
- 7z e test-com-server-%DOWNLOADPLATFORM%.zip -oc:\gopath\src\github.com\go-ole\go-ole > NUL
- c:\gopath\src\github.com\go-ole\go-ole\build\register-assembly.bat
# - set
- go version
- go env
- c:\gopath\src\github.com\go-ole\go-ole\build\compile-go.bat
- go tool dist install -v cmd/8a
- go tool dist install -v cmd/8c
- go tool dist install -v cmd/8g
- go tool dist install -v cmd/8l
- go tool dist install -v cmd/6a
- go tool dist install -v cmd/6c
- go tool dist install -v cmd/6g
- go tool dist install -v cmd/6l
- go get -u golang.org/x/tools/cmd/cover
- go get -u golang.org/x/tools/cmd/godoc
- go get -u golang.org/x/tools/cmd/stringer
build_script:
- cd c:\gopath\src\github.com\go-ole\go-ole
- go get -v -t ./...
- go build
- go test -v -cover ./...
# disable automatic tests
test: off
# disable deployment
deploy: off
================================================
FILE: vendor/github.com/go-ole/go-ole/com.go
================================================
// +build windows
package ole
import (
"errors"
"syscall"
"time"
"unicode/utf16"
"unsafe"
)
var (
procCoInitialize, _ = modole32.FindProc("CoInitialize")
procCoInitializeEx, _ = modole32.FindProc("CoInitializeEx")
procCoUninitialize, _ = modole32.FindProc("CoUninitialize")
procCoCreateInstance, _ = modole32.FindProc("CoCreateInstance")
procCoTaskMemFree, _ = modole32.FindProc("CoTaskMemFree")
procCLSIDFromProgID, _ = modole32.FindProc("CLSIDFromProgID")
procCLSIDFromString, _ = modole32.FindProc("CLSIDFromString")
procStringFromCLSID, _ = modole32.FindProc("StringFromCLSID")
procStringFromIID, _ = modole32.FindProc("StringFromIID")
procIIDFromString, _ = modole32.FindProc("IIDFromString")
procGetUserDefaultLCID, _ = modkernel32.FindProc("GetUserDefaultLCID")
procCopyMemory, _ = modkernel32.FindProc("RtlMoveMemory")
procVariantInit, _ = modoleaut32.FindProc("VariantInit")
procVariantClear, _ = modoleaut32.FindProc("VariantClear")
procVariantTimeToSystemTime, _ = modoleaut32.FindProc("VariantTimeToSystemTime")
procSysAllocString, _ = modoleaut32.FindProc("SysAllocString")
procSysAllocStringLen, _ = modoleaut32.FindProc("SysAllocStringLen")
procSysFreeString, _ = modoleaut32.FindProc("SysFreeString")
procSysStringLen, _ = modoleaut32.FindProc("SysStringLen")
procCreateDispTypeInfo, _ = modoleaut32.FindProc("CreateDispTypeInfo")
procCreateStdDispatch, _ = modoleaut32.FindProc("CreateStdDispatch")
procGetActiveObject, _ = modoleaut32.FindProc("GetActiveObject")
procGetMessageW, _ = moduser32.FindProc("GetMessageW")
procDispatchMessageW, _ = moduser32.FindProc("DispatchMessageW")
)
// coInitialize initializes COM library on current thread.
//
// MSDN documentation suggests that this function should not be called. Call
// CoInitializeEx() instead. The reason has to do with threading and this
// function is only for single-threaded apartments.
//
// That said, most users of the library have gotten away with just this
// function. If you are experiencing threading issues, then use
// CoInitializeEx().
func coInitialize() (err error) {
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms678543(v=vs.85).aspx
// Suggests that no value should be passed to CoInitialized.
// Could just be Call() since the parameter is optional. <-- Needs testing to be sure.
hr, _, _ := procCoInitialize.Call(uintptr(0))
if hr != 0 {
err = NewError(hr)
}
return
}
// coInitializeEx initializes COM library with concurrency model.
func coInitializeEx(coinit uint32) (err error) {
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms695279(v=vs.85).aspx
// Suggests that the first parameter is not only optional but should always be NULL.
hr, _, _ := procCoInitializeEx.Call(uintptr(0), uintptr(coinit))
if hr != 0 {
err = NewError(hr)
}
return
}
// CoInitialize initializes COM library on current thread.
//
// MSDN documentation suggests that this function should not be called. Call
// CoInitializeEx() instead. The reason has to do with threading and this
// function is only for single-threaded apartments.
//
// That said, most users of the library have gotten away with just this
// function. If you are experiencing threading issues, then use
// CoInitializeEx().
func CoInitialize(p uintptr) (err error) {
// p is ignored and won't be used.
// Avoid any variable not used errors.
p = uintptr(0)
return coInitialize()
}
// CoInitializeEx initializes COM library with concurrency model.
func CoInitializeEx(p uintptr, coinit uint32) (err error) {
// Avoid any variable not used errors.
p = uintptr(0)
return coInitializeEx(coinit)
}
// CoUninitialize uninitializes COM Library.
func CoUninitialize() {
procCoUninitialize.Call()
}
// CoTaskMemFree frees memory pointer.
func CoTaskMemFree(memptr uintptr) {
procCoTaskMemFree.Call(memptr)
}
// CLSIDFromProgID retrieves Class Identifier with the given Program Identifier.
//
// The Programmatic Identifier must be registered, because it will be looked up
// in the Windows Registry. The registry entry has the following keys: CLSID,
// Insertable, Protocol and Shell
// (https://msdn.microsoft.com/en-us/library/dd542719(v=vs.85).aspx).
//
// programID identifies the class id with less precision and is not guaranteed
// to be unique. These are usually found in the registry under
// HKEY_LOCAL_MACHINE\SOFTWARE\Classes, usually with the format of
// "Program.Component.Version" with version being optional.
//
// CLSIDFromProgID in Windows API.
func CLSIDFromProgID(progId string) (clsid *GUID, err error) {
var guid GUID
lpszProgID := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(progId)))
hr, _, _ := procCLSIDFromProgID.Call(lpszProgID, uintptr(unsafe.Pointer(&guid)))
if hr != 0 {
err = NewError(hr)
}
clsid = &guid
return
}
// CLSIDFromString retrieves Class ID from string representation.
//
// This is technically the string version of the GUID and will convert the
// string to object.
//
// CLSIDFromString in Windows API.
func CLSIDFromString(str string) (clsid *GUID, err error) {
var guid GUID
lpsz := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(str)))
hr, _, _ := procCLSIDFromString.Call(lpsz, uintptr(unsafe.Pointer(&guid)))
if hr != 0 {
err = NewError(hr)
}
clsid = &guid
return
}
// StringFromCLSID returns GUID formated string from GUID object.
func StringFromCLSID(clsid *GUID) (str string, err error) {
var p *uint16
hr, _, _ := procStringFromCLSID.Call(uintptr(unsafe.Pointer(clsid)), uintptr(unsafe.Pointer(&p)))
if hr != 0 {
err = NewError(hr)
}
str = LpOleStrToString(p)
return
}
// IIDFromString returns GUID from program ID.
func IIDFromString(progId string) (clsid *GUID, err error) {
var guid GUID
lpsz := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(progId)))
hr, _, _ := procIIDFromString.Call(lpsz, uintptr(unsafe.Pointer(&guid)))
if hr != 0 {
err = NewError(hr)
}
clsid = &guid
return
}
// StringFromIID returns GUID formatted string from GUID object.
func StringFromIID(iid *GUID) (str string, err error) {
var p *uint16
hr, _, _ := procStringFromIID.Call(uintptr(unsafe.Pointer(iid)), uintptr(unsafe.Pointer(&p)))
if hr != 0 {
err = NewError(hr)
}
str = LpOleStrToString(p)
return
}
// CreateInstance of single uninitialized object with GUID.
func CreateInstance(clsid *GUID, iid *GUID) (unk *IUnknown, err error) {
if iid == nil {
iid = IID_IUnknown
}
hr, _, _ := procCoCreateInstance.Call(
uintptr(unsafe.Pointer(clsid)),
0,
CLSCTX_SERVER,
uintptr(unsafe.Pointer(iid)),
uintptr(unsafe.Pointer(&unk)))
if hr != 0 {
err = NewError(hr)
}
return
}
// GetActiveObject retrieves pointer to active object.
func GetActiveObject(clsid *GUID, iid *GUID) (unk *IUnknown, err error) {
if iid == nil {
iid = IID_IUnknown
}
hr, _, _ := procGetActiveObject.Call(
uintptr(unsafe.Pointer(clsid)),
uintptr(unsafe.Pointer(iid)),
uintptr(unsafe.Pointer(&unk)))
if hr != 0 {
err = NewError(hr)
}
return
}
// VariantInit initializes variant.
func VariantInit(v *VARIANT) (err error) {
hr, _, _ := procVariantInit.Call(uintptr(unsafe.Pointer(v)))
if hr != 0 {
err = NewError(hr)
}
return
}
// VariantClear clears value in Variant settings to VT_EMPTY.
func VariantClear(v *VARIANT) (err error) {
hr, _, _ := procVariantClear.Call(uintptr(unsafe.Pointer(v)))
if hr != 0 {
err = NewError(hr)
}
return
}
// SysAllocString allocates memory for string and copies string into memory.
func SysAllocString(v string) (ss *int16) {
pss, _, _ := procSysAllocString.Call(uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(v))))
ss = (*int16)(unsafe.Pointer(pss))
return
}
// SysAllocStringLen copies up to length of given string returning pointer.
func SysAllocStringLen(v string) (ss *int16) {
utf16 := utf16.Encode([]rune(v + "\x00"))
ptr := &utf16[0]
pss, _, _ := procSysAllocStringLen.Call(uintptr(unsafe.Pointer(ptr)), uintptr(len(utf16)-1))
ss = (*int16)(unsafe.Pointer(pss))
return
}
// SysFreeString frees string system memory. This must be called with SysAllocString.
func SysFreeString(v *int16) (err error) {
hr, _, _ := procSysFreeString.Call(uintptr(unsafe.Pointer(v)))
if hr != 0 {
err = NewError(hr)
}
return
}
// SysStringLen is the length of the system allocated string.
func SysStringLen(v *int16) uint32 {
l, _, _ := procSysStringLen.Call(uintptr(unsafe.Pointer(v)))
return uint32(l)
}
// CreateStdDispatch provides default IDispatch implementation for IUnknown.
//
// This handles default IDispatch implementation for objects. It haves a few
// limitations with only supporting one language. It will also only return
// default exception codes.
func CreateStdDispatch(unk *IUnknown, v uintptr, ptinfo *IUnknown) (disp *IDispatch, err error) {
hr, _, _ := procCreateStdDispatch.Call(
uintptr(unsafe.Pointer(unk)),
v,
uintptr(unsafe.Pointer(ptinfo)),
uintptr(unsafe.Pointer(&disp)))
if hr != 0 {
err = NewError(hr)
}
return
}
// CreateDispTypeInfo provides default ITypeInfo implementation for IDispatch.
//
// This will not handle the full implementation of the interface.
func CreateDispTypeInfo(idata *INTERFACEDATA) (pptinfo *IUnknown, err error) {
hr, _, _ := procCreateDispTypeInfo.Call(
uintptr(unsafe.Pointer(idata)),
uintptr(GetUserDefaultLCID()),
uintptr(unsafe.Pointer(&pptinfo)))
if hr != 0 {
err = NewError(hr)
}
return
}
// copyMemory moves location of a block of memory.
func copyMemory(dest unsafe.Pointer, src unsafe.Pointer, length uint32) {
procCopyMemory.Call(uintptr(dest), uintptr(src), uintptr(length))
}
// GetUserDefaultLCID retrieves current user default locale.
func GetUserDefaultLCID() (lcid uint32) {
ret, _, _ := procGetUserDefaultLCID.Call()
lcid = uint32(ret)
return
}
// GetMessage in message queue from runtime.
//
// This function appears to block. PeekMessage does not block.
func GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax uint32) (ret int32, err error) {
r0, _, err := procGetMessageW.Call(uintptr(unsafe.Pointer(msg)), uintptr(hwnd), uintptr(MsgFilterMin), uintptr(MsgFilterMax))
ret = int32(r0)
return
}
// DispatchMessage to window procedure.
func DispatchMessage(msg *Msg) (ret int32) {
r0, _, _ := procDispatchMessageW.Call(uintptr(unsafe.Pointer(msg)))
ret = int32(r0)
return
}
// GetVariantDate converts COM Variant Time value to Go time.Time.
func GetVariantDate(value float64) (time.Time, error) {
var st syscall.Systemtime
r, _, _ := procVariantTimeToSystemTime.Call(uintptr(unsafe.Pointer(&value)), uintptr(unsafe.Pointer(&st)))
if r != 0 {
return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), nil), nil
}
return time.Now(), errors.New("Could not convert to time, passing current time.")
}
================================================
FILE: vendor/github.com/go-ole/go-ole/com_func.go
================================================
// +build !windows
package ole
import (
"time"
"unsafe"
)
// coInitialize initializes COM library on current thread.
//
// MSDN documentation suggests that this function should not be called. Call
// CoInitializeEx() instead. The reason has to do with threading and this
// function is only for single-threaded apartments.
//
// That said, most users of the library have gotten away with just this
// function. If you are experiencing threading issues, then use
// CoInitializeEx().
func coInitialize() error {
return NewError(E_NOTIMPL)
}
// coInitializeEx initializes COM library with concurrency model.
func coInitializeEx(coinit uint32) error {
return NewError(E_NOTIMPL)
}
// CoInitialize initializes COM library on current thread.
//
// MSDN documentation suggests that this function should not be called. Call
// CoInitializeEx() instead. The reason has to do with threading and this
// function is only for single-threaded apartments.
//
// That said, most users of the library have gotten away with just this
// function. If you are experiencing threading issues, then use
// CoInitializeEx().
func CoInitialize(p uintptr) error {
return NewError(E_NOTIMPL)
}
// CoInitializeEx initializes COM library with concurrency model.
func CoInitializeEx(p uintptr, coinit uint32) error {
return NewError(E_NOTIMPL)
}
// CoUninitialize uninitializes COM Library.
func CoUninitialize() {}
// CoTaskMemFree frees memory pointer.
func CoTaskMemFree(memptr uintptr) {}
// CLSIDFromProgID retrieves Class Identifier with the given Program Identifier.
//
// The Programmatic Identifier must be registered, because it will be looked up
// in the Windows Registry. The registry entry has the following keys: CLSID,
// Insertable, Protocol and Shell
// (https://msdn.microsoft.com/en-us/library/dd542719(v=vs.85).aspx).
//
// programID identifies the class id with less precision and is not guaranteed
// to be unique. These are usually found in the registry under
// HKEY_LOCAL_MACHINE\SOFTWARE\Classes, usually with the format of
// "Program.Component.Version" with version being optional.
//
// CLSIDFromProgID in Windows API.
func CLSIDFromProgID(progId string) (*GUID, error) {
return nil, NewError(E_NOTIMPL)
}
// CLSIDFromString retrieves Class ID from string representation.
//
// This is technically the string version of the GUID and will convert the
// string to object.
//
// CLSIDFromString in Windows API.
func CLSIDFromString(str string) (*GUID, error) {
return nil, NewError(E_NOTIMPL)
}
// StringFromCLSID returns GUID formated string from GUID object.
func StringFromCLSID(clsid *GUID) (string, error) {
return "", NewError(E_NOTIMPL)
}
// IIDFromString returns GUID from program ID.
func IIDFromString(progId string) (*GUID, error) {
return nil, NewError(E_NOTIMPL)
}
// StringFromIID returns GUID formatted string from GUID object.
func StringFromIID(iid *GUID) (string, error) {
return "", NewError(E_NOTIMPL)
}
// CreateInstance of single uninitialized object with GUID.
func CreateInstance(clsid *GUID, iid *GUID) (*IUnknown, error) {
return nil, NewError(E_NOTIMPL)
}
// GetActiveObject retrieves pointer to active object.
func GetActiveObject(clsid *GUID, iid *GUID) (*IUnknown, error) {
return nil, NewError(E_NOTIMPL)
}
// VariantInit initializes variant.
func VariantInit(v *VARIANT) error {
return NewError(E_NOTIMPL)
}
// VariantClear clears value in Variant settings to VT_EMPTY.
func VariantClear(v *VARIANT) error {
return NewError(E_NOTIMPL)
}
// SysAllocString allocates memory for string and copies string into memory.
func SysAllocString(v string) *int16 {
u := int16(0)
return &u
}
// SysAllocStringLen copies up to length of given string returning pointer.
func SysAllocStringLen(v string) *int16 {
u := int16(0)
return &u
}
// SysFreeString frees string system memory. This must be called with SysAllocString.
func SysFreeString(v *int16) error {
return NewError(E_NOTIMPL)
}
// SysStringLen is the length of the system allocated string.
func SysStringLen(v *int16) uint32 {
return uint32(0)
}
// CreateStdDispatch provides default IDispatch implementation for IUnknown.
//
// This handles default IDispatch implementation for objects. It haves a few
// limitations with only supporting one language. It will also only return
// default exception codes.
func CreateStdDispatch(unk *IUnknown, v uintptr, ptinfo *IUnknown) (*IDispatch, error) {
return nil, NewError(E_NOTIMPL)
}
// CreateDispTypeInfo provides default ITypeInfo implementation for IDispatch.
//
// This will not handle the full implementation of the interface.
func CreateDispTypeInfo(idata *INTERFACEDATA) (*IUnknown, error) {
return nil, NewError(E_NOTIMPL)
}
// copyMemory moves location of a block of memory.
func copyMemory(dest unsafe.Pointer, src unsafe.Pointer, length uint32) {}
// GetUserDefaultLCID retrieves current user default locale.
func GetUserDefaultLCID() uint32 {
return uint32(0)
}
// GetMessage in message queue from runtime.
//
// This function appears to block. PeekMessage does not block.
func GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax uint32) (int32, error) {
return int32(0), NewError(E_NOTIMPL)
}
// DispatchMessage to window procedure.
func DispatchMessage(msg *Msg) int32 {
return int32(0)
}
func GetVariantDate(value float64) (time.Time, error) {
return time.Now(), NewError(E_NOTIMPL)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/connect.go
================================================
package ole
// Connection contains IUnknown for fluent interface interaction.
//
// Deprecated. Use oleutil package instead.
type Connection struct {
Object *IUnknown // Access COM
}
// Initialize COM.
func (*Connection) Initialize() (err error) {
return coInitialize()
}
// Uninitialize COM.
func (*Connection) Uninitialize() {
CoUninitialize()
}
// Create IUnknown object based first on ProgId and then from String.
func (c *Connection) Create(progId string) (err error) {
var clsid *GUID
clsid, err = CLSIDFromProgID(progId)
if err != nil {
clsid, err = CLSIDFromString(progId)
if err != nil {
return
}
}
unknown, err := CreateInstance(clsid, IID_IUnknown)
if err != nil {
return
}
c.Object = unknown
return
}
// Release IUnknown object.
func (c *Connection) Release() {
c.Object.Release()
}
// Load COM object from list of programIDs or strings.
func (c *Connection) Load(names ...string) (errors []error) {
var tempErrors []error = make([]error, len(names))
var numErrors int = 0
for _, name := range names {
err := c.Create(name)
if err != nil {
tempErrors = append(tempErrors, err)
numErrors += 1
continue
}
break
}
copy(errors, tempErrors[0:numErrors])
return
}
// Dispatch returns Dispatch object.
func (c *Connection) Dispatch() (object *Dispatch, err error) {
dispatch, err := c.Object.QueryInterface(IID_IDispatch)
if err != nil {
return
}
object = &Dispatch{dispatch}
return
}
// Dispatch stores IDispatch object.
type Dispatch struct {
Object *IDispatch // Dispatch object.
}
// Call method on IDispatch with parameters.
func (d *Dispatch) Call(method string, params ...interface{}) (result *VARIANT, err error) {
id, err := d.GetId(method)
if err != nil {
return
}
result, err = d.Invoke(id, DISPATCH_METHOD, params)
return
}
// MustCall method on IDispatch with parameters.
func (d *Dispatch) MustCall(method string, params ...interface{}) (result *VARIANT) {
id, err := d.GetId(method)
if err != nil {
panic(err)
}
result, err = d.Invoke(id, DISPATCH_METHOD, params)
if err != nil {
panic(err)
}
return
}
// Get property on IDispatch with parameters.
func (d *Dispatch) Get(name string, params ...interface{}) (result *VARIANT, err error) {
id, err := d.GetId(name)
if err != nil {
return
}
result, err = d.Invoke(id, DISPATCH_PROPERTYGET, params)
return
}
// MustGet property on IDispatch with parameters.
func (d *Dispatch) MustGet(name string, params ...interface{}) (result *VARIANT) {
id, err := d.GetId(name)
if err != nil {
panic(err)
}
result, err = d.Invoke(id, DISPATCH_PROPERTYGET, params)
if err != nil {
panic(err)
}
return
}
// Set property on IDispatch with parameters.
func (d *Dispatch) Set(name string, params ...interface{}) (result *VARIANT, err error) {
id, err := d.GetId(name)
if err != nil {
return
}
result, err = d.Invoke(id, DISPATCH_PROPERTYPUT, params)
return
}
// MustSet property on IDispatch with parameters.
func (d *Dispatch) MustSet(name string, params ...interface{}) (result *VARIANT) {
id, err := d.GetId(name)
if err != nil {
panic(err)
}
result, err = d.Invoke(id, DISPATCH_PROPERTYPUT, params)
if err != nil {
panic(err)
}
return
}
// GetId retrieves ID of name on IDispatch.
func (d *Dispatch) GetId(name string) (id int32, err error) {
var dispid []int32
dispid, err = d.Object.GetIDsOfName([]string{name})
if err != nil {
return
}
id = dispid[0]
return
}
// GetIds retrieves all IDs of names on IDispatch.
func (d *Dispatch) GetIds(names ...string) (dispid []int32, err error) {
dispid, err = d.Object.GetIDsOfName(names)
return
}
// Invoke IDispatch on DisplayID of dispatch type with parameters.
//
// There have been problems where if send cascading params..., it would error
// out because the parameters would be empty.
func (d *Dispatch) Invoke(id int32, dispatch int16, params []interface{}) (result *VARIANT, err error) {
if len(params) < 1 {
result, err = d.Object.Invoke(id, dispatch)
} else {
result, err = d.Object.Invoke(id, dispatch, params...)
}
return
}
// Release IDispatch object.
func (d *Dispatch) Release() {
d.Object.Release()
}
// Connect initializes COM and attempts to load IUnknown based on given names.
func Connect(names ...string) (connection *Connection) {
connection.Initialize()
connection.Load(names...)
return
}
================================================
FILE: vendor/github.com/go-ole/go-ole/constants.go
================================================
package ole
const (
CLSCTX_INPROC_SERVER = 1
CLSCTX_INPROC_HANDLER = 2
CLSCTX_LOCAL_SERVER = 4
CLSCTX_INPROC_SERVER16 = 8
CLSCTX_REMOTE_SERVER = 16
CLSCTX_ALL = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER
CLSCTX_INPROC = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER
CLSCTX_SERVER = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER
)
const (
COINIT_APARTMENTTHREADED = 0x2
COINIT_MULTITHREADED = 0x0
COINIT_DISABLE_OLE1DDE = 0x4
COINIT_SPEED_OVER_MEMORY = 0x8
)
const (
DISPATCH_METHOD = 1
DISPATCH_PROPERTYGET = 2
DISPATCH_PROPERTYPUT = 4
DISPATCH_PROPERTYPUTREF = 8
)
const (
S_OK = 0x00000000
E_UNEXPECTED = 0x8000FFFF
E_NOTIMPL = 0x80004001
E_OUTOFMEMORY = 0x8007000E
E_INVALIDARG = 0x80070057
E_NOINTERFACE = 0x80004002
E_POINTER = 0x80004003
E_HANDLE = 0x80070006
E_ABORT = 0x80004004
E_FAIL = 0x80004005
E_ACCESSDENIED = 0x80070005
E_PENDING = 0x8000000A
CO_E_CLASSSTRING = 0x800401F3
)
const (
CC_FASTCALL = iota
CC_CDECL
CC_MSCPASCAL
CC_PASCAL = CC_MSCPASCAL
CC_MACPASCAL
CC_STDCALL
CC_FPFASTCALL
CC_SYSCALL
CC_MPWCDECL
CC_MPWPASCAL
CC_MAX = CC_MPWPASCAL
)
type VT uint16
const (
VT_EMPTY VT = 0x0
VT_NULL VT = 0x1
VT_I2 VT = 0x2
VT_I4 VT = 0x3
VT_R4 VT = 0x4
VT_R8 VT = 0x5
VT_CY VT = 0x6
VT_DATE VT = 0x7
VT_BSTR VT = 0x8
VT_DISPATCH VT = 0x9
VT_ERROR VT = 0xa
VT_BOOL VT = 0xb
VT_VARIANT VT = 0xc
VT_UNKNOWN VT = 0xd
VT_DECIMAL VT = 0xe
VT_I1 VT = 0x10
VT_UI1 VT = 0x11
VT_UI2 VT = 0x12
VT_UI4 VT = 0x13
VT_I8 VT = 0x14
VT_UI8 VT = 0x15
VT_INT VT = 0x16
VT_UINT VT = 0x17
VT_VOID VT = 0x18
VT_HRESULT VT = 0x19
VT_PTR VT = 0x1a
VT_SAFEARRAY VT = 0x1b
VT_CARRAY VT = 0x1c
VT_USERDEFINED VT = 0x1d
VT_LPSTR VT = 0x1e
VT_LPWSTR VT = 0x1f
VT_RECORD VT = 0x24
VT_INT_PTR VT = 0x25
VT_UINT_PTR VT = 0x26
VT_FILETIME VT = 0x40
VT_BLOB VT = 0x41
VT_STREAM VT = 0x42
VT_STORAGE VT = 0x43
VT_STREAMED_OBJECT VT = 0x44
VT_STORED_OBJECT VT = 0x45
VT_BLOB_OBJECT VT = 0x46
VT_CF VT = 0x47
VT_CLSID VT = 0x48
VT_BSTR_BLOB VT = 0xfff
VT_VECTOR VT = 0x1000
VT_ARRAY VT = 0x2000
VT_BYREF VT = 0x4000
VT_RESERVED VT = 0x8000
VT_ILLEGAL VT = 0xffff
VT_ILLEGALMASKED VT = 0xfff
VT_TYPEMASK VT = 0xfff
)
const (
DISPID_UNKNOWN = -1
DISPID_VALUE = 0
DISPID_PROPERTYPUT = -3
DISPID_NEWENUM = -4
DISPID_EVALUATE = -5
DISPID_CONSTRUCTOR = -6
DISPID_DESTRUCTOR = -7
DISPID_COLLECT = -8
)
const (
TKIND_ENUM = 1
TKIND_RECORD = 2
TKIND_MODULE = 3
TKIND_INTERFACE = 4
TKIND_DISPATCH = 5
TKIND_COCLASS = 6
TKIND_ALIAS = 7
TKIND_UNION = 8
TKIND_MAX = 9
)
// Safe Array Feature Flags
const (
FADF_AUTO = 0x0001
FADF_STATIC = 0x0002
FADF_EMBEDDED = 0x0004
FADF_FIXEDSIZE = 0x0010
FADF_RECORD = 0x0020
FADF_HAVEIID = 0x0040
FADF_HAVEVARTYPE = 0x0080
FADF_BSTR = 0x0100
FADF_UNKNOWN = 0x0200
FADF_DISPATCH = 0x0400
FADF_VARIANT = 0x0800
FADF_RESERVED = 0xF008
)
================================================
FILE: vendor/github.com/go-ole/go-ole/error.go
================================================
package ole
// OleError stores COM errors.
type OleError struct {
hr uintptr
description string
subError error
}
// NewError creates new error with HResult.
func NewError(hr uintptr) *OleError {
return &OleError{hr: hr}
}
// NewErrorWithDescription creates new COM error with HResult and description.
func NewErrorWithDescription(hr uintptr, description string) *OleError {
return &OleError{hr: hr, description: description}
}
// NewErrorWithSubError creates new COM error with parent error.
func NewErrorWithSubError(hr uintptr, description string, err error) *OleError {
return &OleError{hr: hr, description: description, subError: err}
}
// Code is the HResult.
func (v *OleError) Code() uintptr {
return uintptr(v.hr)
}
// String description, either manually set or format message with error code.
func (v *OleError) String() string {
if v.description != "" {
return errstr(int(v.hr)) + " (" + v.description + ")"
}
return errstr(int(v.hr))
}
// Error implements error interface.
func (v *OleError) Error() string {
return v.String()
}
// Description retrieves error summary, if there is one.
func (v *OleError) Description() string {
return v.description
}
// SubError returns parent error, if there is one.
func (v *OleError) SubError() error {
return v.subError
}
================================================
FILE: vendor/github.com/go-ole/go-ole/error_func.go
================================================
// +build !windows
package ole
// errstr converts error code to string.
func errstr(errno int) string {
return ""
}
================================================
FILE: vendor/github.com/go-ole/go-ole/error_windows.go
================================================
// +build windows
package ole
import (
"fmt"
"syscall"
"unicode/utf16"
)
// errstr converts error code to string.
func errstr(errno int) string {
// ask windows for the remaining errors
var flags uint32 = syscall.FORMAT_MESSAGE_FROM_SYSTEM | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS
b := make([]uint16, 300)
n, err := syscall.FormatMessage(flags, 0, uint32(errno), 0, b, nil)
if err != nil {
return fmt.Sprintf("error %d (FormatMessage failed with: %v)", errno, err)
}
// trim terminating \r and \n
for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- {
}
return string(utf16.Decode(b[:n]))
}
================================================
FILE: vendor/github.com/go-ole/go-ole/guid.go
================================================
package ole
var (
// IID_NULL is null Interface ID, used when no other Interface ID is known.
IID_NULL = NewGUID("{00000000-0000-0000-0000-000000000000}")
// IID_IUnknown is for IUnknown interfaces.
IID_IUnknown = NewGUID("{00000000-0000-0000-C000-000000000046}")
// IID_IDispatch is for IDispatch interfaces.
IID_IDispatch = NewGUID("{00020400-0000-0000-C000-000000000046}")
// IID_IEnumVariant is for IEnumVariant interfaces
IID_IEnumVariant = NewGUID("{00020404-0000-0000-C000-000000000046}")
// IID_IConnectionPointContainer is for IConnectionPointContainer interfaces.
IID_IConnectionPointContainer = NewGUID("{B196B284-BAB4-101A-B69C-00AA00341D07}")
// IID_IConnectionPoint is for IConnectionPoint interfaces.
IID_IConnectionPoint = NewGUID("{B196B286-BAB4-101A-B69C-00AA00341D07}")
// IID_IInspectable is for IInspectable interfaces.
IID_IInspectable = NewGUID("{AF86E2E0-B12D-4C6A-9C5A-D7AA65101E90}")
// IID_IProvideClassInfo is for IProvideClassInfo interfaces.
IID_IProvideClassInfo = NewGUID("{B196B283-BAB4-101A-B69C-00AA00341D07}")
)
// These are for testing and not part of any library.
var (
// IID_ICOMTestString is for ICOMTestString interfaces.
//
// {E0133EB4-C36F-469A-9D3D-C66B84BE19ED}
IID_ICOMTestString = NewGUID("{E0133EB4-C36F-469A-9D3D-C66B84BE19ED}")
// IID_ICOMTestInt8 is for ICOMTestInt8 interfaces.
//
// {BEB06610-EB84-4155-AF58-E2BFF53680B4}
IID_ICOMTestInt8 = NewGUID("{BEB06610-EB84-4155-AF58-E2BFF53680B4}")
// IID_ICOMTestInt16 is for ICOMTestInt16 interfaces.
//
// {DAA3F9FA-761E-4976-A860-8364CE55F6FC}
IID_ICOMTestInt16 = NewGUID("{DAA3F9FA-761E-4976-A860-8364CE55F6FC}")
// IID_ICOMTestInt32 is for ICOMTestInt32 interfaces.
//
// {E3DEDEE7-38A2-4540-91D1-2EEF1D8891B0}
IID_ICOMTestInt32 = NewGUID("{E3DEDEE7-38A2-4540-91D1-2EEF1D8891B0}")
// IID_ICOMTestInt64 is for ICOMTestInt64 interfaces.
//
// {8D437CBC-B3ED-485C-BC32-C336432A1623}
IID_ICOMTestInt64 = NewGUID("{8D437CBC-B3ED-485C-BC32-C336432A1623}")
// IID_ICOMTestFloat is for ICOMTestFloat interfaces.
//
// {BF1ED004-EA02-456A-AA55-2AC8AC6B054C}
IID_ICOMTestFloat = NewGUID("{BF1ED004-EA02-456A-AA55-2AC8AC6B054C}")
// IID_ICOMTestDouble is for ICOMTestDouble interfaces.
//
// {BF908A81-8687-4E93-999F-D86FAB284BA0}
IID_ICOMTestDouble = NewGUID("{BF908A81-8687-4E93-999F-D86FAB284BA0}")
// IID_ICOMTestBoolean is for ICOMTestBoolean interfaces.
//
// {D530E7A6-4EE8-40D1-8931-3D63B8605010}
IID_ICOMTestBoolean = NewGUID("{D530E7A6-4EE8-40D1-8931-3D63B8605010}")
// IID_ICOMEchoTestObject is for ICOMEchoTestObject interfaces.
//
// {6485B1EF-D780-4834-A4FE-1EBB51746CA3}
IID_ICOMEchoTestObject = NewGUID("{6485B1EF-D780-4834-A4FE-1EBB51746CA3}")
// IID_ICOMTestTypes is for ICOMTestTypes interfaces.
//
// {CCA8D7AE-91C0-4277-A8B3-FF4EDF28D3C0}
IID_ICOMTestTypes = NewGUID("{CCA8D7AE-91C0-4277-A8B3-FF4EDF28D3C0}")
// CLSID_COMEchoTestObject is for COMEchoTestObject class.
//
// {3C24506A-AE9E-4D50-9157-EF317281F1B0}
CLSID_COMEchoTestObject = NewGUID("{3C24506A-AE9E-4D50-9157-EF317281F1B0}")
// CLSID_COMTestScalarClass is for COMTestScalarClass class.
//
// {865B85C5-0334-4AC6-9EF6-AACEC8FC5E86}
CLSID_COMTestScalarClass = NewGUID("{865B85C5-0334-4AC6-9EF6-AACEC8FC5E86}")
)
const hextable = "0123456789ABCDEF"
const emptyGUID = "{00000000-0000-0000-0000-000000000000}"
// GUID is Windows API specific GUID type.
//
// This exists to match Windows GUID type for direct passing for COM.
// Format is in xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx.
type GUID struct {
Data1 uint32
Data2 uint16
Data3 uint16
Data4 [8]byte
}
// NewGUID converts the given string into a globally unique identifier that is
// compliant with the Windows API.
//
// The supplied string may be in any of these formats:
//
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
// {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
//
// The conversion of the supplied string is not case-sensitive.
func NewGUID(guid string) *GUID {
d := []byte(guid)
var d1, d2, d3, d4a, d4b []byte
switch len(d) {
case 38:
if d[0] != '{' || d[37] != '}' {
return nil
}
d = d[1:37]
fallthrough
case 36:
if d[8] != '-' || d[13] != '-' || d[18] != '-' || d[23] != '-' {
return nil
}
d1 = d[0:8]
d2 = d[9:13]
d3 = d[14:18]
d4a = d[19:23]
d4b = d[24:36]
case 32:
d1 = d[0:8]
d2 = d[8:12]
d3 = d[12:16]
d4a = d[16:20]
d4b = d[20:32]
default:
return nil
}
var g GUID
var ok1, ok2, ok3, ok4 bool
g.Data1, ok1 = decodeHexUint32(d1)
g.Data2, ok2 = decodeHexUint16(d2)
g.Data3, ok3 = decodeHexUint16(d3)
g.Data4, ok4 = decodeHexByte64(d4a, d4b)
if ok1 && ok2 && ok3 && ok4 {
return &g
}
return nil
}
func decodeHexUint32(src []byte) (value uint32, ok bool) {
var b1, b2, b3, b4 byte
var ok1, ok2, ok3, ok4 bool
b1, ok1 = decodeHexByte(src[0], src[1])
b2, ok2 = decodeHexByte(src[2], src[3])
b3, ok3 = decodeHexByte(src[4], src[5])
b4, ok4 = decodeHexByte(src[6], src[7])
value = (uint32(b1) << 24) | (uint32(b2) << 16) | (uint32(b3) << 8) | uint32(b4)
ok = ok1 && ok2 && ok3 && ok4
return
}
func decodeHexUint16(src []byte) (value uint16, ok bool) {
var b1, b2 byte
var ok1, ok2 bool
b1, ok1 = decodeHexByte(src[0], src[1])
b2, ok2 = decodeHexByte(src[2], src[3])
value = (uint16(b1) << 8) | uint16(b2)
ok = ok1 && ok2
return
}
func decodeHexByte64(s1 []byte, s2 []byte) (value [8]byte, ok bool) {
var ok1, ok2, ok3, ok4, ok5, ok6, ok7, ok8 bool
value[0], ok1 = decodeHexByte(s1[0], s1[1])
value[1], ok2 = decodeHexByte(s1[2], s1[3])
value[2], ok3 = decodeHexByte(s2[0], s2[1])
value[3], ok4 = decodeHexByte(s2[2], s2[3])
value[4], ok5 = decodeHexByte(s2[4], s2[5])
value[5], ok6 = decodeHexByte(s2[6], s2[7])
value[6], ok7 = decodeHexByte(s2[8], s2[9])
value[7], ok8 = decodeHexByte(s2[10], s2[11])
ok = ok1 && ok2 && ok3 && ok4 && ok5 && ok6 && ok7 && ok8
return
}
func decodeHexByte(c1, c2 byte) (value byte, ok bool) {
var n1, n2 byte
var ok1, ok2 bool
n1, ok1 = decodeHexChar(c1)
n2, ok2 = decodeHexChar(c2)
value = (n1 << 4) | n2
ok = ok1 && ok2
return
}
func decodeHexChar(c byte) (byte, bool) {
switch {
case '0' <= c && c <= '9':
return c - '0', true
case 'a' <= c && c <= 'f':
return c - 'a' + 10, true
case 'A' <= c && c <= 'F':
return c - 'A' + 10, true
}
return 0, false
}
// String converts the GUID to string form. It will adhere to this pattern:
//
// {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
//
// If the GUID is nil, the string representation of an empty GUID is returned:
//
// {00000000-0000-0000-0000-000000000000}
func (guid *GUID) String() string {
if guid == nil {
return emptyGUID
}
var c [38]byte
c[0] = '{'
putUint32Hex(c[1:9], guid.Data1)
c[9] = '-'
putUint16Hex(c[10:14], guid.Data2)
c[14] = '-'
putUint16Hex(c[15:19], guid.Data3)
c[19] = '-'
putByteHex(c[20:24], guid.Data4[0:2])
c[24] = '-'
putByteHex(c[25:37], guid.Data4[2:8])
c[37] = '}'
return string(c[:])
}
func putUint32Hex(b []byte, v uint32) {
b[0] = hextable[byte(v>>24)>>4]
b[1] = hextable[byte(v>>24)&0x0f]
b[2] = hextable[byte(v>>16)>>4]
b[3] = hextable[byte(v>>16)&0x0f]
b[4] = hextable[byte(v>>8)>>4]
b[5] = hextable[byte(v>>8)&0x0f]
b[6] = hextable[byte(v)>>4]
b[7] = hextable[byte(v)&0x0f]
}
func putUint16Hex(b []byte, v uint16) {
b[0] = hextable[byte(v>>8)>>4]
b[1] = hextable[byte(v>>8)&0x0f]
b[2] = hextable[byte(v)>>4]
b[3] = hextable[byte(v)&0x0f]
}
func putByteHex(dst, src []byte) {
for i := 0; i < len(src); i++ {
dst[i*2] = hextable[src[i]>>4]
dst[i*2+1] = hextable[src[i]&0x0f]
}
}
// IsEqualGUID compares two GUID.
//
// Not constant time comparison.
func IsEqualGUID(guid1 *GUID, guid2 *GUID) bool {
return guid1.Data1 == guid2.Data1 &&
guid1.Data2 == guid2.Data2 &&
guid1.Data3 == guid2.Data3 &&
guid1.Data4[0] == guid2.Data4[0] &&
guid1.Data4[1] == guid2.Data4[1] &&
guid1.Data4[2] == guid2.Data4[2] &&
guid1.Data4[3] == guid2.Data4[3] &&
guid1.Data4[4] == guid2.Data4[4] &&
guid1.Data4[5] == guid2.Data4[5] &&
guid1.Data4[6] == guid2.Data4[6] &&
guid1.Data4[7] == guid2.Data4[7]
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iconnectionpoint.go
================================================
package ole
import "unsafe"
type IConnectionPoint struct {
IUnknown
}
type IConnectionPointVtbl struct {
IUnknownVtbl
GetConnectionInterface uintptr
GetConnectionPointContainer uintptr
Advise uintptr
Unadvise uintptr
EnumConnections uintptr
}
func (v *IConnectionPoint) VTable() *IConnectionPointVtbl {
return (*IConnectionPointVtbl)(unsafe.Pointer(v.RawVTable))
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go
================================================
// +build !windows
package ole
import "unsafe"
func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 {
return int32(0)
}
func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error) {
return uint32(0), NewError(E_NOTIMPL)
}
func (v *IConnectionPoint) Unadvise(cookie uint32) error {
return NewError(E_NOTIMPL)
}
func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error) {
return NewError(E_NOTIMPL)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go
================================================
// +build windows
package ole
import (
"syscall"
"unsafe"
)
func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 {
// XXX: This doesn't look like it does what it's supposed to
return release((*IUnknown)(unsafe.Pointer(v)))
}
func (v *IConnectionPoint) Advise(unknown *IUnknown) (cookie uint32, err error) {
hr, _, _ := syscall.Syscall(
v.VTable().Advise,
3,
uintptr(unsafe.Pointer(v)),
uintptr(unsafe.Pointer(unknown)),
uintptr(unsafe.Pointer(&cookie)))
if hr != 0 {
err = NewError(hr)
}
return
}
func (v *IConnectionPoint) Unadvise(cookie uint32) (err error) {
hr, _, _ := syscall.Syscall(
v.VTable().Unadvise,
2,
uintptr(unsafe.Pointer(v)),
uintptr(cookie),
0)
if hr != 0 {
err = NewError(hr)
}
return
}
func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) error {
return NewError(E_NOTIMPL)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go
================================================
package ole
import "unsafe"
type IConnectionPointContainer struct {
IUnknown
}
type IConnectionPointContainerVtbl struct {
IUnknownVtbl
EnumConnectionPoints uintptr
FindConnectionPoint uintptr
}
func (v *IConnectionPointContainer) VTable() *IConnectionPointContainerVtbl {
return (*IConnectionPointContainerVtbl)(unsafe.Pointer(v.RawVTable))
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go
================================================
// +build !windows
package ole
func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error {
return NewError(E_NOTIMPL)
}
func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) error {
return NewError(E_NOTIMPL)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go
================================================
// +build windows
package ole
import (
"syscall"
"unsafe"
)
func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error {
return NewError(E_NOTIMPL)
}
func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) (err error) {
hr, _, _ := syscall.Syscall(
v.VTable().FindConnectionPoint,
3,
uintptr(unsafe.Pointer(v)),
uintptr(unsafe.Pointer(iid)),
uintptr(unsafe.Pointer(point)))
if hr != 0 {
err = NewError(hr)
}
return
}
================================================
FILE: vendor/github.com/go-ole/go-ole/idispatch.go
================================================
package ole
import "unsafe"
type IDispatch struct {
IUnknown
}
type IDispatchVtbl struct {
IUnknownVtbl
GetTypeInfoCount uintptr
GetTypeInfo uintptr
GetIDsOfNames uintptr
Invoke uintptr
}
func (v *IDispatch) VTable() *IDispatchVtbl {
return (*IDispatchVtbl)(unsafe.Pointer(v.RawVTable))
}
func (v *IDispatch) GetIDsOfName(names []string) (dispid []int32, err error) {
dispid, err = getIDsOfName(v, names)
return
}
func (v *IDispatch) Invoke(dispid int32, dispatch int16, params ...interface{}) (result *VARIANT, err error) {
result, err = invoke(v, dispid, dispatch, params...)
return
}
func (v *IDispatch) GetTypeInfoCount() (c uint32, err error) {
c, err = getTypeInfoCount(v)
return
}
func (v *IDispatch) GetTypeInfo() (tinfo *ITypeInfo, err error) {
tinfo, err = getTypeInfo(v)
return
}
// GetSingleIDOfName is a helper that returns single display ID for IDispatch name.
//
// This replaces the common pattern of attempting to get a single name from the list of available
// IDs. It gives the first ID, if it is available.
func (v *IDispatch) GetSingleIDOfName(name string) (displayID int32, err error) {
var displayIDs []int32
displayIDs, err = v.GetIDsOfName([]string{name})
if err != nil {
return
}
displayID = displayIDs[0]
return
}
// InvokeWithOptionalArgs accepts arguments as an array, works like Invoke.
//
// Accepts name and will attempt to retrieve Display ID to pass to Invoke.
//
// Passing params as an array is a workaround that could be fixed in later versions of Go that
// prevent passing empty params. During testing it was discovered that this is an acceptable way of
// getting around not being able to pass params normally.
func (v *IDispatch) InvokeWithOptionalArgs(name string, dispatch int16, params []interface{}) (result *VARIANT, err error) {
displayID, err := v.GetSingleIDOfName(name)
if err != nil {
return
}
if len(params) < 1 {
result, err = v.Invoke(displayID, dispatch)
} else {
result, err = v.Invoke(displayID, dispatch, params...)
}
return
}
// CallMethod invokes named function with arguments on object.
func (v *IDispatch) CallMethod(name string, params ...interface{}) (*VARIANT, error) {
return v.InvokeWithOptionalArgs(name, DISPATCH_METHOD, params)
}
// GetProperty retrieves the property with the name with the ability to pass arguments.
//
// Most of the time you will not need to pass arguments as most objects do not allow for this
// feature. Or at least, should not allow for this feature. Some servers don't follow best practices
// and this is provided for those edge cases.
func (v *IDispatch) GetProperty(name string, params ...interface{}) (*VARIANT, error) {
return v.InvokeWithOptionalArgs(name, DISPATCH_PROPERTYGET, params)
}
// PutProperty attempts to mutate a property in the object.
func (v *IDispatch) PutProperty(name string, params ...interface{}) (*VARIANT, error) {
return v.InvokeWithOptionalArgs(name, DISPATCH_PROPERTYPUT, params)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/idispatch_func.go
================================================
// +build !windows
package ole
func getIDsOfName(disp *IDispatch, names []string) ([]int32, error) {
return []int32{}, NewError(E_NOTIMPL)
}
func getTypeInfoCount(disp *IDispatch) (uint32, error) {
return uint32(0), NewError(E_NOTIMPL)
}
func getTypeInfo(disp *IDispatch) (*ITypeInfo, error) {
return nil, NewError(E_NOTIMPL)
}
func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (*VARIANT, error) {
return nil, NewError(E_NOTIMPL)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/idispatch_windows.go
================================================
// +build windows
package ole
import (
"syscall"
"time"
"unsafe"
)
func getIDsOfName(disp *IDispatch, names []string) (dispid []int32, err error) {
wnames := make([]*uint16, len(names))
for i := 0; i < len(names); i++ {
wnames[i] = syscall.StringToUTF16Ptr(names[i])
}
dispid = make([]int32, len(names))
namelen := uint32(len(names))
hr, _, _ := syscall.Syscall6(
disp.VTable().GetIDsOfNames,
6,
uintptr(unsafe.Pointer(disp)),
uintptr(unsafe.Pointer(IID_NULL)),
uintptr(unsafe.Pointer(&wnames[0])),
uintptr(namelen),
uintptr(GetUserDefaultLCID()),
uintptr(unsafe.Pointer(&dispid[0])))
if hr != 0 {
err = NewError(hr)
}
return
}
func getTypeInfoCount(disp *IDispatch) (c uint32, err error) {
hr, _, _ := syscall.Syscall(
disp.VTable().GetTypeInfoCount,
2,
uintptr(unsafe.Pointer(disp)),
uintptr(unsafe.Pointer(&c)),
0)
if hr != 0 {
err = NewError(hr)
}
return
}
func getTypeInfo(disp *IDispatch) (tinfo *ITypeInfo, err error) {
hr, _, _ := syscall.Syscall(
disp.VTable().GetTypeInfo,
3,
uintptr(unsafe.Pointer(disp)),
uintptr(GetUserDefaultLCID()),
uintptr(unsafe.Pointer(&tinfo)))
if hr != 0 {
err = NewError(hr)
}
return
}
func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (result *VARIANT, err error) {
var dispparams DISPPARAMS
if dispatch&DISPATCH_PROPERTYPUT != 0 {
dispnames := [1]int32{DISPID_PROPERTYPUT}
dispparams.rgdispidNamedArgs = uintptr(unsafe.Pointer(&dispnames[0]))
dispparams.cNamedArgs = 1
}
var vargs []VARIANT
if len(params) > 0 {
vargs = make([]VARIANT, len(params))
for i, v := range params {
//n := len(params)-i-1
n := len(params) - i - 1
VariantInit(&vargs[n])
switch vv := v.(type) {
case bool:
if vv {
vargs[n] = NewVariant(VT_BOOL, 0xffff)
} else {
vargs[n] = NewVariant(VT_BOOL, 0)
}
case *bool:
vargs[n] = NewVariant(VT_BOOL|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*bool)))))
case uint8:
vargs[n] = NewVariant(VT_I1, int64(v.(uint8)))
case *uint8:
vargs[n] = NewVariant(VT_I1|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint8)))))
case int8:
vargs[n] = NewVariant(VT_I1, int64(v.(int8)))
case *int8:
vargs[n] = NewVariant(VT_I1|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint8)))))
case int16:
vargs[n] = NewVariant(VT_I2, int64(v.(int16)))
case *int16:
vargs[n] = NewVariant(VT_I2|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int16)))))
case uint16:
vargs[n] = NewVariant(VT_UI2, int64(v.(uint16)))
case *uint16:
vargs[n] = NewVariant(VT_UI2|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint16)))))
case int32:
vargs[n] = NewVariant(VT_I4, int64(v.(int32)))
case *int32:
vargs[n] = NewVariant(VT_I4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int32)))))
case uint32:
vargs[n] = NewVariant(VT_UI4, int64(v.(uint32)))
case *uint32:
vargs[n] = NewVariant(VT_UI4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint32)))))
case int64:
vargs[n] = NewVariant(VT_I8, int64(v.(int64)))
case *int64:
vargs[n] = NewVariant(VT_I8|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int64)))))
case uint64:
vargs[n] = NewVariant(VT_UI8, int64(uintptr(v.(uint64))))
case *uint64:
vargs[n] = NewVariant(VT_UI8|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint64)))))
case int:
vargs[n] = NewVariant(VT_I4, int64(v.(int)))
case *int:
vargs[n] = NewVariant(VT_I4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int)))))
case uint:
vargs[n] = NewVariant(VT_UI4, int64(v.(uint)))
case *uint:
vargs[n] = NewVariant(VT_UI4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint)))))
case float32:
vargs[n] = NewVariant(VT_R4, *(*int64)(unsafe.Pointer(&vv)))
case *float32:
vargs[n] = NewVariant(VT_R4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*float32)))))
case float64:
vargs[n] = NewVariant(VT_R8, *(*int64)(unsafe.Pointer(&vv)))
case *float64:
vargs[n] = NewVariant(VT_R8|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*float64)))))
case string:
vargs[n] = NewVariant(VT_BSTR, int64(uintptr(unsafe.Pointer(SysAllocStringLen(v.(string))))))
case *string:
vargs[n] = NewVariant(VT_BSTR|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*string)))))
case time.Time:
s := vv.Format("2006-01-02 15:04:05")
vargs[n] = NewVariant(VT_BSTR, int64(uintptr(unsafe.Pointer(SysAllocStringLen(s)))))
case *time.Time:
s := vv.Format("2006-01-02 15:04:05")
vargs[n] = NewVariant(VT_BSTR|VT_BYREF, int64(uintptr(unsafe.Pointer(&s))))
case *IDispatch:
vargs[n] = NewVariant(VT_DISPATCH, int64(uintptr(unsafe.Pointer(v.(*IDispatch)))))
case **IDispatch:
vargs[n] = NewVariant(VT_DISPATCH|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(**IDispatch)))))
case nil:
vargs[n] = NewVariant(VT_NULL, 0)
case *VARIANT:
vargs[n] = NewVariant(VT_VARIANT|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*VARIANT)))))
case []byte:
safeByteArray := safeArrayFromByteSlice(v.([]byte))
vargs[n] = NewVariant(VT_ARRAY|VT_UI1, int64(uintptr(unsafe.Pointer(safeByteArray))))
defer VariantClear(&vargs[n])
case []string:
safeByteArray := safeArrayFromStringSlice(v.([]string))
vargs[n] = NewVariant(VT_ARRAY|VT_BSTR, int64(uintptr(unsafe.Pointer(safeByteArray))))
defer VariantClear(&vargs[n])
default:
panic("unknown type")
}
}
dispparams.rgvarg = uintptr(unsafe.Pointer(&vargs[0]))
dispparams.cArgs = uint32(len(params))
}
result = new(VARIANT)
var excepInfo EXCEPINFO
VariantInit(result)
hr, _, _ := syscall.Syscall9(
disp.VTable().Invoke,
9,
uintptr(unsafe.Pointer(disp)),
uintptr(dispid),
uintptr(unsafe.Pointer(IID_NULL)),
uintptr(GetUserDefaultLCID()),
uintptr(dispatch),
uintptr(unsafe.Pointer(&dispparams)),
uintptr(unsafe.Pointer(result)),
uintptr(unsafe.Pointer(&excepInfo)),
0)
if hr != 0 {
err = NewErrorWithSubError(hr, BstrToString(excepInfo.bstrDescription), excepInfo)
}
for i, varg := range vargs {
n := len(params) - i - 1
if varg.VT == VT_BSTR && varg.Val != 0 {
SysFreeString(((*int16)(unsafe.Pointer(uintptr(varg.Val)))))
}
if varg.VT == (VT_BSTR|VT_BYREF) && varg.Val != 0 {
*(params[n].(*string)) = LpOleStrToString(*(**uint16)(unsafe.Pointer(uintptr(varg.Val))))
}
}
return
}
================================================
FILE: vendor/github.com/go-ole/go-ole/ienumvariant.go
================================================
package ole
import "unsafe"
type IEnumVARIANT struct {
IUnknown
}
type IEnumVARIANTVtbl struct {
IUnknownVtbl
Next uintptr
Skip uintptr
Reset uintptr
Clone uintptr
}
func (v *IEnumVARIANT) VTable() *IEnumVARIANTVtbl {
return (*IEnumVARIANTVtbl)(unsafe.Pointer(v.RawVTable))
}
================================================
FILE: vendor/github.com/go-ole/go-ole/ienumvariant_func.go
================================================
// +build !windows
package ole
func (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error) {
return nil, NewError(E_NOTIMPL)
}
func (enum *IEnumVARIANT) Reset() error {
return NewError(E_NOTIMPL)
}
func (enum *IEnumVARIANT) Skip(celt uint) error {
return NewError(E_NOTIMPL)
}
func (enum *IEnumVARIANT) Next(celt uint) (VARIANT, uint, error) {
return NewVariant(VT_NULL, int64(0)), 0, NewError(E_NOTIMPL)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/ienumvariant_windows.go
================================================
// +build windows
package ole
import (
"syscall"
"unsafe"
)
func (enum *IEnumVARIANT) Clone() (cloned *IEnumVARIANT, err error) {
hr, _, _ := syscall.Syscall(
enum.VTable().Clone,
2,
uintptr(unsafe.Pointer(enum)),
uintptr(unsafe.Pointer(&cloned)),
0)
if hr != 0 {
err = NewError(hr)
}
return
}
func (enum *IEnumVARIANT) Reset() (err error) {
hr, _, _ := syscall.Syscall(
enum.VTable().Reset,
1,
uintptr(unsafe.Pointer(enum)),
0,
0)
if hr != 0 {
err = NewError(hr)
}
return
}
func (enum *IEnumVARIANT) Skip(celt uint) (err error) {
hr, _, _ := syscall.Syscall(
enum.VTable().Skip,
2,
uintptr(unsafe.Pointer(enum)),
uintptr(celt),
0)
if hr != 0 {
err = NewError(hr)
}
return
}
func (enum *IEnumVARIANT) Next(celt uint) (array VARIANT, length uint, err error) {
hr, _, _ := syscall.Syscall6(
enum.VTable().Next,
4,
uintptr(unsafe.Pointer(enum)),
uintptr(celt),
uintptr(unsafe.Pointer(&array)),
uintptr(unsafe.Pointer(&length)),
0,
0)
if hr != 0 {
err = NewError(hr)
}
return
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iinspectable.go
================================================
package ole
import "unsafe"
type IInspectable struct {
IUnknown
}
type IInspectableVtbl struct {
IUnknownVtbl
GetIIds uintptr
GetRuntimeClassName uintptr
GetTrustLevel uintptr
}
func (v *IInspectable) VTable() *IInspectableVtbl {
return (*IInspectableVtbl)(unsafe.Pointer(v.RawVTable))
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iinspectable_func.go
================================================
// +build !windows
package ole
func (v *IInspectable) GetIids() ([]*GUID, error) {
return []*GUID{}, NewError(E_NOTIMPL)
}
func (v *IInspectable) GetRuntimeClassName() (string, error) {
return "", NewError(E_NOTIMPL)
}
func (v *IInspectable) GetTrustLevel() (uint32, error) {
return uint32(0), NewError(E_NOTIMPL)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iinspectable_windows.go
================================================
// +build windows
package ole
import (
"bytes"
"encoding/binary"
"reflect"
"syscall"
"unsafe"
)
func (v *IInspectable) GetIids() (iids []*GUID, err error) {
var count uint32
var array uintptr
hr, _, _ := syscall.Syscall(
v.VTable().GetIIds,
3,
uintptr(unsafe.Pointer(v)),
uintptr(unsafe.Pointer(&count)),
uintptr(unsafe.Pointer(&array)))
if hr != 0 {
err = NewError(hr)
return
}
defer CoTaskMemFree(array)
iids = make([]*GUID, count)
byteCount := count * uint32(unsafe.Sizeof(GUID{}))
slicehdr := reflect.SliceHeader{Data: array, Len: int(byteCount), Cap: int(byteCount)}
byteSlice := *(*[]byte)(unsafe.Pointer(&slicehdr))
reader := bytes.NewReader(byteSlice)
for i := range iids {
guid := GUID{}
err = binary.Read(reader, binary.LittleEndian, &guid)
if err != nil {
return
}
iids[i] = &guid
}
return
}
func (v *IInspectable) GetRuntimeClassName() (s string, err error) {
var hstring HString
hr, _, _ := syscall.Syscall(
v.VTable().GetRuntimeClassName,
2,
uintptr(unsafe.Pointer(v)),
uintptr(unsafe.Pointer(&hstring)),
0)
if hr != 0 {
err = NewError(hr)
return
}
s = hstring.String()
DeleteHString(hstring)
return
}
func (v *IInspectable) GetTrustLevel() (level uint32, err error) {
hr, _, _ := syscall.Syscall(
v.VTable().GetTrustLevel,
2,
uintptr(unsafe.Pointer(v)),
uintptr(unsafe.Pointer(&level)),
0)
if hr != 0 {
err = NewError(hr)
}
return
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iprovideclassinfo.go
================================================
package ole
import "unsafe"
type IProvideClassInfo struct {
IUnknown
}
type IProvideClassInfoVtbl struct {
IUnknownVtbl
GetClassInfo uintptr
}
func (v *IProvideClassInfo) VTable() *IProvideClassInfoVtbl {
return (*IProvideClassInfoVtbl)(unsafe.Pointer(v.RawVTable))
}
func (v *IProvideClassInfo) GetClassInfo() (cinfo *ITypeInfo, err error) {
cinfo, err = getClassInfo(v)
return
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go
================================================
// +build !windows
package ole
func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) {
return nil, NewError(E_NOTIMPL)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go
================================================
// +build windows
package ole
import (
"syscall"
"unsafe"
)
func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) {
hr, _, _ := syscall.Syscall(
disp.VTable().GetClassInfo,
2,
uintptr(unsafe.Pointer(disp)),
uintptr(unsafe.Pointer(&tinfo)),
0)
if hr != 0 {
err = NewError(hr)
}
return
}
================================================
FILE: vendor/github.com/go-ole/go-ole/itypeinfo.go
================================================
package ole
import "unsafe"
type ITypeInfo struct {
IUnknown
}
type ITypeInfoVtbl struct {
IUnknownVtbl
GetTypeAttr uintptr
GetTypeComp uintptr
GetFuncDesc uintptr
GetVarDesc uintptr
GetNames uintptr
GetRefTypeOfImplType uintptr
GetImplTypeFlags uintptr
GetIDsOfNames uintptr
Invoke uintptr
GetDocumentation uintptr
GetDllEntry uintptr
GetRefTypeInfo uintptr
AddressOfMember uintptr
CreateInstance uintptr
GetMops uintptr
GetContainingTypeLib uintptr
ReleaseTypeAttr uintptr
ReleaseFuncDesc uintptr
ReleaseVarDesc uintptr
}
func (v *ITypeInfo) VTable() *ITypeInfoVtbl {
return (*ITypeInfoVtbl)(unsafe.Pointer(v.RawVTable))
}
================================================
FILE: vendor/github.com/go-ole/go-ole/itypeinfo_func.go
================================================
// +build !windows
package ole
func (v *ITypeInfo) GetTypeAttr() (*TYPEATTR, error) {
return nil, NewError(E_NOTIMPL)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/itypeinfo_windows.go
================================================
// +build windows
package ole
import (
"syscall"
"unsafe"
)
func (v *ITypeInfo) GetTypeAttr() (tattr *TYPEATTR, err error) {
hr, _, _ := syscall.Syscall(
uintptr(v.VTable().GetTypeAttr),
2,
uintptr(unsafe.Pointer(v)),
uintptr(unsafe.Pointer(&tattr)),
0)
if hr != 0 {
err = NewError(hr)
}
return
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iunknown.go
================================================
package ole
import "unsafe"
type IUnknown struct {
RawVTable *interface{}
}
type IUnknownVtbl struct {
QueryInterface uintptr
AddRef uintptr
Release uintptr
}
type UnknownLike interface {
QueryInterface(iid *GUID) (disp *IDispatch, err error)
AddRef() int32
Release() int32
}
func (v *IUnknown) VTable() *IUnknownVtbl {
return (*IUnknownVtbl)(unsafe.Pointer(v.RawVTable))
}
func (v *IUnknown) PutQueryInterface(interfaceID *GUID, obj interface{}) error {
return reflectQueryInterface(v, v.VTable().QueryInterface, interfaceID, obj)
}
func (v *IUnknown) IDispatch(interfaceID *GUID) (dispatch *IDispatch, err error) {
err = v.PutQueryInterface(interfaceID, &dispatch)
return
}
func (v *IUnknown) IEnumVARIANT(interfaceID *GUID) (enum *IEnumVARIANT, err error) {
err = v.PutQueryInterface(interfaceID, &enum)
return
}
func (v *IUnknown) QueryInterface(iid *GUID) (*IDispatch, error) {
return queryInterface(v, iid)
}
func (v *IUnknown) MustQueryInterface(iid *GUID) (disp *IDispatch) {
unk, err := queryInterface(v, iid)
if err != nil {
panic(err)
}
return unk
}
func (v *IUnknown) AddRef() int32 {
return addRef(v)
}
func (v *IUnknown) Release() int32 {
return release(v)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iunknown_func.go
================================================
// +build !windows
package ole
func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) {
return NewError(E_NOTIMPL)
}
func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) {
return nil, NewError(E_NOTIMPL)
}
func addRef(unk *IUnknown) int32 {
return 0
}
func release(unk *IUnknown) int32 {
return 0
}
================================================
FILE: vendor/github.com/go-ole/go-ole/iunknown_windows.go
================================================
// +build windows
package ole
import (
"reflect"
"syscall"
"unsafe"
)
func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) {
selfValue := reflect.ValueOf(self).Elem()
objValue := reflect.ValueOf(obj).Elem()
hr, _, _ := syscall.Syscall(
method,
3,
selfValue.UnsafeAddr(),
uintptr(unsafe.Pointer(interfaceID)),
objValue.Addr().Pointer())
if hr != 0 {
err = NewError(hr)
}
return
}
func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) {
hr, _, _ := syscall.Syscall(
unk.VTable().QueryInterface,
3,
uintptr(unsafe.Pointer(unk)),
uintptr(unsafe.Pointer(iid)),
uintptr(unsafe.Pointer(&disp)))
if hr != 0 {
err = NewError(hr)
}
return
}
func addRef(unk *IUnknown) int32 {
ret, _, _ := syscall.Syscall(
unk.VTable().AddRef,
1,
uintptr(unsafe.Pointer(unk)),
0,
0)
return int32(ret)
}
func release(unk *IUnknown) int32 {
ret, _, _ := syscall.Syscall(
unk.VTable().Release,
1,
uintptr(unsafe.Pointer(unk)),
0,
0)
return int32(ret)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/ole.go
================================================
package ole
import (
"fmt"
"strings"
)
// DISPPARAMS are the arguments that passed to methods or property.
type DISPPARAMS struct {
rgvarg uintptr
rgdispidNamedArgs uintptr
cArgs uint32
cNamedArgs uint32
}
// EXCEPINFO defines exception info.
type EXCEPINFO struct {
wCode uint16
wReserved uint16
bstrSource *uint16
bstrDescription *uint16
bstrHelpFile *uint16
dwHelpContext uint32
pvReserved uintptr
pfnDeferredFillIn uintptr
scode uint32
}
// String convert EXCEPINFO to string.
func (e EXCEPINFO) String() string {
var src, desc, hlp string
if e.bstrSource == nil {
src = "<nil>"
} else {
src = BstrToString(e.bstrSource)
}
if e.bstrDescription == nil {
desc = "<nil>"
} else {
desc = BstrToString(e.bstrDescription)
}
if e.bstrHelpFile == nil {
hlp = "<nil>"
} else {
hlp = BstrToString(e.bstrHelpFile)
}
return fmt.Sprintf(
"wCode: %#x, bstrSource: %v, bstrDescription: %v, bstrHelpFile: %v, dwHelpContext: %#x, scode: %#x",
e.wCode, src, desc, hlp, e.dwHelpContext, e.scode,
)
}
// Error implements error interface and returns error string.
func (e EXCEPINFO) Error() string {
if e.bstrDescription != nil {
return strings.TrimSpace(BstrToString(e.bstrDescription))
}
src := "Unknown"
if e.bstrSource != nil {
src = BstrToString(e.bstrSource)
}
code := e.scode
if e.wCode != 0 {
code = uint32(e.wCode)
}
return fmt.Sprintf("%v: %#x", src, code)
}
// PARAMDATA defines parameter data type.
type PARAMDATA struct {
Name *int16
Vt uint16
}
// METHODDATA defines method info.
type METHODDATA struct {
Name *uint16
Data *PARAMDATA
Dispid int32
Meth uint32
CC int32
CArgs uint32
Flags uint16
VtReturn uint32
}
// INTERFACEDATA defines interface info.
type INTERFACEDATA struct {
MethodData *METHODDATA
CMembers uint32
}
// Point is 2D vector type.
type Point struct {
X int32
Y int32
}
// Msg is message between processes.
type Msg struct {
Hwnd uint32
Message uint32
Wparam int32
Lparam int32
Time uint32
Pt Point
}
// TYPEDESC defines data type.
type TYPEDESC struct {
Hreftype uint32
VT uint16
}
// IDLDESC defines IDL info.
type IDLDESC struct {
DwReserved uint32
WIDLFlags uint16
}
// TYPEATTR defines type info.
type TYPEATTR struct {
Guid GUID
Lcid uint32
dwReserved uint32
MemidConstructor int32
MemidDestructor int32
LpstrSchema *uint16
CbSizeInstance uint32
Typekind int32
CFuncs uint16
CVars uint16
CImplTypes uint16
CbSizeVft uint16
CbAlignment uint16
WTypeFlags uint16
WMajorVerNum uint16
WMinorVerNum uint16
TdescAlias TYPEDESC
IdldescType IDLDESC
}
================================================
FILE: vendor/github.com/go-ole/go-ole/oleutil/connection.go
================================================
// +build windows
package oleutil
import (
"reflect"
"unsafe"
ole "github.com/go-ole/go-ole"
)
type stdDispatch struct {
lpVtbl *stdDispatchVtbl
ref int32
iid *ole.GUID
iface interface{}
funcMap map[string]int32
}
type stdDispatchVtbl struct {
pQueryInterface uintptr
pAddRef uintptr
pRelease uintptr
pGetTypeInfoCount uintptr
pGetTypeInfo uintptr
pGetIDsOfNames uintptr
pInvoke uintptr
}
func dispQueryInterface(this *ole.IUnknown, iid *ole.GUID, punk **ole.IUnknown) uint32 {
pthis := (*stdDispatch)(unsafe.Pointer(this))
*punk = nil
if ole.IsEqualGUID(iid, ole.IID_IUnknown) ||
ole.IsEqualGUID(iid, ole.IID_IDispatch) {
dispAddRef(this)
*punk = this
return ole.S_OK
}
if ole.IsEqualGUID(iid, pthis.iid) {
dispAddRef(this)
*punk = this
return ole.S_OK
}
return ole.E_NOINTERFACE
}
func dispAddRef(this *ole.IUnknown) int32 {
pthis := (*stdDispatch)(unsafe.Pointer(this))
pthis.ref++
return pthis.ref
}
func dispRelease(this *ole.IUnknown) int32 {
pthis := (*stdDispatch)(unsafe.Pointer(this))
pthis.ref--
return pthis.ref
}
func dispGetIDsOfNames(this *ole.IUnknown, iid *ole.GUID, wnames []*uint16, namelen int, lcid int, pdisp []int32) uintptr {
pthis := (*stdDispatch)(unsafe.Pointer(this))
names := make([]string, len(wnames))
for i := 0; i < len(names); i++ {
names[i] = ole.LpOleStrToString(wnames[i])
}
for n := 0; n < namelen; n++ {
if id, ok := pthis.funcMap[names[n]]; ok {
pdisp[n] = id
}
}
return ole.S_OK
}
func dispGetTypeInfoCount(pcount *int) uintptr {
if pcount != nil {
*pcount = 0
}
return ole.S_OK
}
func dispGetTypeInfo(ptypeif *uintptr) uintptr {
return ole.E_NOTIMPL
}
func dispInvoke(this *ole.IDispatch, dispid int32, riid *ole.GUID, lcid int, flags int16, dispparams *ole.DISPPARAMS, result *ole.VARIANT, pexcepinfo *ole.EXCEPINFO, nerr *uint) uintptr {
pthis := (*stdDispatch)(unsafe.Pointer(this))
found := ""
for name, id := range pthis.funcMap {
if id == dispid {
found = name
}
}
if found != "" {
rv := reflect.ValueOf(pthis.iface).Elem()
rm := rv.MethodByName(found)
rr := rm.Call([]reflect.Value{})
println(len(rr))
return ole.S_OK
}
return ole.E_NOTIMPL
}
================================================
FILE: vendor/github.com/go-ole/go-ole/oleutil/connection_func.go
================================================
// +build !windows
package oleutil
import ole "github.com/go-ole/go-ole"
// ConnectObject creates a connection point between two services for communication.
func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (uint32, error) {
return 0, ole.NewError(ole.E_NOTIMPL)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/oleutil/connection_windows.go
================================================
// +build windows
package oleutil
import (
"reflect"
"syscall"
"unsafe"
ole "github.com/go-ole/go-ole"
)
// ConnectObject creates a connection point between two services for communication.
func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (cookie uint32, err error) {
unknown, err := disp.QueryInterface(ole.IID_IConnectionPointContainer)
if err != nil {
return
}
container := (*ole.IConnectionPointContainer)(unsafe.Pointer(unknown))
var point *ole.IConnectionPoint
err = container.FindConnectionPoint(iid, &point)
if err != nil {
return
}
if edisp, ok := idisp.(*ole.IUnknown); ok {
cookie, err = point.Advise(edisp)
container.Release()
if err != nil {
return
}
}
rv := reflect.ValueOf(disp).Elem()
if rv.Type().Kind() == reflect.Struct {
dest := &stdDispatch{}
dest.lpVtbl = &stdDispatchVtbl{}
dest.lpVtbl.pQueryInterface = syscall.NewCallback(dispQueryInterface)
dest.lpVtbl.pAddRef = syscall.NewCallback(dispAddRef)
dest.lpVtbl.pRelease = syscall.NewCallback(dispRelease)
dest.lpVtbl.pGetTypeInfoCount = syscall.NewCallback(dispGetTypeInfoCount)
dest.lpVtbl.pGetTypeInfo = syscall.NewCallback(dispGetTypeInfo)
dest.lpVtbl.pGetIDsOfNames = syscall.NewCallback(dispGetIDsOfNames)
dest.lpVtbl.pInvoke = syscall.NewCallback(dispInvoke)
dest.iface = disp
dest.iid = iid
cookie, err = point.Advise((*ole.IUnknown)(unsafe.Pointer(dest)))
container.Release()
if err != nil {
point.Release()
return
}
}
container.Release()
return 0, ole.NewError(ole.E_INVALIDARG)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/oleutil/go-get.go
================================================
// This file is here so go get succeeds as without it errors with:
// no buildable Go source files in ...
//
// +build !windows
package oleutil
================================================
FILE: vendor/github.com/go-ole/go-ole/oleutil/oleutil.go
================================================
package oleutil
import ole "github.com/go-ole/go-ole"
// ClassIDFrom retrieves class ID whether given is program ID or application string.
func ClassIDFrom(programID string) (classID *ole.GUID, err error) {
return ole.ClassIDFrom(programID)
}
// CreateObject creates object from programID based on interface type.
//
// Only supports IUnknown.
//
// Program ID can be either program ID or application string.
func CreateObject(programID string) (unknown *ole.IUnknown, err error) {
classID, err := ole.ClassIDFrom(programID)
if err != nil {
return
}
unknown, err = ole.CreateInstance(classID, ole.IID_IUnknown)
if err != nil {
return
}
return
}
// GetActiveObject retrieves active object for program ID and interface ID based
// on interface type.
//
// Only supports IUnknown.
//
// Program ID can be either program ID or application string.
func GetActiveObject(programID string) (unknown *ole.IUnknown, err error) {
classID, err := ole.ClassIDFrom(programID)
if err != nil {
return
}
unknown, err = ole.GetActiveObject(classID, ole.IID_IUnknown)
if err != nil {
return
}
return
}
// CallMethod calls method on IDispatch with parameters.
func CallMethod(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) {
return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_METHOD, params)
}
// MustCallMethod calls method on IDispatch with parameters or panics.
func MustCallMethod(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) {
r, err := CallMethod(disp, name, params...)
if err != nil {
panic(err.Error())
}
return r
}
// GetProperty retrieves property from IDispatch.
func GetProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) {
return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYGET, params)
}
// MustGetProperty retrieves property from IDispatch or panics.
func MustGetProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) {
r, err := GetProperty(disp, name, params...)
if err != nil {
panic(err.Error())
}
return r
}
// PutProperty mutates property.
func PutProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) {
return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYPUT, params)
}
// MustPutProperty mutates property or panics.
func MustPutProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) {
r, err := PutProperty(disp, name, params...)
if err != nil {
panic(err.Error())
}
return r
}
================================================
FILE: vendor/github.com/go-ole/go-ole/safearray.go
================================================
// Package is meant to retrieve and process safe array data returned from COM.
package ole
// SafeArrayBound defines the SafeArray boundaries.
type SafeArrayBound struct {
Elements uint32
LowerBound int32
}
// SafeArray is how COM handles arrays.
type SafeArray struct {
Dimensions uint16
FeaturesFlag uint16
ElementsSize uint32
LocksAmount uint32
Data uint32
Bounds [16]byte
}
// SAFEARRAY is obsolete, exists for backwards compatibility.
// Use SafeArray
type SAFEARRAY SafeArray
// SAFEARRAYBOUND is obsolete, exists for backwards compatibility.
// Use SafeArrayBound
type SAFEARRAYBOUND SafeArrayBound
================================================
FILE: vendor/github.com/go-ole/go-ole/safearray_func.go
================================================
// +build !windows
package ole
import (
"unsafe"
)
// safeArrayAccessData returns raw array pointer.
//
// AKA: SafeArrayAccessData in Windows API.
func safeArrayAccessData(safearray *SafeArray) (uintptr, error) {
return uintptr(0), NewError(E_NOTIMPL)
}
// safeArrayUnaccessData releases raw array.
//
// AKA: SafeArrayUnaccessData in Windows API.
func safeArrayUnaccessData(safearray *SafeArray) error {
return NewError(E_NOTIMPL)
}
// safeArrayAllocData allocates SafeArray.
//
// AKA: SafeArrayAllocData in Windows API.
func safeArrayAllocData(safearray *SafeArray) error {
return NewError(E_NOTIMPL)
}
// safeArrayAllocDescriptor allocates SafeArray.
//
// AKA: SafeArrayAllocDescriptor in Windows API.
func safeArrayAllocDescriptor(dimensions uint32) (*SafeArray, error) {
return nil, NewError(E_NOTIMPL)
}
// safeArrayAllocDescriptorEx allocates SafeArray.
//
// AKA: SafeArrayAllocDescriptorEx in Windows API.
func safeArrayAllocDescriptorEx(variantType VT, dimensions uint32) (*SafeArray, error) {
return nil, NewError(E_NOTIMPL)
}
// safeArrayCopy returns copy of SafeArray.
//
// AKA: SafeArrayCopy in Windows API.
func safeArrayCopy(original *SafeArray) (*SafeArray, error) {
return nil, NewError(E_NOTIMPL)
}
// safeArrayCopyData duplicates SafeArray into another SafeArray object.
//
// AKA: SafeArrayCopyData in Windows API.
func safeArrayCopyData(original *SafeArray, duplicate *SafeArray) error {
return NewError(E_NOTIMPL)
}
// safeArrayCreate creates SafeArray.
//
// AKA: SafeArrayCreate in Windows API.
func safeArrayCreate(variantType VT, dimensions uint32, bounds *SafeArrayBound) (*SafeArray, error) {
return nil, NewError(E_NOTIMPL)
}
// safeArrayCreateEx creates SafeArray.
//
// AKA: SafeArrayCreateEx in Windows API.
func safeArrayCreateEx(variantType VT, dimensions uint32, bounds *SafeArrayBound, extra uintptr) (*SafeArray, error) {
return nil, NewError(E_NOTIMPL)
}
// safeArrayCreateVector creates SafeArray.
//
// AKA: SafeArrayCreateVector in Windows API.
func safeArrayCreateVector(variantType VT, lowerBound int32, length uint32) (*SafeArray, error) {
return nil, NewError(E_NOTIMPL)
}
// safeArrayCreateVectorEx creates SafeArray.
//
// AKA: SafeArrayCreateVectorEx in Windows API.
func safeArrayCreateVectorEx(variantType VT, lowerBound int32, length uint32, extra uintptr) (*SafeArray, error) {
return nil, NewError(E_NOTIMPL)
}
// safeArrayDestroy destroys SafeArray object.
//
// AKA: SafeArrayDestroy in Windows API.
func safeArrayDestroy(safearray *SafeArray) error {
return NewError(E_NOTIMPL)
}
// safeArrayDestroyData destroys SafeArray object.
//
// AKA: SafeArrayDestroyData in Windows API.
func safeArrayDestroyData(safearray *SafeArray) error {
return NewError(E_NOTIMPL)
}
// safeArrayDestroyDescriptor destroys SafeArray object.
//
// AKA: SafeArrayDestroyDescriptor in Windows API.
func safeArrayDestroyDescriptor(safearray *SafeArray) error {
return NewError(E_NOTIMPL)
}
// safeArrayGetDim is the amount of dimensions in the SafeArray.
//
// SafeArrays may have multiple dimensions. Meaning, it could be
// multidimensional array.
//
// AKA: SafeArrayGetDim in Windows API.
func safeArrayGetDim(safearray *SafeArray) (*uint32, error) {
u := uint32(0)
return &u, NewError(E_NOTIMPL)
}
// safeArrayGetElementSize is the element size in bytes.
//
// AKA: SafeArrayGetElemsize in Windows API.
func safeArrayGetElementSize(safearray *SafeArray) (*uint32, error) {
u := uint32(0)
return &u, NewError(E_NOTIMPL)
}
// safeArrayGetElement retrieves element at given index.
func safeArrayGetElement(safearray *SafeArray, index int64, pv unsafe.Pointer) error {
return NewError(E_NOTIMPL)
}
// safeArrayGetElement retrieves element at given index and converts to string.
func safeArrayGetElementString(safearray *SafeArray, index int64) (string, error) {
return "", NewError(E_NOTIMPL)
}
// safeArrayGetIID is the InterfaceID of the elements in the SafeArray.
//
// AKA: SafeArrayGetIID in Windows API.
func safeArrayGetIID(safearray *SafeArray) (*GUID, error) {
return nil, NewError(E_NOTIMPL)
}
// safeArrayGetLBound returns lower bounds of SafeArray.
//
// SafeArrays may have multiple dimensions. Meaning, it could be
// multidimensional array.
//
// AKA: SafeArrayGetLBound in Windows API.
func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (int64, error) {
return int64(0), NewError(E_NOTIMPL)
}
// safeArrayGetUBound returns upper bounds of SafeArray.
//
// SafeArrays may have multiple dimensions. Meaning, it could be
// multidimensional array.
//
// AKA: SafeArrayGetUBound in Windows API.
func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (int64, error) {
return int64(0), NewError(E_NOTIMPL)
}
// safeArrayGetVartype returns data type of SafeArray.
//
// AKA: SafeArrayGetVartype in Windows API.
func safeArrayGetVartype(safearray *SafeArray) (uint16, error) {
return uint16(0), NewError(E_NOTIMPL)
}
// safeArrayLock locks SafeArray for reading to modify SafeArray.
//
// This must be called during some calls to ensure that another process does not
// read or write to the SafeArray during editing.
//
// AKA: SafeArrayLock in Windows API.
func safeArrayLock(safearray *SafeArray) error {
return NewError(E_NOTIMPL)
}
// safeArrayUnlock unlocks SafeArray for reading.
//
// AKA: SafeArrayUnlock in Windows API.
func safeArrayUnlock(safearray *SafeArray) error {
return NewError(E_NOTIMPL)
}
// safeArrayPutElement stores the data element at the specified location in the
// array.
//
// AKA: SafeArrayPutElement in Windows API.
func safeArrayPutElement(safearray *SafeArray, index int64, element uintptr) error {
return NewError(E_NOTIMPL)
}
// safeArrayGetRecordInfo accesses IRecordInfo info for custom types.
//
// AKA: SafeArrayGetRecordInfo in Windows API.
//
// XXX: Must implement IRecordInfo interface for this to return.
func safeArrayGetRecordInfo(safearray *SafeArray) (interface{}, error) {
return nil, NewError(E_NOTIMPL)
}
// safeArraySetRecordInfo mutates IRecordInfo info for custom types.
//
// AKA: SafeArraySetRecordInfo in Windows API.
//
// XXX: Must implement IRecordInfo interface for this to return.
func safeArraySetRecordInfo(safearray *SafeArray, recordInfo interface{}) error {
return NewError(E_NOTIMPL)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/safearray_windows.go
================================================
// +build windows
package ole
import (
"unsafe"
)
var (
procSafeArrayAccessData, _ = modoleaut32.FindProc("SafeArrayAccessData")
procSafeArrayAllocData, _ = modoleaut32.FindProc("SafeArrayAllocData")
procSafeArrayAllocDescriptor, _ = modoleaut32.FindProc("SafeArrayAllocDescriptor")
procSafeArrayAllocDescriptorEx, _ = modoleaut32.FindProc("SafeArrayAllocDescriptorEx")
procSafeArrayCopy, _ = modoleaut32.FindProc("SafeArrayCopy")
procSafeArrayCopyData, _ = modoleaut32.FindProc("SafeArrayCopyData")
procSafeArrayCreate, _ = modoleaut32.FindProc("SafeArrayCreate")
procSafeArrayCreateEx, _ = modoleaut32.FindProc("SafeArrayCreateEx")
procSafeArrayCreateVector, _ = modoleaut32.FindProc("SafeArrayCreateVector")
procSafeArrayCreateVectorEx, _ = modoleaut32.FindProc("SafeArrayCreateVectorEx")
procSafeArrayDestroy, _ = modoleaut32.FindProc("SafeArrayDestroy")
procSafeArrayDestroyData, _ = modoleaut32.FindProc("SafeArrayDestroyData")
procSafeArrayDestroyDescriptor, _ = modoleaut32.FindProc("SafeArrayDestroyDescriptor")
procSafeArrayGetDim, _ = modoleaut32.FindProc("SafeArrayGetDim")
procSafeArrayGetElement, _ = modoleaut32.FindProc("SafeArrayGetElement")
procSafeArrayGetElemsize, _ = modoleaut32.FindProc("SafeArrayGetElemsize")
procSafeArrayGetIID, _ = modoleaut32.FindProc("SafeArrayGetIID")
procSafeArrayGetLBound, _ = modoleaut32.FindProc("SafeArrayGetLBound")
procSafeArrayGetUBound, _ = modoleaut32.FindProc("SafeArrayGetUBound")
procSafeArrayGetVartype, _ = modoleaut32.FindProc("SafeArrayGetVartype")
procSafeArrayLock, _ = modoleaut32.FindProc("SafeArrayLock")
procSafeArrayPtrOfIndex, _ = modoleaut32.FindProc("SafeArrayPtrOfIndex")
procSafeArrayUnaccessData, _ = modoleaut32.FindProc("SafeArrayUnaccessData")
procSafeArrayUnlock, _ = modoleaut32.FindProc("SafeArrayUnlock")
procSafeArrayPutElement, _ = modoleaut32.FindProc("SafeArrayPutElement")
//procSafeArrayRedim, _ = modoleaut32.FindProc("SafeArrayRedim") // TODO
//procSafeArraySetIID, _ = modoleaut32.FindProc("SafeArraySetIID") // TODO
procSafeArrayGetRecordInfo, _ = modoleaut32.FindProc("SafeArrayGetRecordInfo")
procSafeArraySetRecordInfo, _ = modoleaut32.FindProc("SafeArraySetRecordInfo")
)
// safeArrayAccessData returns raw array pointer.
//
// AKA: SafeArrayAccessData in Windows API.
// Todo: Test
func safeArrayAccessData(safearray *SafeArray) (element uintptr, err error) {
err = convertHresultToError(
procSafeArrayAccessData.Call(
uintptr(unsafe.Pointer(safearray)),
uintptr(unsafe.Pointer(&element))))
return
}
// safeArrayUnaccessData releases raw array.
//
// AKA: SafeArrayUnaccessData in Windows API.
func safeArrayUnaccessData(safearray *SafeArray) (err error) {
err = convertHresultToError(procSafeArrayUnaccessData.Call(uintptr(unsafe.Pointer(safearray))))
return
}
// safeArrayAllocData allocates SafeArray.
//
// AKA: SafeArrayAllocData in Windows API.
func safeArrayAllocData(safearray *SafeArray) (err error) {
err = convertHresultToError(procSafeArrayAllocData.Call(uintptr(unsafe.Pointer(safearray))))
return
}
// safeArrayAllocDescriptor allocates SafeArray.
//
// AKA: SafeArrayAllocDescriptor in Windows API.
func safeArrayAllocDescriptor(dimensions uint32) (safearray *SafeArray, err error) {
err = convertHresultToError(
procSafeArrayAllocDescriptor.Call(uintptr(dimensions), uintptr(unsafe.Pointer(&safearray))))
return
}
// safeArrayAllocDescriptorEx allocates SafeArray.
//
// AKA: SafeArrayAllocDescriptorEx in Windows API.
func safeArrayAllocDescriptorEx(variantType VT, dimensions uint32) (safearray *SafeArray, err error) {
err = convertHresultToError(
procSafeArrayAllocDescriptorEx.Call(
uintptr(variantType),
uintptr(dimensions),
uintptr(unsafe.Pointer(&safearray))))
return
}
// safeArrayCopy returns copy of SafeArray.
//
// AKA: SafeArrayCopy in Windows API.
func safeArrayCopy(original *SafeArray) (safearray *SafeArray, err error) {
err = convertHresultToError(
procSafeArrayCopy.Call(
uintptr(unsafe.Pointer(original)),
uintptr(unsafe.Pointer(&safearray))))
return
}
// safeArrayCopyData duplicates SafeArray into another SafeArray object.
//
// AKA: SafeArrayCopyData in Windows API.
func safeArrayCopyData(original *SafeArray, duplicate *SafeArray) (err error) {
err = convertHresultToError(
procSafeArrayCopyData.Call(
uintptr(unsafe.Pointer(original)),
uintptr(unsafe.Pointer(duplicate))))
return
}
// safeArrayCreate creates SafeArray.
//
// AKA: SafeArrayCreate in Windows API.
func safeArrayCreate(variantType VT, dimensions uint32, bounds *SafeArrayBound) (safearray *SafeArray, err error) {
sa, _, err := procSafeArrayCreate.Call(
uintptr(variantType),
uintptr(dimensions),
uintptr(unsafe.Pointer(bounds)))
safearray = (*SafeArray)(unsafe.Pointer(&sa))
return
}
// safeArrayCreateEx creates SafeArray.
//
// AKA: SafeArrayCreateEx in Windows API.
func safeArrayCreateEx(variantType VT, dimensions uint32, bounds *SafeArrayBound, extra uintptr) (safearray *SafeArray, err error) {
sa, _, err := procSafeArrayCreateEx.Call(
uintptr(variantType),
uintptr(dimensions),
uintptr(unsafe.Pointer(bounds)),
extra)
safearray = (*SafeArray)(unsafe.Pointer(sa))
return
}
// safeArrayCreateVector creates SafeArray.
//
// AKA: SafeArrayCreateVector in Windows API.
func safeArrayCreateVector(variantType VT, lowerBound int32, length uint32) (safearray *SafeArray, err error) {
sa, _, err := procSafeArrayCreateVector.Call(
uintptr(variantType),
uintptr(lowerBound),
uintptr(length))
safearray = (*SafeArray)(unsafe.Pointer(sa))
return
}
// safeArrayCreateVectorEx creates SafeArray.
//
// AKA: SafeArrayCreateVectorEx in Windows API.
func safeArrayCreateVectorEx(variantType VT, lowerBound int32, length uint32, extra uintptr) (safearray *SafeArray, err error) {
sa, _, err := procSafeArrayCreateVectorEx.Call(
uintptr(variantType),
uintptr(lowerBound),
uintptr(length),
extra)
safearray = (*SafeArray)(unsafe.Pointer(sa))
return
}
// safeArrayDestroy destroys SafeArray object.
//
// AKA: SafeArrayDestroy in Windows API.
func safeArrayDestroy(safearray *SafeArray) (err error) {
err = convertHresultToError(procSafeArrayDestroy.Call(uintptr(unsafe.Pointer(safearray))))
return
}
// safeArrayDestroyData destroys SafeArray object.
//
// AKA: SafeArrayDestroyData in Windows API.
func safeArrayDestroyData(safearray *SafeArray) (err error) {
err = convertHresultToError(procSafeArrayDestroyData.Call(uintptr(unsafe.Pointer(safearray))))
return
}
// safeArrayDestroyDescriptor destroys SafeArray object.
//
// AKA: SafeArrayDestroyDescriptor in Windows API.
func safeArrayDestroyDescriptor(safearray *SafeArray) (err error) {
err = convertHresultToError(procSafeArrayDestroyDescriptor.Call(uintptr(unsafe.Pointer(safearray))))
return
}
// safeArrayGetDim is the amount of dimensions in the SafeArray.
//
// SafeArrays may have multiple dimensions. Meaning, it could be
// multidimensional array.
//
// AKA: SafeArrayGetDim in Windows API.
func safeArrayGetDim(safearray *SafeArray) (dimensions *uint32, err error) {
l, _, err := procSafeArrayGetDim.Call(uintptr(unsafe.Pointer(safearray)))
dimensions = (*uint32)(unsafe.Pointer(l))
return
}
// safeArrayGetElementSize is the element size in bytes.
//
// AKA: SafeArrayGetElemsize in Windows API.
func safeArrayGetElementSize(safearray *SafeArray) (length *uint32, err error) {
l, _, err := procSafeArrayGetElemsize.Call(uintptr(unsafe.Pointer(safearray)))
length = (*uint32)(unsafe.Pointer(l))
return
}
// safeArrayGetElement retrieves element at given index.
func safeArrayGetElement(safearray *SafeArray, index int64, pv unsafe.Pointer) error {
return convertHresultToError(
procSafeArrayGetElement.Call(
uintptr(unsafe.Pointer(safearray)),
uintptr(unsafe.Pointer(&index)),
uintptr(pv)))
}
// safeArrayGetElementString retrieves element at given index and converts to string.
func safeArrayGetElementString(safearray *SafeArray, index int64) (str string, err error) {
var element *int16
err = convertHresultToError(
procSafeArrayGetElement.Call(
uintptr(unsafe.Pointer(safearray)),
uintptr(unsafe.Pointer(&index)),
uintptr(unsafe.Pointer(&element))))
str = BstrToString(*(**uint16)(unsafe.Pointer(&element)))
SysFreeString(element)
return
}
// safeArrayGetIID is the InterfaceID of the elements in the SafeArray.
//
// AKA: SafeArrayGetIID in Windows API.
func safeArrayGetIID(safearray *SafeArray) (guid *GUID, err error) {
err = convertHresultToError(
procSafeArrayGetIID.Call(
uintptr(unsafe.Pointer(safearray)),
uintptr(unsafe.Pointer(&guid))))
return
}
// safeArrayGetLBound returns lower bounds of SafeArray.
//
// SafeArrays may have multiple dimensions. Meaning, it could be
// multidimensional array.
//
// AKA: SafeArrayGetLBound in Windows API.
func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (lowerBound int64, err error) {
err = convertHresultToError(
procSafeArrayGetLBound.Call(
uintptr(unsafe.Pointer(safearray)),
uintptr(dimension),
uintptr(unsafe.Pointer(&lowerBound))))
return
}
// safeArrayGetUBound returns upper bounds of SafeArray.
//
// SafeArrays may have multiple dimensions. Meaning, it could be
// multidimensional array.
//
// AKA: SafeArrayGetUBound in Windows API.
func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (upperBound int64, err error) {
err = convertHresultToError(
procSafeArrayGetUBound.Call(
uintptr(unsafe.Pointer(safearray)),
uintptr(dimension),
uintptr(unsafe.Pointer(&upperBound))))
return
}
// safeArrayGetVartype returns data type of SafeArray.
//
// AKA: SafeArrayGetVartype in Windows API.
func safeArrayGetVartype(safearray *SafeArray) (varType uint16, err error) {
err = convertHresultToError(
procSafeArrayGetVartype.Call(
uintptr(unsafe.Pointer(safearray)),
uintptr(unsafe.Pointer(&varType))))
return
}
// safeArrayLock locks SafeArray for reading to modify SafeArray.
//
// This must be called during some calls to ensure that another process does not
// read or write to the SafeArray during editing.
//
// AKA: SafeArrayLock in Windows API.
func safeArrayLock(safearray *SafeArray) (err error) {
err = convertHresultToError(procSafeArrayLock.Call(uintptr(unsafe.Pointer(safearray))))
return
}
// safeArrayUnlock unlocks SafeArray for reading.
//
// AKA: SafeArrayUnlock in Windows API.
func safeArrayUnlock(safearray *SafeArray) (err error) {
err = convertHresultToError(procSafeArrayUnlock.Call(uintptr(unsafe.Pointer(safearray))))
return
}
// safeArrayPutElement stores the data element at the specified location in the
// array.
//
// AKA: SafeArrayPutElement in Windows API.
func safeArrayPutElement(safearray *SafeArray, index int64, element uintptr) (err error) {
err = convertHresultToError(
procSafeArrayPutElement.Call(
uintptr(unsafe.Pointer(safearray)),
uintptr(unsafe.Pointer(&index)),
uintptr(unsafe.Pointer(element))))
return
}
// safeArrayGetRecordInfo accesses IRecordInfo info for custom types.
//
// AKA: SafeArrayGetRecordInfo in Windows API.
//
// XXX: Must implement IRecordInfo interface for this to return.
func safeArrayGetRecordInfo(safearray *SafeArray) (recordInfo interface{}, err error) {
err = convertHresultToError(
procSafeArrayGetRecordInfo.Call(
uintptr(unsafe.Pointer(safearray)),
uintptr(unsafe.Pointer(&recordInfo))))
return
}
// safeArraySetRecordInfo mutates IRecordInfo info for custom types.
//
// AKA: SafeArraySetRecordInfo in Windows API.
//
// XXX: Must implement IRecordInfo interface for this to return.
func safeArraySetRecordInfo(safearray *SafeArray, recordInfo interface{}) (err error) {
err = convertHresultToError(
procSafeArraySetRecordInfo.Call(
uintptr(unsafe.Pointer(safearray)),
uintptr(unsafe.Pointer(&recordInfo))))
return
}
================================================
FILE: vendor/github.com/go-ole/go-ole/safearrayconversion.go
================================================
// Helper for converting SafeArray to array of objects.
package ole
import (
"unsafe"
)
type SafeArrayConversion struct {
Array *SafeArray
}
func (sac *SafeArrayConversion) ToStringArray() (strings []string) {
totalElements, _ := sac.TotalElements(0)
strings = make([]string, totalElements)
for i := int64(0); i < totalElements; i++ {
strings[int32(i)], _ = safeArrayGetElementString(sac.Array, i)
}
return
}
func (sac *SafeArrayConversion) ToByteArray() (bytes []byte) {
totalElements, _ := sac.TotalElements(0)
bytes = make([]byte, totalElements)
for i := int64(0); i < totalElements; i++ {
safeArrayGetElement(sac.Array, i, unsafe.Pointer(&bytes[int32(i)]))
}
return
}
func (sac *SafeArrayConversion) ToValueArray() (values []interface{}) {
totalElements, _ := sac.TotalElements(0)
values = make([]interface{}, totalElements)
vt, _ := safeArrayGetVartype(sac.Array)
for i := 0; i < int(totalElements); i++ {
switch VT(vt) {
case VT_BOOL:
var v bool
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_I1:
var v int8
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_I2:
var v int16
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_I4:
var v int32
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_I8:
var v int64
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_UI1:
var v uint8
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_UI2:
var v uint16
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_UI4:
var v uint32
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_UI8:
var v uint64
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_R4:
var v float32
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_R8:
var v float64
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_BSTR:
var v string
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v
case VT_VARIANT:
var v VARIANT
safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
values[i] = v.Value()
default:
// TODO
}
}
return
}
func (sac *SafeArrayConversion) GetType() (varType uint16, err error) {
return safeArrayGetVartype(sac.Array)
}
func (sac *SafeArrayConversion) GetDimensions() (dimensions *uint32, err error) {
return safeArrayGetDim(sac.Array)
}
func (sac *SafeArrayConversion) GetSize() (length *uint32, err error) {
return safeArrayGetElementSize(sac.Array)
}
func (sac *SafeArrayConversion) TotalElements(index uint32) (totalElements int64, err error) {
if index < 1 {
index = 1
}
// Get array bounds
var LowerBounds int64
var UpperBounds int64
LowerBounds, err = safeArrayGetLBound(sac.Array, index)
if err != nil {
return
}
UpperBounds, err = safeArrayGetUBound(sac.Array, index)
if err != nil {
return
}
totalElements = UpperBounds - LowerBounds + 1
return
}
// Release Safe Array memory
func (sac *SafeArrayConversion) Release() {
safeArrayDestroy(sac.Array)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/safearrayslices.go
================================================
// +build windows
package ole
import (
"unsafe"
)
func safeArrayFromByteSlice(slice []byte) *SafeArray {
array, _ := safeArrayCreateVector(VT_UI1, 0, uint32(len(slice)))
if array == nil {
panic("Could not convert []byte to SAFEARRAY")
}
for i, v := range slice {
safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(&v)))
}
return array
}
func safeArrayFromStringSlice(slice []string) *SafeArray {
array, _ := safeArrayCreateVector(VT_BSTR, 0, uint32(len(slice)))
if array == nil {
panic("Could not convert []string to SAFEARRAY")
}
// SysAllocStringLen(s)
for i, v := range slice {
safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(SysAllocStringLen(v))))
}
return array
}
================================================
FILE: vendor/github.com/go-ole/go-ole/utility.go
================================================
package ole
import (
"unicode/utf16"
"unsafe"
)
// ClassIDFrom retrieves class ID whether given is program ID or application string.
//
// Helper that provides check against both Class ID from Program ID and Class ID from string. It is
// faster, if you know which you are using, to use the individual functions, but this will check
// against available functions for you.
func ClassIDFrom(programID string) (classID *GUID, err error) {
classID, err = CLSIDFromProgID(programID)
if err != nil {
classID, err = CLSIDFromString(programID)
if err != nil {
return
}
}
return
}
// BytePtrToString converts byte pointer to a Go string.
func BytePtrToString(p *byte) string {
a := (*[10000]uint8)(unsafe.Pointer(p))
i := 0
for a[i] != 0 {
i++
}
return string(a[:i])
}
// UTF16PtrToString is alias for LpOleStrToString.
//
// Kept for compatibility reasons.
func UTF16PtrToString(p *uint16) string {
return LpOleStrToString(p)
}
// LpOleStrToString converts COM Unicode to Go string.
func LpOleStrToString(p *uint16) string {
if p == nil {
return ""
}
length := lpOleStrLen(p)
a := make([]uint16, length)
ptr := unsafe.Pointer(p)
for i := 0; i < int(length); i++ {
a[i] = *(*uint16)(ptr)
ptr = unsafe.Pointer(uintptr(ptr) + 2)
}
return string(utf16.Decode(a))
}
// BstrToString converts COM binary string to Go string.
func BstrToString(p *uint16) string {
if p == nil {
return ""
}
length := SysStringLen((*int16)(unsafe.Pointer(p)))
a := make([]uint16, length)
ptr := unsafe.Pointer(p)
for i := 0; i < int(length); i++ {
a[i] = *(*uint16)(ptr)
ptr = unsafe.Pointer(uintptr(ptr) + 2)
}
return string(utf16.Decode(a))
}
// lpOleStrLen returns the length of Unicode string.
func lpOleStrLen(p *uint16) (length int64) {
if p == nil {
return 0
}
ptr := unsafe.Pointer(p)
for i := 0; ; i++ {
if 0 == *(*uint16)(ptr) {
length = int64(i)
break
}
ptr = unsafe.Pointer(uintptr(ptr) + 2)
}
return
}
// convertHresultToError converts syscall to error, if call is unsuccessful.
func convertHresultToError(hr uintptr, r2 uintptr, ignore error) (err error) {
if hr != 0 {
err = NewError(hr)
}
return
}
================================================
FILE: vendor/github.com/go-ole/go-ole/variables.go
================================================
// +build windows
package ole
import (
"syscall"
)
var (
modcombase = syscall.NewLazyDLL("combase.dll")
modkernel32, _ = syscall.LoadDLL("kernel32.dll")
modole32, _ = syscall.LoadDLL("ole32.dll")
modoleaut32, _ = syscall.LoadDLL("oleaut32.dll")
modmsvcrt, _ = syscall.LoadDLL("msvcrt.dll")
moduser32, _ = syscall.LoadDLL("user32.dll")
)
================================================
FILE: vendor/github.com/go-ole/go-ole/variant.go
================================================
package ole
import "unsafe"
// NewVariant returns new variant based on type and value.
func NewVariant(vt VT, val int64) VARIANT {
return VARIANT{VT: vt, Val: val}
}
// ToIUnknown converts Variant to Unknown object.
func (v *VARIANT) ToIUnknown() *IUnknown {
if v.VT != VT_UNKNOWN {
return nil
}
return (*IUnknown)(unsafe.Pointer(uintptr(v.Val)))
}
// ToIDispatch converts variant to dispatch object.
func (v *VARIANT) ToIDispatch() *IDispatch {
if v.VT != VT_DISPATCH {
return nil
}
return (*IDispatch)(unsafe.Pointer(uintptr(v.Val)))
}
// ToArray converts variant to SafeArray helper.
func (v *VARIANT) ToArray() *SafeArrayConversion {
if v.VT != VT_SAFEARRAY {
if v.VT&VT_ARRAY == 0 {
return nil
}
}
var safeArray *SafeArray = (*SafeArray)(unsafe.Pointer(uintptr(v.Val)))
return &SafeArrayConversion{safeArray}
}
// ToString converts variant to Go string.
func (v *VARIANT) ToString() string {
if v.VT != VT_BSTR {
return ""
}
return BstrToString(*(**uint16)(unsafe.Pointer(&v.Val)))
}
// Clear the memory of variant object.
func (v *VARIANT) Clear() error {
return VariantClear(v)
}
// Value returns variant value based on its type.
//
// Currently supported types: 2- and 4-byte integers, strings, bools.
// Note that 64-bit integers, datetimes, and other types are stored as strings
// and will be returned as strings.
//
// Needs to be further converted, because this returns an interface{}.
func (v *VARIANT) Value() interface{} {
switch v.VT {
case VT_I1:
return int8(v.Val)
case VT_UI1:
return uint8(v.Val)
case VT_I2:
return int16(v.Val)
case VT_UI2:
return uint16(v.Val)
case VT_I4:
return int32(v.Val)
case VT_UI4:
return uint32(v.Val)
case VT_I8:
return int64(v.Val)
case VT_UI8:
return uint64(v.Val)
case VT_INT:
return int(v.Val)
case VT_UINT:
return uint(v.Val)
case VT_INT_PTR:
return uintptr(v.Val) // TODO
case VT_UINT_PTR:
return uintptr(v.Val)
case VT_R4:
return *(*float32)(unsafe.Pointer(&v.Val))
case VT_R8:
return *(*float64)(unsafe.Pointer(&v.Val))
case VT_BSTR:
return v.ToString()
case VT_DATE:
// VT_DATE type will either return float64 or time.Time.
d := float64(v.Val)
date, err := GetVariantDate(d)
if err != nil {
return d
}
return date
case VT_UNKNOWN:
return v.ToIUnknown()
case VT_DISPATCH:
return v.ToIDispatch()
case VT_BOOL:
return v.Val != 0
}
return nil
}
================================================
FILE: vendor/github.com/go-ole/go-ole/variant_386.go
================================================
// +build 386
package ole
type VARIANT struct {
VT VT // 2
wReserved1 uint16 // 4
wReserved2 uint16 // 6
wReserved3 uint16 // 8
Val int64 // 16
}
================================================
FILE: vendor/github.com/go-ole/go-ole/variant_amd64.go
================================================
// +build amd64
package ole
type VARIANT struct {
VT VT // 2
wReserved1 uint16 // 4
wReserved2 uint16 // 6
wReserved3 uint16 // 8
Val int64 // 16
_ [8]byte // 24
}
================================================
FILE: vendor/github.com/go-ole/go-ole/vt_string.go
================================================
// generated by stringer -output vt_string.go -type VT; DO NOT EDIT
package ole
import "fmt"
const (
_VT_name_0 = "VT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_DISPATCHVT_ERRORVT_BOOLVT_VARIANTVT_UNKNOWNVT_DECIMAL"
_VT_name_1 = "VT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_HRESULTVT_PTRVT_SAFEARRAYVT_CARRAYVT_USERDEFINEDVT_LPSTRVT_LPWSTR"
_VT_name_2 = "VT_RECORDVT_INT_PTRVT_UINT_PTR"
_VT_name_3 = "VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_STORED_OBJECTVT_BLOB_OBJECTVT_CFVT_CLSID"
_VT_name_4 = "VT_BSTR_BLOBVT_VECTOR"
_VT_name_5 = "VT_ARRAY"
_VT_name_6 = "VT_BYREF"
_VT_name_7 = "VT_RESERVED"
_VT_name_8 = "VT_ILLEGAL"
)
var (
_VT_index_0 = [...]uint8{0, 8, 15, 20, 25, 30, 35, 40, 47, 54, 65, 73, 80, 90, 100, 110}
_VT_index_1 = [...]uint8{0, 5, 11, 17, 23, 28, 34, 40, 47, 54, 64, 70, 82, 91, 105, 113, 122}
_VT_index_2 = [...]uint8{0, 9, 19, 30}
_VT_index_3 = [...]uint8{0, 11, 18, 27, 37, 55, 71, 85, 90, 98}
_VT_index_4 = [...]uint8{0, 12, 21}
_VT_index_5 = [...]uint8{0, 8}
_VT_index_6 = [...]uint8{0, 8}
_VT_index_7 = [...]uint8{0, 11}
_VT_index_8 = [...]uint8{0, 10}
)
func (i VT) String() string {
switch {
case 0 <= i && i <= 14:
return _VT_name_0[_VT_index_0[i]:_VT_index_0[i+1]]
case 16 <= i && i <= 31:
i -= 16
return _VT_name_1[_VT_index_1[i]:_VT_index_1[i+1]]
case 36 <= i && i <= 38:
i -= 36
return _VT_name_2[_VT_index_2[i]:_VT_index_2[i+1]]
case 64 <= i && i <= 72:
i -= 64
return _VT_name_3[_VT_index_3[i]:_VT_index_3[i+1]]
case 4095 <= i && i <= 4096:
i -= 4095
return _VT_name_4[_VT_index_4[i]:_VT_index_4[i+1]]
case i == 8192:
return _VT_name_5
case i == 16384:
return _VT_name_6
case i == 32768:
return _VT_name_7
case i == 65535:
return _VT_name_8
default:
return fmt.Sprintf("VT(%d)", i)
}
}
================================================
FILE: vendor/github.com/go-ole/go-ole/winrt.go
================================================
// +build windows
package ole
import (
"reflect"
"syscall"
"unicode/utf8"
"unsafe"
)
var (
procRoInitialize = modcombase.NewProc("RoInitialize")
procRoActivateInstance = modcombase.NewProc("RoActivateInstance")
procRoGetActivationFactory = modcombase.NewProc("RoGetActivationFactory")
procWindowsCreateString = modcombase.NewProc("WindowsCreateString")
procWindowsDeleteString = modcombase.NewProc("WindowsDeleteString")
procWindowsGetStringRawBuffer = modcombase.NewProc("WindowsGetStringRawBuffer")
)
func RoInitialize(thread_type uint32) (err error) {
hr, _, _ := procRoInitialize.Call(uintptr(thread_type))
if hr != 0 {
err = NewError(hr)
}
return
}
func RoActivateInstance(clsid string) (ins *IInspectable, err error) {
hClsid, err := NewHString(clsid)
if err != nil {
return nil, err
}
defer DeleteHString(hClsid)
hr, _, _ := procRoActivateInstance.Call(
uintptr(unsafe.Pointer(hClsid)),
uintptr(unsafe.Pointer(&ins)))
if hr != 0 {
err = NewError(hr)
}
return
}
func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable, err error) {
hClsid, err := NewHString(clsid)
if err != nil {
return nil, err
}
defer DeleteHString(hClsid)
hr, _, _ := procRoGetActivationFactory.Call(
uintptr(unsafe.Pointer(hClsid)),
uintptr(unsafe.Pointer(iid)),
uintptr(unsafe.Pointer(&ins)))
if hr != 0 {
err = NewError(hr)
}
return
}
// HString is handle string for pointers.
type HString uintptr
// NewHString returns a new HString for Go string.
func NewHString(s string) (hstring HString, err error) {
u16 := syscall.StringToUTF16Ptr(s)
len := uint32(utf8.RuneCountInString(s))
hr, _, _ := procWindowsCreateString.Call(
uintptr(unsafe.Pointer(u16)),
uintptr(len),
uintptr(unsafe.Pointer(&hstring)))
if hr != 0 {
err = NewError(hr)
}
return
}
// DeleteHString deletes HString.
func DeleteHString(hstring HString) (err error) {
hr, _, _ := procWindowsDeleteString.Call(uintptr(hstring))
if hr != 0 {
err = NewError(hr)
}
return
}
// String returns Go string value of HString.
func (h HString) String() string {
var u16buf uintptr
var u16len uint32
u16buf, _, _ = procWindowsGetStringRawBuffer.Call(
uintptr(h),
uintptr(unsafe.Pointer(&u16len)))
u16hdr := reflect.SliceHeader{Data: u16buf, Len: int(u16len), Cap: int(u16len)}
u16 := *(*[]uint16)(unsafe.Pointer(&u16hdr))
return syscall.UTF16ToString(u16)
}
================================================
FILE: vendor/github.com/go-ole/go-ole/winrt_doc.go
================================================
// +build !windows
package ole
// RoInitialize
func RoInitialize(thread_type uint32) (err error) {
return NewError(E_NOTIMPL)
}
// RoActivateInstance
func RoActivateInstance(clsid string) (ins *IInspectable, err error) {
return nil, NewError(E_NOTIMPL)
}
// RoGetActivationFactory
func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable, err error) {
return nil, NewError(E_NOTIMPL)
}
// HString is handle string for pointers.
type HString uintptr
// NewHString returns a new HString for Go string.
func NewHString(s string) (hstring HString, err error) {
return HString(uintptr(0)), NewError(E_NOTIMPL)
}
// DeleteHString deletes HString.
func DeleteHString(hstring HString) (err error) {
return NewError(E_NOTIMPL)
}
// String returns Go string value of HString.
func (h HString) String() string {
return ""
}
================================================
FILE: vendor/github.com/shirou/gopsutil/LICENSE
================================================
gopsutil is distributed under BSD license reproduced below.
Copyright (c) 2014, WAKAYAMA Shirou
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the gopsutil authors nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: vendor/github.com/shirou/gopsutil/README.rst
================================================
gopsutil: psutil for golang
==============================
.. image:: https://circleci.com/gh/shirou/gopsutil.svg?&style=shield
:target: https://circleci.com/gh/shirou/gopsutil
.. image:: https://coveralls.io/repos/shirou/gopsutil/badge.svg?branch=master
:target: https://coveralls.io/r/shirou/gopsutil?branch=master
.. image:: https://godoc.org/github.com/shirou/gopsutil?status.svg
:target: http://godoc.org/github.com/shirou/gopsutil
This is a port of psutil (http://pythonhosted.org/psutil/). The challenge is porting all
psutil functions on some architectures...
.. highlights:: Package Structure Changed!
Package (a.k.a. directory) structure has been changed!! see `issue 24 <https://github.com/shirou/gopsutil/issues/24>`_
.. highlights:: golang 1.4 will become REQUIRED!
Since syscall package becomes frozen, we should use golang/x/sys of golang 1.4 as soon as possible.
Available Architectures
------------------------------------
- FreeBSD i386/amd64
- Linux i386/amd64/arm(raspberry pi)
- Windows/amd64
- Darwin/amd64
All works are implemented without cgo by porting c struct to golang struct.
Usage
---------
.. code:: go
import (
"fmt"
"github.com/shirou/gopsutil/mem"
)
func main() {
v, _ := mem.VirtualMemory()
// almost every return value is a struct
fmt.Printf("Total: %v, Free:%v, UsedPercent:%f%%\n", v.Total, v.Free, v.UsedPercent)
// convert to JSON. String() is also implemented
fmt.Println(v)
}
The output is below.
::
Total: 3179569152, Free:284233728, UsedPercent:84.508194%
{"total":3179569152,"available":492572672,"used":2895335424,"usedPercent":84.50819439828305, (snip)}
You can set an alternative location to /proc by setting the HOST_PROC environment variable.
You can set an alternative location to /sys by setting the HOST_SYS environment variable.
Documentation
------------------------
see http://godoc.org/github.com/shirou/gopsutil
More Info
--------------------
Several methods have been added which are not present in psutil, but will provide useful information.
- host/HostInfo() (linux)
- Hostname
- Uptime
- Procs
- OS (ex: "linux")
- Platform (ex: "ubuntu", "arch")
- PlatformFamily (ex: "debian")
- PlatformVersion (ex: "Ubuntu 13.10")
- VirtualizationSystem (ex: "LXC")
- VirtualizationRole (ex: "guest"/"host")
- cpu/CPUInfo() (linux, freebsd)
- CPU (ex: 0, 1, ...)
- VendorID (ex: "GenuineIntel")
- Family
- Model
- Stepping
- PhysicalID
- CoreID
- Cores (ex: 2)
- ModelName (ex: "Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz")
- Mhz
- CacheSize
- Flags (ex: "fpu vme de pse tsc msr pae mce cx8 ...")
- load/LoadAvg() (linux, freebsd)
- Load1
- Load5
- Load15
- docker/GetDockerIDList() (linux only)
- container id list ([]string)
- docker/CgroupCPU() (linux only)
- user
- system
- docker/CgroupMem() (linux only)
- various status
- net_protocols (linux only)
- system wide stats on network protocols (i.e IP, TCP, UDP, etc.)
- sourced from /proc/net/snmp
- iptables nf_conntrack (linux only)
- system wide stats on netfilter conntrack module
- sourced from /proc/sys/net/netfilter/nf_conntrack_count
Some codes are ported from Ohai. many thanks.
Current Status
------------------
- x: work
- b: almost work but something broken
================= ====== ======= ====== =======
name Linux FreeBSD MacOSX Windows
cpu_times x x x x
cpu_count x x x x
cpu_percent x x x x
cpu_times_percent x x x x
virtual_memory x x x x
swap_memory x x x
disk_partitions x x x x
disk_io_counters x x
disk_usage x x x x
net_io_counters x x b x
boot_time x x x x
users x x x x
pids x x x x
pid_exists x x x x
net_connections x x
net_protocols x
net_if_addrs
net_if_stats
netfilter_conntrack x
================= ====== ======= ====== =======
Process class
^^^^^^^^^^^^^^^
================ ===== ======= ====== =======
name Linux FreeBSD MacOSX Windows
pid x x x x
ppid x x x x
name x x x x
cmdline x x x
create_time x
status x x x
cwd x
exe x x x
uids x x x
gids x x x
terminal x x x
io_counters x
nice x x x
num_fds x
num_ctx_switches x
num_threads x x x x
cpu_times x
memory_info x x x
memory_info_ex x
memory_maps x
open_files x
send_signal x x x
suspend x x x
resume x x x
terminate x x x
kill x x x
username x
ionice
rlimit
num_handlres
threads
cpu_percent x x
cpu_affinity
memory_percent
parent x x
children x x x
connections x x
is_running
================ ===== ======= ====== =======
Original Metrics
^^^^^^^^^^^^^^^^^^^
================== ===== ======= ====== =======
item Linux FreeBSD MacOSX Windows
**HostInfo**
hostname x x x x
uptime x x x
proces x x
os x x x x
platform x x x
platformfamiliy x x x
virtualization x
**CPU**
VendorID x x x x
Family x x x x
Model x x x x
Stepping x x x x
PhysicalID x
CoreID x
Cores x x
ModelName x x x x
**LoadAvg**
Load1 x x x
Load5 x x x
Load15 x x x
**GetDockerID**
container id x no no no
**CgroupsCPU**
user x no no no
system x no no no
**CgroupsMem**
various x no no no
================== ===== ======= ====== =======
- future work
- process_iter
- wait_procs
- Process class
- as_dict
- wait
License
------------
New BSD License (same as psutil)
Related Works
-----------------------
I have been influenced by the following great works:
- psutil: http://pythonhosted.org/psutil/
- dstat: https://github.com/dagwieers/dstat
- gosigar: https://github.com/cloudfoundry/gosigar/
- goprocinfo: https://github.com/c9s/goprocinfo
- go-ps: https://github.com/mitchellh/go-ps
- ohai: https://github.com/opscode/ohai/
- bosun: https://github.com/bosun-monitor/bosun/tree/master/cmd/scollector/collectors
- mackerel: https://github.com/mackerelio/mackerel-agent/tree/master/metrics
How to Contribute
---------------------------
1. Fork it
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create new Pull Request
My English is terrible, so documentation or correcting comments are also
welcome.
================================================
FILE: vendor/github.com/shirou/gopsutil/circle.yml
================================================
machine:
timezone:
Asia/Tokyo
test:
override:
- GOOS=linux GOARCH=amd64 go test -v ./...
- GOOS=linux GOARCH=386 go get -v ./...
- GOOS=linux GOARCH=arm GOARM=7 go get -v ./...
- GOOS=freebsd GOARCH=amd64 go get -v ./...
- GOOS=windows GOARCH=amd64 go get -v ./...
- GOOS=darwin GOARCH=amd64 go get -v ./...
================================================
FILE: vendor/github.com/shirou/gopsutil/coverall.sh
================================================
#/bin/sh
# see http://www.songmu.jp/riji/entry/2015-01-15-goveralls-multi-package.html
set -e
# cleanup
cleanup() {
if [ $tmpprof != "" ] && [ -f $tmpprof ]; then
rm -f $tmpprof
fi
exit
}
trap cleanup INT QUIT TERM EXIT
# メインの処理
prof=${1:-".profile.cov"}
echo "mode: count" > $prof
gopath1=$(echo $GOPATH | cut -d: -f1)
for pkg in $(go list ./...); do
tmpprof=$gopath1/src/$pkg/profile.tmp
go test -covermode=count -coverprofile=$tmpprof $pkg
if [ -f $tmpprof ]; then
cat $tmpprof | tail -n +2 >> $prof
rm $tmpprof
fi
done
================================================
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu.go
================================================
package cpu
import (
"encoding/json"
"runtime"
"strconv"
"strings"
)
type CPUTimesStat struct {
CPU string `json:"cpu"`
User float64 `json:"user"`
System float64 `json:"system"`
Idle float64 `json:"idle"`
Nice float64 `json:"nice"`
Iowait float64 `json:"iowait"`
Irq float64 `json:"irq"`
Softirq float64 `json:"softirq"`
Steal float64 `json:"steal"`
Guest float64 `json:"guest"`
GuestNice float64 `json:"guest_nice"`
Stolen float64 `json:"stolen"`
}
type CPUInfoStat struct {
CPU int32 `json:"cpu"`
VendorID string `json:"vendor_id"`
Family string `json:"family"`
Model string `json:"model"`
Stepping int32 `json:"stepping"`
PhysicalID string `json:"physical_id"`
CoreID string `json:"core_id"`
Cores int32 `json:"cores"`
ModelName string `json:"model_name"`
Mhz float64 `json:"mhz"`
CacheSize int32 `json:"cache_size"`
Flags []string `json:"flags"`
}
var lastCPUTimes []CPUTimesStat
var lastPerCPUTimes []CPUTimesStat
func CPUCounts(logical bool) (int, error) {
return runtime.NumCPU(), nil
}
func (c CPUTimesStat) String() string {
v := []string{
`"cpu":"` + c.CPU + `"`,
`"user":` + strconv.FormatFloat(c.User, 'f', 1, 64),
`"system":` + strconv.FormatFloat(c.System, 'f', 1, 64),
`"idle":` + strconv.FormatFloat(c.Idle, 'f', 1, 64),
`"nice":` + strconv.FormatFloat(c.Nice, 'f', 1, 64),
`"iowait":` + strconv.FormatFloat(c.Iowait, 'f', 1, 64),
`"irq":` + strconv.FormatFloat(c.Irq, 'f', 1, 64),
`"softirq":` + strconv.FormatFloat(c.Softirq, 'f', 1, 64),
`"steal":` + strconv.FormatFloat(c.Steal, 'f', 1, 64),
`"guest":` + strconv.FormatFloat(c.Guest, 'f', 1, 64),
`"guest_nice":` + strconv.FormatFloat(c.GuestNice, 'f', 1, 64),
`"stolen":` + strconv.FormatFloat(c.Stolen, 'f', 1, 64),
}
return `{` + strings.Join(v, ",") + `}`
}
// Total returns the total number of seconds in a CPUTimesStat
func (c CPUTimesStat) Total() float64 {
total := c.User + c.System + c.Nice + c.Iowait + c.Irq + c.Softirq + c.Steal +
c.Guest + c.GuestNice + c.Idle + c.Stolen
return total
}
func (c CPUInfoStat) String() string {
s, _ := json.Marshal(c)
return string(s)
}
================================================
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go
================================================
// +build darwin
package cpu
import (
"os/exec"
"strconv"
"strings"
)
// sys/resource.h
const (
CPUser = 0
CPNice = 1
CPSys = 2
CPIntr = 3
CPIdle = 4
CPUStates = 5
)
// default value. from time.h
var ClocksPerSec = float64(128)
func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
if percpu {
return perCPUTimes()
}
return allCPUTimes()
}
// Returns only one CPUInfoStat on FreeBSD
func CPUInfo() ([]CPUInfoStat, error) {
var ret []CPUInfoStat
out, err := exec.Command("/usr/sbin/sysctl", "machdep.cpu").Output()
if err != nil {
return ret, err
}
c := CPUInfoStat{}
for _, line := range strings.Split(string(out), "\n") {
values := strings.Fields(line)
if len(values) < 1 {
continue
}
t, err := strconv.ParseInt(values[1], 10, 64)
// err is not checked here because some value is string.
if strings.HasPrefix(line, "machdep.cpu.brand_string") {
c.ModelName = strings.Join(values[1:], " ")
} else if strings.HasPrefix(line, "machdep.cpu.family") {
c.Family = values[1]
} else if strings.HasPrefix(line, "machdep.cpu.model") {
c.Model = values[1]
} else if strings.HasPrefix(line, "machdep.cpu.stepping") {
if err != nil {
return ret, err
}
c.Stepping = int32(t)
} else if strings.HasPrefix(line, "machdep.cpu.features") {
for _, v := range values[1:] {
c.Flags = append(c.Flags, strings.ToLower(v))
}
} else if strings.HasPrefix(line, "machdep.cpu.leaf7_features") {
for _, v := range values[1:] {
c.Flags = append(c.Flags, strings.ToLower(v))
}
} else if strings.HasPrefix(line, "machdep.cpu.extfeatures") {
for _, v := range values[1:] {
c.Flags = append(c.Flags, strings.ToLower(v))
}
} else if strings.HasPrefix(line, "machdep.cpu.core_count") {
if err != nil {
return ret, err
}
c.Cores = int32(t)
} else if strings.HasPrefix(line, "machdep.cpu.cache.size") {
if err != nil {
return ret, err
}
c.CacheSize = int32(t)
} else if strings.HasPrefix(line, "machdep.cpu.vendor") {
c.VendorID = values[1]
}
}
// Use the rated frequency of the CPU. This is a static value and does not
// account for low power or Turbo Boost modes.
out, err = exec.Command("/usr/sbin/sysctl", "hw.cpufrequency").Output()
if err != nil {
return ret, err
}
values := strings.Fields(string(out))
mhz, err := strconv.ParseFloat(values[1], 64)
if err != nil {
return ret, err
}
c.Mhz = mhz / 1000000.0
return append(ret, c), nil
}
================================================
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go
================================================
// +build darwin
// +build cgo
package cpu
/*
#include <stdlib.h>
#include <sys/sysctl.h>
#include <sys/mount.h>
#include <mach/mach_init.h>
#include <mach/mach_host.h>
#include <mach/host_info.h>
#include <libproc.h>
#include <mach/processor_info.h>
#include <mach/vm_map.h>
*/
import "C"
import (
"bytes"
"encoding/binary"
"fmt"
"unsafe"
)
// these CPU times for darwin is borrowed from influxdb/telegraf.
func perCPUTimes() ([]CPUTimesStat, error) {
var (
count C.mach_msg_type_number_t
cpuload *C.processor_cpu_load_info_data_t
ncpu C.natural_t
)
status := C.host_processor_info(C.host_t(C.mach_host_self()),
C.PROCESSOR_CPU_LOAD_INFO,
&ncpu,
(*C.processor_info_array_t)(unsafe.Pointer(&cpuload)),
&count)
if status != C.KERN_SUCCESS {
return nil, fmt.Errorf("host_processor_info error=%d", status)
}
// jump through some cgo casting hoops and ensure we properly free
// the memory that cpuload points to
target := C.vm_map_t(C.mach_task_self_)
address := C.vm_address_t(uintptr(unsafe.Pointer(cpuload)))
defer C.vm_deallocate(target, address, C.vm_size_t(ncpu))
// the body of struct processor_cpu_load_info
// aka processor_cpu_load_info_data_t
var cpu_ticks [C.CPU_STATE_MAX]uint32
// copy the cpuload array to a []byte buffer
// where we can binary.Read the data
size := int(ncpu) * binary.Size(cpu_ticks)
buf := C.GoBytes(unsafe.Pointer(cpuload), C.int(size))
bbuf := bytes.NewBuffer(buf)
var ret []CPUTimesStat
for i := 0; i < int(ncpu); i++ {
err := binary.Read(bbuf, binary.LittleEndian, &cpu_ticks)
if err != nil {
return nil, err
}
c := CPUTimesStat{
CPU: fmt.Sprintf("cpu%d", i),
User: float64(cpu_ticks[C.CPU_STATE_USER]) / ClocksPerSec,
System: float64(cpu_ticks[C.CPU_STATE_SYSTEM]) / ClocksPerSec,
Nice: float64(cpu_ticks[C.CPU_STATE_NICE]) / ClocksPerSec,
Idle: float64(cpu_ticks[C.CPU_STATE_IDLE]) / ClocksPerSec,
}
ret = append(ret, c)
}
return ret, nil
}
func allCPUTimes() ([]CPUTimesStat, error) {
var count C.mach_msg_type_number_t = C.HOST_CPU_LOAD_INFO_COUNT
var cpuload C.host_cpu_load_info_data_t
status := C.host_statistics(C.host_t(C.mach_host_self()),
C.HOST_CPU_LOAD_INFO,
C.host_info_t(unsafe.Pointer(&cpuload)),
&count)
if status != C.KERN_SUCCESS {
return nil, fmt.Errorf("host_statistics error=%d", status)
}
c := CPUTimesStat{
CPU: "cpu-total",
User: float64(cpuload.cpu_ticks[C.CPU_STATE_USER]) / ClocksPerSec,
System: float64(cpuload.cpu_ticks[C.CPU_STATE_SYSTEM]) / ClocksPerSec,
Nice: float64(cpuload.cpu_ticks[C.CPU_STATE_NICE]) / ClocksPerSec,
Idle: float64(cpuload.cpu_ticks[C.CPU_STATE_IDLE]) / ClocksPerSec,
}
return []CPUTimesStat{c}, nil
}
================================================
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_nocgo.go
================================================
// +build darwin
// +build !cgo
package cpu
import "github.com/shirou/gopsutil/internal/common"
func perCPUTimes() ([]CPUTimesStat, error) {
return []CPUTimesStat{}, common.NotImplementedError
}
func allCPUTimes() ([]CPUTimesStat, error) {
return []CPUTimesStat{}, common.NotImplementedError
}
================================================
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go
================================================
// +build freebsd
package cpu
import (
"fmt"
"os/exec"
"regexp"
"strconv"
"strings"
"github.com/shirou/gopsutil/internal/common"
)
// sys/resource.h
const (
CPUser = 0
CPNice = 1
CPSys = 2
CPIntr = 3
CPIdle = 4
CPUStates = 5
)
var ClocksPerSec = float64(128)
func init() {
out, err := exec.Command("/usr/bin/getconf", "CLK_TCK").Output()
// ignore errors
if err == nil {
i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64)
if err == nil {
ClocksPerSec = float64(i)
}
}
}
func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
var ret []CPUTimesStat
var sysctlCall string
var ncpu int
if percpu {
sysctlCall = "kern.cp_times"
ncpu, _ = CPUCounts(true)
} else {
sysctlCall = "kern.cp_time"
ncpu = 1
}
cpuTimes, err := common.DoSysctrl(sysctlCall)
if err != nil {
return ret, err
}
for i := 0; i < ncpu; i++ {
offset := CPUStates * i
user, err := strconv.ParseFloat(cpuTimes[CPUser+offset], 64)
if err != nil {
return ret, err
}
nice, err := strconv.ParseFloat(cpuTimes[CPNice+offset], 64)
if err != nil {
return ret, err
}
sys, err := strconv.ParseFloat(cpuTimes[CPSys+offset], 64)
if err != nil {
return ret, err
}
idle, err := strconv.ParseFloat(cpuTimes[CPIdle+offset], 64)
if err != nil {
return ret, err
}
intr, err := strconv.ParseFloat(cpuTimes[CPIntr+offset], 64)
if err != nil {
return ret, err
}
c := CPUTimesStat{
User: float64(user / ClocksPerSec),
Nice: float64(nice / ClocksPerSec),
System: float64(sys / ClocksPerSec),
Idle: float64(idle / ClocksPerSec),
Irq: float64(intr / ClocksPerSec),
}
if !percpu {
c.CPU = "cpu-total"
} else {
c.CPU = fmt.Sprintf("cpu%d", i)
}
ret = append(ret, c)
}
return ret, nil
}
// Returns only one CPUInfoStat on FreeBSD
func CPUInfo() ([]CPUInfoStat, error) {
filename := "/var/run/dmesg.boot"
lines, _ := common.ReadLines(filename)
var ret []CPUInfoStat
c := CPUInfoStat{}
for _, line := range lines {
if matches := regexp.MustCompile(`CPU:\s+(.+) \(([\d.]+).+\)`).FindStringSubmatch(line); matches != nil {
c.ModelName = matches[1]
t, err := strconv.ParseFloat(matches[2], 64)
if err != nil {
return ret, nil
}
c.Mhz = t
} else if matches := regexp.MustCompile(`Origin = "(.+)" Id = (.+) Family = (.+) Model = (.+) Stepping = (.+)`).FindStringSubmatch(line); matches != nil {
c.VendorID = matches[1]
c.Family = matches[3]
c.Model = matches[4]
t, err := strconv.ParseInt(matches[5], 10, 32)
if err != nil {
return ret, nil
}
c.Stepping = int32(t)
} else if matches := regexp.MustCompile(`Features=.+<(.+)>`).FindStringSubmatch(line); matches != nil {
for _, v := range strings.Split(matches[1], ",") {
c.Flags = append(c.Flags, strings.ToLower(v))
}
} else if matches := regexp.MustCompile(`Features2=[a-f\dx]+<(.+)>`).FindStringSubmatch(line); matches != nil {
for _, v := range strings.Split(matches[1], ",") {
c.Flags = append(c.Flags, strings.ToLower(v))
}
} else if matches := regexp.MustCompile(`Logical CPUs per core: (\d+)`).FindStringSubmatch(line); matches != nil {
// FIXME: no this line?
t, err := strconv.ParseInt(matches[1], 10, 32)
if err != nil {
return ret, nil
}
c.Cores = int32(t)
}
}
return append(ret, c), nil
}
================================================
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go
================================================
// +build linux
package cpu
import (
"errors"
"fmt"
"os/exec"
"strconv"
"strings"
"github.com/shirou/gopsutil/internal/common"
)
var cpu_tick = float64(100)
func init() {
out, err := exec.Command("/usr/bin/getconf", "CLK_TCK").Output()
// ignore errors
if err == nil {
i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64)
if err == nil {
cpu_tick = float64(i)
}
}
}
func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
filename := common.HostProc("stat")
var lines = []string{}
if percpu {
var startIdx uint = 1
for {
linen, _ := common.ReadLinesOffsetN(filename, startIdx, 1)
line := linen[0]
if !strings.HasPrefix(line, "cpu") {
break
}
lines = append(lines, line)
startIdx += 1
}
} else {
lines, _ = common.ReadLinesOffsetN(filename, 0, 1)
}
ret := make([]CPUTimesStat, 0, len(lines))
for _, line := range lines {
ct, err := parseStatLine(line)
if err != nil {
continue
}
ret = append(ret, *ct)
}
return ret, nil
}
func sysCpuPath(cpu int32, relPath string) string {
return common.HostSys(fmt.Sprintf("devices/system/cpu/cpu%d", cpu), relPath)
}
func finishCPUInfo(c *CPUInfoStat) error {
if c.Mhz == 0 {
lines, err := common.ReadLines(sysCpuPath(c.CPU, "cpufreq/cpuinfo_max_freq"))
if err == nil {
value, err := strconv.ParseFloat(lines[0], 64)
if err != nil {
return err
}
c.Mhz = value
}
}
if len(c.CoreID) == 0 {
lines, err := common.ReadLines(sysCpuPath(c.CPU, "topology/core_id"))
if err == nil {
c.CoreID = lines[0]
}
}
return nil
}
// CPUInfo on linux will return 1 item per physical thread.
//
// CPUs have three levels of counting: sockets, cores, threads.
// Cores with HyperThreading count as having 2 threads per core.
// Sockets often come with many physical CPU cores.
// For example a single socket board with two cores each with HT will
// return 4 CPUInfoStat structs on Linux and the "Cores" field set to 1.
func CPUInfo() ([]CPUInfoStat, error) {
filename := common.HostProc("cpuinfo")
lines, _ := common.ReadLines(filename)
var ret []CPUInfoStat
c := CPUInfoStat{CPU: -1, Cores: 1}
for _, line := range lines {
fields := strings.Split(line, ":")
if len(fields) < 2 {
continue
}
key := strings.TrimSpace(fields[0])
value := strings.TrimSpace(fields[1])
switch key {
case "processor":
if c.CPU >= 0 {
err := finishCPUInfo(&c)
if err != nil {
return ret, err
}
ret = append(ret, c)
}
c = CPUInfoStat{Cores: 1}
t, err := strconv.ParseInt(value, 10, 64)
if err != nil {
return ret, err
}
c.CPU = int32(t)
case "vendor_id":
c.VendorID = value
case "cpu family":
c.Family = value
case "model":
c.Model = value
case "model name":
c.ModelName = value
case "stepping":
t, err := strconv.ParseInt(value, 10, 64)
if err != nil {
return ret, err
}
c.Stepping = int32(t)
case "cpu MHz":
t, err := strconv.ParseFloat(value, 64)
if err != nil {
return ret, err
}
c.Mhz = t
case "cache size":
t, err := strconv.ParseInt(strings.Replace(value, " KB", "", 1), 10, 64)
if err != nil {
return ret, err
}
c.CacheSize = int32(t)
case "physical id":
c.PhysicalID = value
case "core id":
c.CoreID = value
case "flags", "Features":
c.Flags = strings.FieldsFunc(value, func(r rune) bool {
return r == ',' || r == ' '
})
}
}
if c.CPU >= 0 {
err := finishCPUInfo(&c)
if err != nil {
return ret, err
}
ret = append(ret, c)
}
return ret, nil
}
func parseStatLine(line string) (*CPUTimesStat, error) {
fields := strings.Fields(line)
if strings.HasPrefix(fields[0], "cpu") == false {
// return CPUTimesStat{}, e
return nil, errors.New("not contain cpu")
}
cpu := fields[0]
if cpu == "cpu" {
cpu = "cpu-total"
}
user, err := strconv.ParseFloat(fields[1], 64)
if err != nil {
return nil, err
}
nice, err := strconv.ParseFloat(fields[2], 64)
if err != nil {
return nil, err
}
system, err := strconv.ParseFloat(fields[3], 64)
if err != nil {
return nil, err
}
idle, err := strconv.ParseFloat(fields[4], 64)
if err != nil {
return nil, err
}
iowait, err := strconv.ParseFloat(fields[5], 64)
if err != nil {
return nil, err
}
irq, err := strconv.ParseFloat(fields[6], 64)
if err != nil {
return nil, err
}
softirq, err := strconv.ParseFloat(fields[7], 64)
if err != nil {
return nil, err
}
ct := &CPUTimesStat{
CPU: cpu,
User: float64(user) / cpu_tick,
Nice: float64(nice) / cpu_tick,
System: float64(system) / cpu_tick,
Idle: float64(idle) / cpu_tick,
Iowait: float64(iowait) / cpu_tick,
Irq: float64(irq) / cpu_tick,
Softirq: float64(softirq) / cpu_tick,
}
if len(fields) > 8 { // Linux >= 2.6.11
steal, err := strconv.ParseFloat(fields[8], 64)
if err != nil {
return nil, err
}
ct.Steal = float64(steal) / cpu_tick
}
if len(fields) > 9 { // Linux >= 2.6.24
guest, err := strconv.ParseFloat(fields[9], 64)
if err != nil {
return nil, err
}
ct.Guest = float64(guest) / cpu_tick
}
if len(fields) > 10 { // Linux >= 3.2.0
guestNice, err := strconv.ParseFloat(fields[10], 64)
if err != nil {
return nil, err
}
ct.GuestNice = float64(guestNice) / cpu_tick
}
return ct, nil
}
================================================
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_unix.go
================================================
// +build linux freebsd darwin
package cpu
import (
"fmt"
"time"
)
func CPUPercent(interval time.Duration, percpu bool) ([]float64, error) {
getAllBusy := func(t CPUTimesStat) (float64, float64) {
busy := t.User + t.System + t.Nice + t.Iowait + t.Irq +
t.Softirq + t.Steal + t.Guest + t.GuestNice + t.Stolen
return busy + t.Idle, busy
}
calculate := func(t1, t2 CPUTimesStat) float64 {
t1All, t1Busy := getAllBusy(t1)
t2All, t2Busy := getAllBusy(t2)
if t2Busy <= t1Busy {
return 0
}
if t2All <= t1All {
return 1
}
return (t2Busy - t1Busy) / (t2All - t1All) * 100
}
// Get CPU usage at the start of the interval.
cpuTimes1, err := CPUTimes(percpu)
if err != nil {
return nil, err
}
if interval > 0 {
time.Sleep(interval)
}
// And at the end of the interval.
cpuTimes2, err := CPUTimes(percpu)
if err != nil {
return nil, err
}
// Make sure the CPU measurements have the same length.
if len(cpuTimes1) != len(cpuTimes2) {
return nil, fmt.Errorf(
"received two CPU counts: %d != %d",
len(cpuTimes1), len(cpuTimes2),
)
}
ret := make([]float64, len(cpuTimes1))
for i, t := range cpuTimes2 {
ret[i] = calculate(cpuTimes1[i], t)
}
return ret, nil
}
================================================
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_windows.go
================================================
// +build windows
package cpu
import (
"fmt"
"syscall"
"time"
"unsafe"
"github.com/StackExchange/wmi"
"github.com/shirou/gopsutil/internal/common"
)
type Win32_Processor struct {
LoadPercentage *uint16
Family uint16
Manufacturer string
Name string
NumberOfLogicalProcessors uint32
ProcessorId *string
Stepping *string
MaxClockSpeed uint32
}
// TODO: Get percpu
func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
var ret []CPUTimesStat
var lpIdleTime common.FILETIME
var lpKernelTime common.FILETIME
var lpUserTime common.FILETIME
r, _, _ := common.ProcGetSystemTimes.Call(
uintptr(unsafe.Pointer(&lpIdleTime)),
uintptr(unsafe.Pointer(&lpKernelTime)),
uintptr(unsafe.Pointer(&lpUserTime)))
if r == 0 {
return ret, syscall.GetLastError()
}
LOT := float64(0.0000001)
HIT := (LOT * 4294967296.0)
idle := ((HIT * float64(lpIdleTime.DwHighDateTime)) + (LOT * float64(lpIdleTime.DwLowDateTime)))
user := ((HIT * float64(lpUserTime.DwHighDateTime)) + (LOT * float64(lpUserTime.DwLowDateTime)))
kernel := ((HIT * float64(lpKernelTime.DwHighDateTime)) + (LOT * float64(lpKernelTime.DwLowDateTime)))
system := (kernel - idle)
ret = append(ret, CPUTimesStat{
Idle: float64(idle),
User: float64(user),
System: float64(system),
})
return ret, nil
}
func CPUInfo() ([]CPUInfoStat, error) {
var ret []CPUInfoStat
var dst []Win32_Processor
q := wmi.CreateQuery(&dst, "")
err := wmi.Query(q, &dst)
if err != nil {
return ret, err
}
var procID string
for i, l := range dst {
procID = ""
if l.ProcessorId != nil {
procID = *l.ProcessorId
}
cpu := CPUInfoStat{
CPU: int32(i),
Family: fmt.Sprintf("%d", l.Family),
VendorID: l.Manufacturer,
ModelName: l.Name,
Cores: int32(l.NumberOfLogicalProcessors),
PhysicalID: procID,
Mhz: float64(l.MaxClockSpeed),
Flags: []string{},
}
ret = append(ret, cpu)
}
return ret, nil
}
func CPUPercent(interval time.Duration, percpu bool) ([]float64, error) {
var ret []float64
var dst []Win32_Processor
q := wmi.CreateQuery(&dst, "")
err := wmi.Query(q, &dst)
if err != nil {
return ret, err
}
for _, l := range dst {
// use range but windows can only get one percent.
if l.LoadPercentage == nil {
continue
}
ret = append(ret, float64(*l.LoadPercentage))
}
return ret, nil
}
================================================
FILE: vendor/github.com/shirou/gopsutil/doc.go
================================================
package gopsutil
================================================
FILE: vendor/github.com/shirou/gopsutil/host/host.go
================================================
package host
import (
"encoding/json"
)
// A HostInfoStat describes the host status.
// This is not in the psutil but it useful.
type HostInfoStat struct {
Hostname string `json:"hostname"`
Uptime uint64 `json:"uptime"`
BootTime uint64 `json:"boot_time"`
Procs uint64 `json:"procs"` // number of processes
OS string `json:"os"` // ex: freebsd, linux
Platform string `json:"platform"` // ex: ubuntu, linuxmint
PlatformFamily string `json:"platform_family"` // ex: debian, rhel
PlatformVersion string `json:"platform_version"`
VirtualizationSystem string `json:"virtualization_system"`
VirtualizationRole string `json:"virtualization_role"` // guest or host
}
type UserStat struct {
User string `json:"user"`
Terminal string `json:"terminal"`
Host string `json:"host"`
Started int `json:"started"`
}
func (h HostInfoStat) String() string {
s, _ := json.Marshal(h)
return string(s)
}
func (u UserStat) String() string {
s, _ := json.Marshal(u)
return string(s)
}
================================================
FILE: vendor/github.com/shirou/gopsutil/host/host_darwin.go
================================================
// +build darwin
package host
import (
"bytes"
"encoding/binary"
"io/ioutil"
"os"
"os/exec"
"runtime"
"strconv"
"strings"
"time"
"unsafe"
"github.com/shirou/gopsutil/internal/common"
)
// from utmpx.h
const USER_PROCESS = 7
func HostInfo() (*HostInfoStat, error) {
ret := &HostInfoStat{
OS: runtime.GOOS,
PlatformFamily: "darwin",
}
hostname, err := os.Hostname()
if err == nil {
ret.Hostname = hostname
}
platform, family, version, err := GetPlatformInformation()
if err == nil {
ret.Platform = platform
ret.PlatformFamily = family
ret.PlatformVersion = version
}
system, role, err := GetVirtualization()
if err == nil {
ret.VirtualizationSystem = system
ret.VirtualizationRole = role
}
boot, err := BootTime()
if err == nil {
ret.BootTime = boot
ret.Uptime = uptime(boot)
}
return ret, nil
}
func BootTime() (uint64, error) {
values, err := common.DoSysctrl("kern.boottime")
if err != nil {
return 0, err
}
// ex: { sec = 1392261637, usec = 627534 } Thu Feb 13 12:20:37 2014
v := strings.Replace(values[2], ",", "", 1)
boottime, err := strconv.ParseInt(v, 10, 64)
if err != nil {
return 0, err
}
return uint64(boottime), nil
}
func uptime(boot uint64) uint64 {
return uint64(time.Now().Unix()) - boot
}
func Uptime() (uint64, error) {
boot, err := BootTime()
if err != nil {
return 0, err
}
return uptime(boot), nil
}
func Users() ([]UserStat, error) {
utmpfile := "/var/run/utmpx"
var ret []UserStat
file, err := os.Open(utmpfile)
if err != nil {
return ret, err
}
buf, err := ioutil.ReadAll(file)
if err != nil {
return ret, err
}
u := Utmpx{}
entrySize := int(unsafe.Sizeof(u))
count := len(buf) / entrySize
for i := 0; i < count; i++ {
b := buf[i*entrySize : i*entrySize+entrySize]
var u Utmpx
br := bytes.NewReader(b)
err := binary.Read(br, binary.LittleEndian, &u)
if err != nil {
continue
}
if u.Type != USER_PROCESS {
continue
}
user := UserStat{
User: common.IntToString(u.User[:]),
Terminal: common.IntToString(u.Line[:]),
Host: common.IntToString(u.Host[:]),
Started: int(u.Tv.Sec),
}
ret = append(ret, user)
}
return ret, nil
}
func GetPlatformInformation() (string, string, string, error) {
platform := ""
family := ""
version := ""
out, err := exec.Command("uname", "-s").Output()
if err == nil {
platform = strings.ToLower(strings.TrimSpace(string(out)))
}
out, err = exec.Command("uname", "-r").Output()
if err == nil {
version = strings.ToLower(strings.TrimSpace(string(out)))
}
return platform, family, version, nil
}
func GetVirtualization() (string, string, error) {
system := ""
role := ""
return system, role, nil
}
================================================
FILE: vendor/github.com/shirou/gopsutil/host/host_darwin_amd64.go
================================================
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_darwin.go
package host
type Utmpx struct {
User [256]int8
Id [4]int8
Line [32]int8
Pid int32
Type int16
Pad_cgo_0 [6]byte
Tv Timeval
Host [256]int8
Pad [16]uint32
}
type Timeval struct {
Sec int32
}
================================================
FILE: vendor/github.com/shirou/gopsutil/host/host_freebsd.go
================================================
// +build freebsd
package host
import (
"bytes"
"encoding/binary"
"io/ioutil"
"os"
"os/exec"
"runtime"
"strconv"
"strings"
"time"
"unsafe"
"github.com/shirou/gopsutil/internal/common"
)
const (
UTNameSize = 16 /* see MAXLOGNAME in <sys/param.h> */
UTLineSize = 8
UTHostSize = 16
)
func HostInfo() (*HostInfoStat, error) {
ret := &HostInfoStat{
OS: runtime.GOOS,
PlatformFamily: "freebsd",
}
hostname, err := os.Hostname()
if err == nil {
ret.Hostname = hostname
}
platform, family, version, err := GetPlatformInformation()
if err == nil {
ret.Platform = platform
ret.PlatformFamily = family
ret.PlatformVersion = version
}
system, role, err := GetVirtualization()
if err == nil {
ret.VirtualizationSystem = system
ret.VirtualizationRole = role
}
boot, err := BootTime()
if err == nil {
ret.BootTime = boot
ret.Uptime = uptime(boot)
}
return ret, nil
}
func BootTime() (uint64, error) {
values, err := common.DoSysctrl("kern.boottime")
if err != nil {
return 0, err
}
// ex: { sec = 1392261637, usec = 627534 } Thu Feb 13 12:20:37 2014
v := strings.Replace(values[2], ",", "", 1)
boottime, err := strconv.ParseUint(v, 10, 64)
if err != nil {
return 0, err
}
return boottime, nil
}
func uptime(boot uint64) uint64 {
return uint64(time.Now().Unix()) - boot
}
func Uptime() (uint64, error) {
boot, err := BootTime()
if err != nil {
return 0, err
}
return uptime(boot), nil
}
func Users() ([]UserStat, error) {
utmpfile := "/var/run/utx.active"
if !common.PathExists(utmpfile) {
utmpfile = "/var/run/utmp" // before 9.0
return getUsersFromUtmp(utmpfile)
}
var ret []UserStat
file, err := os.Open(utmpfile)
if err != nil {
return ret, err
}
buf, err := ioutil.ReadAll(file)
if err != nil {
return ret, err
}
u := Utmpx{}
entrySize := int(unsafe.Sizeof(u)) - 3
entrySize = 197 // TODO: why should 197
count := len(buf) / entrySize
for i := 0; i < count; i++ {
b := buf[i*entrySize : i*entrySize+entrySize]
var u Utmpx
br := bytes.NewReader(b)
err := binary.Read(br, binary.LittleEndian, &u)
if err != nil || u.Type != 4 {
continue
}
sec := (binary.LittleEndian.Uint32(u.Tv.Sec[:])) / 2 // TODO:
user := UserStat{
User: common.IntToString(u.User[:]),
Terminal: common.IntToString(u.Line[:]),
Host: common.IntToString(u.Host[:]),
Started: int(sec),
}
ret = append(ret, user)
}
return ret, nil
}
func GetPlatformInformation() (string, string, string, error) {
platform := ""
family := ""
version := ""
out, err := exec.Command("uname", "-s").Output()
if err == nil {
platform = strings.ToLower(strings.TrimSpace(string(out)))
}
out, err = exec.Command("uname", "-r").Output()
if err == nil {
version = strings.ToLower(strings.TrimSpace(string(out)))
}
return platform, family, version, nil
}
func GetVirtualization() (string, string, error) {
system := ""
role := ""
return system, role, nil
}
// before 9.0
func getUsersFromUtmp(utmpfile string) ([]UserStat, error) {
var ret []UserStat
file, err := os.Open(utmpfile)
if err != nil {
return ret, err
}
buf, err := ioutil.ReadAll(file)
if err != nil {
return ret, err
}
u := Utmp{}
entrySize := int(unsafe.Sizeof(u))
count := len(buf) / entrySize
for i := 0; i < count; i++ {
b := buf[i*entrySize : i*entrySize+entrySize]
var u Utmp
br := bytes.NewReader(b)
err := binary.Read(br, binary.LittleEndian, &u)
if err != nil || u.Time == 0 {
continue
}
user := UserStat{
User: common.IntToString(u.Name[:]),
Terminal: common.IntToString(u.Line[:]),
Host: common.IntToString(u.Host[:]),
Started: int(u.Time),
}
ret = append(ret, user)
}
return ret, nil
}
================================================
FILE: vendor/github.com/shirou/gopsutil/host/host_freebsd_amd64.go
================================================
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_freebsd.go
package host
const (
sizeofPtr = 0x8
sizeofShort = 0x2
sizeofInt = 0x4
sizeofLong = 0x8
sizeofLongLong = 0x8
)
type (
_C_short int16
_C_int int32
_C_long int64
_C_long_long int64
)
type Utmp struct {
Line [8]int8
Name [16]int8
Host [16]int8
Time int32
}
type Utmpx struct {
Type int16
Tv Timeval
Id [8]int8
Pid int32
User [32]int8
Line [16]int8
Host [125]int8
// Host [128]int8
// X__ut_spare [64]int8
}
type Timeval struct {
Sec [4]byte
Usec [3]byte
}
================================================
FILE: vendor/github.com/shirou/gopsutil/host/host_linux.go
================================================
// +build linux
package host
import (
"bytes"
"encoding/binary"
"fmt"
"io/ioutil"
"os"
"os/exec"
"regexp"
"runtime"
"strconv"
"strings"
"time"
"unsafe"
"github.com/shirou/gopsutil/internal/common"
)
type LSB struct {
ID string
Release string
Codename string
Description string
}
// from utmp.h
const USER_PROCESS = 7
func HostInfo() (*HostInfoStat, error) {
ret := &HostInfoStat{
OS: runtime.GOOS,
}
hostname, err := os.Hostname()
if err == nil {
ret.Hostname = hostname
}
platform, family, version, err := GetPlatformInformation()
if err == nil {
ret.Platform = platform
ret.PlatformFamily = family
ret.PlatformVersion = version
}
system, role, err := GetVirtualization()
if err == nil {
ret.VirtualizationSystem = system
ret.VirtualizationRole = role
}
boot, err := BootTime()
if err == nil {
ret.BootTime = boot
ret.Uptime = uptime(boot)
}
return ret, nil
}
// BootTime returns the system boot time expressed in seconds since the epoch.
func BootTime() (uint64, error) {
filename := common.HostProc("stat")
lines, err := common.ReadLines(filename)
if err != nil {
return 0, err
}
for _, line := range lines {
if strings.HasPrefix(line, "btime") {
f := strings.Fields(line)
if len(f) != 2 {
return 0, fmt.Errorf("wrong btime format")
}
b, err := strconv.ParseInt(f[1], 10, 64)
if err != nil {
return 0, err
}
return uint64(b), nil
}
}
return 0, fmt.Errorf("could not find btime")
}
func uptime(boot uint64) uint64 {
return uint64(time.Now().Unix()) - boot
}
func Uptime() (uint64, error) {
boot, err := BootTime()
if err != nil {
return 0, err
}
return uptime(boot), nil
}
func Users() ([]UserStat, error) {
utmpfile := "/var/run/utmp"
file, err := os.Open(utmpfile)
if err != nil {
return nil, err
}
buf, err := ioutil.ReadAll(file)
if err != nil {
return nil, err
}
u := utmp{}
entrySize := int(unsafe.Sizeof(u))
count := len(buf) / entrySize
ret := make([]UserStat, 0, count)
for i := 0; i < count; i++ {
b := buf[i*entrySize : i*entrySize+entrySize]
var u utmp
br := bytes.NewReader(b)
err := binary.Read(br, binary.LittleEndian, &u)
if err != nil {
continue
}
if u.Type != USER_PROCESS {
continue
}
user := UserStat{
User: common.IntToString(u.User[:]),
Terminal: common.IntToString(u.Line[:]),
Host: common.IntToString(u.Host[:]),
Started: int(u.Tv.TvSec),
}
ret = append(ret, user)
}
return ret, nil
}
func getLSB() (*LSB, error) {
ret := &LSB{}
if common.PathExists("/etc/lsb-release") {
contents, err := common.ReadLines("/etc/lsb-release")
if err != nil {
return ret, err // return empty
}
for _, line := range contents {
field := strings.Split(line, "=")
if len(field) < 2 {
continue
}
switch field[0] {
case "DISTRIB_ID":
ret.ID = field[1]
case "DISTRIB_RELEASE":
ret.Release = field[1]
case "DISTRIB_CODENAME":
ret.Codename = field[1]
case "DISTRIB_DESCRIPTION":
ret.Description = field[1]
}
}
} else if common.PathExists("/usr/bin/lsb_release") {
out, err := exec.Command("/usr/bin/lsb_release").Output()
if err != nil {
return ret, err
}
for _, line := range strings.Split(string(out), "\n") {
field := strings.Split(line, ":")
if len(field) < 2 {
continue
}
switch field[0] {
case "Distributor ID":
ret.ID = field[1]
case "Release":
ret.Release = field[1]
case "Codename":
ret.Codename = field[1]
case "Description":
ret.Description = field[1]
}
}
}
return ret, nil
}
func GetPlatformInformation() (platform string, family string, version string, err error) {
lsb, err := getLSB()
if err != nil {
lsb = &LSB{}
}
if common.PathExists("/etc/oracle-release") {
platform = "oracle"
contents, err := common.ReadLines("/etc/oracle-release")
if err == nil {
version = getRedhatishVersion(contents)
}
} else if common.PathExists("/etc/enterprise-release") {
platform = "oracle"
contents, err := common.ReadLines("/etc/enterprise-release")
if err == nil {
version = getRedhatishVersion(contents)
}
} else if common.PathExists("/etc/debian_version") {
if lsb.ID == "Ubuntu" {
platform = "ubuntu"
version = lsb.Release
} else if lsb.ID == "LinuxMint" {
platform = "linuxmint"
version = lsb.Release
} else {
if common.PathExists("/usr/bin/raspi-config") {
platform = "raspbian"
} else {
platform = "debian"
}
contents, err := common.ReadLines("/etc/debian_version")
if err == nil {
version = contents[0]
}
}
} else if common.PathExists("/etc/redhat-release") {
contents, err := common.ReadLines("/etc/redhat-release")
if err == nil {
version = getRedhatishVersion(contents)
platform = getRedhatishPlatform(contents)
}
} else if common.PathExists("/etc/system-release") {
contents, err := common.ReadLines("/etc/system-release")
if err == nil {
version = getRedhatishVersion(contents)
platform = getRedhatishPlatform(contents)
}
} else if common.PathExists("/etc/gent
gitextract_a633ijnj/ ├── .gitignore ├── LICENSE ├── README.md ├── client.go ├── examples/ │ ├── client/ │ │ └── client.go │ └── server/ │ └── server.go ├── http.go ├── server.go ├── stats.go ├── stats_test.go ├── vendor/ │ └── github.com/ │ ├── StackExchange/ │ │ └── wmi/ │ │ ├── LICENSE │ │ ├── README.md │ │ └── wmi.go │ ├── go-ole/ │ │ └── go-ole/ │ │ ├── ChangeLog.md │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── com.go │ │ ├── com_func.go │ │ ├── connect.go │ │ ├── constants.go │ │ ├── error.go │ │ ├── error_func.go │ │ ├── error_windows.go │ │ ├── guid.go │ │ ├── iconnectionpoint.go │ │ ├── iconnectionpoint_func.go │ │ ├── iconnectionpoint_windows.go │ │ ├── iconnectionpointcontainer.go │ │ ├── iconnectionpointcontainer_func.go │ │ ├── iconnectionpointcontainer_windows.go │ │ ├── idispatch.go │ │ ├── idispatch_func.go │ │ ├── idispatch_windows.go │ │ ├── ienumvariant.go │ │ ├── ienumvariant_func.go │ │ ├── ienumvariant_windows.go │ │ ├── iinspectable.go │ │ ├── iinspectable_func.go │ │ ├── iinspectable_windows.go │ │ ├── iprovideclassinfo.go │ │ ├── iprovideclassinfo_func.go │ │ ├── iprovideclassinfo_windows.go │ │ ├── itypeinfo.go │ │ ├── itypeinfo_func.go │ │ ├── itypeinfo_windows.go │ │ ├── iunknown.go │ │ ├── iunknown_func.go │ │ ├── iunknown_windows.go │ │ ├── ole.go │ │ ├── oleutil/ │ │ │ ├── connection.go │ │ │ ├── connection_func.go │ │ │ ├── connection_windows.go │ │ │ ├── go-get.go │ │ │ └── oleutil.go │ │ ├── safearray.go │ │ ├── safearray_func.go │ │ ├── safearray_windows.go │ │ ├── safearrayconversion.go │ │ ├── safearrayslices.go │ │ ├── utility.go │ │ ├── variables.go │ │ ├── variant.go │ │ ├── variant_386.go │ │ ├── variant_amd64.go │ │ ├── vt_string.go │ │ ├── winrt.go │ │ └── winrt_doc.go │ └── shirou/ │ ├── gopsutil/ │ │ ├── LICENSE │ │ ├── README.rst │ │ ├── circle.yml │ │ ├── coverall.sh │ │ ├── cpu/ │ │ │ ├── cpu.go │ │ │ ├── cpu_darwin.go │ │ │ ├── cpu_darwin_cgo.go │ │ │ ├── cpu_darwin_nocgo.go │ │ │ ├── cpu_freebsd.go │ │ │ ├── cpu_linux.go │ │ │ ├── cpu_unix.go │ │ │ └── cpu_windows.go │ │ ├── doc.go │ │ ├── host/ │ │ │ ├── host.go │ │ │ ├── host_darwin.go │ │ │ ├── host_darwin_amd64.go │ │ │ ├── host_freebsd.go │ │ │ ├── host_freebsd_amd64.go │ │ │ ├── host_linux.go │ │ │ ├── host_linux_386.go │ │ │ ├── host_linux_amd64.go │ │ │ ├── host_linux_arm.go │ │ │ ├── host_windows.go │ │ │ ├── types_darwin.go │ │ │ ├── types_freebsd.go │ │ │ └── types_linux.go │ │ ├── internal/ │ │ │ └── common/ │ │ │ ├── binary.go │ │ │ ├── common.go │ │ │ ├── common_darwin.go │ │ │ ├── common_freebsd.go │ │ │ ├── common_linux.go │ │ │ ├── common_unix.go │ │ │ └── common_windows.go │ │ ├── mem/ │ │ │ ├── mem.go │ │ │ ├── mem_darwin.go │ │ │ ├── mem_freebsd.go │ │ │ ├── mem_linux.go │ │ │ └── mem_windows.go │ │ ├── mktypes.sh │ │ ├── net/ │ │ │ ├── net.go │ │ │ ├── net_darwin.go │ │ │ ├── net_freebsd.go │ │ │ ├── net_linux.go │ │ │ ├── net_unix.go │ │ │ └── net_windows.go │ │ ├── process/ │ │ │ ├── process.go │ │ │ ├── process_darwin.go │ │ │ ├── process_darwin_amd64.go │ │ │ ├── process_freebsd.go │ │ │ ├── process_freebsd_386.go │ │ │ ├── process_freebsd_amd64.go │ │ │ ├── process_linux.go │ │ │ ├── process_linux_386.go │ │ │ ├── process_linux_amd64.go │ │ │ ├── process_linux_arm.go │ │ │ ├── process_posix.go │ │ │ ├── process_windows.go │ │ │ └── types_darwin.go │ │ └── windows_memo.rst │ └── w32/ │ ├── AUTHORS │ ├── LICENSE │ ├── README.md │ ├── advapi32.go │ ├── comctl32.go │ ├── comdlg32.go │ ├── constants.go │ ├── dwmapi.go │ ├── gdi32.go │ ├── gdiplus.go │ ├── idispatch.go │ ├── istream.go │ ├── iunknown.go │ ├── kernel32.go │ ├── ole32.go │ ├── oleaut32.go │ ├── opengl32.go │ ├── psapi.go │ ├── shell32.go │ ├── typedef.go │ ├── user32.go │ ├── utils.go │ └── vars.go └── vendor.yml
Showing preview only (270K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3617 symbols across 127 files)
FILE: client.go
type httpStats (line 12) | type httpStats struct
method add (line 17) | func (h *httpStats) add(r *HTTPRequest) {
method extract (line 23) | func (h *httpStats) extract() []*HTTPRequest {
type ClientConfig (line 33) | type ClientConfig struct
type ClientStats (line 48) | type ClientStats struct
method Run (line 91) | func (c *ClientStats) Run() {
method Stop (line 166) | func (c *ClientStats) Stop() {
function NewClient (line 65) | func NewClient(clientConfig *ClientConfig, serverConfig *ServerConfig) (...
FILE: examples/client/client.go
function main (line 13) | func main() {
function LoggingRecoveryHandler (line 55) | func LoggingRecoveryHandler(next http.Handler) http.Handler {
FILE: examples/server/server.go
function main (line 9) | func main() {
FILE: http.go
type LogResponseWritter (line 10) | type LogResponseWritter struct
method Status (line 17) | func (w *LogResponseWritter) Status() int {
method Size (line 22) | func (w *LogResponseWritter) Size() int {
method Header (line 27) | func (w *LogResponseWritter) Header() http.Header {
method Write (line 33) | func (w *LogResponseWritter) Write(data []byte) (int, error) {
method WriteHeader (line 43) | func (w *LogResponseWritter) WriteHeader(statusCode int) {
type HTTPRequest (line 50) | type HTTPRequest struct
method Writer (line 82) | func (r *HTTPRequest) Writer() http.ResponseWriter {
method Failure (line 87) | func (r *HTTPRequest) Failure(err string) {
method Complete (line 94) | func (r *HTTPRequest) Complete() {
method NewHTTPRequest (line 68) | func (s *ClientStats) NewHTTPRequest(w http.ResponseWriter, r *http.Requ...
FILE: server.go
type ServerConfig (line 11) | type ServerConfig struct
type ServerStats (line 19) | type ServerStats struct
method Run (line 41) | func (s *ServerStats) Run() <-chan *Stats {
function NewServer (line 26) | func NewServer(config *ServerConfig) (*ServerStats, error) {
FILE: stats.go
constant udp (line 12) | udp = "udp"
constant defaultBufferSize (line 13) | defaultBufferSize = 1024 * 1000
type CPUPercentages (line 17) | type CPUPercentages struct
type GoMemory (line 34) | type GoMemory struct
type GoInfo (line 46) | type GoInfo struct
type MemInfo (line 53) | type MemInfo struct
type CPUInfo (line 59) | type CPUInfo struct
type Stats (line 68) | type Stats struct
method initGoInfo (line 76) | func (s *Stats) initGoInfo() {
method GetHostInfo (line 82) | func (s *Stats) GetHostInfo() {
method GetCPUInfo (line 95) | func (s *Stats) GetCPUInfo() {
method GetCPUTimes (line 105) | func (s *Stats) GetCPUTimes() {
method CalculateCPUTimes (line 120) | func (s *Stats) CalculateCPUTimes() []CPUPercentages {
method GetAllCPUInfo (line 162) | func (s *Stats) GetAllCPUInfo() {
method GetTotalCPUTimes (line 168) | func (s *Stats) GetTotalCPUTimes() {
method CalculateTotalCPUTimes (line 183) | func (s *Stats) CalculateTotalCPUTimes() []CPUPercentages {
method GetMemoryInfo (line 225) | func (s *Stats) GetMemoryInfo(logMemory, logGoMemory bool) {
FILE: stats_test.go
function TestMain (line 22) | func TestMain(m *testing.M) {
function TestClientSendingData (line 45) | func TestClientSendingData(t *testing.T) {
FILE: vendor/github.com/StackExchange/wmi/wmi.go
constant S_FALSE (line 55) | S_FALSE = 0x00000001
function QueryNamespace (line 58) | func QueryNamespace(query string, dst interface{}, namespace string) err...
function Query (line 74) | func Query(query string, dst interface{}, connectServerArgs ...interface...
type Client (line 81) | type Client struct
method Query (line 117) | func (c *Client) Query(query string, dst interface{}, connectServerArg...
method loadEntity (line 248) | func (c *Client) loadEntity(dst interface{}, src *ole.IDispatch) (errF...
type ErrFieldMismatch (line 234) | type ErrFieldMismatch struct
method Error (line 240) | func (e *ErrFieldMismatch) Error() string {
type multiArgType (line 382) | type multiArgType
constant multiArgTypeInvalid (line 385) | multiArgTypeInvalid multiArgType = iota
constant multiArgTypeStruct (line 386) | multiArgTypeStruct
constant multiArgTypeStructPtr (line 387) | multiArgTypeStructPtr
function checkMultiArg (line 394) | func checkMultiArg(v reflect.Value) (m multiArgType, elemType reflect.Ty...
function oleInt64 (line 411) | func oleInt64(item *ole.IDispatch, prop string) (int64, error) {
function CreateQuery (line 425) | func CreateQuery(src interface{}, where string) string {
FILE: vendor/github.com/go-ole/go-ole/com.go
function coInitialize (line 50) | func coInitialize() (err error) {
function coInitializeEx (line 62) | func coInitializeEx(coinit uint32) (err error) {
function CoInitialize (line 81) | func CoInitialize(p uintptr) (err error) {
function CoInitializeEx (line 89) | func CoInitializeEx(p uintptr, coinit uint32) (err error) {
function CoUninitialize (line 96) | func CoUninitialize() {
function CoTaskMemFree (line 101) | func CoTaskMemFree(memptr uintptr) {
function CLSIDFromProgID (line 118) | func CLSIDFromProgID(progId string) (clsid *GUID, err error) {
function CLSIDFromString (line 135) | func CLSIDFromString(str string) (clsid *GUID, err error) {
function StringFromCLSID (line 147) | func StringFromCLSID(clsid *GUID) (str string, err error) {
function IIDFromString (line 158) | func IIDFromString(progId string) (clsid *GUID, err error) {
function StringFromIID (line 170) | func StringFromIID(iid *GUID) (str string, err error) {
function CreateInstance (line 181) | func CreateInstance(clsid *GUID, iid *GUID) (unk *IUnknown, err error) {
function GetActiveObject (line 198) | func GetActiveObject(clsid *GUID, iid *GUID) (unk *IUnknown, err error) {
function VariantInit (line 213) | func VariantInit(v *VARIANT) (err error) {
function VariantClear (line 222) | func VariantClear(v *VARIANT) (err error) {
function SysAllocString (line 231) | func SysAllocString(v string) (ss *int16) {
function SysAllocStringLen (line 238) | func SysAllocStringLen(v string) (ss *int16) {
function SysFreeString (line 248) | func SysFreeString(v *int16) (err error) {
function SysStringLen (line 257) | func SysStringLen(v *int16) uint32 {
function CreateStdDispatch (line 267) | func CreateStdDispatch(unk *IUnknown, v uintptr, ptinfo *IUnknown) (disp...
function CreateDispTypeInfo (line 282) | func CreateDispTypeInfo(idata *INTERFACEDATA) (pptinfo *IUnknown, err er...
function copyMemory (line 294) | func copyMemory(dest unsafe.Pointer, src unsafe.Pointer, length uint32) {
function GetUserDefaultLCID (line 299) | func GetUserDefaultLCID() (lcid uint32) {
function GetMessage (line 308) | func GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax...
function DispatchMessage (line 315) | func DispatchMessage(msg *Msg) (ret int32) {
function GetVariantDate (line 322) | func GetVariantDate(value float64) (time.Time, error) {
FILE: vendor/github.com/go-ole/go-ole/com_func.go
function coInitialize (line 19) | func coInitialize() error {
function coInitializeEx (line 24) | func coInitializeEx(coinit uint32) error {
function CoInitialize (line 37) | func CoInitialize(p uintptr) error {
function CoInitializeEx (line 42) | func CoInitializeEx(p uintptr, coinit uint32) error {
function CoUninitialize (line 47) | func CoUninitialize() {}
function CoTaskMemFree (line 50) | func CoTaskMemFree(memptr uintptr) {}
function CLSIDFromProgID (line 65) | func CLSIDFromProgID(progId string) (*GUID, error) {
function CLSIDFromString (line 75) | func CLSIDFromString(str string) (*GUID, error) {
function StringFromCLSID (line 80) | func StringFromCLSID(clsid *GUID) (string, error) {
function IIDFromString (line 85) | func IIDFromString(progId string) (*GUID, error) {
function StringFromIID (line 90) | func StringFromIID(iid *GUID) (string, error) {
function CreateInstance (line 95) | func CreateInstance(clsid *GUID, iid *GUID) (*IUnknown, error) {
function GetActiveObject (line 100) | func GetActiveObject(clsid *GUID, iid *GUID) (*IUnknown, error) {
function VariantInit (line 105) | func VariantInit(v *VARIANT) error {
function VariantClear (line 110) | func VariantClear(v *VARIANT) error {
function SysAllocString (line 115) | func SysAllocString(v string) *int16 {
function SysAllocStringLen (line 121) | func SysAllocStringLen(v string) *int16 {
function SysFreeString (line 127) | func SysFreeString(v *int16) error {
function SysStringLen (line 132) | func SysStringLen(v *int16) uint32 {
function CreateStdDispatch (line 141) | func CreateStdDispatch(unk *IUnknown, v uintptr, ptinfo *IUnknown) (*IDi...
function CreateDispTypeInfo (line 148) | func CreateDispTypeInfo(idata *INTERFACEDATA) (*IUnknown, error) {
function copyMemory (line 153) | func copyMemory(dest unsafe.Pointer, src unsafe.Pointer, length uint32) {}
function GetUserDefaultLCID (line 156) | func GetUserDefaultLCID() uint32 {
function GetMessage (line 163) | func GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax...
function DispatchMessage (line 168) | func DispatchMessage(msg *Msg) int32 {
function GetVariantDate (line 172) | func GetVariantDate(value float64) (time.Time, error) {
FILE: vendor/github.com/go-ole/go-ole/connect.go
type Connection (line 6) | type Connection struct
method Initialize (line 11) | func (*Connection) Initialize() (err error) {
method Uninitialize (line 16) | func (*Connection) Uninitialize() {
method Create (line 21) | func (c *Connection) Create(progId string) (err error) {
method Release (line 41) | func (c *Connection) Release() {
method Load (line 46) | func (c *Connection) Load(names ...string) (errors []error) {
method Dispatch (line 64) | func (c *Connection) Dispatch() (object *Dispatch, err error) {
type Dispatch (line 74) | type Dispatch struct
method Call (line 79) | func (d *Dispatch) Call(method string, params ...interface{}) (result ...
method MustCall (line 90) | func (d *Dispatch) MustCall(method string, params ...interface{}) (res...
method Get (line 105) | func (d *Dispatch) Get(name string, params ...interface{}) (result *VA...
method MustGet (line 115) | func (d *Dispatch) MustGet(name string, params ...interface{}) (result...
method Set (line 129) | func (d *Dispatch) Set(name string, params ...interface{}) (result *VA...
method MustSet (line 139) | func (d *Dispatch) MustSet(name string, params ...interface{}) (result...
method GetId (line 153) | func (d *Dispatch) GetId(name string) (id int32, err error) {
method GetIds (line 164) | func (d *Dispatch) GetIds(names ...string) (dispid []int32, err error) {
method Invoke (line 173) | func (d *Dispatch) Invoke(id int32, dispatch int16, params []interface...
method Release (line 183) | func (d *Dispatch) Release() {
function Connect (line 188) | func Connect(names ...string) (connection *Connection) {
FILE: vendor/github.com/go-ole/go-ole/constants.go
constant CLSCTX_INPROC_SERVER (line 4) | CLSCTX_INPROC_SERVER = 1
constant CLSCTX_INPROC_HANDLER (line 5) | CLSCTX_INPROC_HANDLER = 2
constant CLSCTX_LOCAL_SERVER (line 6) | CLSCTX_LOCAL_SERVER = 4
constant CLSCTX_INPROC_SERVER16 (line 7) | CLSCTX_INPROC_SERVER16 = 8
constant CLSCTX_REMOTE_SERVER (line 8) | CLSCTX_REMOTE_SERVER = 16
constant CLSCTX_ALL (line 9) | CLSCTX_ALL = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | ...
constant CLSCTX_INPROC (line 10) | CLSCTX_INPROC = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER
constant CLSCTX_SERVER (line 11) | CLSCTX_SERVER = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CL...
constant COINIT_APARTMENTTHREADED (line 15) | COINIT_APARTMENTTHREADED = 0x2
constant COINIT_MULTITHREADED (line 16) | COINIT_MULTITHREADED = 0x0
constant COINIT_DISABLE_OLE1DDE (line 17) | COINIT_DISABLE_OLE1DDE = 0x4
constant COINIT_SPEED_OVER_MEMORY (line 18) | COINIT_SPEED_OVER_MEMORY = 0x8
constant DISPATCH_METHOD (line 22) | DISPATCH_METHOD = 1
constant DISPATCH_PROPERTYGET (line 23) | DISPATCH_PROPERTYGET = 2
constant DISPATCH_PROPERTYPUT (line 24) | DISPATCH_PROPERTYPUT = 4
constant DISPATCH_PROPERTYPUTREF (line 25) | DISPATCH_PROPERTYPUTREF = 8
constant S_OK (line 29) | S_OK = 0x00000000
constant E_UNEXPECTED (line 30) | E_UNEXPECTED = 0x8000FFFF
constant E_NOTIMPL (line 31) | E_NOTIMPL = 0x80004001
constant E_OUTOFMEMORY (line 32) | E_OUTOFMEMORY = 0x8007000E
constant E_INVALIDARG (line 33) | E_INVALIDARG = 0x80070057
constant E_NOINTERFACE (line 34) | E_NOINTERFACE = 0x80004002
constant E_POINTER (line 35) | E_POINTER = 0x80004003
constant E_HANDLE (line 36) | E_HANDLE = 0x80070006
constant E_ABORT (line 37) | E_ABORT = 0x80004004
constant E_FAIL (line 38) | E_FAIL = 0x80004005
constant E_ACCESSDENIED (line 39) | E_ACCESSDENIED = 0x80070005
constant E_PENDING (line 40) | E_PENDING = 0x8000000A
constant CO_E_CLASSSTRING (line 42) | CO_E_CLASSSTRING = 0x800401F3
constant CC_FASTCALL (line 46) | CC_FASTCALL = iota
constant CC_CDECL (line 47) | CC_CDECL
constant CC_MSCPASCAL (line 48) | CC_MSCPASCAL
constant CC_PASCAL (line 49) | CC_PASCAL = CC_MSCPASCAL
constant CC_MACPASCAL (line 50) | CC_MACPASCAL
constant CC_STDCALL (line 51) | CC_STDCALL
constant CC_FPFASTCALL (line 52) | CC_FPFASTCALL
constant CC_SYSCALL (line 53) | CC_SYSCALL
constant CC_MPWCDECL (line 54) | CC_MPWCDECL
constant CC_MPWPASCAL (line 55) | CC_MPWPASCAL
constant CC_MAX (line 56) | CC_MAX = CC_MPWPASCAL
type VT (line 59) | type VT
constant VT_EMPTY (line 62) | VT_EMPTY VT = 0x0
constant VT_NULL (line 63) | VT_NULL VT = 0x1
constant VT_I2 (line 64) | VT_I2 VT = 0x2
constant VT_I4 (line 65) | VT_I4 VT = 0x3
constant VT_R4 (line 66) | VT_R4 VT = 0x4
constant VT_R8 (line 67) | VT_R8 VT = 0x5
constant VT_CY (line 68) | VT_CY VT = 0x6
constant VT_DATE (line 69) | VT_DATE VT = 0x7
constant VT_BSTR (line 70) | VT_BSTR VT = 0x8
constant VT_DISPATCH (line 71) | VT_DISPATCH VT = 0x9
constant VT_ERROR (line 72) | VT_ERROR VT = 0xa
constant VT_BOOL (line 73) | VT_BOOL VT = 0xb
constant VT_VARIANT (line 74) | VT_VARIANT VT = 0xc
constant VT_UNKNOWN (line 75) | VT_UNKNOWN VT = 0xd
constant VT_DECIMAL (line 76) | VT_DECIMAL VT = 0xe
constant VT_I1 (line 77) | VT_I1 VT = 0x10
constant VT_UI1 (line 78) | VT_UI1 VT = 0x11
constant VT_UI2 (line 79) | VT_UI2 VT = 0x12
constant VT_UI4 (line 80) | VT_UI4 VT = 0x13
constant VT_I8 (line 81) | VT_I8 VT = 0x14
constant VT_UI8 (line 82) | VT_UI8 VT = 0x15
constant VT_INT (line 83) | VT_INT VT = 0x16
constant VT_UINT (line 84) | VT_UINT VT = 0x17
constant VT_VOID (line 85) | VT_VOID VT = 0x18
constant VT_HRESULT (line 86) | VT_HRESULT VT = 0x19
constant VT_PTR (line 87) | VT_PTR VT = 0x1a
constant VT_SAFEARRAY (line 88) | VT_SAFEARRAY VT = 0x1b
constant VT_CARRAY (line 89) | VT_CARRAY VT = 0x1c
constant VT_USERDEFINED (line 90) | VT_USERDEFINED VT = 0x1d
constant VT_LPSTR (line 91) | VT_LPSTR VT = 0x1e
constant VT_LPWSTR (line 92) | VT_LPWSTR VT = 0x1f
constant VT_RECORD (line 93) | VT_RECORD VT = 0x24
constant VT_INT_PTR (line 94) | VT_INT_PTR VT = 0x25
constant VT_UINT_PTR (line 95) | VT_UINT_PTR VT = 0x26
constant VT_FILETIME (line 96) | VT_FILETIME VT = 0x40
constant VT_BLOB (line 97) | VT_BLOB VT = 0x41
constant VT_STREAM (line 98) | VT_STREAM VT = 0x42
constant VT_STORAGE (line 99) | VT_STORAGE VT = 0x43
constant VT_STREAMED_OBJECT (line 100) | VT_STREAMED_OBJECT VT = 0x44
constant VT_STORED_OBJECT (line 101) | VT_STORED_OBJECT VT = 0x45
constant VT_BLOB_OBJECT (line 102) | VT_BLOB_OBJECT VT = 0x46
constant VT_CF (line 103) | VT_CF VT = 0x47
constant VT_CLSID (line 104) | VT_CLSID VT = 0x48
constant VT_BSTR_BLOB (line 105) | VT_BSTR_BLOB VT = 0xfff
constant VT_VECTOR (line 106) | VT_VECTOR VT = 0x1000
constant VT_ARRAY (line 107) | VT_ARRAY VT = 0x2000
constant VT_BYREF (line 108) | VT_BYREF VT = 0x4000
constant VT_RESERVED (line 109) | VT_RESERVED VT = 0x8000
constant VT_ILLEGAL (line 110) | VT_ILLEGAL VT = 0xffff
constant VT_ILLEGALMASKED (line 111) | VT_ILLEGALMASKED VT = 0xfff
constant VT_TYPEMASK (line 112) | VT_TYPEMASK VT = 0xfff
constant DISPID_UNKNOWN (line 116) | DISPID_UNKNOWN = -1
constant DISPID_VALUE (line 117) | DISPID_VALUE = 0
constant DISPID_PROPERTYPUT (line 118) | DISPID_PROPERTYPUT = -3
constant DISPID_NEWENUM (line 119) | DISPID_NEWENUM = -4
constant DISPID_EVALUATE (line 120) | DISPID_EVALUATE = -5
constant DISPID_CONSTRUCTOR (line 121) | DISPID_CONSTRUCTOR = -6
constant DISPID_DESTRUCTOR (line 122) | DISPID_DESTRUCTOR = -7
constant DISPID_COLLECT (line 123) | DISPID_COLLECT = -8
constant TKIND_ENUM (line 127) | TKIND_ENUM = 1
constant TKIND_RECORD (line 128) | TKIND_RECORD = 2
constant TKIND_MODULE (line 129) | TKIND_MODULE = 3
constant TKIND_INTERFACE (line 130) | TKIND_INTERFACE = 4
constant TKIND_DISPATCH (line 131) | TKIND_DISPATCH = 5
constant TKIND_COCLASS (line 132) | TKIND_COCLASS = 6
constant TKIND_ALIAS (line 133) | TKIND_ALIAS = 7
constant TKIND_UNION (line 134) | TKIND_UNION = 8
constant TKIND_MAX (line 135) | TKIND_MAX = 9
constant FADF_AUTO (line 141) | FADF_AUTO = 0x0001
constant FADF_STATIC (line 142) | FADF_STATIC = 0x0002
constant FADF_EMBEDDED (line 143) | FADF_EMBEDDED = 0x0004
constant FADF_FIXEDSIZE (line 144) | FADF_FIXEDSIZE = 0x0010
constant FADF_RECORD (line 145) | FADF_RECORD = 0x0020
constant FADF_HAVEIID (line 146) | FADF_HAVEIID = 0x0040
constant FADF_HAVEVARTYPE (line 147) | FADF_HAVEVARTYPE = 0x0080
constant FADF_BSTR (line 148) | FADF_BSTR = 0x0100
constant FADF_UNKNOWN (line 149) | FADF_UNKNOWN = 0x0200
constant FADF_DISPATCH (line 150) | FADF_DISPATCH = 0x0400
constant FADF_VARIANT (line 151) | FADF_VARIANT = 0x0800
constant FADF_RESERVED (line 152) | FADF_RESERVED = 0xF008
FILE: vendor/github.com/go-ole/go-ole/error.go
type OleError (line 4) | type OleError struct
method Code (line 26) | func (v *OleError) Code() uintptr {
method String (line 31) | func (v *OleError) String() string {
method Error (line 39) | func (v *OleError) Error() string {
method Description (line 44) | func (v *OleError) Description() string {
method SubError (line 49) | func (v *OleError) SubError() error {
function NewError (line 11) | func NewError(hr uintptr) *OleError {
function NewErrorWithDescription (line 16) | func NewErrorWithDescription(hr uintptr, description string) *OleError {
function NewErrorWithSubError (line 21) | func NewErrorWithSubError(hr uintptr, description string, err error) *Ol...
FILE: vendor/github.com/go-ole/go-ole/error_func.go
function errstr (line 6) | func errstr(errno int) string {
FILE: vendor/github.com/go-ole/go-ole/error_windows.go
function errstr (line 12) | func errstr(errno int) string {
FILE: vendor/github.com/go-ole/go-ole/guid.go
constant hextable (line 92) | hextable = "0123456789ABCDEF"
constant emptyGUID (line 93) | emptyGUID = "{00000000-0000-0000-0000-000000000000}"
type GUID (line 99) | type GUID struct
method String (line 224) | func (guid *GUID) String() string {
function NewGUID (line 116) | func NewGUID(guid string) *GUID {
function decodeHexUint32 (line 158) | func decodeHexUint32(src []byte) (value uint32, ok bool) {
function decodeHexUint16 (line 170) | func decodeHexUint16(src []byte) (value uint16, ok bool) {
function decodeHexByte64 (line 180) | func decodeHexByte64(s1 []byte, s2 []byte) (value [8]byte, ok bool) {
function decodeHexByte (line 194) | func decodeHexByte(c1, c2 byte) (value byte, ok bool) {
function decodeHexChar (line 204) | func decodeHexChar(c byte) (byte, bool) {
function putUint32Hex (line 244) | func putUint32Hex(b []byte, v uint32) {
function putUint16Hex (line 255) | func putUint16Hex(b []byte, v uint16) {
function putByteHex (line 262) | func putByteHex(dst, src []byte) {
function IsEqualGUID (line 272) | func IsEqualGUID(guid1 *GUID, guid2 *GUID) bool {
FILE: vendor/github.com/go-ole/go-ole/iconnectionpoint.go
type IConnectionPoint (line 5) | type IConnectionPoint struct
method VTable (line 18) | func (v *IConnectionPoint) VTable() *IConnectionPointVtbl {
type IConnectionPointVtbl (line 9) | type IConnectionPointVtbl struct
FILE: vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go
method GetConnectionInterface (line 7) | func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 {
method Advise (line 11) | func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error) {
method Unadvise (line 15) | func (v *IConnectionPoint) Unadvise(cookie uint32) error {
method EnumConnections (line 19) | func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error) {
FILE: vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go
method GetConnectionInterface (line 10) | func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 {
method Advise (line 15) | func (v *IConnectionPoint) Advise(unknown *IUnknown) (cookie uint32, err...
method Unadvise (line 28) | func (v *IConnectionPoint) Unadvise(cookie uint32) (err error) {
method EnumConnections (line 41) | func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) error {
FILE: vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go
type IConnectionPointContainer (line 5) | type IConnectionPointContainer struct
method VTable (line 15) | func (v *IConnectionPointContainer) VTable() *IConnectionPointContaine...
type IConnectionPointContainerVtbl (line 9) | type IConnectionPointContainerVtbl struct
FILE: vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go
method EnumConnectionPoints (line 5) | func (v *IConnectionPointContainer) EnumConnectionPoints(points interfac...
method FindConnectionPoint (line 9) | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point...
FILE: vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go
method EnumConnectionPoints (line 10) | func (v *IConnectionPointContainer) EnumConnectionPoints(points interfac...
method FindConnectionPoint (line 14) | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point...
FILE: vendor/github.com/go-ole/go-ole/idispatch.go
type IDispatch (line 5) | type IDispatch struct
method VTable (line 17) | func (v *IDispatch) VTable() *IDispatchVtbl {
method GetIDsOfName (line 21) | func (v *IDispatch) GetIDsOfName(names []string) (dispid []int32, err ...
method Invoke (line 26) | func (v *IDispatch) Invoke(dispid int32, dispatch int16, params ...int...
method GetTypeInfoCount (line 31) | func (v *IDispatch) GetTypeInfoCount() (c uint32, err error) {
method GetTypeInfo (line 36) | func (v *IDispatch) GetTypeInfo() (tinfo *ITypeInfo, err error) {
method GetSingleIDOfName (line 45) | func (v *IDispatch) GetSingleIDOfName(name string) (displayID int32, e...
method InvokeWithOptionalArgs (line 62) | func (v *IDispatch) InvokeWithOptionalArgs(name string, dispatch int16...
method CallMethod (line 78) | func (v *IDispatch) CallMethod(name string, params ...interface{}) (*V...
method GetProperty (line 87) | func (v *IDispatch) GetProperty(name string, params ...interface{}) (*...
method PutProperty (line 92) | func (v *IDispatch) PutProperty(name string, params ...interface{}) (*...
type IDispatchVtbl (line 9) | type IDispatchVtbl struct
FILE: vendor/github.com/go-ole/go-ole/idispatch_func.go
function getIDsOfName (line 5) | func getIDsOfName(disp *IDispatch, names []string) ([]int32, error) {
function getTypeInfoCount (line 9) | func getTypeInfoCount(disp *IDispatch) (uint32, error) {
function getTypeInfo (line 13) | func getTypeInfo(disp *IDispatch) (*ITypeInfo, error) {
function invoke (line 17) | func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...int...
FILE: vendor/github.com/go-ole/go-ole/idispatch_windows.go
function getIDsOfName (line 11) | func getIDsOfName(disp *IDispatch, names []string) (dispid []int32, err ...
function getTypeInfoCount (line 33) | func getTypeInfoCount(disp *IDispatch) (c uint32, err error) {
function getTypeInfo (line 46) | func getTypeInfo(disp *IDispatch) (tinfo *ITypeInfo, err error) {
function invoke (line 59) | func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...int...
FILE: vendor/github.com/go-ole/go-ole/ienumvariant.go
type IEnumVARIANT (line 5) | type IEnumVARIANT struct
method VTable (line 17) | func (v *IEnumVARIANT) VTable() *IEnumVARIANTVtbl {
type IEnumVARIANTVtbl (line 9) | type IEnumVARIANTVtbl struct
FILE: vendor/github.com/go-ole/go-ole/ienumvariant_func.go
method Clone (line 5) | func (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error) {
method Reset (line 9) | func (enum *IEnumVARIANT) Reset() error {
method Skip (line 13) | func (enum *IEnumVARIANT) Skip(celt uint) error {
method Next (line 17) | func (enum *IEnumVARIANT) Next(celt uint) (VARIANT, uint, error) {
FILE: vendor/github.com/go-ole/go-ole/ienumvariant_windows.go
method Clone (line 10) | func (enum *IEnumVARIANT) Clone() (cloned *IEnumVARIANT, err error) {
method Reset (line 23) | func (enum *IEnumVARIANT) Reset() (err error) {
method Skip (line 36) | func (enum *IEnumVARIANT) Skip(celt uint) (err error) {
method Next (line 49) | func (enum *IEnumVARIANT) Next(celt uint) (array VARIANT, length uint, e...
FILE: vendor/github.com/go-ole/go-ole/iinspectable.go
type IInspectable (line 5) | type IInspectable struct
method VTable (line 16) | func (v *IInspectable) VTable() *IInspectableVtbl {
type IInspectableVtbl (line 9) | type IInspectableVtbl struct
FILE: vendor/github.com/go-ole/go-ole/iinspectable_func.go
method GetIids (line 5) | func (v *IInspectable) GetIids() ([]*GUID, error) {
method GetRuntimeClassName (line 9) | func (v *IInspectable) GetRuntimeClassName() (string, error) {
method GetTrustLevel (line 13) | func (v *IInspectable) GetTrustLevel() (uint32, error) {
FILE: vendor/github.com/go-ole/go-ole/iinspectable_windows.go
method GetIids (line 13) | func (v *IInspectable) GetIids() (iids []*GUID, err error) {
method GetRuntimeClassName (line 44) | func (v *IInspectable) GetRuntimeClassName() (s string, err error) {
method GetTrustLevel (line 61) | func (v *IInspectable) GetTrustLevel() (level uint32, err error) {
FILE: vendor/github.com/go-ole/go-ole/iprovideclassinfo.go
type IProvideClassInfo (line 5) | type IProvideClassInfo struct
method VTable (line 14) | func (v *IProvideClassInfo) VTable() *IProvideClassInfoVtbl {
method GetClassInfo (line 18) | func (v *IProvideClassInfo) GetClassInfo() (cinfo *ITypeInfo, err erro...
type IProvideClassInfoVtbl (line 9) | type IProvideClassInfoVtbl struct
FILE: vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go
function getClassInfo (line 5) | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) {
FILE: vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go
function getClassInfo (line 10) | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) {
FILE: vendor/github.com/go-ole/go-ole/itypeinfo.go
type ITypeInfo (line 5) | type ITypeInfo struct
method VTable (line 32) | func (v *ITypeInfo) VTable() *ITypeInfoVtbl {
type ITypeInfoVtbl (line 9) | type ITypeInfoVtbl struct
FILE: vendor/github.com/go-ole/go-ole/itypeinfo_func.go
method GetTypeAttr (line 5) | func (v *ITypeInfo) GetTypeAttr() (*TYPEATTR, error) {
FILE: vendor/github.com/go-ole/go-ole/itypeinfo_windows.go
method GetTypeAttr (line 10) | func (v *ITypeInfo) GetTypeAttr() (tattr *TYPEATTR, err error) {
FILE: vendor/github.com/go-ole/go-ole/iunknown.go
type IUnknown (line 5) | type IUnknown struct
method VTable (line 21) | func (v *IUnknown) VTable() *IUnknownVtbl {
method PutQueryInterface (line 25) | func (v *IUnknown) PutQueryInterface(interfaceID *GUID, obj interface{...
method IDispatch (line 29) | func (v *IUnknown) IDispatch(interfaceID *GUID) (dispatch *IDispatch, ...
method IEnumVARIANT (line 34) | func (v *IUnknown) IEnumVARIANT(interfaceID *GUID) (enum *IEnumVARIANT...
method QueryInterface (line 39) | func (v *IUnknown) QueryInterface(iid *GUID) (*IDispatch, error) {
method MustQueryInterface (line 43) | func (v *IUnknown) MustQueryInterface(iid *GUID) (disp *IDispatch) {
method AddRef (line 51) | func (v *IUnknown) AddRef() int32 {
method Release (line 55) | func (v *IUnknown) Release() int32 {
type IUnknownVtbl (line 9) | type IUnknownVtbl struct
type UnknownLike (line 15) | type UnknownLike interface
FILE: vendor/github.com/go-ole/go-ole/iunknown_func.go
function reflectQueryInterface (line 5) | func reflectQueryInterface(self interface{}, method uintptr, interfaceID...
function queryInterface (line 9) | func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err erro...
function addRef (line 13) | func addRef(unk *IUnknown) int32 {
function release (line 17) | func release(unk *IUnknown) int32 {
FILE: vendor/github.com/go-ole/go-ole/iunknown_windows.go
function reflectQueryInterface (line 11) | func reflectQueryInterface(self interface{}, method uintptr, interfaceID...
function queryInterface (line 27) | func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err erro...
function addRef (line 40) | func addRef(unk *IUnknown) int32 {
function release (line 50) | func release(unk *IUnknown) int32 {
FILE: vendor/github.com/go-ole/go-ole/ole.go
type DISPPARAMS (line 9) | type DISPPARAMS struct
type EXCEPINFO (line 17) | type EXCEPINFO struct
method String (line 30) | func (e EXCEPINFO) String() string {
method Error (line 57) | func (e EXCEPINFO) Error() string {
type PARAMDATA (line 76) | type PARAMDATA struct
type METHODDATA (line 82) | type METHODDATA struct
type INTERFACEDATA (line 94) | type INTERFACEDATA struct
type Point (line 100) | type Point struct
type Msg (line 106) | type Msg struct
type TYPEDESC (line 116) | type TYPEDESC struct
type IDLDESC (line 122) | type IDLDESC struct
type TYPEATTR (line 128) | type TYPEATTR struct
FILE: vendor/github.com/go-ole/go-ole/oleutil/connection.go
type stdDispatch (line 12) | type stdDispatch struct
type stdDispatchVtbl (line 20) | type stdDispatchVtbl struct
function dispQueryInterface (line 30) | func dispQueryInterface(this *ole.IUnknown, iid *ole.GUID, punk **ole.IU...
function dispAddRef (line 47) | func dispAddRef(this *ole.IUnknown) int32 {
function dispRelease (line 53) | func dispRelease(this *ole.IUnknown) int32 {
function dispGetIDsOfNames (line 59) | func dispGetIDsOfNames(this *ole.IUnknown, iid *ole.GUID, wnames []*uint...
function dispGetTypeInfoCount (line 73) | func dispGetTypeInfoCount(pcount *int) uintptr {
function dispGetTypeInfo (line 80) | func dispGetTypeInfo(ptypeif *uintptr) uintptr {
function dispInvoke (line 84) | func dispInvoke(this *ole.IDispatch, dispid int32, riid *ole.GUID, lcid ...
FILE: vendor/github.com/go-ole/go-ole/oleutil/connection_func.go
function ConnectObject (line 8) | func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}...
FILE: vendor/github.com/go-ole/go-ole/oleutil/connection_windows.go
function ConnectObject (line 14) | func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}...
FILE: vendor/github.com/go-ole/go-ole/oleutil/oleutil.go
function ClassIDFrom (line 6) | func ClassIDFrom(programID string) (classID *ole.GUID, err error) {
function CreateObject (line 15) | func CreateObject(programID string) (unknown *ole.IUnknown, err error) {
function GetActiveObject (line 35) | func GetActiveObject(programID string) (unknown *ole.IUnknown, err error) {
function CallMethod (line 50) | func CallMethod(disp *ole.IDispatch, name string, params ...interface{})...
function MustCallMethod (line 55) | func MustCallMethod(disp *ole.IDispatch, name string, params ...interfac...
function GetProperty (line 64) | func GetProperty(disp *ole.IDispatch, name string, params ...interface{}...
function MustGetProperty (line 69) | func MustGetProperty(disp *ole.IDispatch, name string, params ...interfa...
function PutProperty (line 78) | func PutProperty(disp *ole.IDispatch, name string, params ...interface{}...
function MustPutProperty (line 83) | func MustPutProperty(disp *ole.IDispatch, name string, params ...interfa...
FILE: vendor/github.com/go-ole/go-ole/safearray.go
type SafeArrayBound (line 6) | type SafeArrayBound struct
type SafeArray (line 12) | type SafeArray struct
type SAFEARRAY (line 23) | type SAFEARRAY
type SAFEARRAYBOUND (line 27) | type SAFEARRAYBOUND
FILE: vendor/github.com/go-ole/go-ole/safearray_func.go
function safeArrayAccessData (line 12) | func safeArrayAccessData(safearray *SafeArray) (uintptr, error) {
function safeArrayUnaccessData (line 19) | func safeArrayUnaccessData(safearray *SafeArray) error {
function safeArrayAllocData (line 26) | func safeArrayAllocData(safearray *SafeArray) error {
function safeArrayAllocDescriptor (line 33) | func safeArrayAllocDescriptor(dimensions uint32) (*SafeArray, error) {
function safeArrayAllocDescriptorEx (line 40) | func safeArrayAllocDescriptorEx(variantType VT, dimensions uint32) (*Saf...
function safeArrayCopy (line 47) | func safeArrayCopy(original *SafeArray) (*SafeArray, error) {
function safeArrayCopyData (line 54) | func safeArrayCopyData(original *SafeArray, duplicate *SafeArray) error {
function safeArrayCreate (line 61) | func safeArrayCreate(variantType VT, dimensions uint32, bounds *SafeArra...
function safeArrayCreateEx (line 68) | func safeArrayCreateEx(variantType VT, dimensions uint32, bounds *SafeAr...
function safeArrayCreateVector (line 75) | func safeArrayCreateVector(variantType VT, lowerBound int32, length uint...
function safeArrayCreateVectorEx (line 82) | func safeArrayCreateVectorEx(variantType VT, lowerBound int32, length ui...
function safeArrayDestroy (line 89) | func safeArrayDestroy(safearray *SafeArray) error {
function safeArrayDestroyData (line 96) | func safeArrayDestroyData(safearray *SafeArray) error {
function safeArrayDestroyDescriptor (line 103) | func safeArrayDestroyDescriptor(safearray *SafeArray) error {
function safeArrayGetDim (line 113) | func safeArrayGetDim(safearray *SafeArray) (*uint32, error) {
function safeArrayGetElementSize (line 121) | func safeArrayGetElementSize(safearray *SafeArray) (*uint32, error) {
function safeArrayGetElement (line 127) | func safeArrayGetElement(safearray *SafeArray, index int64, pv unsafe.Po...
function safeArrayGetElementString (line 132) | func safeArrayGetElementString(safearray *SafeArray, index int64) (strin...
function safeArrayGetIID (line 139) | func safeArrayGetIID(safearray *SafeArray) (*GUID, error) {
function safeArrayGetLBound (line 149) | func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (int64, ...
function safeArrayGetUBound (line 159) | func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (int64, ...
function safeArrayGetVartype (line 166) | func safeArrayGetVartype(safearray *SafeArray) (uint16, error) {
function safeArrayLock (line 176) | func safeArrayLock(safearray *SafeArray) error {
function safeArrayUnlock (line 183) | func safeArrayUnlock(safearray *SafeArray) error {
function safeArrayPutElement (line 191) | func safeArrayPutElement(safearray *SafeArray, index int64, element uint...
function safeArrayGetRecordInfo (line 200) | func safeArrayGetRecordInfo(safearray *SafeArray) (interface{}, error) {
function safeArraySetRecordInfo (line 209) | func safeArraySetRecordInfo(safearray *SafeArray, recordInfo interface{}...
FILE: vendor/github.com/go-ole/go-ole/safearray_windows.go
function safeArrayAccessData (line 45) | func safeArrayAccessData(safearray *SafeArray) (element uintptr, err err...
function safeArrayUnaccessData (line 56) | func safeArrayUnaccessData(safearray *SafeArray) (err error) {
function safeArrayAllocData (line 64) | func safeArrayAllocData(safearray *SafeArray) (err error) {
function safeArrayAllocDescriptor (line 72) | func safeArrayAllocDescriptor(dimensions uint32) (safearray *SafeArray, ...
function safeArrayAllocDescriptorEx (line 81) | func safeArrayAllocDescriptorEx(variantType VT, dimensions uint32) (safe...
function safeArrayCopy (line 93) | func safeArrayCopy(original *SafeArray) (safearray *SafeArray, err error) {
function safeArrayCopyData (line 104) | func safeArrayCopyData(original *SafeArray, duplicate *SafeArray) (err e...
function safeArrayCreate (line 115) | func safeArrayCreate(variantType VT, dimensions uint32, bounds *SafeArra...
function safeArrayCreateEx (line 127) | func safeArrayCreateEx(variantType VT, dimensions uint32, bounds *SafeAr...
function safeArrayCreateVector (line 140) | func safeArrayCreateVector(variantType VT, lowerBound int32, length uint...
function safeArrayCreateVectorEx (line 152) | func safeArrayCreateVectorEx(variantType VT, lowerBound int32, length ui...
function safeArrayDestroy (line 165) | func safeArrayDestroy(safearray *SafeArray) (err error) {
function safeArrayDestroyData (line 173) | func safeArrayDestroyData(safearray *SafeArray) (err error) {
function safeArrayDestroyDescriptor (line 181) | func safeArrayDestroyDescriptor(safearray *SafeArray) (err error) {
function safeArrayGetDim (line 192) | func safeArrayGetDim(safearray *SafeArray) (dimensions *uint32, err erro...
function safeArrayGetElementSize (line 201) | func safeArrayGetElementSize(safearray *SafeArray) (length *uint32, err ...
function safeArrayGetElement (line 208) | func safeArrayGetElement(safearray *SafeArray, index int64, pv unsafe.Po...
function safeArrayGetElementString (line 217) | func safeArrayGetElementString(safearray *SafeArray, index int64) (str s...
function safeArrayGetIID (line 232) | func safeArrayGetIID(safearray *SafeArray) (guid *GUID, err error) {
function safeArrayGetLBound (line 246) | func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (lowerBo...
function safeArrayGetUBound (line 261) | func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (upperBo...
function safeArrayGetVartype (line 273) | func safeArrayGetVartype(safearray *SafeArray) (varType uint16, err erro...
function safeArrayLock (line 287) | func safeArrayLock(safearray *SafeArray) (err error) {
function safeArrayUnlock (line 295) | func safeArrayUnlock(safearray *SafeArray) (err error) {
function safeArrayPutElement (line 304) | func safeArrayPutElement(safearray *SafeArray, index int64, element uint...
function safeArrayGetRecordInfo (line 318) | func safeArrayGetRecordInfo(safearray *SafeArray) (recordInfo interface{...
function safeArraySetRecordInfo (line 331) | func safeArraySetRecordInfo(safearray *SafeArray, recordInfo interface{}...
FILE: vendor/github.com/go-ole/go-ole/safearrayconversion.go
type SafeArrayConversion (line 9) | type SafeArrayConversion struct
method ToStringArray (line 13) | func (sac *SafeArrayConversion) ToStringArray() (strings []string) {
method ToByteArray (line 24) | func (sac *SafeArrayConversion) ToByteArray() (bytes []byte) {
method ToValueArray (line 35) | func (sac *SafeArrayConversion) ToValueArray() (values []interface{}) {
method GetType (line 102) | func (sac *SafeArrayConversion) GetType() (varType uint16, err error) {
method GetDimensions (line 106) | func (sac *SafeArrayConversion) GetDimensions() (dimensions *uint32, e...
method GetSize (line 110) | func (sac *SafeArrayConversion) GetSize() (length *uint32, err error) {
method TotalElements (line 114) | func (sac *SafeArrayConversion) TotalElements(index uint32) (totalElem...
method Release (line 138) | func (sac *SafeArrayConversion) Release() {
FILE: vendor/github.com/go-ole/go-ole/safearrayslices.go
function safeArrayFromByteSlice (line 9) | func safeArrayFromByteSlice(slice []byte) *SafeArray {
function safeArrayFromStringSlice (line 22) | func safeArrayFromStringSlice(slice []string) *SafeArray {
FILE: vendor/github.com/go-ole/go-ole/utility.go
function ClassIDFrom (line 13) | func ClassIDFrom(programID string) (classID *GUID, err error) {
function BytePtrToString (line 25) | func BytePtrToString(p *byte) string {
function UTF16PtrToString (line 37) | func UTF16PtrToString(p *uint16) string {
function LpOleStrToString (line 42) | func LpOleStrToString(p *uint16) string {
function BstrToString (line 61) | func BstrToString(p *uint16) string {
function lpOleStrLen (line 78) | func lpOleStrLen(p *uint16) (length int64) {
function convertHresultToError (line 96) | func convertHresultToError(hr uintptr, r2 uintptr, ignore error) (err er...
FILE: vendor/github.com/go-ole/go-ole/variant.go
function NewVariant (line 6) | func NewVariant(vt VT, val int64) VARIANT {
method ToIUnknown (line 11) | func (v *VARIANT) ToIUnknown() *IUnknown {
method ToIDispatch (line 19) | func (v *VARIANT) ToIDispatch() *IDispatch {
method ToArray (line 27) | func (v *VARIANT) ToArray() *SafeArrayConversion {
method ToString (line 38) | func (v *VARIANT) ToString() string {
method Clear (line 46) | func (v *VARIANT) Clear() error {
method Value (line 57) | func (v *VARIANT) Value() interface{} {
FILE: vendor/github.com/go-ole/go-ole/variant_386.go
type VARIANT (line 5) | type VARIANT struct
FILE: vendor/github.com/go-ole/go-ole/variant_amd64.go
type VARIANT (line 5) | type VARIANT struct
FILE: vendor/github.com/go-ole/go-ole/vt_string.go
constant _VT_name_0 (line 8) | _VT_name_0 = "VT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_D...
constant _VT_name_1 (line 9) | _VT_name_1 = "VT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_H...
constant _VT_name_2 (line 10) | _VT_name_2 = "VT_RECORDVT_INT_PTRVT_UINT_PTR"
constant _VT_name_3 (line 11) | _VT_name_3 = "VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_...
constant _VT_name_4 (line 12) | _VT_name_4 = "VT_BSTR_BLOBVT_VECTOR"
constant _VT_name_5 (line 13) | _VT_name_5 = "VT_ARRAY"
constant _VT_name_6 (line 14) | _VT_name_6 = "VT_BYREF"
constant _VT_name_7 (line 15) | _VT_name_7 = "VT_RESERVED"
constant _VT_name_8 (line 16) | _VT_name_8 = "VT_ILLEGAL"
method String (line 31) | func (i VT) String() string {
FILE: vendor/github.com/go-ole/go-ole/winrt.go
function RoInitialize (line 21) | func RoInitialize(thread_type uint32) (err error) {
function RoActivateInstance (line 29) | func RoActivateInstance(clsid string) (ins *IInspectable, err error) {
function RoGetActivationFactory (line 45) | func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable,...
type HString (line 63) | type HString
method String (line 89) | func (h HString) String() string {
function NewHString (line 66) | func NewHString(s string) (hstring HString, err error) {
function DeleteHString (line 80) | func DeleteHString(hstring HString) (err error) {
FILE: vendor/github.com/go-ole/go-ole/winrt_doc.go
function RoInitialize (line 6) | func RoInitialize(thread_type uint32) (err error) {
function RoActivateInstance (line 11) | func RoActivateInstance(clsid string) (ins *IInspectable, err error) {
function RoGetActivationFactory (line 16) | func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable,...
type HString (line 21) | type HString
method String (line 34) | func (h HString) String() string {
function NewHString (line 24) | func NewHString(s string) (hstring HString, err error) {
function DeleteHString (line 29) | func DeleteHString(hstring HString) (err error) {
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu.go
type CPUTimesStat (line 10) | type CPUTimesStat struct
method String (line 47) | func (c CPUTimesStat) String() string {
method Total (line 67) | func (c CPUTimesStat) Total() float64 {
type CPUInfoStat (line 25) | type CPUInfoStat struct
method String (line 73) | func (c CPUInfoStat) String() string {
function CPUCounts (line 43) | func CPUCounts(logical bool) (int, error) {
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go
constant CPUser (line 13) | CPUser = 0
constant CPNice (line 14) | CPNice = 1
constant CPSys (line 15) | CPSys = 2
constant CPIntr (line 16) | CPIntr = 3
constant CPIdle (line 17) | CPIdle = 4
constant CPUStates (line 18) | CPUStates = 5
function CPUTimes (line 24) | func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
function CPUInfo (line 33) | func CPUInfo() ([]CPUInfoStat, error) {
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go
function perCPUTimes (line 28) | func perCPUTimes() ([]CPUTimesStat, error) {
function allCPUTimes (line 84) | func allCPUTimes() ([]CPUTimesStat, error) {
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_nocgo.go
function perCPUTimes (line 8) | func perCPUTimes() ([]CPUTimesStat, error) {
function allCPUTimes (line 12) | func allCPUTimes() ([]CPUTimesStat, error) {
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go
constant CPUser (line 17) | CPUser = 0
constant CPNice (line 18) | CPNice = 1
constant CPSys (line 19) | CPSys = 2
constant CPIntr (line 20) | CPIntr = 3
constant CPIdle (line 21) | CPIdle = 4
constant CPUStates (line 22) | CPUStates = 5
function init (line 27) | func init() {
function CPUTimes (line 38) | func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
function CPUInfo (line 99) | func CPUInfo() ([]CPUInfoStat, error) {
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go
function init (line 17) | func init() {
function CPUTimes (line 28) | func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
function sysCpuPath (line 59) | func sysCpuPath(cpu int32, relPath string) string {
function finishCPUInfo (line 63) | func finishCPUInfo(c *CPUInfoStat) error {
function CPUInfo (line 90) | func CPUInfo() ([]CPUInfoStat, error) {
function parseStatLine (line 166) | func parseStatLine(line string) (*CPUTimesStat, error) {
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_unix.go
function CPUPercent (line 10) | func CPUPercent(interval time.Duration, percpu bool) ([]float64, error) {
FILE: vendor/github.com/shirou/gopsutil/cpu/cpu_windows.go
type Win32_Processor (line 16) | type Win32_Processor struct
function CPUTimes (line 28) | func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
function CPUInfo (line 57) | func CPUInfo() ([]CPUInfoStat, error) {
function CPUPercent (line 89) | func CPUPercent(interval time.Duration, percpu bool) ([]float64, error) {
FILE: vendor/github.com/shirou/gopsutil/host/host.go
type HostInfoStat (line 9) | type HostInfoStat struct
method String (line 30) | func (h HostInfoStat) String() string {
type UserStat (line 23) | type UserStat struct
method String (line 35) | func (u UserStat) String() string {
FILE: vendor/github.com/shirou/gopsutil/host/host_darwin.go
constant USER_PROCESS (line 21) | USER_PROCESS = 7
function HostInfo (line 23) | func HostInfo() (*HostInfoStat, error) {
function BootTime (line 55) | func BootTime() (uint64, error) {
function uptime (line 70) | func uptime(boot uint64) uint64 {
function Uptime (line 74) | func Uptime() (uint64, error) {
function Users (line 82) | func Users() ([]UserStat, error) {
function GetPlatformInformation (line 125) | func GetPlatformInformation() (string, string, string, error) {
function GetVirtualization (line 143) | func GetVirtualization() (string, string, error) {
FILE: vendor/github.com/shirou/gopsutil/host/host_darwin_amd64.go
type Utmpx (line 6) | type Utmpx struct
type Timeval (line 17) | type Timeval struct
FILE: vendor/github.com/shirou/gopsutil/host/host_freebsd.go
constant UTNameSize (line 21) | UTNameSize = 16
constant UTLineSize (line 22) | UTLineSize = 8
constant UTHostSize (line 23) | UTHostSize = 16
function HostInfo (line 26) | func HostInfo() (*HostInfoStat, error) {
function BootTime (line 58) | func BootTime() (uint64, error) {
function uptime (line 74) | func uptime(boot uint64) uint64 {
function Uptime (line 78) | func Uptime() (uint64, error) {
function Users (line 86) | func Users() ([]UserStat, error) {
function GetPlatformInformation (line 132) | func GetPlatformInformation() (string, string, string, error) {
function GetVirtualization (line 150) | func GetVirtualization() (string, string, error) {
function getUsersFromUtmp (line 158) | func getUsersFromUtmp(utmpfile string) ([]UserStat, error) {
FILE: vendor/github.com/shirou/gopsutil/host/host_freebsd_amd64.go
constant sizeofPtr (line 7) | sizeofPtr = 0x8
constant sizeofShort (line 8) | sizeofShort = 0x2
constant sizeofInt (line 9) | sizeofInt = 0x4
constant sizeofLong (line 10) | sizeofLong = 0x8
constant sizeofLongLong (line 11) | sizeofLongLong = 0x8
type _C_short (line 15) | type _C_short
type _C_int (line 16) | type _C_int
type _C_long (line 17) | type _C_long
type _C_long_long (line 18) | type _C_long_long
type Utmp (line 21) | type Utmp struct
type Utmpx (line 27) | type Utmpx struct
type Timeval (line 38) | type Timeval struct
FILE: vendor/github.com/shirou/gopsutil/host/host_linux.go
type LSB (line 22) | type LSB struct
constant USER_PROCESS (line 30) | USER_PROCESS = 7
function HostInfo (line 32) | func HostInfo() (*HostInfoStat, error) {
function BootTime (line 63) | func BootTime() (uint64, error) {
function uptime (line 86) | func uptime(boot uint64) uint64 {
function Uptime (line 90) | func Uptime() (uint64, error) {
function Users (line 98) | func Users() ([]UserStat, error) {
function getLSB (line 142) | func getLSB() (*LSB, error) {
function GetPlatformInformation (line 192) | func GetPlatformInformation() (platform string, family string, version s...
function getRedhatishVersion (line 297) | func getRedhatishVersion(contents []string) string {
function getRedhatishPlatform (line 309) | func getRedhatishPlatform(contents []string) string {
function getSuseVersion (line 320) | func getSuseVersion(contents []string) string {
function getSusePlatform (line 332) | func getSusePlatform(contents []string) string {
function GetVirtualization (line 340) | func GetVirtualization() (string, string, error) {
FILE: vendor/github.com/shirou/gopsutil/host/host_linux_386.go
constant sizeofPtr (line 9) | sizeofPtr = 0x4
constant sizeofShort (line 10) | sizeofShort = 0x2
constant sizeofInt (line 11) | sizeofInt = 0x4
constant sizeofLong (line 12) | sizeofLong = 0x4
constant sizeofLongLong (line 13) | sizeofLongLong = 0x8
type _C_short (line 17) | type _C_short
type _C_int (line 18) | type _C_int
type _C_long (line 19) | type _C_long
type _C_long_long (line 20) | type _C_long_long
type utmp (line 23) | type utmp struct
type exit_status (line 37) | type exit_status struct
type UtTv (line 41) | type UtTv struct
FILE: vendor/github.com/shirou/gopsutil/host/host_linux_amd64.go
constant sizeofPtr (line 7) | sizeofPtr = 0x8
constant sizeofShort (line 8) | sizeofShort = 0x2
constant sizeofInt (line 9) | sizeofInt = 0x4
constant sizeofLong (line 10) | sizeofLong = 0x8
constant sizeofLongLong (line 11) | sizeofLongLong = 0x8
type _C_short (line 15) | type _C_short
type _C_int (line 16) | type _C_int
type _C_long (line 17) | type _C_long
type _C_long_long (line 18) | type _C_long_long
type utmp (line 21) | type utmp struct
type exit_status (line 35) | type exit_status struct
type UtTv (line 39) | type UtTv struct
FILE: vendor/github.com/shirou/gopsutil/host/host_linux_arm.go
constant sizeofPtr (line 7) | sizeofPtr = 0x8
constant sizeofShort (line 8) | sizeofShort = 0x2
constant sizeofInt (line 9) | sizeofInt = 0x4
constant sizeofLong (line 10) | sizeofLong = 0x8
constant sizeofLongLong (line 11) | sizeofLongLong = 0x8
type _C_short (line 15) | type _C_short
type _C_int (line 16) | type _C_int
type _C_long (line 17) | type _C_long
type _C_long_long (line 18) | type _C_long_long
type utmp (line 21) | type utmp struct
type exit_status (line 35) | type exit_status struct
type UtTv (line 39) | type UtTv struct
FILE: vendor/github.com/shirou/gopsutil/host/host_windows.go
type Win32_OperatingSystem (line 23) | type Win32_OperatingSystem struct
function HostInfo (line 31) | func HostInfo() (*HostInfoStat, error) {
function GetOSInfo (line 66) | func GetOSInfo() (Win32_OperatingSystem, error) {
function BootTime (line 79) | func BootTime() (uint64, error) {
function uptime (line 91) | func uptime(boot uint64) uint64 {
function Uptime (line 95) | func Uptime() (uint64, error) {
function GetPlatformInformation (line 103) | func GetPlatformInformation() (platform string, family string, version s...
function Users (line 130) | func Users() ([]UserStat, error) {
FILE: vendor/github.com/shirou/gopsutil/host/types_darwin.go
type Utmpx (line 16) | type Utmpx
type Timeval (line 17) | type Timeval
FILE: vendor/github.com/shirou/gopsutil/host/types_freebsd.go
constant sizeofPtr (line 25) | sizeofPtr = C.sizeofPtr
constant sizeofShort (line 26) | sizeofShort = C.sizeof_short
constant sizeofInt (line 27) | sizeofInt = C.sizeof_int
constant sizeofLong (line 28) | sizeofLong = C.sizeof_long
constant sizeofLongLong (line 29) | sizeofLongLong = C.sizeof_longlong
type _C_short (line 35) | type _C_short
type _C_int (line 36) | type _C_int
type _C_long (line 37) | type _C_long
type _C_long_long (line 38) | type _C_long_long
type Utmp (line 41) | type Utmp
type Utmpx (line 42) | type Utmpx
type Timeval (line 43) | type Timeval
FILE: vendor/github.com/shirou/gopsutil/host/types_linux.go
constant sizeofPtr (line 24) | sizeofPtr = C.sizeofPtr
constant sizeofShort (line 25) | sizeofShort = C.sizeof_short
constant sizeofInt (line 26) | sizeofInt = C.sizeof_int
constant sizeofLong (line 27) | sizeofLong = C.sizeof_long
constant sizeofLongLong (line 28) | sizeofLongLong = C.sizeof_longlong
type _C_short (line 34) | type _C_short
type _C_int (line 35) | type _C_int
type _C_long (line 36) | type _C_long
type _C_long_long (line 37) | type _C_long_long
type utmp (line 40) | type utmp
type exit_status (line 41) | type exit_status
type UtTv (line 42) | type UtTv struct
FILE: vendor/github.com/shirou/gopsutil/internal/common/binary.go
type ByteOrder (line 33) | type ByteOrder interface
type littleEndian (line 49) | type littleEndian struct
method Uint16 (line 51) | func (littleEndian) Uint16(b []byte) uint16 { return uint16(b[0]) | ui...
method PutUint16 (line 53) | func (littleEndian) PutUint16(b []byte, v uint16) {
method Uint32 (line 58) | func (littleEndian) Uint32(b []byte) uint32 {
method PutUint32 (line 62) | func (littleEndian) PutUint32(b []byte, v uint32) {
method Uint64 (line 69) | func (littleEndian) Uint64(b []byte) uint64 {
method PutUint64 (line 74) | func (littleEndian) PutUint64(b []byte, v uint64) {
method String (line 85) | func (littleEndian) String() string { return "LittleEndian" }
method GoString (line 87) | func (littleEndian) GoString() string { return "binary.LittleEndian" }
type bigEndian (line 89) | type bigEndian struct
method Uint16 (line 91) | func (bigEndian) Uint16(b []byte) uint16 { return uint16(b[1]) | uint1...
method PutUint16 (line 93) | func (bigEndian) PutUint16(b []byte, v uint16) {
method Uint32 (line 98) | func (bigEndian) Uint32(b []byte) uint32 {
method PutUint32 (line 102) | func (bigEndian) PutUint32(b []byte, v uint32) {
method Uint64 (line 109) | func (bigEndian) Uint64(b []byte) uint64 {
method PutUint64 (line 114) | func (bigEndian) PutUint64(b []byte, v uint64) {
method String (line 125) | func (bigEndian) String() string { return "BigEndian" }
method GoString (line 127) | func (bigEndian) GoString() string { return "binary.BigEndian" }
function Read (line 138) | func Read(r io.Reader, order ByteOrder, data interface{}) error {
function Write (line 230) | func Write(w io.Writer, order ByteOrder, data interface{}) error {
function Size (line 340) | func Size(v interface{}) int {
function dataSize (line 348) | func dataSize(v reflect.Value) int {
function sizeof (line 359) | func sizeof(t reflect.Type) int {
type coder (line 386) | type coder struct
type decoder (line 391) | type decoder
method uint8 (line 394) | func (d *decoder) uint8() uint8 {
method uint16 (line 405) | func (d *decoder) uint16() uint16 {
method uint32 (line 416) | func (d *decoder) uint32() uint32 {
method uint64 (line 427) | func (d *decoder) uint64() uint64 {
method int8 (line 438) | func (d *decoder) int8() int8 { return int8(d.uint8()) }
method int16 (line 442) | func (d *decoder) int16() int16 { return int16(d.uint16()) }
method int32 (line 446) | func (d *decoder) int32() int32 { return int32(d.uint32()) }
method int64 (line 450) | func (d *decoder) int64() int64 { return int64(d.uint64()) }
method value (line 454) | func (d *decoder) value(v reflect.Value) {
method skip (line 592) | func (d *decoder) skip(v reflect.Value) {
type encoder (line 392) | type encoder
method uint8 (line 400) | func (e *encoder) uint8(x uint8) {
method uint16 (line 411) | func (e *encoder) uint16(x uint16) {
method uint32 (line 422) | func (e *encoder) uint32(x uint32) {
method uint64 (line 433) | func (e *encoder) uint64(x uint64) {
method int8 (line 440) | func (e *encoder) int8(x int8) { e.uint8(uint8(x)) }
method int16 (line 444) | func (e *encoder) int16(x int16) { e.uint16(uint16(x)) }
method int32 (line 448) | func (e *encoder) int32(x int32) { e.uint32(uint32(x)) }
method int64 (line 452) | func (e *encoder) int64(x int64) { e.uint64(uint64(x)) }
method value (line 520) | func (e *encoder) value(v reflect.Value) {
method skip (line 596) | func (e *encoder) skip(v reflect.Value) {
function intDataSize (line 606) | func intDataSize(data interface{}) int {
FILE: vendor/github.com/shirou/gopsutil/internal/common/common.go
type Invoker (line 24) | type Invoker interface
type Invoke (line 28) | type Invoke struct
method Command (line 30) | func (i Invoke) Command(name string, arg ...string) ([]byte, error) {
type FakeInvoke (line 34) | type FakeInvoke struct
method Command (line 41) | func (i FakeInvoke) Command(name string, arg ...string) ([]byte, error) {
function ReadLines (line 71) | func ReadLines(filename string) ([]string, error) {
function ReadLinesOffsetN (line 80) | func ReadLinesOffsetN(filename string, offset uint, n int) ([]string, er...
function IntToString (line 104) | func IntToString(orig []int8) string {
function ByteToString (line 121) | func ByteToString(orig []byte) string {
function ReadInts (line 145) | func ReadInts(filename string) ([]int64, error) {
function mustParseInt32 (line 172) | func mustParseInt32(val string) int32 {
function mustParseUint64 (line 178) | func mustParseUint64(val string) uint64 {
function mustParseFloat64 (line 184) | func mustParseFloat64(val string) float64 {
function StringsHas (line 190) | func StringsHas(target []string, src string) bool {
function StringsContains (line 200) | func StringsContains(target []string, src string) bool {
function attributes (line 211) | func attributes(m interface{}) map[string]reflect.Type {
function PathExists (line 232) | func PathExists(filename string) bool {
function GetEnv (line 240) | func GetEnv(key string, dfault string, combineWith ...string) string {
function HostProc (line 260) | func HostProc(combineWith ...string) string {
function HostSys (line 264) | func HostSys(combineWith ...string) string {
FILE: vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go
function DoSysctrl (line 13) | func DoSysctrl(mib string) ([]string, error) {
function CallSyscall (line 26) | func CallSyscall(mib []int32) ([]byte, uint64, error) {
FILE: vendor/github.com/shirou/gopsutil/internal/common/common_freebsd.go
function DoSysctrl (line 13) | func DoSysctrl(mib string) ([]string, error) {
function CallSyscall (line 26) | func CallSyscall(mib []int32) ([]byte, uint64, error) {
FILE: vendor/github.com/shirou/gopsutil/internal/common/common_unix.go
function CallLsof (line 11) | func CallLsof(invoke Invoker, pid int32, args ...string) ([]string, erro...
function CallPgrep (line 42) | func CallPgrep(invoke Invoker, pid int32) ([]int32, error) {
FILE: vendor/github.com/shirou/gopsutil/internal/common/common_windows.go
type PDH_FMT_COUNTERVALUE_DOUBLE (line 11) | type PDH_FMT_COUNTERVALUE_DOUBLE struct
type PDH_FMT_COUNTERVALUE_LARGE (line 17) | type PDH_FMT_COUNTERVALUE_LARGE struct
type PDH_FMT_COUNTERVALUE_LONG (line 23) | type PDH_FMT_COUNTERVALUE_LONG struct
constant ERROR_SUCCESS (line 31) | ERROR_SUCCESS = 0
constant ERROR_FILE_NOT_FOUND (line 32) | ERROR_FILE_NOT_FOUND = 2
constant DRIVE_REMOVABLE (line 33) | DRIVE_REMOVABLE = 2
constant DRIVE_FIXED (line 34) | DRIVE_FIXED = 3
constant HKEY_LOCAL_MACHINE (line 35) | HKEY_LOCAL_MACHINE = 0x80000002
constant RRF_RT_REG_SZ (line 36) | RRF_RT_REG_SZ = 0x00000002
constant RRF_RT_REG_DWORD (line 37) | RRF_RT_REG_DWORD = 0x00000010
constant PDH_FMT_LONG (line 38) | PDH_FMT_LONG = 0x00000100
constant PDH_FMT_DOUBLE (line 39) | PDH_FMT_DOUBLE = 0x00000200
constant PDH_FMT_LARGE (line 40) | PDH_FMT_LARGE = 0x00000400
constant PDH_INVALID_DATA (line 41) | PDH_INVALID_DATA = 0xc0000bc6
constant PDH_INVALID_HANDLE (line 42) | PDH_INVALID_HANDLE = 0xC0000bbc
constant PDH_NO_DATA (line 43) | PDH_NO_DATA = 0x800007d5
type FILETIME (line 60) | type FILETIME struct
function BytePtrToString (line 66) | func BytePtrToString(p *uint8) string {
type CounterInfo (line 77) | type CounterInfo struct
function CreateQuery (line 85) | func CreateQuery() (syscall.Handle, error) {
function CreateCounter (line 95) | func CreateCounter(query syscall.Handle, pname, cname string) (*CounterI...
FILE: vendor/github.com/shirou/gopsutil/mem/mem.go
type VirtualMemoryStat (line 7) | type VirtualMemoryStat struct
method String (line 30) | func (m VirtualMemoryStat) String() string {
type SwapMemoryStat (line 21) | type SwapMemoryStat struct
method String (line 35) | func (m SwapMemoryStat) String() string {
FILE: vendor/github.com/shirou/gopsutil/mem/mem_darwin.go
function getPageSize (line 13) | func getPageSize() (uint64, error) {
function getVmStat (line 27) | func getVmStat(pagesize uint64, vms *VirtualMemoryStat) error {
function parseVmStat (line 35) | func parseVmStat(out string, pagesize uint64, vms *VirtualMemoryStat) er...
function VirtualMemory (line 84) | func VirtualMemory() (*VirtualMemoryStat, error) {
function SwapMemory (line 114) | func SwapMemory() (*SwapMemoryStat, error) {
FILE: vendor/github.com/shirou/gopsutil/mem/mem_freebsd.go
function VirtualMemory (line 14) | func VirtualMemory() (*VirtualMemoryStat, error) {
function SwapMemory (line 90) | func SwapMemory() (*SwapMemoryStat, error) {
FILE: vendor/github.com/shirou/gopsutil/mem/mem_linux.go
function VirtualMemory (line 13) | func VirtualMemory() (*VirtualMemoryStat, error) {
function SwapMemory (line 60) | func SwapMemory() (*SwapMemoryStat, error) {
FILE: vendor/github.com/shirou/gopsutil/mem/mem_windows.go
type MEMORYSTATUSEX (line 16) | type MEMORYSTATUSEX struct
function VirtualMemory (line 28) | func VirtualMemory() (*VirtualMemoryStat, error) {
function SwapMemory (line 46) | func SwapMemory() (*SwapMemoryStat, error) {
FILE: vendor/github.com/shirou/gopsutil/net/net.go
function init (line 16) | func init() {
type NetIOCountersStat (line 20) | type NetIOCountersStat struct
method String (line 79) | func (n NetIOCountersStat) String() string {
type Addr (line 33) | type Addr struct
method String (line 94) | func (a Addr) String() string {
type NetConnectionStat (line 38) | type NetConnectionStat struct
method String (line 84) | func (n NetConnectionStat) String() string {
type NetProtoCountersStat (line 49) | type NetProtoCountersStat struct
method String (line 89) | func (n NetProtoCountersStat) String() string {
type NetInterfaceAddr (line 55) | type NetInterfaceAddr struct
method String (line 104) | func (n NetInterfaceAddr) String() string {
type NetInterfaceStat (line 59) | type NetInterfaceStat struct
method String (line 99) | func (n NetInterfaceStat) String() string {
type NetFilterStat (line 67) | type NetFilterStat struct
function NetInterfaces (line 109) | func NetInterfaces() ([]NetInterfaceStat, error) {
function getNetIOCountersAll (line 156) | func getNetIOCountersAll(n []NetIOCountersStat) ([]NetIOCountersStat, er...
function parseNetLine (line 174) | func parseNetLine(line string) (NetConnectionStat, error) {
function parseNetAddr (line 217) | func parseNetAddr(line string) (laddr Addr, raddr Addr, err error) {
FILE: vendor/github.com/shirou/gopsutil/net/net_darwin.go
function NetIOCounters (line 19) | func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
function NetIOCountersByFile (line 96) | func NetIOCountersByFile(pernic bool, filename string) ([]NetIOCountersS...
function NetFilterCounters (line 100) | func NetFilterCounters() ([]NetFilterStat, error) {
function NetProtoCounters (line 108) | func NetProtoCounters(protocols []string) ([]NetProtoCountersStat, error) {
FILE: vendor/github.com/shirou/gopsutil/net/net_freebsd.go
function NetIOCounters (line 14) | func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
function NetIOCountersByFile (line 90) | func NetIOCountersByFile(pernic bool, filename string) ([]NetIOCountersS...
function NetFilterCounters (line 94) | func NetFilterCounters() ([]NetFilterStat, error) {
function NetProtoCounters (line 102) | func NetProtoCounters(protocols []string) ([]NetProtoCountersStat, error) {
FILE: vendor/github.com/shirou/gopsutil/net/net_linux.go
function NetIOCounters (line 18) | func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
function NetIOCountersByFile (line 23) | func NetIOCountersByFile(pernic bool, filename string) ([]NetIOCountersS...
function NetProtoCounters (line 112) | func NetProtoCounters(protocols []string) ([]NetProtoCountersStat, error) {
function NetFilterCounters (line 171) | func NetFilterCounters() ([]NetFilterStat, error) {
FILE: vendor/github.com/shirou/gopsutil/net/net_unix.go
function NetConnections (line 12) | func NetConnections(kind string) ([]NetConnectionStat, error) {
function NetConnectionsPid (line 17) | func NetConnectionsPid(kind string, pid int32) ([]NetConnectionStat, err...
FILE: vendor/github.com/shirou/gopsutil/net/net_windows.go
constant TCPTableBasicListener (line 22) | TCPTableBasicListener = iota
constant TCPTableBasicConnections (line 23) | TCPTableBasicConnections
constant TCPTableBasicAll (line 24) | TCPTableBasicAll
constant TCPTableOwnerPIDListener (line 25) | TCPTableOwnerPIDListener
constant TCPTableOwnerPIDConnections (line 26) | TCPTableOwnerPIDConnections
constant TCPTableOwnerPIDAll (line 27) | TCPTableOwnerPIDAll
constant TCPTableOwnerModuleListener (line 28) | TCPTableOwnerModuleListener
constant TCPTableOwnerModuleConnections (line 29) | TCPTableOwnerModuleConnections
constant TCPTableOwnerModuleAll (line 30) | TCPTableOwnerModuleAll
function NetIOCounters (line 33) | func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
function NetIOCountersByFile (line 78) | func NetIOCountersByFile(pernic bool, filename string) ([]NetIOCountersS...
function NetConnections (line 83) | func NetConnections(kind string) ([]NetConnectionStat, error) {
function getAdapterList (line 90) | func getAdapterList() (*syscall.IpAdapterInfo, error) {
function NetFilterCounters (line 106) | func NetFilterCounters() ([]NetFilterStat, error) {
function NetProtoCounters (line 114) | func NetProtoCounters(protocols []string) ([]NetProtoCountersStat, error) {
FILE: vendor/github.com/shirou/gopsutil/process/process.go
function init (line 15) | func init() {
type Process (line 19) | type Process struct
method String (line 62) | func (p Process) String() string {
method CPUPercent (line 109) | func (p *Process) CPUPercent(interval time.Duration) (float64, error) {
method MemoryPercent (line 151) | func (p *Process) MemoryPercent() (float32, error) {
type OpenFilesStat (line 33) | type OpenFilesStat struct
method String (line 67) | func (o OpenFilesStat) String() string {
type MemoryInfoStat (line 38) | type MemoryInfoStat struct
method String (line 72) | func (m MemoryInfoStat) String() string {
type RlimitStat (line 44) | type RlimitStat struct
method String (line 77) | func (r RlimitStat) String() string {
type IOCountersStat (line 50) | type IOCountersStat struct
method String (line 82) | func (i IOCountersStat) String() string {
type NumCtxSwitchesStat (line 57) | type NumCtxSwitchesStat struct
method String (line 87) | func (p NumCtxSwitchesStat) String() string {
function PidExists (line 92) | func PidExists(pid int32) (bool, error) {
function calculatePercent (line 141) | func calculatePercent(t1, t2 *cpu.CPUTimesStat, delta float64, numcpu in...
FILE: vendor/github.com/shirou/gopsutil/process/process_darwin.go
constant CTLKern (line 22) | CTLKern = 1
constant KernProc (line 23) | KernProc = 14
constant KernProcPID (line 24) | KernProcPID = 1
constant KernProcProc (line 25) | KernProcProc = 8
constant KernProcAll (line 26) | KernProcAll = 0
constant KernProcPathname (line 27) | KernProcPathname = 12
constant ClockTicks (line 31) | ClockTicks = 100
type _Ctype_struct___0 (line 34) | type _Ctype_struct___0 struct
type MemoryInfoExStat (line 39) | type MemoryInfoExStat struct
type MemoryMapsStat (line 42) | type MemoryMapsStat struct
function Pids (line 45) | func Pids() ([]int32, error) {
method Ppid (line 64) | func (p *Process) Ppid() (int32, error) {
method Name (line 73) | func (p *Process) Name() (string, error) {
method Exe (line 81) | func (p *Process) Exe() (string, error) {
method Cmdline (line 84) | func (p *Process) Cmdline() (string, error) {
method CreateTime (line 91) | func (p *Process) CreateTime() (int64, error) {
method Cwd (line 94) | func (p *Process) Cwd() (string, error) {
method Parent (line 97) | func (p *Process) Parent() (*Process, error) {
method Status (line 115) | func (p *Process) Status() (string, error) {
method Uids (line 123) | func (p *Process) Uids() ([]int32, error) {
method Gids (line 134) | func (p *Process) Gids() ([]int32, error) {
method Terminal (line 145) | func (p *Process) Terminal() (string, error) {
method Nice (line 162) | func (p *Process) Nice() (int32, error) {
method IOnice (line 169) | func (p *Process) IOnice() (int32, error) {
method Rlimit (line 172) | func (p *Process) Rlimit() ([]RlimitStat, error) {
method IOCounters (line 176) | func (p *Process) IOCounters() (*IOCountersStat, error) {
method NumCtxSwitches (line 179) | func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) {
method NumFDs (line 182) | func (p *Process) NumFDs() (int32, error) {
method NumThreads (line 185) | func (p *Process) NumThreads() (int32, error) {
method Threads (line 192) | func (p *Process) Threads() (map[string]string, error) {
function convertCpuTimes (line 197) | func convertCpuTimes(s string) (ret float64, err error) {
method CPUTimes (line 222) | func (p *Process) CPUTimes() (*cpu.CPUTimesStat, error) {
method CPUAffinity (line 245) | func (p *Process) CPUAffinity() ([]int32, error) {
method MemoryInfo (line 248) | func (p *Process) MemoryInfo() (*MemoryInfoStat, error) {
method MemoryInfoEx (line 274) | func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) {
method Children (line 278) | func (p *Process) Children() ([]*Process, error) {
method OpenFiles (line 294) | func (p *Process) OpenFiles() ([]OpenFilesStat, error) {
method Connections (line 298) | func (p *Process) Connections() ([]net.NetConnectionStat, error) {
method NetIOCounters (line 302) | func (p *Process) NetIOCounters(pernic bool) ([]net.NetIOCountersStat, e...
method IsRunning (line 306) | func (p *Process) IsRunning() (bool, error) {
method MemoryMaps (line 309) | func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) {
function copyParams (line 314) | func copyParams(k *KinfoProc, p *Process) error {
function processes (line 319) | func processes() ([]Process, error) {
function parseKinfoProc (line 359) | func parseKinfoProc(buf []byte) (KinfoProc, error) {
method getKProc (line 373) | func (p *Process) getKProc() (*KinfoProc, error) {
function NewProcess (line 397) | func NewProcess(pid int32) (*Process, error) {
function callPs (line 407) | func callPs(arg string, pid int32, threadOption bool) ([][]string, error) {
FILE: vendor/github.com/shirou/gopsutil/process/process_darwin_amd64.go
constant sizeofPtr (line 7) | sizeofPtr = 0x8
constant sizeofShort (line 8) | sizeofShort = 0x2
constant sizeofInt (line 9) | sizeofInt = 0x4
constant sizeofLong (line 10) | sizeofLong = 0x8
constant sizeofLongLong (line 11) | sizeofLongLong = 0x8
type _C_short (line 15) | type _C_short
type _C_int (line 16) | type _C_int
type _C_long (line 17) | type _C_long
type _C_long_long (line 18) | type _C_long_long
type Timespec (line 21) | type Timespec struct
type Timeval (line 26) | type Timeval struct
type Rusage (line 32) | type Rusage struct
type Rlimit (line 51) | type Rlimit struct
type UGid_t (line 56) | type UGid_t
type KinfoProc (line 58) | type KinfoProc struct
type Eproc (line 63) | type Eproc struct
type Proc (line 90) | type Proc struct
type Session (line 92) | type Session struct
type ucred (line 94) | type ucred struct
type Uucred (line 102) | type Uucred struct
type Upcred (line 110) | type Upcred struct
type Vmspace (line 121) | type Vmspace struct
type Sigacts (line 130) | type Sigacts struct
type ExternProc (line 132) | type ExternProc struct
type Itimerval (line 183) | type Itimerval struct
type Vnode (line 188) | type Vnode struct
type Pgrp (line 190) | type Pgrp struct
type UserStruct (line 192) | type UserStruct struct
type Au_session (line 194) | type Au_session struct
type Posix_cred (line 199) | type Posix_cred struct
type Label (line 212) | type Label struct
type AuditinfoAddr (line 214) | type AuditinfoAddr struct
type AuMask (line 221) | type AuMask struct
type AuTidAddr (line 225) | type AuTidAddr struct
type UcredQueue (line 231) | type UcredQueue struct
FILE: vendor/github.com/shirou/gopsutil/process/process_freebsd.go
type MemoryInfoExStat (line 18) | type MemoryInfoExStat struct
type MemoryMapsStat (line 21) | type MemoryMapsStat struct
function Pids (line 24) | func Pids() ([]int32, error) {
method Ppid (line 38) | func (p *Process) Ppid() (int32, error) {
method Name (line 46) | func (p *Process) Name() (string, error) {
method Exe (line 54) | func (p *Process) Exe() (string, error) {
method Cmdline (line 57) | func (p *Process) Cmdline() (string, error) {
method CreateTime (line 72) | func (p *Process) CreateTime() (int64, error) {
method Cwd (line 75) | func (p *Process) Cwd() (string, error) {
method Parent (line 78) | func (p *Process) Parent() (*Process, error) {
method Status (line 81) | func (p *Process) Status() (string, error) {
method Uids (line 89) | func (p *Process) Uids() ([]int32, error) {
method Gids (line 101) | func (p *Process) Gids() ([]int32, error) {
method Terminal (line 112) | func (p *Process) Terminal() (string, error) {
method Nice (line 127) | func (p *Process) Nice() (int32, error) {
method IOnice (line 130) | func (p *Process) IOnice() (int32, error) {
method Rlimit (line 133) | func (p *Process) Rlimit() ([]RlimitStat, error) {
method IOCounters (line 137) | func (p *Process) IOCounters() (*IOCountersStat, error) {
method NumCtxSwitches (line 147) | func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) {
method NumFDs (line 150) | func (p *Process) NumFDs() (int32, error) {
method NumThreads (line 153) | func (p *Process) NumThreads() (int32, error) {
method Threads (line 161) | func (p *Process) Threads() (map[string]string, error) {
method CPUTimes (line 165) | func (p *Process) CPUTimes() (*cpu.CPUTimesStat, error) {
method CPUAffinity (line 176) | func (p *Process) CPUAffinity() ([]int32, error) {
method MemoryInfo (line 179) | func (p *Process) MemoryInfo() (*MemoryInfoStat, error) {
method MemoryInfoEx (line 195) | func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) {
method Children (line 199) | func (p *Process) Children() ([]*Process, error) {
method OpenFiles (line 215) | func (p *Process) OpenFiles() ([]OpenFilesStat, error) {
method Connections (line 219) | func (p *Process) Connections() ([]net.NetConnectionStat, error) {
method NetIOCounters (line 223) | func (p *Process) NetIOCounters(pernic bool) ([]net.NetIOCountersStat, e...
method IsRunning (line 227) | func (p *Process) IsRunning() (bool, error) {
method MemoryMaps (line 230) | func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) {
function copyParams (line 235) | func copyParams(k *KinfoProc, p *Process) error {
function processes (line 240) | func processes() ([]Process, error) {
function parseKinfoProc (line 273) | func parseKinfoProc(buf []byte) (KinfoProc, error) {
method getKProc (line 280) | func (p *Process) getKProc() (*KinfoProc, error) {
function NewProcess (line 300) | func NewProcess(pid int32) (*Process, error) {
FILE: vendor/github.com/shirou/gopsutil/process/process_freebsd_386.go
constant CTLKern (line 8) | CTLKern = 1
constant KernProc (line 9) | KernProc = 14
constant KernProcPID (line 10) | KernProcPID = 1
constant KernProcProc (line 11) | KernProcProc = 8
constant KernProcPathname (line 12) | KernProcPathname = 12
constant KernProcArgs (line 13) | KernProcArgs = 7
type Timespec (line 16) | type Timespec struct
type Timeval (line 21) | type Timeval struct
type Rusage (line 26) | type Rusage struct
type KinfoProc (line 46) | type KinfoProc struct
FILE: vendor/github.com/shirou/gopsutil/process/process_freebsd_amd64.go
constant CTLKern (line 7) | CTLKern = 1
constant KernProc (line 8) | KernProc = 14
constant KernProcPID (line 9) | KernProcPID = 1
constant KernProcProc (line 10) | KernProcProc = 8
constant KernProcPathname (line 11) | KernProcPathname = 12
constant KernProcArgs (line 12) | KernProcArgs = 7
type Timespec (line 15) | type Timespec struct
type Timeval (line 20) | type Timeval struct
type Rusage (line 25) | type Rusage struct
type KinfoProc (line 45) | type KinfoProc struct
FILE: vendor/github.com/shirou/gopsutil/process/process_linux.go
constant PrioProcess (line 25) | PrioProcess = 0
type MemoryInfoExStat (line 29) | type MemoryInfoExStat struct
method String (line 39) | func (m MemoryInfoExStat) String() string {
type MemoryMapsStat (line 44) | type MemoryMapsStat struct
method String (line 58) | func (m MemoryMapsStat) String() string {
function NewProcess (line 65) | func NewProcess(pid int32) (*Process, error) {
method Ppid (line 73) | func (p *Process) Ppid() (int32, error) {
method Name (line 80) | func (p *Process) Name() (string, error) {
method Exe (line 83) | func (p *Process) Exe() (string, error) {
method Cmdline (line 86) | func (p *Process) Cmdline() (string, error) {
method CreateTime (line 89) | func (p *Process) CreateTime() (int64, error) {
method Cwd (line 97) | func (p *Process) Cwd() (string, error) {
method Parent (line 100) | func (p *Process) Parent() (*Process, error) {
method Status (line 114) | func (p *Process) Status() (string, error) {
method Uids (line 121) | func (p *Process) Uids() ([]int32, error) {
method Gids (line 128) | func (p *Process) Gids() ([]int32, error) {
method Terminal (line 135) | func (p *Process) Terminal() (string, error) {
method Nice (line 142) | func (p *Process) Nice() (int32, error) {
method IOnice (line 149) | func (p *Process) IOnice() (int32, error) {
method Rlimit (line 152) | func (p *Process) Rlimit() ([]RlimitStat, error) {
method IOCounters (line 155) | func (p *Process) IOCounters() (*IOCountersStat, error) {
method NumCtxSwitches (line 158) | func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) {
method NumFDs (line 165) | func (p *Process) NumFDs() (int32, error) {
method NumThreads (line 169) | func (p *Process) NumThreads() (int32, error) {
method Threads (line 176) | func (p *Process) Threads() (map[string]string, error) {
method CPUTimes (line 180) | func (p *Process) CPUTimes() (*cpu.CPUTimesStat, error) {
method CPUAffinity (line 187) | func (p *Process) CPUAffinity() ([]int32, error) {
method MemoryInfo (line 190) | func (p *Process) MemoryInfo() (*MemoryInfoStat, error) {
method MemoryInfoEx (line 197) | func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) {
method Children (line 205) | func (p *Process) Children() ([]*Process, error) {
method OpenFiles (line 224) | func (p *Process) OpenFiles() ([]OpenFilesStat, error) {
method Connections (line 237) | func (p *Process) Connections() ([]net.NetConnectionStat, error) {
method NetIOCounters (line 241) | func (p *Process) NetIOCounters(pernic bool) ([]net.NetIOCountersStat, e...
method IsRunning (line 246) | func (p *Process) IsRunning() (bool, error) {
method MemoryMaps (line 251) | func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) {
method fillFromfd (line 333) | func (p *Process) fillFromfd() (int32, []*OpenFilesStat, error) {
method fillFromCwd (line 366) | func (p *Process) fillFromCwd() (string, error) {
method fillFromExe (line 377) | func (p *Process) fillFromExe() (string, error) {
method fillFromCmdline (line 388) | func (p *Process) fillFromCmdline() (string, error) {
method fillFromIO (line 406) | func (p *Process) fillFromIO() (*IOCountersStat, error) {
method fillFromStatm (line 445) | func (p *Process) fillFromStatm() (*MemoryInfoStat, *MemoryInfoExStat, e...
method fillFromStatus (line 497) | func (p *Process) fillFromStatus() error {
method fillFromStat (line 584) | func (p *Process) fillFromStat() (string, int32, *cpu.CPUTimesStat, int6...
function Pids (line 644) | func Pids() ([]int32, error) {
function callLsof (line 669) | func callLsof(arg string, pid int32) ([]string, error) {
FILE: vendor/github.com/shirou/gopsutil/process/process_linux_386.go
constant ClockTicks (line 7) | ClockTicks = 100
constant PageSize (line 8) | PageSize = 4096
FILE: vendor/github.com/shirou/gopsutil/process/process_linux_amd64.go
constant ClockTicks (line 7) | ClockTicks = 100
constant PageSize (line 8) | PageSize = 4096
FILE: vendor/github.com/shirou/gopsutil/process/process_linux_arm.go
constant ClockTicks (line 7) | ClockTicks = 100
constant PageSize (line 8) | PageSize = 4096
FILE: vendor/github.com/shirou/gopsutil/process/process_posix.go
function getTerminalMap (line 15) | func getTerminalMap() (map[uint64]string, error) {
method SendSignal (line 54) | func (p *Process) SendSignal(sig syscall.Signal) error {
method Suspend (line 77) | func (p *Process) Suspend() error {
method Resume (line 80) | func (p *Process) Resume() error {
method Terminate (line 83) | func (p *Process) Terminate() error {
method Kill (line 86) | func (p *Process) Kill() error {
method Username (line 89) | func (p *Process) Username() (string, error) {
FILE: vendor/github.com/shirou/gopsutil/process/process_windows.go
constant NoMoreFiles (line 21) | NoMoreFiles = 0x12
constant MaxPathLength (line 22) | MaxPathLength = 260
type SystemProcessInformation (line 25) | type SystemProcessInformation struct
type MemoryInfoExStat (line 41) | type MemoryInfoExStat struct
type MemoryMapsStat (line 44) | type MemoryMapsStat struct
type Win32_Process (line 47) | type Win32_Process struct
function Pids (line 89) | func Pids() ([]int32, error) {
method Ppid (line 104) | func (p *Process) Ppid() (int32, error) {
function GetWin32Proc (line 112) | func GetWin32Proc(pid int32) ([]Win32_Process, error) {
method Name (line 126) | func (p *Process) Name() (string, error) {
method Exe (line 133) | func (p *Process) Exe() (string, error) {
method Cmdline (line 140) | func (p *Process) Cmdline() (string, error) {
method CreateTime (line 148) | func (p *Process) CreateTime() (int64, error) {
method Cwd (line 157) | func (p *Process) Cwd() (string, error) {
method Parent (line 160) | func (p *Process) Parent() (*Process, error) {
method Status (line 163) | func (p *Process) Status() (string, error) {
method Username (line 166) | func (p *Process) Username() (string, error) {
method Uids (line 169) | func (p *Process) Uids() ([]int32, error) {
method Gids (line 174) | func (p *Process) Gids() ([]int32, error) {
method Terminal (line 178) | func (p *Process) Terminal() (string, error) {
method Nice (line 183) | func (p *Process) Nice() (int32, error) {
method IOnice (line 190) | func (p *Process) IOnice() (int32, error) {
method Rlimit (line 193) | func (p *Process) Rlimit() ([]RlimitStat, error) {
method IOCounters (line 198) | func (p *Process) IOCounters() (*IOCountersStat, error) {
method NumCtxSwitches (line 201) | func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) {
method NumFDs (line 204) | func (p *Process) NumFDs() (int32, error) {
method NumThreads (line 207) | func (p *Process) NumThreads() (int32, error) {
method Threads (line 214) | func (p *Process) Threads() (map[string]string, error) {
method CPUTimes (line 218) | func (p *Process) CPUTimes() (*cpu.CPUTimesStat, error) {
method CPUAffinity (line 221) | func (p *Process) CPUAffinity() ([]int32, error) {
method MemoryInfo (line 224) | func (p *Process) MemoryInfo() (*MemoryInfoStat, error) {
method MemoryInfoEx (line 227) | func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) {
method Children (line 231) | func (p *Process) Children() ([]*Process, error) {
method OpenFiles (line 235) | func (p *Process) OpenFiles() ([]OpenFilesStat, error) {
method Connections (line 239) | func (p *Process) Connections() ([]net.NetConnectionStat, error) {
method NetIOCounters (line 243) | func (p *Process) NetIOCounters(pernic bool) ([]net.NetIOCountersStat, e...
method IsRunning (line 247) | func (p *Process) IsRunning() (bool, error) {
method MemoryMaps (line 251) | func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) {
function NewProcess (line 256) | func NewProcess(pid int32) (*Process, error) {
method SendSignal (line 262) | func (p *Process) SendSignal(sig syscall.Signal) error {
method Suspend (line 266) | func (p *Process) Suspend() error {
method Resume (line 269) | func (p *Process) Resume() error {
method Terminate (line 272) | func (p *Process) Terminate() error {
method Kill (line 275) | func (p *Process) Kill() error {
method getFromSnapProcess (line 279) | func (p *Process) getFromSnapProcess(pid int32) (int32, int32, string, e...
function processes (line 306) | func processes() ([]*Process, error) {
function getProcInfo (line 329) | func getProcInfo(pid int32) (*SystemProcessInformation, error) {
FILE: vendor/github.com/shirou/gopsutil/process/types_darwin.go
constant sizeofPtr (line 91) | sizeofPtr = C.sizeofPtr
constant sizeofShort (line 92) | sizeofShort = C.sizeof_short
constant sizeofInt (line 93) | sizeofInt = C.sizeof_int
constant sizeofLong (line 94) | sizeofLong = C.sizeof_long
constant sizeofLongLong (line 95) | sizeofLongLong = C.sizeof_longlong
type _C_short (line 101) | type _C_short
type _C_int (line 102) | type _C_int
type _C_long (line 103) | type _C_long
type _C_long_long (line 104) | type _C_long_long
type Timespec (line 109) | type Timespec
type Timeval (line 111) | type Timeval
type Rusage (line 115) | type Rusage
type Rlimit (line 117) | type Rlimit
type UGid_t (line 119) | type UGid_t
type KinfoProc (line 121) | type KinfoProc
type Eproc (line 123) | type Eproc
type Proc (line 125) | type Proc
type Session (line 127) | type Session
type ucred (line 129) | type ucred
type Uucred (line 131) | type Uucred
type Upcred (line 133) | type Upcred
type Vmspace (line 135) | type Vmspace
type Sigacts (line 137) | type Sigacts
type ExternProc (line 139) | type ExternProc
type Itimerval (line 141) | type Itimerval
type Vnode (line 143) | type Vnode
type Pgrp (line 145) | type Pgrp
type UserStruct (line 147) | type UserStruct
type Au_session (line 149) | type Au_session
type Posix_cred (line 151) | type Posix_cred
type Label (line 153) | type Label
type AuditinfoAddr (line 155) | type AuditinfoAddr
type AuMask (line 156) | type AuMask
type AuTidAddr (line 157) | type AuTidAddr
type UcredQueue (line 160) | type UcredQueue
FILE: vendor/github.com/shirou/w32/advapi32.go
function RegCreateKey (line 34) | func RegCreateKey(hKey HKEY, subKey string) HKEY {
function RegOpenKeyEx (line 50) | func RegOpenKeyEx(hKey HKEY, subKey string, samDesired uint32) HKEY {
function RegCloseKey (line 65) | func RegCloseKey(hKey HKEY) error {
function RegGetRaw (line 76) | func RegGetRaw(hKey HKEY, subKey string, value string) []byte {
function RegSetBinary (line 112) | func RegSetBinary(hKey HKEY, subKey string, value []byte) (errno int) {
function RegGetString (line 131) | func RegGetString(hKey HKEY, subKey string, value string) string {
function RegEnumKeyEx (line 177) | func RegEnumKeyEx(hKey HKEY, index uint32) string {
function OpenEventLog (line 192) | func OpenEventLog(servername string, sourcename string) HANDLE {
function ReadEventLog (line 200) | func ReadEventLog(eventlog HANDLE, readflags, recordoffset uint32, buffe...
function CloseEventLog (line 213) | func CloseEventLog(eventlog HANDLE) bool {
function OpenSCManager (line 220) | func OpenSCManager(lpMachineName, lpDatabaseName string, dwDesiredAccess...
function CloseServiceHandle (line 240) | func CloseServiceHandle(hSCObject HANDLE) error {
function OpenService (line 248) | func OpenService(hSCManager HANDLE, lpServiceName string, dwDesiredAcces...
function StartService (line 261) | func StartService(hService HANDLE, lpServiceArgVectors []string) error {
function ControlService (line 288) | func ControlService(hService HANDLE, dwControl uint32, lpServiceStatus *...
FILE: vendor/github.com/shirou/w32/comctl32.go
function InitCommonControlsEx (line 26) | func InitCommonControlsEx(lpInitCtrls *INITCOMMONCONTROLSEX) bool {
function ImageList_Create (line 33) | func ImageList_Create(cx, cy int, flags uint, cInitial, cGrow int) HIMAG...
function ImageList_Destroy (line 48) | func ImageList_Destroy(himl HIMAGELIST) bool {
function ImageList_GetImageCount (line 55) | func ImageList_GetImageCount(himl HIMAGELIST) int {
function ImageList_SetImageCount (line 62) | func ImageList_SetImageCount(himl HIMAGELIST, uNewCount uint) bool {
function ImageList_Add (line 70) | func ImageList_Add(himl HIMAGELIST, hbmImage, hbmMask HBITMAP) int {
function ImageList_ReplaceIcon (line 79) | func ImageList_ReplaceIcon(himl HIMAGELIST, i int, hicon HICON) int {
function ImageList_AddIcon (line 88) | func ImageList_AddIcon(himl HIMAGELIST, hicon HICON) int {
function ImageList_Remove (line 92) | func ImageList_Remove(himl HIMAGELIST, i int) bool {
function ImageList_RemoveAll (line 100) | func ImageList_RemoveAll(himl HIMAGELIST) bool {
function TrackMouseEvent (line 104) | func TrackMouseEvent(tme *TRACKMOUSEEVENT) bool {
FILE: vendor/github.com/shirou/w32/comdlg32.go
function GetOpenFileName (line 20) | func GetOpenFileName(ofn *OPENFILENAME) bool {
function GetSaveFileName (line 27) | func GetSaveFileName(ofn *OPENFILENAME) bool {
function CommDlgExtendedError (line 34) | func CommDlgExtendedError() uint {
FILE: vendor/github.com/shirou/w32/constants.go
constant FALSE (line 8) | FALSE = 0
constant TRUE (line 9) | TRUE = 1
constant NO_ERROR (line 13) | NO_ERROR = 0
constant ERROR_SUCCESS (line 14) | ERROR_SUCCESS = 0
constant ERROR_FILE_NOT_FOUND (line 15) | ERROR_FILE_NOT_FOUND = 2
constant ERROR_PATH_NOT_FOUND (line 16) | ERROR_PATH_NOT_FOUND = 3
constant ERROR_ACCESS_DENIED (line 17) | ERROR_ACCESS_DENIED = 5
constant ERROR_INVALID_HANDLE (line 18) | ERROR_INVALID_HANDLE = 6
constant ERROR_BAD_FORMAT (line 19) | ERROR_BAD_FORMAT = 11
constant ERROR_INVALID_NAME (line 20) | ERROR_INVALID_NAME = 123
constant ERROR_MORE_DATA (line 21) | ERROR_MORE_DATA = 234
constant ERROR_NO_MORE_ITEMS (line 22) | ERROR_NO_MORE_ITEMS = 259
constant ERROR_INVALID_SERVICE_CONTROL (line 23) | ERROR_INVALID_SERVICE_CONTROL = 1052
constant ERROR_SERVICE_REQUEST_TIMEOUT (line 24) | ERROR_SERVICE_REQUEST_TIMEOUT = 1053
constant ERROR_SERVICE_NO_THREAD (line 25) | ERROR_SERVICE_NO_THREAD = 1054
constant ERROR_SERVICE_DATABASE_LOCKED (line 26) | ERROR_SERVICE_DATABASE_LOCKED = 1055
constant ERROR_SERVICE_ALREADY_RUNNING (line 27) | ERROR_SERVICE_ALREADY_RUNNING = 1056
constant ERROR_SERVICE_DISABLED (line 28) | ERROR_SERVICE_DISABLED = 1058
constant ERROR_SERVICE_DOES_NOT_EXIST (line 29) | ERROR_SERVICE_DOES_NOT_EXIST = 1060
constant ERROR_SERVICE_CANNOT_ACCEPT_CTRL (line 30) | ERROR_SERVICE_CANNOT_ACCEPT_CTRL = 1061
constant ERROR_SERVICE_NOT_ACTIVE (line 31) | ERROR_SERVICE_NOT_ACTIVE = 1062
constant ERROR_DATABASE_DOES_NOT_EXIST (line 32) | ERROR_DATABASE_DOES_NOT_EXIST = 1065
constant ERROR_SERVICE_DEPENDENCY_FAIL (line 33) | ERROR_SERVICE_DEPENDENCY_FAIL = 1068
constant ERROR_SERVICE_LOGON_FAILED (line 34) | ERROR_SERVICE_LOGON_FAILED = 1069
constant ERROR_SERVICE_MARKED_FOR_DELETE (line 35) | ERROR_SERVICE_MARKED_FOR_DELETE = 1072
constant ERROR_SERVICE_DEPENDENCY_DELETED (line 36) | ERROR_SERVICE_DEPENDENCY_DELETED = 1075
constant SE_ERR_FNF (line 40) | SE_ERR_FNF = 2
constant SE_ERR_PNF (line 41) | SE_ERR_PNF = 3
constant SE_ERR_ACCESSDENIED (line 42) | SE_ERR_ACCESSDENIED = 5
constant SE_ERR_OOM (line 43) | SE_ERR_OOM = 8
constant SE_ERR_DLLNOTFOUND (line 44) | SE_ERR_DLLNOTFOUND = 32
constant SE_ERR_SHARE (line 45) | SE_ERR_SHARE = 26
constant SE_ERR_ASSOCINCOMPLETE (line 46) | SE_ERR_ASSOCINCOMPLETE = 27
constant SE_ERR_DDETIMEOUT (line 47) | SE_ERR_DDETIMEOUT = 28
constant SE_ERR_DDEFAIL (line 48) | SE_ERR_DDEFAIL = 29
constant SE_ERR_DDEBUSY (line 49) | SE_ERR_DDEBUSY = 30
constant SE_ERR_NOASSOC (line 50) | SE_ERR_NOASSOC = 31
constant CW_USEDEFAULT (line 54) | CW_USEDEFAULT = ^0x7fffffff
constant SW_HIDE (line 59) | SW_HIDE = 0
constant SW_NORMAL (line 60) | SW_NORMAL = 1
constant SW_SHOWNORMAL (line 61) | SW_SHOWNORMAL = 1
constant SW_SHOWMINIMIZED (line 62) | SW_SHOWMINIMIZED = 2
constant SW_MAXIMIZE (line 63) | SW_MAXIMIZE = 3
constant SW_SHOWMAXIMIZED (line 64) | SW_SHOWMAXIMIZED = 3
constant SW_SHOWNOACTIVATE (line 65) | SW_SHOWNOACTIVATE = 4
constant SW_SHOW (line 66) | SW_SHOW = 5
constant SW_MINIMIZE (line 67) | SW_MINIMIZE = 6
constant SW_SHOWMINNOACTIVE (line 68) | SW_SHOWMINNOACTIVE = 7
constant SW_SHOWNA (line 69) | SW_SHOWNA = 8
constant SW_RESTORE (line 70) | SW_RESTORE = 9
constant SW_SHOWDEFAULT (line 71) | SW_SHOWDEFAULT = 10
constant SW_FORCEMINIMIZE (line 72) | SW_FORCEMINIMIZE = 11
constant CS_VREDRAW (line 77) | CS_VREDRAW = 0x00000001
constant CS_HREDRAW (line 78) | CS_HREDRAW = 0x00000002
constant CS_KEYCVTWINDOW (line 79) | CS_KEYCVTWINDOW = 0x00000004
constant CS_DBLCLKS (line 80) | CS_DBLCLKS = 0x00000008
constant CS_OWNDC (line 81) | CS_OWNDC = 0x00000020
constant CS_CLASSDC (line 82) | CS_CLASSDC = 0x00000040
constant CS_PARENTDC (line 83) | CS_PARENTDC = 0x00000080
constant CS_NOKEYCVT (line 84) | CS_NOKEYCVT = 0x00000100
constant CS_NOCLOSE (line 85) | CS_NOCLOSE = 0x00000200
constant CS_SAVEBITS (line 86) | CS_SAVEBITS = 0x00000800
constant CS_BYTEALIGNCLIENT (line 87) | CS_BYTEALIGNCLIENT = 0x00001000
constant CS_BYTEALIGNWINDOW (line 88) | CS_BYTEALIGNWINDOW = 0x00002000
constant CS_GLOBALCLASS (line 89) | CS_GLOBALCLASS = 0x00004000
constant CS_IME (line 90) | CS_IME = 0x00010000
constant CS_DROPSHADOW (line 91) | CS_DROPSHADOW = 0x00020000
constant IDC_ARROW (line 96) | IDC_ARROW = 32512
constant IDC_IBEAM (line 97) | IDC_IBEAM = 32513
constant IDC_WAIT (line 98) | IDC_WAIT = 32514
constant IDC_CROSS (line 99) | IDC_CROSS = 32515
constant IDC_UPARROW (line 100) | IDC_UPARROW = 32516
constant IDC_SIZENWSE (line 101) | IDC_SIZENWSE = 32642
constant IDC_SIZENESW (line 102) | IDC_SIZENESW = 32643
constant IDC_SIZEWE (line 103) | IDC_SIZEWE = 32644
constant IDC_SIZENS (line 104) | IDC_SIZENS = 32645
constant IDC_SIZEALL (line 105) | IDC_SIZEALL = 32646
constant IDC_NO (line 106) | IDC_NO = 32648
constant IDC_HAND (line 107) | IDC_HAND = 32649
constant IDC_APPSTARTING (line 108) | IDC_APPSTARTING = 32650
constant IDC_HELP (line 109) | IDC_HELP = 32651
constant IDC_ICON (line 110) | IDC_ICON = 32641
constant IDC_SIZE (line 111) | IDC_SIZE = 32640
constant IDI_APPLICATION (line 116) | IDI_APPLICATION = 32512
constant IDI_HAND (line 117) | IDI_HAND = 32513
constant IDI_QUESTION (line 118) | IDI_QUESTION = 32514
constant IDI_EXCLAMATION (line 119) | IDI_EXCLAMATION = 32515
constant IDI_ASTERISK (line 120) | IDI_ASTERISK = 32516
constant IDI_WINLOGO (line 121) | IDI_WINLOGO = 32517
constant IDI_WARNING (line 122) | IDI_WARNING = IDI_EXCLAMATION
constant IDI_ERROR (line 123) | IDI_ERROR = IDI_HAND
constant IDI_INFORMATION (line 124) | IDI_INFORMATION = IDI_ASTERISK
constant BS_3STATE (line 129) | BS_3STATE = 5
constant BS_AUTO3STATE (line 130) | BS_AUTO3STATE = 6
constant BS_AUTOCHECKBOX (line 131) | BS_AUTOCHECKBOX = 3
constant BS_AUTORADIOBUTTON (line 132) | BS_AUTORADIOBUTTON = 9
constant BS_BITMAP (line 133) | BS_BITMAP = 128
constant BS_BOTTOM (line 134) | BS_BOTTOM = 0X800
constant BS_CENTER (line 135) | BS_CENTER = 0X300
constant BS_CHECKBOX (line 136) | BS_CHECKBOX = 2
constant BS_DEFPUSHBUTTON (line 137) | BS_DEFPUSHBUTTON = 1
constant BS_GROUPBOX (line 138) | BS_GROUPBOX = 7
constant BS_ICON (line 139) | BS_ICON = 64
constant BS_LEFT (line 140) | BS_LEFT = 256
constant BS_LEFTTEXT (line 141) | BS_LEFTTEXT = 32
constant BS_MULTILINE (line 142) | BS_MULTILINE = 0X2000
constant BS_NOTIFY (line 143) | BS_NOTIFY = 0X4000
constant BS_OWNERDRAW (line 144) | BS_OWNERDRAW = 0XB
constant BS_PUSHBUTTON (line 145) | BS_PUSHBUTTON = 0
constant BS_PUSHLIKE (line 146) | BS_PUSHLIKE = 4096
constant BS_RADIOBUTTON (line 147) | BS_RADIOBUTTON = 4
constant BS_RIGHT (line 148) | BS_RIGHT = 512
constant BS_RIGHTBUTTON (line 149) | BS_RIGHTBUTTON = 32
constant BS_TEXT (line 150) | BS_TEXT = 0
constant BS_TOP (line 151) | BS_TOP = 0X400
constant BS_USERBUTTON (line 152) | BS_USERBUTTON = 8
constant BS_VCENTER (line 153) | BS_VCENTER = 0XC00
constant BS_FLAT (line 154) | BS_FLAT = 0X8000
constant BST_CHECKED (line 159) | BST_CHECKED = 1
constant BST_INDETERMINATE (line 160) | BST_INDETERMINATE = 2
constant BST_UNCHECKED (line 161) | BST_UNCHECKED = 0
constant BST_FOCUS (line 162) | BST_FOCUS = 8
constant BST_PUSHED (line 163) | BST_PUSHED = 4
constant COLOR_3DDKSHADOW (line 168) | COLOR_3DDKSHADOW = 21
constant COLOR_3DFACE (line 169) | COLOR_3DFACE = 15
constant COLOR_3DHILIGHT (line 170) | COLOR_3DHILIGHT = 20
constant COLOR_3DHIGHLIGHT (line 171) | COLOR_3DHIGHLIGHT = 20
constant COLOR_3DLIGHT (line 172) | COLOR_3DLIGHT = 22
constant COLOR_BTNHILIGHT (line 173) | COLOR_BTNHILIGHT = 20
constant COLOR_3DSHADOW (line 174) | COLOR_3DSHADOW = 16
constant COLOR_ACTIVEBORDER (line 175) | COLOR_ACTIVEBORDER = 10
constant COLOR_ACTIVECAPTION (line 176) | COLOR_ACTIVECAPTION = 2
constant COLOR_APPWORKSPACE (line 177) | COLOR_APPWORKSPACE = 12
constant COLOR_BACKGROUND (line 178) | COLOR_BACKGROUND = 1
constant COLOR_DESKTOP (line 179) | COLOR_DESKTOP = 1
constant COLOR_BTNFACE (line 180) | COLOR_BTNFACE = 15
constant COLOR_BTNHIGHLIGHT (line 181) | COLOR_BTNHIGHLIGHT = 20
constant COLOR_BTNSHADOW (line 182) | COLOR_BTNSHADOW = 16
constant COLOR_BTNTEXT (line 183) | COLOR_BTNTEXT = 18
constant COLOR_CAPTIONTEXT (line 184) | COLOR_CAPTIONTEXT = 9
constant COLOR_GRAYTEXT (line 185) | COLOR_GRAYTEXT = 17
constant COLOR_HIGHLIGHT (line 186) | COLOR_HIGHLIGHT = 13
constant COLOR_HIGHLIGHTTEXT (line 187) | COLOR_HIGHLIGHTTEXT = 14
constant COLOR_INACTIVEBORDER (line 188) | COLOR_INACTIVEBORDER = 11
constant COLOR_INACTIVECAPTION (line 189) | COLOR_INACTIVECAPTION = 3
constant COLOR_INACTIVECAPTIONTEXT (line 190) | COLOR_INACTIVECAPTIONTEXT = 19
constant COLOR_INFOBK (line 191) | COLOR_INFOBK = 24
constant COLOR_INFOTEXT (line 192) | COLOR_INFOTEXT = 23
constant COLOR_MENU (line 193) | COLOR_MENU = 4
constant COLOR_MENUTEXT (line 194) | COLOR_MENUTEXT = 7
constant COLOR_SCROLLBAR (line 195) | COLOR_SCROLLBAR = 0
constant COLOR_WINDOW (line 196) | COLOR_WINDOW = 5
constant COLOR_WINDOWFRAME (line 197) | COLOR_WINDOWFRAME = 6
constant COLOR_WINDOWTEXT (line 198) | COLOR_WINDOWTEXT = 8
constant COLOR_HOTLIGHT (line 199) | COLOR_HOTLIGHT = 26
constant COLOR_GRADIENTACTIVECAPTION (line 200) | COLOR_GRADIENTACTIVECAPTION = 27
constant COLOR_GRADIENTINACTIVECAPTION (line 201) | COLOR_GRADIENTINACTIVECAPTION = 28
constant BM_CLICK (line 206) | BM_CLICK = 245
constant BM_GETCHECK (line 207) | BM_GETCHECK = 240
constant BM_GETIMAGE (line 208) | BM_GETIMAGE = 246
constant BM_GETSTATE (line 209) | BM_GETSTATE = 242
constant BM_SETCHECK (line 210) | BM_SETCHECK = 241
constant BM_SETIMAGE (line 211) | BM_SETIMAGE = 247
constant BM_SETSTATE (line 212) | BM_SETSTATE = 243
constant BM_SETSTYLE (line 213) | BM_SETSTYLE = 244
constant BN_CLICKED (line 218) | BN_CLICKED = 0
constant BN_PAINT (line 219) | BN_PAINT = 1
constant BN_HILITE (line 220) | BN_HILITE = 2
constant BN_PUSHED (line 221) | BN_PUSHED = BN_HILITE
constant BN_UNHILITE (line 222) | BN_UNHILITE = 3
constant BN_UNPUSHED (line 223) | BN_UNPUSHED = BN_UNHILITE
constant BN_DISABLE (line 224) | BN_DISABLE = 4
constant BN_DOUBLECLICKED (line 225) | BN_DOUBLECLICKED = 5
constant BN_DBLCLK (line 226) | BN_DBLCLK = BN_DOUBLECLICKED
constant BN_SETFOCUS (line 227) | BN_SETFOCUS = 6
constant BN_KILLFOCUS (line 228) | BN_KILLFOCUS = 7
constant GWL_EXSTYLE (line 233) | GWL_EXSTYLE = -20
constant GWL_STYLE (line 234) | GWL_STYLE = -16
constant GWL_WNDPROC (line 235) | GWL_WNDPROC = -4
constant GWLP_WNDPROC (line 236) | GWLP_WNDPROC = -4
constant GWL_HINSTANCE (line 237) | GWL_HINSTANCE = -6
constant GWLP_HINSTANCE (line 238) | GWLP_HINSTANCE = -6
constant GWL_HWNDPARENT (line 239) | GWL_HWNDPARENT = -8
constant GWLP_HWNDPARENT (line 240) | GWLP_HWNDPARENT = -8
constant GWL_ID (line 241) | GWL_ID = -12
constant GWLP_ID (line 242) | GWLP_ID = -12
constant GWL_USERDATA (line 243) | GWL_USERDATA = -21
constant GWLP_USERDATA (line 244) | GWLP_USERDATA = -21
constant WS_OVERLAPPED (line 249) | WS_OVERLAPPED = 0X00000000
constant WS_POPUP (line 250) | WS_POPUP = 0X80000000
constant WS_CHILD (line 251) | WS_CHILD = 0X40000000
constant WS_MINIMIZE (line 252) | WS_MINIMIZE = 0X20000000
constant WS_VISIBLE (line 253) | WS_VISIBLE = 0X10000000
constant WS_DISABLED (line 254) | WS_DISABLED = 0X08000000
constant WS_CLIPSIBLINGS (line 255) | WS_CLIPSIBLINGS = 0X04000000
constant WS_CLIPCHILDREN (line 256) | WS_CLIPCHILDREN = 0X02000000
constant WS_MAXIMIZE (line 257) | WS_MAXIMIZE = 0X01000000
constant WS_CAPTION (line 258) | WS_CAPTION = 0X00C00000
constant WS_BORDER (line 259) | WS_BORDER = 0X00800000
constant WS_DLGFRAME (line 260) | WS_DLGFRAME = 0X00400000
constant WS_VSCROLL (line 261) | WS_VSCROLL = 0X00200000
constant WS_HSCROLL (line 262) | WS_HSCROLL = 0X00100000
constant WS_SYSMENU (line 263) | WS_SYSMENU = 0X00080000
constant WS_THICKFRAME (line 264) | WS_THICKFRAME = 0X00040000
constant WS_GROUP (line 265) | WS_GROUP = 0X00020000
constant WS_TABSTOP (line 266) | WS_TABSTOP = 0X00010000
constant WS_MINIMIZEBOX (line 267) | WS_MINIMIZEBOX = 0X00020000
constant WS_MAXIMIZEBOX (line 268) | WS_MAXIMIZEBOX = 0X00010000
constant WS_TILED (line 269) | WS_TILED = 0X00000000
constant WS_ICONIC (line 270) | WS_ICONIC = 0X20000000
constant WS_SIZEBOX (line 271) | WS_SIZEBOX = 0X00040000
constant WS_OVERLAPPEDWINDOW (line 272) | WS_OVERLAPPEDWINDOW = 0X00000000 | 0X00C00000 | 0X00080000 | 0X00040000 ...
constant WS_POPUPWINDOW (line 273) | WS_POPUPWINDOW = 0X80000000 | 0X00800000 | 0X00080000
constant WS_CHILDWINDOW (line 274) | WS_CHILDWINDOW = 0X40000000
constant WS_EX_DLGMODALFRAME (line 279) | WS_EX_DLGMODALFRAME = 0X00000001
constant WS_EX_NOPARENTNOTIFY (line 280) | WS_EX_NOPARENTNOTIFY = 0X00000004
constant WS_EX_TOPMOST (line 281) | WS_EX_TOPMOST = 0X00000008
constant WS_EX_ACCEPTFILES (line 282) | WS_EX_ACCEPTFILES = 0X00000010
constant WS_EX_TRANSPARENT (line 283) | WS_EX_TRANSPARENT = 0X00000020
constant WS_EX_MDICHILD (line 284) | WS_EX_MDICHILD = 0X00000040
constant WS_EX_TOOLWINDOW (line 285) | WS_EX_TOOLWINDOW = 0X00000080
constant WS_EX_WINDOWEDGE (line 286) | WS_EX_WINDOWEDGE = 0X00000100
constant WS_EX_CLIENTEDGE (line 287) | WS_EX_CLIENTEDGE = 0X00000200
constant WS_EX_CONTEXTHELP (line 288) | WS_EX_CONTEXTHELP = 0X00000400
constant WS_EX_RIGHT (line 289) | WS_EX_RIGHT = 0X00001000
constant WS_EX_LEFT (line 290) | WS_EX_LEFT = 0X00000000
constant WS_EX_RTLREADING (line 291) | WS_EX_RTLREADING = 0X00002000
constant WS_EX_LTRREADING (line 292) | WS_EX_LTRREADING = 0X00000000
constant WS_EX_LEFTSCROLLBAR (line 293) | WS_EX_LEFTSCROLLBAR = 0X00004000
constant WS_EX_RIGHTSCROLLBAR (line 294) | WS_EX_RIGHTSCROLLBAR = 0X00000000
constant WS_EX_CONTROLPARENT (line 295) | WS_EX_CONTROLPARENT = 0X00010000
constant WS_EX_STATICEDGE (line 296) | WS_EX_STATICEDGE = 0X00020000
constant WS_EX_APPWINDOW (line 297) | WS_EX_APPWINDOW = 0X00040000
constant WS_EX_OVERLAPPEDWINDOW (line 298) | WS_EX_OVERLAPPEDWINDOW = 0X00000100 | 0X00000200
constant WS_EX_PALETTEWINDOW (line 299) | WS_EX_PALETTEWINDOW = 0X00000100 | 0X00000080 | 0X00000008
constant WS_EX_LAYERED (line 300) | WS_EX_LAYERED = 0X00080000
constant WS_EX_NOINHERITLAYOUT (line 301) | WS_EX_NOINHERITLAYOUT = 0X00100000
constant WS_EX_LAYOUTRTL (line 302) | WS_EX_LAYOUTRTL = 0X00400000
constant WS_EX_NOACTIVATE (line 303) | WS_EX_NOACTIVATE = 0X08000000
constant WM_APP (line 308) | WM_APP = 32768
constant WM_ACTIVATE (line 309) | WM_ACTIVATE = 6
constant WM_ACTIVATEAPP (line 310) | WM_ACTIVATEAPP = 28
constant WM_AFXFIRST (line 311) | WM_AFXFIRST = 864
constant WM_AFXLAST (line 312) | WM_AFXLAST = 895
constant WM_ASKCBFORMATNAME (line 313) | WM_ASKCBFORMATNAME = 780
constant WM_CANCELJOURNAL (line 314) | WM_CANCELJOURNAL = 75
constant WM_CANCELMODE (line 315) | WM_CANCELMODE = 31
constant WM_CAPTURECHANGED (line 316) | WM_CAPTURECHANGED = 533
constant WM_CHANGECBCHAIN (line 317) | WM_CHANGECBCHAIN = 781
constant WM_CHAR (line 318) | WM_CHAR = 258
constant WM_CHARTOITEM (line 319) | WM_CHARTOITEM = 47
constant WM_CHILDACTIVATE (line 320) | WM_CHILDACTIVATE = 34
constant WM_CLEAR (line 321) | WM_CLEAR = 771
constant WM_CLOSE (line 322) | WM_CLOSE = 16
constant WM_COMMAND (line 323) | WM_COMMAND = 273
constant WM_COMMNOTIFY (line 324) | WM_COMMNOTIFY = 68
constant WM_COMPACTING (line 325) | WM_COMPACTING = 65
constant WM_COMPAREITEM (line 326) | WM_COMPAREITEM = 57
constant WM_CONTEXTMENU (line 327) | WM_CONTEXTMENU = 123
constant WM_COPY (line 328) | WM_COPY = 769
constant WM_COPYDATA (line 329) | WM_COPYDATA = 74
constant WM_CREATE (line 330) | WM_CREATE = 1
constant WM_CTLCOLORBTN (line 331) | WM_CTLCOLORBTN = 309
constant WM_CTLCOLORDLG (line 332) | WM_CTLCOLORDLG = 310
constant WM_CTLCOLOREDIT (line 333) | WM_CTLCOLOREDIT = 307
constant WM_CTLCOLORLISTBOX (line 334) | WM_CTLCOLORLISTBOX = 308
constant WM_CTLCOLORMSGBOX (line 335) | WM_CTLCOLORMSGBOX = 306
constant WM_CTLCOLORSCROLLBAR (line 336) | WM_CTLCOLORSCROLLBAR = 311
constant WM_CTLCOLORSTATIC (line 337) | WM_CTLCOLORSTATIC = 312
constant WM_CUT (line 338) | WM_CUT = 768
constant WM_DEADCHAR (line 339) | WM_DEADCHAR = 259
constant WM_DELETEITEM (line 340) | WM_DELETEITEM = 45
constant WM_DESTROY (line 341) | WM_DESTROY = 2
constant WM_DESTROYCLIPBOARD (line 342) | WM_DESTROYCLIPBOARD = 775
constant WM_DEVICECHANGE (line 343) | WM_DEVICECHANGE = 537
constant WM_DEVMODECHANGE (line 344) | WM_DEVMODECHANGE = 27
constant WM_DISPLAYCHANGE (line 345) | WM_DISPLAYCHANGE = 126
constant WM_DRAWCLIPBOARD (line 346) | WM_DRAWCLIPBOARD = 776
constant WM_DRAWITEM (line 347) | WM_DRAWITEM = 43
constant WM_DROPFILES (line 348) | WM_DROPFILES = 563
constant WM_ENABLE (line 349) | WM_ENABLE = 10
constant WM_ENDSESSION (line 350) | WM_ENDSESSION = 22
constant WM_ENTERIDLE (line 351) | WM_ENTERIDLE = 289
constant WM_ENTERMENULOOP (line 352) | WM_ENTERMENULOOP = 529
constant WM_ENTERSIZEMOVE (line 353) | WM_ENTERSIZEMOVE = 561
constant WM_ERASEBKGND (line 354) | WM_ERASEBKGND = 20
constant WM_EXITMENULOOP (line 355) | WM_EXITMENULOOP = 530
constant WM_EXITSIZEMOVE (line 356) | WM_EXITSIZEMOVE = 562
constant WM_FONTCHANGE (line 357) | WM_FONTCHANGE = 29
constant WM_GETDLGCODE (line 358) | WM_GETDLGCODE = 135
constant WM_GETFONT (line 359) | WM_GETFONT = 49
constant WM_GETHOTKEY (line 360) | WM_GETHOTKEY = 51
constant WM_GETICON (line 361) | WM_GETICON = 127
constant WM_GETMINMAXINFO (line 362) | WM_GETMINMAXINFO = 36
constant WM_GETTEXT (line 363) | WM_GETTEXT = 13
constant WM_GETTEXTLENGTH (line 364) | WM_GETTEXTLENGTH = 14
constant WM_HANDHELDFIRST (line 365) | WM_HANDHELDFIRST = 856
constant WM_HANDHELDLAST (line 366) | WM_HANDHELDLAST = 863
constant WM_HELP (line 367) | WM_HELP = 83
constant WM_HOTKEY (line 368) | WM_HOTKEY = 786
constant WM_HSCROLL (line 369) | WM_HSCROLL = 276
constant WM_HSCROLLCLIPBOARD (line 370) | WM_HSCROLLCLIPBOARD = 782
constant WM_ICONERASEBKGND (line 371) | WM_ICONERASEBKGND = 39
constant WM_INITDIALOG (line 372) | WM_INITDIALOG = 272
constant WM_INITMENU (line 373) | WM_INITMENU = 278
constant WM_INITMENUPOPUP (line 374) | WM_INITMENUPOPUP = 279
constant WM_INPUT (line 375) | WM_INPUT = 0X00FF
constant WM_INPUTLANGCHANGE (line 376) | WM_INPUTLANGCHANGE = 81
constant WM_INPUTLANGCHANGEREQUEST (line 377) | WM_INPUTLANGCHANGEREQUEST = 80
constant WM_KEYDOWN (line 378) | WM_KEYDOWN = 256
constant WM_KEYUP (line 379) | WM_KEYUP = 257
constant WM_KILLFOCUS (line 380) | WM_KILLFOCUS = 8
constant WM_MDIACTIVATE (line 381) | WM_MDIACTIVATE = 546
constant WM_MDICASCADE (line 382) | WM_MDICASCADE = 551
constant WM_MDICREATE (line 383) | WM_MDICREATE = 544
constant WM_MDIDESTROY (line 384) | WM_MDIDESTROY = 545
constant WM_MDIGETACTIVE (line 385) | WM_MDIGETACTIVE = 553
constant WM_MDIICONARRANGE (line 386) | WM_MDIICONARRANGE = 552
constant WM_MDIMAXIMIZE (line 387) | WM_MDIMAXIMIZE = 549
constant WM_MDINEXT (line 388) | WM_MDINEXT = 548
constant WM_MDIREFRESHMENU (line 389) | WM_MDIREFRESHMENU = 564
constant WM_MDIRESTORE (line 390) | WM_MDIRESTORE = 547
constant WM_MDISETMENU (line 391) | WM_MDISETMENU = 560
constant WM_MDITILE (line 392) | WM_MDITILE = 550
constant WM_MEASUREITEM (line 393) | WM_MEASUREITEM = 44
constant WM_GETOBJECT (line 394) | WM_GETOBJECT = 0X003D
constant WM_CHANGEUISTATE (line 395) | WM_CHANGEUISTATE = 0X0127
constant WM_UPDATEUISTATE (line 396) | WM_UPDATEUISTATE = 0X0128
constant WM_QUERYUISTATE (line 397) | WM_QUERYUISTATE = 0X0129
constant WM_UNINITMENUPOPUP (line 398) | WM_UNINITMENUPOPUP = 0X0125
constant WM_MENURBUTTONUP (line 399) | WM_MENURBUTTONUP = 290
constant WM_MENUCOMMAND (line 400) | WM_MENUCOMMAND = 0X0126
constant WM_MENUGETOBJECT (line 401) | WM_MENUGETOBJECT = 0X0124
constant WM_MENUDRAG (line 402) | WM_MENUDRAG = 0X0123
constant WM_APPCOMMAND (line 403) | WM_APPCOMMAND = 0X0319
constant WM_MENUCHAR (line 404) | WM_MENUCHAR = 288
constant WM_MENUSELECT (line 405) | WM_MENUSELECT = 287
constant WM_MOVE (line 406) | WM_MOVE = 3
constant WM_MOVING (line 407) | WM_MOVING = 534
constant WM_NCACTIVATE (line 408) | WM_NCACTIVATE = 134
constant WM_NCCALCSIZE (line 409) | WM_NCCALCSIZE = 131
constant WM_NCCREATE (line 410) | WM_NCCREATE = 129
constant WM_NCDESTROY (line 411) | WM_NCDESTROY = 130
constant WM_NCHITTEST (line 412) | WM_NCHITTEST = 132
constant WM_NCLBUTTONDBLCLK (line 413) | WM_NCLBUTTONDBLCLK = 163
constant WM_NCLBUTTONDOWN (line 414) | WM_NCLBUTTONDOWN = 161
constant WM_NCLBUTTONUP (line 415) | WM_NCLBUTTONUP = 162
constant WM_NCMBUTTONDBLCLK (line 416) | WM_NCMBUTTONDBLCLK = 169
constant WM_NCMBUTTONDOWN (line 417) | WM_NCMBUTTONDOWN = 167
constant WM_NCMBUTTONUP (line 418) | WM_NCMBUTTONUP = 168
constant WM_NCXBUTTONDOWN (line 419) | WM_NCXBUTTONDOWN = 171
constant WM_NCXBUTTONUP (line 420) | WM_NCXBUTTONUP = 172
constant WM_NCXBUTTONDBLCLK (line 421) | WM_NCXBUTTONDBLCLK = 173
constant WM_NCMOUSEHOVER (line 422) | WM_NCMOUSEHOVER = 0X02A0
constant WM_NCMOUSELEAVE (line 423) | WM_NCMOUSELEAVE = 0X02A2
constant WM_NCMOUSEMOVE (line 424) | WM_NCMOUSEMOVE = 160
constant WM_NCPAINT (line 425) | WM_NCPAINT = 133
constant WM_NCRBUTTONDBLCLK (line 426) | WM_NCRBUTTONDBLCLK = 166
constant WM_NCRBUTTONDOWN (line 427) | WM_NCRBUTTONDOWN = 164
constant WM_NCRBUTTONUP (line 428) | WM_NCRBUTTONUP = 165
constant WM_NEXTDLGCTL (line 429) | WM_NEXTDLGCTL = 40
constant WM_NEXTMENU (line 430) | WM_NEXTMENU = 531
constant WM_NOTIFY (line 431) | WM_NOTIFY = 78
constant WM_NOTIFYFORMAT (line 432) | WM_NOTIFYFORMAT = 85
constant WM_NULL (line 433) | WM_NULL = 0
constant WM_PAINT (line 434) | WM_PAINT = 15
constant WM_PAINTCLIPBOARD (line 435) | WM_PAINTCLIPBOARD = 777
constant WM_PAINTICON (line 436) | WM_PAINTICON = 38
constant WM_PALETTECHANGED (line 437) | WM_PALETTECHANGED = 785
constant WM_PALETTEISCHANGING (line 438) | WM_PALETTEISCHANGING = 784
constant WM_PARENTNOTIFY (line 439) | WM_PARENTNOTIFY = 528
constant WM_PASTE (line 440) | WM_PASTE = 770
constant WM_PENWINFIRST (line 441) | WM_PENWINFIRST = 896
constant WM_PENWINLAST (line 442) | WM_PENWINLAST = 911
constant WM_POWER (line 443) | WM_POWER = 72
constant WM_POWERBROADCAST (line 444) | WM_POWERBROADCAST = 536
constant WM_PRINT (line 445) | WM_PRINT = 791
constant WM_PRINTCLIENT (line 446) | WM_PRINTCLIENT = 792
constant WM_QUERYDRAGICON (line 447) | WM_QUERYDRAGICON = 55
constant WM_QUERYENDSESSION (line 448) | WM_QUERYENDSESSION = 17
constant WM_QUERYNEWPALETTE (line 449) | WM_QUERYNEWPALETTE = 783
constant WM_QUERYOPEN (line 450) | WM_QUERYOPEN = 19
constant WM_QUEUESYNC (line 451) | WM_QUEUESYNC = 35
constant WM_QUIT (line 452) | WM_QUIT = 18
constant WM_RENDERALLFORMATS (line 453) | WM_RENDERALLFORMATS = 774
constant WM_RENDERFORMAT (line 454) | WM_RENDERFORMAT = 773
constant WM_SETCURSOR (line 455) | WM_SETCURSOR = 32
constant WM_SETFOCUS (line 456) | WM_SETFOCUS = 7
constant WM_SETFONT (line 457) | WM_SETFONT = 48
constant WM_SETHOTKEY (line 458) | WM_SETHOTKEY = 50
constant WM_SETICON (line 459) | WM_SETICON = 128
constant WM_SETREDRAW (line 460) | WM_SETREDRAW = 11
constant WM_SETTEXT (line 461) | WM_SETTEXT = 12
constant WM_SETTINGCHANGE (line 462) | WM_SETTINGCHANGE = 26
constant WM_SHOWWINDOW (line 463) | WM_SHOWWINDOW = 24
constant WM_SIZE (line 464) | WM_SIZE = 5
constant WM_SIZECLIPBOARD (line 465) | WM_SIZECLIPBOARD = 779
constant WM_SIZING (line 466) | WM_SIZING = 532
constant WM_SPOOLERSTATUS (line 467) | WM_SPOOLERSTATUS = 42
constant WM_STYLECHANGED (line 468) | WM_STYLECHANGED = 125
constant WM_STYLECHANGING (line 469) | WM_STYLECHANGING = 124
constant WM_SYSCHAR (line 470) | WM_SYSCHAR = 262
constant WM_SYSCOLORCHANGE (line 471) | WM_SYSCOLORCHANGE = 21
constant WM_SYSCOMMAND (line 472) | WM_SYSCOMMAND = 274
constant WM_SYSDEADCHAR (line 473) | WM_SYSDEADCHAR = 263
constant WM_SYSKEYDOWN (line 474) | WM_SYSKEYDOWN = 260
constant WM_SYSKEYUP (line 475) | WM_SYSKEYUP = 261
constant WM_TCARD (line 476) | WM_TCARD = 82
constant WM_THEMECHANGED (line 477) | WM_THEMECHANGED = 794
constant WM_TIMECHANGE (line 478) | WM_TIMECHANGE = 30
constant WM_TIMER (line 479) | WM_TIMER = 275
constant WM_UNDO (line 480) | WM_UNDO = 772
constant WM_USER (line 481) | WM_USER = 1024
constant WM_USERCHANGED (line 482) | WM_USERCHANGED = 84
constant WM_VKEYTOITEM (line 483) | WM_VKEYTOITEM = 46
constant WM_VSCROLL (line 484) | WM_VSCROLL = 277
constant WM_VSCROLLCLIPBOARD (line 485) | WM_VSCROLLCLIPBOARD = 778
constant WM_WINDOWPOSCHANGED (line 486) | WM_WINDOWPOSCHANGED = 71
constant WM_WINDOWPOSCHANGING (line 487) | WM_WINDOWPOSCHANGING = 70
constant WM_WININICHANGE (line 488) | WM_WININICHANGE = 26
constant WM_KEYFIRST (line 489) | WM_KEYFIRST = 256
constant WM_KEYLAST (line 490) | WM_KEYLAST = 264
constant WM_SYNCPAINT (line 491) | WM_SYNCPAINT = 136
constant WM_MOUSEACTIVATE (line 492) | WM_MOUSEACTIVATE = 33
constant WM_MOUSEMOVE (line 493) | WM_MOUSEMOVE = 512
constant WM_LBUTTONDOWN (line 494) | WM_LBUTTONDOWN = 513
constant WM_LBUTTONUP (line 495) | WM_LBUTTONUP = 514
constant WM_LBUTTONDBLCLK (line 496) | WM_LBUTTONDBLCLK = 515
constant WM_RBUTTONDOWN (line 497) | WM_RBUTTONDOWN = 516
constant WM_RBUTTONUP (line 498) | WM_RBUTTONUP = 517
constant WM_RBUTTONDBLCLK (line 499) | WM_RBUTTONDBLCLK = 518
constant WM_MBUTTONDOWN (line 500) | WM_MBUTTONDOWN = 519
constant WM_MBUTTONUP (line 501) | WM_MBUTTONUP = 520
constant WM_MBUTTONDBLCLK (line 502) | WM_MBUTTONDBLCLK = 521
constant WM_MOUSEWHEEL (line 503) | WM_MOUSEWHEEL = 522
constant WM_MOUSEFIRST (line 504) | WM_MOUSEFIRST = 512
constant WM_XBUTTONDOWN (line 505) | WM_XBUTTONDOWN = 523
constant WM_XBUTTONUP (line 506) | WM_XBUTTONUP = 524
constant WM_XBUTTONDBLCLK (line 507) | WM_XBUTTONDBLCLK = 525
constant WM_MOUSELAST (line 508) | WM_MOUSELAST = 525
constant WM_MOUSEHOVER (line 509) | WM_MOUSEHOVER = 0X2A1
constant WM_MOUSELEAVE (line 510) | WM_MOUSELEAVE = 0X2A3
constant WM_CLIPBOARDUPDATE (line 511) | WM_CLIPBOARDUPDATE = 0x031D
constant WA_INACTIVE (line 516) | WA_INACTIVE = 0
constant WA_ACTIVE (line 517) | WA_ACTIVE = 1
constant WA_CLICKACTIVE (line 518) | WA_CLICKACTIVE = 2
constant LF_FACESIZE (line 521) | LF_FACESIZE = 32
constant FW_DONTCARE (line 525) | FW_DONTCARE = 0
constant FW_THIN (line 526) | FW_THIN = 100
constant FW_EXTRALIGHT (line 527) | FW_EXTRALIGHT = 200
constant FW_ULTRALIGHT (line 528) | FW_ULTRALIGHT = FW_EXTRALIGHT
constant FW_LIGHT (line 529) | FW_LIGHT = 300
constant FW_NORMAL (line 530) | FW_NORMAL = 400
constant FW_REGULAR (line 531) | FW_REGULAR = 400
constant FW_MEDIUM (line 532) | FW_MEDIUM = 500
constant FW_SEMIBOLD (line 533) | FW_SEMIBOLD = 600
constant FW_DEMIBOLD (line 534) | FW_DEMIBOLD = FW_SEMIBOLD
constant FW_BOLD (line 535) | FW_BOLD = 700
constant FW_EXTRABOLD (line 536) | FW_EXTRABOLD = 800
constant FW_ULTRABOLD (line 537) | FW_ULTRABOLD = FW_EXTRABOLD
constant FW_HEAVY (line 538) | FW_HEAVY = 900
constant FW_BLACK (line 539) | FW_BLACK = FW_HEAVY
constant ANSI_CHARSET (line 544) | ANSI_CHARSET = 0
constant DEFAULT_CHARSET (line 545) | DEFAULT_CHARSET = 1
constant SYMBOL_CHARSET (line 546) | SYMBOL_CHARSET = 2
constant SHIFTJIS_CHARSET (line 547) | SHIFTJIS_CHARSET = 128
constant HANGEUL_CHARSET (line 548) | HANGEUL_CHARSET = 129
constant HANGUL_CHARSET (line 549) | HANGUL_CHARSET = 129
constant GB2312_CHARSET (line 550) | GB2312_CHARSET = 134
constant CHINESEBIG5_CHARSET (line 551) | CHINESEBIG5_CHARSET = 136
constant GREEK_CHARSET (line 552) | GREEK_CHARSET = 161
constant TURKISH_CHARSET (line 553) | TURKISH_CHARSET = 162
constant HEBREW_CHARSET (line 554) | HEBREW_CHARSET = 177
constant ARABIC_CHARSET (line 555) | ARABIC_CHARSET = 178
constant BALTIC_CHARSET (line 556) | BALTIC_CHARSET = 186
constant RUSSIAN_CHARSET (line 557) | RUSSIAN_CHARSET = 204
constant THAI_CHARSET (line 558) | THAI_CHARSET = 222
constant EASTEUROPE_CHARSET (line 559) | EASTEUROPE_CHARSET = 238
constant OEM_CHARSET (line 560) | OEM_CHARSET = 255
constant JOHAB_CHARSET (line 561) | JOHAB_CHARSET = 130
constant VIETNAMESE_CHARSET (line 562) | VIETNAMESE_CHARSET = 163
constant MAC_CHARSET (line 563) | MAC_CHARSET = 77
constant OUT_DEFAULT_PRECIS (line 568) | OUT_DEFAULT_PRECIS = 0
constant OUT_STRING_PRECIS (line 569) | OUT_STRING_PRECIS = 1
constant OUT_CHARACTER_PRECIS (line 570) | OUT_CHARACTER_PRECIS = 2
constant OUT_STROKE_PRECIS (line 571) | OUT_STROKE_PRECIS = 3
constant OUT_TT_PRECIS (line 572) | OUT_TT_PRECIS = 4
constant OUT_DEVICE_PRECIS (line 573) | OUT_DEVICE_PRECIS = 5
constant OUT_RASTER_PRECIS (line 574) | OUT_RASTER_PRECIS = 6
constant OUT_TT_ONLY_PRECIS (line 575) | OUT_TT_ONLY_PRECIS = 7
constant OUT_OUTLINE_PRECIS (line 576) | OUT_OUTLINE_PRECIS = 8
constant OUT_PS_ONLY_PRECIS (line 577) | OUT_PS_ONLY_PRECIS = 10
constant CLIP_DEFAULT_PRECIS (line 582) | CLIP_DEFAULT_PRECIS = 0
constant CLIP_CHARACTER_PRECIS (line 583) | CLIP_CHARACTER_PRECIS = 1
constant CLIP_STROKE_PRECIS (line 584) | CLIP_STROKE_PRECIS = 2
constant CLIP_MASK (line 585) | CLIP_MASK = 15
constant CLIP_LH_ANGLES (line 586) | CLIP_LH_ANGLES = 16
constant CLIP_TT_ALWAYS (line 587) | CLIP_TT_ALWAYS = 32
constant CLIP_EMBEDDED (line 588) | CLIP_EMBEDDED = 128
constant DEFAULT_QUALITY (line 593) | DEFAULT_QUALITY = 0
constant DRAFT_QUALITY (line 594) | DRAFT_QUALITY = 1
constant PROOF_QUALITY (line 595) | PROOF_QUALITY = 2
constant NONANTIALIASED_QUALITY (line 596) | NONANTIALIASED_QUALITY = 3
constant ANTIALIASED_QUALITY (line 597) | ANTIALIASED_QUALITY = 4
constant CLEARTYPE_QUALITY (line 598) | CLEARTYPE_QUALITY = 5
constant DEFAULT_PITCH (line 603) | DEFAULT_PITCH = 0
constant FIXED_PITCH (line 604) | FIXED_PITCH = 1
constant VARIABLE_PITCH (line 605) | VARIABLE_PITCH = 2
constant FF_DECORATIVE (line 610) | FF_DECORATIVE = 80
constant FF_DONTCARE (line 611) | FF_DONTCARE = 0
constant FF_MODERN (line 612) | FF_MODERN = 48
constant FF_ROMAN (line 613) | FF_ROMAN = 16
constant FF_SCRIPT (line 614) | FF_SCRIPT = 64
constant FF_SWISS (line 615) | FF_SWISS = 32
constant DC_FIELDS (line 620) | DC_FIELDS = 1
constant DC_PAPERS (line 621) | DC_PAPERS = 2
constant DC_PAPERSIZE (line 622) | DC_PAPERSIZE = 3
constant DC_MINEXTENT (line 623) | DC_MINEXTENT = 4
constant DC_MAXEXTENT (line 624) | DC_MAXEXTENT = 5
constant DC_BINS (line 625) | DC_BINS = 6
constant DC_DUPLEX (line 626) | DC_DUPLEX = 7
constant DC_SIZE (line 627) | DC_SIZE = 8
constant DC_EXTRA (line 628) | DC_EXTRA = 9
constant DC_VERSION (line 629) | DC_VERSION = 10
constant DC_DRIVER (line 630) | DC_DRIVER = 11
constant DC_BINNAMES (line 631) | DC_BINNAMES = 12
constant DC_ENUMRESOLUTIONS (line 632) | DC_ENUMRESOLUTIONS = 13
constant DC_FILEDEPENDENCIES (line 633) | DC_FILEDEPENDENCIES = 14
constant DC_TRUETYPE (line 634) | DC_TRUETYPE = 15
constant DC_PAPERNAMES (line 635) | DC_PAPERNAMES = 16
constant DC_ORIENTATION (line 636) | DC_ORIENTATION = 17
constant DC_COPIES (line 637) | DC_COPIES = 18
constant DC_BINADJUST (line 638) | DC_BINADJUST = 19
constant DC_EMF_COMPLIANT (line 639) | DC_EMF_COMPLIANT = 20
constant DC_DATATYPE_PRODUCED (line 640) | DC_DATATYPE_PRODUCED = 21
constant DC_COLLATE (line 641) | DC_COLLATE = 22
constant DC_MANUFACTURER (line 642) | DC_MANUFACTURER = 23
constant DC_MODEL (line 643) | DC_MODEL = 24
constant DC_PERSONALITY (line 644) | DC_PERSONALITY = 25
constant DC_PRINTRATE (line 645) | DC_PRINTRATE = 26
constant DC_PRINTRATEUNIT (line 646) | DC_PRINTRATEUNIT = 27
constant DC_PRINTERMEM (line 647) | DC_PRINTERMEM = 28
constant DC_MEDIAREADY (line 648) | DC_MEDIAREADY = 29
constant DC_STAPLE (line 649) | DC_STAPLE = 30
constant DC_PRINTRATEPPM (line 650) | DC_PRINTRATEPPM = 31
constant DC_COLORDEVICE (line 651) | DC_COLORDEVICE = 32
constant DC_NUP (line 652) | DC_NUP = 33
constant DC_MEDIATYPENAMES (line 653) | DC_MEDIATYPENAMES = 34
constant DC_MEDIATYPES (line 654) | DC_MEDIATYPES = 35
constant DRIVERVERSION (line 659) | DRIVERVERSION = 0
constant TECHNOLOGY (line 660) | TECHNOLOGY = 2
constant HORZSIZE (line 661) | HORZSIZE = 4
constant VERTSIZE (line 662) | VERTSIZE = 6
constant HORZRES (line 663) | HORZRES = 8
constant VERTRES (line 664) | VERTRES = 10
constant LOGPIXELSX (line 665) | LOGPIXELSX = 88
constant LOGPIXELSY (line 666) | LOGPIXELSY = 90
constant BITSPIXEL (line 667) | BITSPIXEL = 12
constant PLANES (line 668) | PLANES = 14
constant NUMBRUSHES (line 669) | NUMBRUSHES = 16
constant NUMPENS (line 670) | NUMPENS = 18
constant NUMFONTS (line 671) | NUMFONTS = 22
constant NUMCOLORS (line 672) | NUMCOLORS = 24
constant NUMMARKERS (line 673) | NUMMARKERS = 20
constant ASPECTX (line 674) | ASPECTX = 40
constant ASPECTY (line 675) | ASPECTY = 42
constant ASPECTXY (line 676) | ASPECTXY = 44
constant PDEVICESIZE (line 677) | PDEVICESIZE = 26
constant CLIPCAPS (line 678) | CLIPCAPS = 36
constant SIZEPALETTE (line 679) | SIZEPALETTE = 104
constant NUMRESERVED (line 680) | NUMRESERVED = 106
constant COLORRES (line 681) | COLORRES = 108
constant PHYSICALWIDTH (line 682) | PHYSICALWIDTH = 110
constant PHYSICALHEIGHT (line 683) | PHYSICALHEIGHT = 111
constant PHYSICALOFFSETX (line 684) | PHYSICALOFFSETX = 112
constant PHYSICALOFFSETY (line 685) | PHYSICALOFFSETY = 113
constant SCALINGFACTORX (line 686) | SCALINGFACTORX = 114
constant SCALINGFACTORY (line 687) | SCALINGFACTORY = 115
constant VREFRESH (line 688) | VREFRESH = 116
constant DESKTOPHORZRES (line 689) | DESKTOPHORZRES = 118
constant DESKTOPVERTRES (line 690) | DESKTOPVERTRES = 117
constant BLTALIGNMENT (line 691) | BLTALIGNMENT = 119
constant SHADEBLENDCAPS (line 692) | SHADEBLENDCAPS = 120
constant COLORMGMTCAPS (line 693) | COLORMGMTCAPS = 121
constant RASTERCAPS (line 694) | RASTERCAPS = 38
constant CURVECAPS (line 695) | CURVECAPS = 28
constant LINECAPS (line 696) | LINECAPS = 30
constant POLYGONALCAPS (line 697) | POLYGONALCAPS = 32
constant TEXTCAPS (line 698) | TEXTCAPS = 34
constant DT_PLOTTER (line 703) | DT_PLOTTER = 0
constant DT_RASDISPLAY (line 704) | DT_RASDISPLAY = 1
constant DT_RASPRINTER (line 705) | DT_RASPRINTER = 2
constant DT_RASCAMERA (line 706) | DT_RASCAMERA = 3
constant DT_CHARSTREAM (line 707) | DT_CHARSTREAM = 4
constant DT_METAFILE (line 708) | DT_METAFILE = 5
constant DT_DISPFILE (line 709) | DT_DISPFILE = 6
constant SB_NONE (line 714) | SB_NONE = 0x00
constant SB_CONST_ALPHA (line 715) | SB_CONST_ALPHA = 0x01
constant SB_PIXEL_ALPHA (line 716) | SB_PIXEL_ALPHA = 0x02
constant SB_PREMULT_ALPHA (line 717) | SB_PREMULT_ALPHA = 0x04
constant SB_GRAD_RECT (line 718) | SB_GRAD_RECT = 0x10
constant SB_GRAD_TRI (line 719) | SB_GRAD_TRI = 0x20
constant CM_NONE (line 724) | CM_NONE = 0x00
constant CM_DEVICE_ICM (line 725) | CM_DEVICE_ICM = 0x01
constant CM_GAMMA_RAMP (line 726) | CM_GAMMA_RAMP = 0x02
constant CM_CMYK_COLOR (line 727) | CM_CMYK_COLOR = 0x04
constant RC_BANDING (line 732) | RC_BANDING = 2
constant RC_BITBLT (line 733) | RC_BITBLT = 1
constant RC_BITMAP64 (line 734) | RC_BITMAP64 = 8
constant RC_DI_BITMAP (line 735) | RC_DI_BITMAP = 128
constant RC_DIBTODEV (line 736) | RC_DIBTODEV = 512
constant RC_FLOODFILL (line 737) | RC_FLOODFILL = 4096
constant RC_GDI20_OUTPUT (line 738) | RC_GDI20_OUTPUT = 16
constant RC_PALETTE (line 739) | RC_PALETTE = 256
constant RC_SCALING (line 740) | RC_SCALING = 4
constant RC_STRETCHBLT (line 741) | RC_STRETCHBLT = 2048
constant RC_STRETCHDIB (line 742) | RC_STRETCHDIB = 8192
constant RC_DEVBITS (line 743) | RC_DEVBITS = 0x8000
constant RC_OP_DX_OUTPUT (line 744) | RC_OP_DX_OUTPUT = 0x4000
constant CC_NONE (line 749) | CC_NONE = 0
constant CC_CIRCLES (line 750) | CC_CIRCLES = 1
constant CC_PIE (line 751) | CC_PIE = 2
constant CC_CHORD (line 752) | CC_CHORD = 4
constant CC_ELLIPSES (line 753) | CC_ELLIPSES = 8
constant CC_WIDE (line 754) | CC_WIDE = 16
constant CC_STYLED (line 755) | CC_STYLED = 32
constant CC_WIDESTYLED (line 756) | CC_WIDESTYLED = 64
constant CC_INTERIORS (line 757) | CC_INTERIORS = 128
constant CC_ROUNDRECT (line 758) | CC_ROUNDRECT = 256
constant LC_NONE (line 763) | LC_NONE = 0
constant LC_POLYLINE (line 764) | LC_POLYLINE = 2
constant LC_MARKER (line 765) | LC_MARKER = 4
constant LC_POLYMARKER (line 766) | LC_POLYMARKER = 8
constant LC_WIDE (line 767) | LC_WIDE = 16
constant LC_STYLED (line 768) | LC_STYLED = 32
constant LC_WIDESTYLED (line 769) | LC_WIDESTYLED = 64
constant LC_INTERIORS (line 770) | LC_INTERIORS = 128
constant PC_NONE (line 775) | PC_NONE = 0
constant PC_POLYGON (line 776) | PC_POLYGON = 1
constant PC_POLYPOLYGON (line 777) | PC_POLYPOLYGON = 256
constant PC_PATHS (line 778) | PC_PATHS = 512
constant PC_RECTANGLE (line 779) | PC_RECTANGLE = 2
constant PC_WINDPOLYGON (line 780) | PC_WINDPOLYGON = 4
constant PC_SCANLINE (line 781) | PC_SCANLINE = 8
constant PC_TRAPEZOID (line 782) | PC_TRAPEZOID = 4
constant PC_WIDE (line 783) | PC_WIDE = 16
constant PC_STYLED (line 784) | PC_STYLED = 32
constant PC_WIDESTYLED (line 785) | PC_WIDESTYLED = 64
constant PC_INTERIORS (line 786) | PC_INTERIORS = 128
constant TC_OP_CHARACTER (line 791) | TC_OP_CHARACTER = 1
constant TC_OP_STROKE (line 792) | TC_OP_STROKE = 2
constant TC_CP_STROKE (line 793) | TC_CP_STROKE = 4
constant TC_CR_90 (line 794) | TC_CR_90 = 8
constant TC_CR_ANY (line 795) | TC_CR_ANY = 16
constant TC_SF_X_YINDEP (line 796) | TC_SF_X_YINDEP = 32
constant TC_SA_DOUBLE (line 797) | TC_SA_DOUBLE = 64
constant TC_SA_INTEGER (line 798) | TC_SA_INTEGER = 128
constant TC_SA_CONTIN (line 799) | TC_SA_CONTIN = 256
constant TC_EA_DOUBLE (line 800) | TC_EA_DOUBLE = 512
constant TC_IA_ABLE (line 801) | TC_IA_ABLE = 1024
constant TC_UA_ABLE (line 802) | TC_UA_ABLE = 2048
constant TC_SO_ABLE (line 803) | TC_SO_ABLE = 4096
constant TC_RA_ABLE (line 804) | TC_RA_ABLE = 8192
constant TC_VA_ABLE (line 805) | TC_VA_ABLE = 16384
constant TC_RESERVED (line 806) | TC_RESERVED = 32768
constant TC_SCROLLBLT (line 807) | TC_SCROLLBLT = 65536
constant SS_BITMAP (line 812) | SS_BITMAP = 14
constant SS_BLACKFRAME (line 813) | SS_BLACKFRAME = 7
constant SS_BLACKRECT (line 814) | SS_BLACKRECT = 4
constant SS_CENTER (line 815) | SS_CENTER = 1
constant SS_CENTERIMAGE (line 816) | SS_CENTERIMAGE = 512
constant SS_EDITCONTROL (line 817) | SS_EDITCONTROL = 0x2000
constant SS_ENHMETAFILE (line 818) | SS_ENHMETAFILE = 15
constant SS_ETCHEDFRAME (line 819) | SS_ETCHEDFRAME = 18
constant SS_ETCHEDHORZ (line 820) | SS_ETCHEDHORZ = 16
constant SS_ETCHEDVERT (line 821) | SS_ETCHEDVERT = 17
constant SS_GRAYFRAME (line 822) | SS_GRAYFRAME = 8
constant SS_GRAYRECT (line 823) | SS_GRAYRECT = 5
constant SS_ICON (line 824) | SS_ICON = 3
constant SS_LEFT (line 825) | SS_LEFT = 0
constant SS_LEFTNOWORDWRAP (line 826) | SS_LEFTNOWORDWRAP = 0xc
constant SS_NOPREFIX (line 827) | SS_NOPREFIX = 128
constant SS_NOTIFY (line 828) | SS_NOTIFY = 256
constant SS_OWNERDRAW (line 829) | SS_OWNERDRAW = 0xd
constant SS_REALSIZECONTROL (line 830) | SS_REALSIZECONTROL = 0x040
constant SS_REALSIZEIMAGE (line 831) | SS_REALSIZEIMAGE = 0x800
constant SS_RIGHT (line 832) | SS_RIGHT = 2
constant SS_RIGHTJUST (line 833) | SS_RIGHTJUST = 0x400
constant SS_SIMPLE (line 834) | SS_SIMPLE = 11
constant SS_SUNKEN (line 835) | SS_SUNKEN = 4096
constant SS_WHITEFRAME (line 836) | SS_WHITEFRAME = 9
constant SS_WHITERECT (line 837) | SS_WHITERECT = 6
constant SS_USERITEM (line 838) | SS_USERITEM = 10
constant SS_TYPEMASK (line 839) | SS_TYPEMASK = 0x0000001F
constant SS_ENDELLIPSIS (line 840) | SS_ENDELLIPSIS = 0x00004000
constant SS_PATHELLIPSIS (line 841) | SS_PATHELLIPSIS = 0x00008000
constant SS_WORDELLIPSIS (line 842) | SS_WORDELLIPSIS = 0x0000C000
constant SS_ELLIPSISMASK (line 843) | SS_ELLIPSISMASK = 0x0000C000
constant ES_LEFT (line 848) | ES_LEFT = 0x0000
constant ES_CENTER (line 849) | ES_CENTER = 0x0001
constant ES_RIGHT (line 850) | ES_RIGHT = 0x0002
constant ES_MULTILINE (line 851) | ES_MULTILINE = 0x0004
constant ES_UPPERCASE (line 852) | ES_UPPERCASE = 0x0008
constant ES_LOWERCASE (line 853) | ES_LOWERCASE = 0x0010
constant ES_PASSWORD (line 854) | ES_PASSWORD = 0x0020
constant ES_AUTOVSCROLL (line 855) | ES_AUTOVSCROLL = 0x0040
constant ES_AUTOHSCROLL (line 856) | ES_AUTOHSCROLL = 0x0080
constant ES_NOHIDESEL (line 857) | ES_NOHIDESEL = 0x0100
constant ES_OEMCONVERT (line 858) | ES_OEMCONVERT = 0x0400
constant ES_READONLY (line 859) | ES_READONLY = 0x0800
constant ES_WANTRETURN (line 860) | ES_WANTRETURN = 0x1000
constant ES_NUMBER (line 861) | ES_NUMBER = 0x2000
constant EN_SETFOCUS (line 866) | EN_SETFOCUS = 0x0100
constant EN_KILLFOCUS (line 867) | EN_KILLFOCUS = 0x0200
constant EN_CHANGE (line 868) | EN_CHANGE = 0x0300
constant EN_UPDATE (line 869) | EN_UPDATE = 0x0400
constant EN_ERRSPACE (line 870) | EN_ERRSPACE = 0x0500
constant EN_MAXTEXT (line 871) | EN_MAXTEXT = 0x0501
constant EN_HSCROLL (line 872) | EN_HSCROLL = 0x0601
constant EN_VSCROLL (line 873) | EN_VSCROLL = 0x0602
constant EN_ALIGN_LTR_EC (line 874) | EN_ALIGN_LTR_EC = 0x0700
constant EN_ALIGN_RTL_EC (line 875) | EN_ALIGN_RTL_EC = 0x0701
constant EM_GETSEL (line 880) | EM_GETSEL = 0x00B0
constant EM_SETSEL (line 881) | EM_SETSEL = 0x00B1
constant EM_GETRECT (line 882) | EM_GETRECT = 0x00B2
constant EM_SETRECT (line 883) | EM_SETRECT = 0x00B3
constant EM_SETRECTNP (line 884) | EM_SETRECTNP = 0x00B4
constant EM_SCROLL (line 885) | EM_SCROLL = 0x00B5
constant EM_LINESCROLL (line 886) | EM_LINESCROLL = 0x00B6
constant EM_SCROLLCARET (line 887) | EM_SCROLLCARET = 0x00B7
constant EM_GETMODIFY (line 888) | EM_GETMODIFY = 0x00B8
constant EM_SETMODIFY (line 889) | EM_SETMODIFY = 0x00B9
constant EM_GETLINECOUNT (line 890) | EM_GETLINECOUNT = 0x00BA
constant EM_LINEINDEX (line 891) | EM_LINEINDEX = 0x00BB
constant EM_SETHANDLE (line 892) | EM_SETHANDLE = 0x00BC
constant EM_GETHANDLE (line 893) | EM_GETHANDLE = 0x00BD
constant EM_GETTHUMB (line 894) | EM_GETTHUMB = 0x00BE
constant EM_LINELENGTH (line 895) | EM_LINELENGTH = 0x00C1
constant EM_REPLACESEL (line 896) | EM_REPLACESEL = 0x00C2
constant EM_GETLINE (line 897) | EM_GETLINE = 0x00C4
constant EM_LIMITTEXT (line 898) | EM_LIMITTEXT = 0x00C5
constant EM_CANUNDO (line 899) | EM_CANUNDO = 0x00C6
constant EM_UNDO (line 900) | EM_UNDO = 0x00C7
constant EM_FMTLINES (line 901) | EM_FMTLINES = 0x00C8
constant EM_LINEFROMCHAR (line 902) | EM_LINEFROMCHAR = 0x00C9
constant EM_SETTABSTOPS (line 903) | EM_SETTABSTOPS = 0x00CB
constant EM_SETPASSWORDCHAR (line 904) | EM_SETPASSWORDCHAR = 0x00CC
constant EM_EMPTYUNDOBUFFER (line 905) | EM_EMPTYUNDOBUFFER = 0x00CD
constant EM_GETFIRSTVISIBLELINE (line 906) | EM_GETFIRSTVISIBLELINE = 0x00CE
constant EM_SETREADONLY (line 907) | EM_SETREADONLY = 0x00CF
constant EM_SETWORDBREAKPROC (line 908) | EM_SETWORDBREAKPROC = 0x00D0
constant EM_GETWORDBREAKPROC (line 909) | EM_GETWORDBREAKPROC = 0x00D1
constant EM_GETPASSWORDCHAR (line 910) | EM_GETPASSWORDCHAR = 0x00D2
constant EM_SETMARGINS (line 911) | EM_SETMARGINS = 0x00D3
constant EM_GETMARGINS (line 912) | EM_GETMARGINS = 0x00D4
constant EM_SETLIMITTEXT (line 913) | EM_SETLIMITTEXT = EM_LIMITTEXT
constant EM_GETLIMITTEXT (line 914) | EM_GETLIMITTEXT = 0x00D5
constant EM_POSFROMCHAR (line 915) | EM_POSFROMCHAR = 0x00D6
constant EM_CHARFROMPOS (line 916) | EM_CHARFROMPOS = 0x00D7
constant EM_SETIMESTATUS (line 917) | EM_SETIMESTATUS = 0x00D8
constant EM_GETIMESTATUS (line 918) | EM_GETIMESTATUS = 0x00D9
constant EM_SETCUEBANNER (line 919) | EM_SETCUEBANNER = 0x1501
constant EM_GETCUEBANNER (line 920) | EM_GETCUEBANNER = 0x1502
constant CCM_FIRST (line 924) | CCM_FIRST = 0x2000
constant CCM_LAST (line 925) | CCM_LAST = CCM_FIRST + 0x200
constant CCM_SETBKCOLOR (line 926) | CCM_SETBKCOLOR = 8193
constant CCM_SETCOLORSCHEME (line 927) | CCM_SETCOLORSCHEME = 8194
constant CCM_GETCOLORSCHEME (line 928) | CCM_GETCOLORSCHEME = 8195
constant CCM_GETDROPTARGET (line 929) | CCM_GETDROPTARGET = 8196
constant CCM_SETUNICODEFORMAT (line 930) | CCM_SETUNICODEFORMAT = 8197
constant CCM_GETUNICODEFORMAT (line 931) | CCM_GETUNICODEFORMAT = 8198
constant CCM_SETVERSION (line 932) | CCM_SETVERSION = 0x2007
constant CCM_GETVERSION (line 933) | CCM_GETVERSION = 0x2008
constant CCM_SETNOTIFYWINDOW (line 934) | CCM_SETNOTIFYWINDOW = 0x2009
constant CCM_SETWINDOWTHEME (line 935) | CCM_SETWINDOWTHEME = 0x200b
constant CCM_DPISCALE (line 936) | CCM_DPISCALE = 0x200c
constant CCS_TOP (line 941) | CCS_TOP = 1
constant CCS_NOMOVEY (line 942) | CCS_NOMOVEY = 2
constant CCS_BOTTOM (line 943) | CCS_BOTTOM = 3
constant CCS_NORESIZE (line 944) | CCS_NORESIZE = 4
constant CCS_NOPARENTALIGN (line 945) | CCS_NOPARENTALIGN = 8
constant CCS_ADJUSTABLE (line 946) | CCS_ADJUSTABLE = 32
constant CCS_NODIVIDER (line 947) | CCS_NODIVIDER = 64
constant CCS_VERT (line 948) | CCS_VERT = 128
constant CCS_LEFT (line 949) | CCS_LEFT = 129
constant CCS_NOMOVEX (line 950) | CCS_NOMOVEX = 130
constant CCS_RIGHT (line 951) | CCS_RIGHT = 131
constant PROGRESS_CLASS (line 956) | PROGRESS_CLASS = "msctls_progress32"
constant PBM_SETPOS (line 957) | PBM_SETPOS = WM_USER + 2
constant PBM_DELTAPOS (line 958) | PBM_DELTAPOS = WM_USER + 3
constant PBM_SETSTEP (line 959) | PBM_SETSTEP = WM_USER + 4
constant PBM_STEPIT (line 960) | PBM_STEPIT = WM_USER + 5
constant PBM_SETRANGE32 (line 961) | PBM_SETRANGE32 = 1030
constant PBM_GETRANGE (line 962) | PBM_GETRANGE = 1031
constant PBM_GETPOS (line 963) | PBM_GETPOS = 1032
constant PBM_SETBARCOLOR (line 964) | PBM_SETBARCOLOR = 1033
constant PBM_SETBKCOLOR (line 965) | PBM_SETBKCOLOR = CCM_SETBKCOLOR
constant PBS_SMOOTH (line 966) | PBS_SMOOTH = 1
constant PBS_VERTICAL (line 967) | PBS_VERTICAL = 4
constant OFN_EX_NOPLACESBAR (line 972) | OFN_EX_NOPLACESBAR = 0x00000001
constant OFN_ALLOWMULTISELECT (line 977) | OFN_ALLOWMULTISELECT = 0x00000200
constant OFN_CREATEPROMPT (line 978) | OFN_CREATEPROMPT = 0x00002000
constant OFN_DONTADDTORECENT (line 979) | OFN_DONTADDTORECENT = 0x02000000
constant OFN_ENABLEHOOK (line 980) | OFN_ENABLEHOOK = 0x00000020
constant OFN_ENABLEINCLUDENOTIFY (line 981) | OFN_ENABLEINCLUDENOTIFY = 0x00400000
constant OFN_ENABLESIZING (line 982) | OFN_ENABLESIZING = 0x00800000
constant OFN_ENABLETEMPLATE (line 983) | OFN_ENABLETEMPLATE = 0x00000040
constant OFN_ENABLETEMPLATEHANDLE (line 984) | OFN_ENABLETEMPLATEHANDLE = 0x00000080
constant OFN_EXPLORER (line 985) | OFN_EXPLORER = 0x00080000
constant OFN_EXTENSIONDIFFERENT (line 986) | OFN_EXTENSIONDIFFERENT = 0x00000400
constant OFN_FILEMUSTEXIST (line 987) | OFN_FILEMUSTEXIST = 0x00001000
constant OFN_FORCESHOWHIDDEN (line 988) | OFN_FORCESHOWHIDDEN = 0x10000000
constant OFN_HIDEREADONLY (line 989) | OFN_HIDEREADONLY = 0x00000004
constant OFN_LONGNAMES (line 990) | OFN_LONGNAMES = 0x00200000
constant OFN_NOCHANGEDIR (line 991) | OFN_NOCHANGEDIR = 0x00000008
constant OFN_NODEREFERENCELINKS (line 992) | OFN_NODEREFERENCELINKS = 0x00100000
constant OFN_NOLONGNAMES (line 993) | OFN_NOLONGNAMES = 0x00040000
constant OFN_NONETWORKBUTTON (line 994) | OFN_NONETWORKBUTTON = 0x00020000
constant OFN_NOREADONLYRETURN (line 995) | OFN_NOREADONLYRETURN = 0x00008000
constant OFN_NOTESTFILECREATE (line 996) | OFN_NOTESTFILECREATE = 0x00010000
constant OFN_NOVALIDATE (line 997) | OFN_NOVALIDATE = 0x00000100
constant OFN_OVERWRITEPROMPT (line 998) | OFN_OVERWRITEPROMPT = 0x00000002
constant OFN_PATHMUSTEXIST (line 999) | OFN_PATHMUSTEXIST = 0x00000800
constant OFN_READONLY (line 1000) | OFN_READONLY = 0x00000001
constant OFN_SHAREAWARE (line 1001) | OFN_SHAREAWARE = 0x00004000
constant OFN_SHOWHELP (line 1002) | OFN_SHOWHELP = 0x00000010
constant BIF_RETURNONLYFSDIRS (line 1007) | BIF_RETURNONLYFSDIRS = 0x00000001
constant BIF_DONTGOBELOWDOMAIN (line 1008) | BIF_DONTGOBELOWDOMAIN = 0x00000002
constant BIF_STATUSTEXT (line 1009) | BIF_STATUSTEXT = 0x00000004
constant BIF_RETURNFSANCESTORS (line 1010) | BIF_RETURNFSANCESTORS = 0x00000008
constant BIF_EDITBOX (line 1011) | BIF_EDITBOX = 0x00000010
constant BIF_VALIDATE (line 1012) | BIF_VALIDATE = 0x00000020
constant BIF_NEWDIALOGSTYLE (line 1013) | BIF_NEWDIALOGSTYLE = 0x00000040
constant BIF_BROWSEINCLUDEURLS (line 1014) | BIF_BROWSEINCLUDEURLS = 0x00000080
constant BIF_USENEWUI (line 1015) | BIF_USENEWUI = BIF_EDITBOX | BIF_NEWDIALOGSTYLE
constant BIF_UAHINT (line 1016) | BIF_UAHINT = 0x00000100
constant BIF_NONEWFOLDERBUTTON (line 1017) | BIF_NONEWFOLDERBUTTON = 0x00000200
constant BIF_NOTRANSLATETARGETS (line 1018) | BIF_NOTRANSLATETARGETS = 0x00000400
constant BIF_BROWSEFORCOMPUTER (line 1019) | BIF_BROWSEFORCOMPUTER = 0x00001000
constant BIF_BROWSEFORPRINTER (line 1020) | BIF_BROWSEFORPRINTER = 0x00002000
constant BIF_BROWSEINCLUDEFILES (line 1021) | BIF_BROWSEINCLUDEFILES = 0x00004000
constant BIF_SHAREABLE (line 1022) | BIF_SHAREABLE = 0x00008000
constant BIF_BROWSEFILEJUNCTIONS (line 1023) | BIF_BROWSEFILEJUNCTIONS = 0x00010000
constant MB_OK (line 1028) | MB_OK = 0x00000000
constant MB_OKCANCEL (line 1029) | MB_OKCANCEL = 0x00000001
constant MB_ABORTRETRYIGNORE (line 1030) | MB_ABORTRETRYIGNORE = 0x00000002
constant MB_YESNOCANCEL (line 1031) | MB_YESNOCANCEL = 0x00000003
constant MB_YESNO (line 1032) | MB_YESNO = 0x00000004
constant MB_RETRYCANCEL (line 1033) | MB_RETRYCANCEL = 0x00000005
constant MB_CANCELTRYCONTINUE (line 1034) | MB_CANCELTRYCONTINUE = 0x00000006
constant MB_ICONHAND (line 1035) | MB_ICONHAND = 0x00000010
constant MB_ICONQUESTION (line 1036) | MB_ICONQUESTION = 0x00000020
constant MB_ICONEXCLAMATION (line 1037) | MB_ICONEXCLAMATION = 0x00000030
constant MB_ICONASTERISK (line 1038) | MB_ICONASTERISK = 0x00000040
constant MB_USERICON (line 1039) | MB_USERICON = 0x00000080
constant MB_ICONWARNING (line 1040) | MB_ICONWARNING = MB_ICONEXCLAMATION
constant MB_ICONERROR (line 1041) | MB_ICONERROR = MB_ICONHAND
constant MB_ICONINFORMATION (line 1042) | MB_ICONINFORMATION = MB_ICONASTERISK
constant MB_ICONSTOP (line 1043) | MB_ICONSTOP = MB_ICONHAND
constant MB_DEFBUTTON1 (line 1044) | MB_DEFBUTTON1 = 0x00000000
constant MB_DEFBUTTON2 (line 1045) | MB_DEFBUTTON2 = 0x00000100
constant MB_DEFBUTTON3 (line 1046) | MB_DEFBUTTON3 = 0x00000200
constant MB_DEFBUTTON4 (line 1047) | MB_DEFBUTTON4 = 0x00000300
constant E_INVALIDARG (line 1052) | E_INVALIDARG = 0x80070057
constant E_OUTOFMEMORY (line 1053) | E_OUTOFMEMORY = 0x8007000E
constant E_UNEXPECTED (line 1054) | E_UNEXPECTED = 0x8000FFFF
constant S_OK (line 1058) | S_OK = 0
constant S_FALSE (line 1059) | S_FALSE = 0x0001
constant RPC_E_CHANGED_MODE (line 1060) | RPC_E_CHANGED_MODE = 0x80010106
constant SM_CXSCREEN (line 1065) | SM_CXSCREEN = 0
constant SM_CYSCREEN (line 1066) | SM_CYSCREEN = 1
constant SM_CXVSCROLL (line 1067) | SM_CXVSCROLL = 2
constant SM_CYHSCROLL (line 1068) | SM_CYHSCROLL = 3
constant SM_CYCAPTION (line 1069) | SM_CYCAPTION = 4
constant SM_CXBORDER (line 1070) | SM_CXBORDER = 5
constant SM_CYBORDER (line 1071) | SM_CYBORDER = 6
constant SM_CXDLGFRAME (line 1072) | SM_CXDLGFRAME = 7
constant SM_CYDLGFRAME (line 1073) | SM_CYDLGFRAME = 8
constant SM_CYVTHUMB (line 1074) | SM_CYVTHUMB = 9
constant SM_CXHTHUMB (line 1075) | SM_CXHTHUMB = 10
constant SM_CXICON (line 1076) | SM_CXICON = 11
constant SM_CYICON (line 1077) | SM_CYICON = 12
constant SM_CXCURSOR (line 1078) | SM_CXCURSOR = 13
constant SM_CYCURSOR (line 1079) | SM_CYCURSOR = 14
constant SM_CYMENU (line 1080) | SM_CYMENU = 15
constant SM_CXFULLSCREEN (line 1081) | SM_CXFULLSCREEN = 16
constant SM_CYFULLSCREEN (line 1082) | SM_CYFULLSCREEN = 17
constant SM_CYKANJIWINDOW (line 1083) | SM_CYKANJIWINDOW = 18
constant SM_MOUSEPRESENT (line 1084) | SM_MOUSEPRESENT = 19
constant SM_CYVSCROLL (line 1085) | SM_CYVSCROLL = 20
constant SM_CXHSCROLL (line 1086) | SM_CXHSCROLL = 21
constant SM_DEBUG (line 1087) | SM_DEBUG = 22
constant SM_SWAPBUTTON (line 1088) | SM_SWAPBUTTON = 23
constant SM_RESERVED1 (line 1089) | SM_RESERVED1 = 24
constant SM_RESERVED2 (line 1090) | SM_RESERVED2 = 25
constant SM_RESERVED3 (line 1091) | SM_RESERVED3 = 26
constant SM_RESERVED4 (line 1092) | SM_RESERVED4 = 27
constant SM_CXMIN (line 1093) | SM_CXMIN = 28
constant SM_CYMIN (line 1094) | SM_CYMIN = 29
constant SM_CXSIZE (line 1095) | SM_CXSIZE = 30
constant SM_CYSIZE (line 1096) | SM_CYSIZE = 31
constant SM_CXFRAME (line 1097) | SM_CXFRAME = 32
constant SM_CYFRAME (line 1098) | SM_CYFRAME = 33
constant SM_CXMINTRACK (line 1099) | SM_CXMINTRACK = 34
constant SM_CYMINTRACK (line 1100) | SM_CYMINTRACK = 35
constant SM_CXDOUBLECLK (line 1101) | SM_CXDOUBLECLK = 36
constant SM_CYDOUBLECLK (line 1102) | SM_CYDOUBLECLK = 37
constant SM_CXICONSPACING (line 1103) | SM_CXICONSPACING = 38
constant SM_CYICONSPACING (line 1104) | SM_CYICONSPACING = 39
constant SM_MENUDROPALIGNMENT (line 1105) | SM_MENUDROPALIGNMENT = 40
constant SM_PENWINDOWS (line 1106) | SM_PENWINDOWS = 41
constant SM_DBCSENABLED (line 1107) | SM_DBCSENABLED = 42
constant SM_CMOUSEBUTTONS (line 1108) | SM_CMOUSEBUTTONS = 43
constant SM_CXFIXEDFRAME (line 1109) | SM_CXFIXEDFRAME = SM_CXDLGFRAME
constant SM_CYFIXEDFRAME (line 1110) | SM_CYFIXEDFRAME = SM_CYDLGFRAME
constant SM_CXSIZEFRAME (line 1111) | SM_CXSIZEFRAME = SM_CXFRAME
constant SM_CYSIZEFRAME (line 1112) | SM_CYSIZEFRAME = SM_CYFRAME
constant SM_SECURE (line 1113) | SM_SECURE = 44
constant SM_CXEDGE (line 1114) | SM_CXEDGE = 45
constant SM_CYEDGE (line 1115) | SM_CYEDGE = 46
constant SM_CXMINSPACING (line 1116) | SM_CXMINSPACING = 47
constant SM_CYMINSPACING (line 1117) | SM_CYMINSPACING = 48
constant SM_CXSMICON (line 1118) | SM_CXSMICON = 49
constant SM_CYSMICON (line 1119) | SM_CYSMICON = 50
constant SM_CYSMCAPTION (line 1120) | SM_CYSMCAPTION = 51
constant SM_CXSMSIZE (line 1121) | SM_CXSMSIZE = 52
constant SM_CYSMSIZE (line 1122) | SM_CYSMSIZE = 53
constant SM_CXMENUSIZE (line 1123) | SM_CXMENUSIZE = 54
constant SM_CYMENUSIZE (line 1124) | SM_CYMENUSIZE = 55
constant SM_ARRANGE (line 1125) | SM_ARRANGE = 56
constant SM_CXMINIMIZED (line 1126) | SM_CXMINIMIZED = 57
constant SM_CYMINIMIZED (line 1127) | SM_CYMINIMIZED = 58
constant SM_CXMAXTRACK (line 1128) | SM_CXMAXTRACK = 59
constant SM_CYMAXTRACK (line 1129) | SM_CYMAXTRACK = 60
constant SM_CXMAXIMIZED (line 1130) | SM_CXMAXIMIZED = 61
constant SM_CYMAXIMIZED (line 1131) | SM_CYMAXIMIZED = 62
constant SM_NETWORK (line 1132) | SM_NETWORK = 63
constant SM_CLEANBOOT (line 1133) | SM_CLEANBOOT = 67
constant SM_CXDRAG (line 1134) | SM_CXDRAG = 68
constant SM_CYDRAG (line 1135) | SM_CYDRAG = 69
constant SM_SHOWSOUNDS (line 1136) | SM_SHOWSOUNDS = 70
constant SM_CXMENUCHECK (line 1137) | SM_CXMENUCHECK = 71
constant SM_CYMENUCHECK (line 1138) | SM_CYMENUCHECK = 72
constant SM_SLOWMACHINE (line 1139) | SM_SLOWMACHINE = 73
constant SM_MIDEASTENABLED (line 1140) | SM_MIDEASTENABLED = 74
constant SM_MOUSEWHEELPRESENT (line 1141) | SM_MOUSEWHEELPRESENT = 75
constant SM_XVIRTUALSCREEN (line 1142) | SM_XVIRTUALSCREEN = 76
constant SM_YVIRTUALSCREEN (line 1143) | SM_YVIRTUALSCREEN = 77
constant SM_CXVIRTUALSCREEN (line 1144) | SM_CXVIRTUALSCREEN = 78
constant SM_CYVIRTUALSCREEN (line 1145) | SM_CYVIRTUALSCREEN = 79
constant SM_CMONITORS (line 1146) | SM_CMONITORS = 80
constant SM_SAMEDISPLAYFORMAT (line 1147) | SM_SAMEDISPLAYFORMAT = 81
constant SM_IMMENABLED (line 1148) | SM_IMMENABLED = 82
constant SM_CXFOCUSBORDER (line 1149) | SM_CXFOCUSBORDER = 83
constant SM_CYFOCUSBORDER (line 1150) | SM_CYFOCUSBORDER = 84
constant SM_TABLETPC (line 1151) | SM_TABLETPC = 86
constant SM_MEDIACENTER (line 1152) | SM_MEDIACENTER = 87
constant SM_STARTER (line 1153) | SM_STARTER = 88
constant SM_SERVERR2 (line 1154) | SM_SERVERR2 = 89
constant SM_CMETRICS (line 1155) | SM_CMETRICS = 91
constant SM_REMOTESESSION (line 1156) | SM_REMOTESESSION = 0x1000
constant SM_SHUTTINGDOWN (line 1157) | SM_SHUTTINGDOWN = 0x2000
constant SM_REMOTECONTROL (line 1158) | SM_REMOTECONTROL = 0x2001
constant SM_CARETBLINKINGENABLED (line 1159) | SM_CARETBLINKINGENABLED = 0x2002
constant CLSCTX_INPROC_SERVER (line 1163) | CLSCTX_INPROC_SERVER = 1
constant CLSCTX_INPROC_HANDLER (line 1164) | CLSCTX_INPROC_HANDLER = 2
constant CLSCTX_LOCAL_SERVER (line 1165) | CLSCTX_LOCAL_SERVER = 4
constant CLSCTX_INPROC_SERVER16 (line 1166) | CLSCTX_INPROC_SERVER16 = 8
constant CLSCTX_REMOTE_SERVER (line 1167) | CLSCTX_REMOTE_SERVER = 16
constant CLSCTX_ALL (line 1168) | CLSCTX_ALL = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | ...
constant CLSCTX_INPROC (line 1169) | CLSCTX_INPROC = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER
constant CLSCTX_SERVER (line 1170) | CLSCTX_SERVER = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CL...
constant COINIT_APARTMENTTHREADED (line 1174) | COINIT_APARTMENTTHREADED = 0x2
constant COINIT_MULTITHREADED (line 1175) | COINIT_MULTITHREADED = 0x0
constant COINIT_DISABLE_OLE1DDE (line 1176) | COINIT_DISABLE_OLE1DDE = 0x4
constant COINIT_SPEED_OVER_MEMORY (line 1177) | COINIT_SPEED_OVER_MEMORY = 0x8
constant DISPATCH_METHOD (line 1181) | DISPATCH_METHOD = 1
constant DISPATCH_PROPERTYGET (line 1182) | DISPATCH_PROPERTYGET = 2
constant DISPATCH_PROPERTYPUT (line 1183) | DISPATCH_PROPERTYPUT = 4
constant DISPATCH_PROPERTYPUTREF (line 1184) | DISPATCH_PROPERTYPUTREF = 8
constant CC_FASTCALL (line 1188) | CC_FASTCALL = iota
constant CC_CDECL (line 1189) | CC_CDECL
constant CC_MSCPASCAL (line 1190) | CC_MSCPASCAL
constant CC_PASCAL (line 1191) | CC_PASCAL = CC_MSCPASCAL
constant CC_MACPASCAL (line 1192) | CC_MACPASCAL
constant CC_STDCALL (line 1193) | CC_STDCALL
constant CC_FPFASTCALL (line 1194) | CC_FPFASTCALL
constant CC_SYSCALL (line 1195) | CC_SYSCALL
constant CC_MPWCDECL (line 1196) | CC_MPWCDECL
constant CC_MPWPASCAL (line 1197) | CC_MPWPASCAL
constant CC_MAX (line 1198) | CC_MAX = CC_MPWPASCAL
constant VT_EMPTY (line 1202) | VT_EMPTY = 0x0
constant VT_NULL (line 1203) | VT_NULL = 0x1
constant VT_I2 (line 1204) | VT_I2 = 0x2
constant VT_I4 (line 1205) | VT_I4 = 0x3
constant VT_R4 (line 1206) | VT_R4 = 0x4
constant VT_R8 (line 1207) | VT_R8 = 0x5
constant VT_CY (line 1208) | VT_CY = 0x6
constant VT_DATE (line 1209) | VT_DATE = 0x7
constant VT_BSTR (line 1210) | VT_BSTR = 0x8
constant VT_DISPATCH (line 1211) | VT_DISPATCH = 0x9
constant VT_ERROR (line 1212) | VT_ERROR = 0xa
constant VT_BOOL (line 1213) | VT_BOOL = 0xb
constant VT_VARIANT (line 1214) | VT_VARIANT = 0xc
constant VT_UNKNOWN (line 1215) | VT_UNKNOWN = 0xd
constant VT_DECIMAL (line 1216) | VT_DECIMAL = 0xe
constant VT_I1 (line 1217) | VT_I1 = 0x10
constant VT_UI1 (line 1218) | VT_UI1 = 0x11
constant VT_UI2 (line 1219) | VT_UI2 = 0x12
constant VT_UI4 (line 1220) | VT_UI4 = 0x13
constant VT_I8 (line 1221) | VT_I8 = 0x14
constant VT_UI8 (line 1222) | VT_UI8 = 0x15
constant VT_INT (line 1223) | VT_INT = 0x16
constant VT_UINT (line 1224) | VT_UINT = 0x17
constant VT_VOID (line 1225) | VT_VOID = 0x18
constant VT_HRESULT (line 1226) | VT_HRESULT = 0x19
constant VT_PTR (line 1227) | VT_PTR = 0x1a
constant VT_SAFEARRAY (line 1228) | VT_SAFEARRAY = 0x1b
constant VT_CARRAY (line 1229) | VT_CARRAY = 0x1c
constant VT_USERDEFINED (line 1230) | VT_USERDEFINED = 0x1d
constant VT_LPSTR (line 1231) | VT_LPSTR = 0x1e
constant VT_LPWSTR (line 1232) | VT_LPWSTR = 0x1f
constant VT_RECORD (line 1233) | VT_RECORD = 0x24
constant VT_INT_PTR (line 1234) | VT_INT_PTR = 0x25
constant VT_UINT_PTR (line 1235) | VT_UINT_PTR = 0x26
constant VT_FILETIME (line 1236) | VT_FILETIME = 0x40
constant VT_BLOB (line 1237) | VT_BLOB = 0x41
constant VT_STREAM (line 1238) | VT_STREAM = 0x42
constant VT_STORAGE (line 1239) | VT_STORAGE = 0x43
constant VT_STREAMED_OBJECT (line 1240) | VT_STREAMED_OBJECT = 0x44
constant VT_STORED_OBJECT (line 1241) | VT_STORED_OBJECT = 0x45
constant VT_BLOB_OBJECT (line 1242) | VT_BLOB_OBJECT = 0x46
constant VT_CF (line 1243) | VT_CF = 0x47
constant VT_CLSID (line 1244) | VT_CLSID = 0x48
constant VT_BSTR_BLOB (line 1245) | VT_BSTR_BLOB = 0xfff
constant VT_VECTOR (line 1246) | VT_VECTOR = 0x1000
constant VT_ARRAY (line 1247) | VT_ARRAY = 0x2000
constant VT_BYREF (line 1248) | VT_BYREF = 0x4000
constant VT_RESERVED (line 1249) | VT_RESERVED = 0x8000
constant VT_ILLEGAL (line 1250) | VT_ILLEGAL = 0xffff
constant VT_ILLEGALMASKED (line 1251) | VT_ILLEGALMASKED = 0xfff
constant VT_TYPEMASK (line 1252) | VT_TYPEMASK = 0xfff
constant DISPID_UNKNOWN (line 1256) | DISPID_UNKNOWN = -1
constant DISPID_VALUE (line 1257) | DISPID_VALUE = 0
constant DISPID_PROPERTYPUT (line 1258) | DISPID_PROPERTYPUT = -3
constant DISPID_NEWENUM (line 1259) | DISPID_NEWENUM = -4
constant DISPID_EVALUATE (line 1260) | DISPID_EVALUATE = -5
constant DISPID_CONSTRUCTOR (line 1261) | DISPID_CONSTRUCTOR = -6
constant DISPID_DESTRUCTOR (line 1262) | DISPID_DESTRUCTOR = -7
constant DISPID_COLLECT (line 1263) | DISPID_COLLECT = -8
constant MONITOR_DEFAULTTONULL (line 1267) | MONITOR_DEFAULTTONULL = 0x00000000
constant MONITOR_DEFAULTTOPRIMARY (line 1268) | MONITOR_DEFAULTTOPRIMARY = 0x00000001
constant MONITOR_DEFAULTTONEAREST (line 1269) | MONITOR_DEFAULTTONEAREST = 0x00000002
constant MONITORINFOF_PRIMARY (line 1271) | MONITORINFOF_PRIMARY = 0x00000001
constant CCHDEVICENAME (line 1275) | CCHDEVICENAME = 32
constant CCHFORMNAME (line 1276) | CCHFORMNAME = 32
constant IDOK (line 1280) | IDOK = 1
constant IDCANCEL (line 1281) | IDCANCEL = 2
constant IDABORT (line 1282) | IDABORT = 3
constant IDRETRY (line 1283) | IDRETRY = 4
constant IDIGNORE (line 1284) | IDIGNORE = 5
constant IDYES (line 1285) | IDYES = 6
constant IDNO (line 1286) | IDNO = 7
constant IDCLOSE (line 1287) | IDCLOSE = 8
constant IDHELP (line 1288) | IDHELP = 9
constant IDTRYAGAIN (line 1289) | IDTRYAGAIN = 10
constant IDCONTINUE (line 1290) | IDCONTINUE = 11
constant IDTIMEOUT (line 1291) | IDTIMEOUT = 32000
constant NM_FIRST (line 1296) | NM_FIRST = 0
constant NM_OUTOFMEMORY (line 1297) | NM_OUTOFMEMORY = NM_FIRST - 1
constant NM_CLICK (line 1298) | NM_CLICK = NM_FIRST - 2
constant NM_DBLCLK (line 1299) | NM_DBLCLK = NM_FIRST - 3
constant NM_RETURN (line 1300) | NM_RETURN = NM_FIRST - 4
constant NM_RCLICK (line 1301) | NM_RCLICK = NM_FIRST - 5
constant NM_RDBLCLK (line 1302) | NM_RDBLCLK = NM_FIRST - 6
constant NM_SETFOCUS (line 1303) | NM_SETFOCUS = NM_FIRST - 7
constant NM_KILLFOCUS (line 1304) | NM_KILLFOCUS = NM_FIRST - 8
constant NM_CUSTOMDRAW (line 1305) | NM_CUSTOMDRAW = NM_FIRST - 12
constant NM_HOVER (line 1306) | NM_HOVER = NM_FIRST - 13
constant NM_NCHITTEST (line 1307) | NM_NCHITTEST = NM_FIRST - 14
constant NM_KEYDOWN (line 1308) | NM_KEYDOWN = NM_FIRST - 15
constant NM_RELEASEDCAPTURE (line 1309) | NM_RELEASEDCAPTURE = NM_FIRST - 16
constant NM_SETCURSOR (line 1310) | NM_SETCURSOR = NM_FIRST - 17
constant NM_CHAR (line 1311) | NM_CHAR = NM_FIRST - 18
constant NM_TOOLTIPSCREATED (line 1312) | NM_TOOLTIPSCREATED = NM_FIRST - 19
constant NM_LAST (line 1313) | NM_LAST = NM_FIRST - 99
constant LVM_FIRST (line 1318) | LVM_FIRST = 0x1000
constant LVM_GETITEMCOUNT (line 1319) | LVM_GETITEMCOUNT = LVM_FIRST + 4
constant LVM_SETIMAGELIST (line 1320) | LVM_SETIMAGELIST = LVM_FIRST + 3
constant LVM_GETIMAGELIST (line 1321) | LVM_GETIMAGELIST = LVM_FIRST + 2
constant LVM_GETITEM (line 1322) | LVM_GETITEM = LVM_FIRST + 75
constant LVM_SETITEM (line 1323) | LVM_SETITEM = LVM_FIRST + 76
constant LVM_INSERTITEM (line 1324) | LVM_INSERTITEM = LVM_FIRST + 77
constant LVM_DELETEITEM (line 1325) | LVM_DELETEITEM = LVM_FIRST + 8
constant LVM_DELETEALLITEMS (line 1326) | LVM_DELETEALLITEMS = LVM_FIRST + 9
constant LVM_GETCALLBACKMASK (line 1327) | LVM_GETCALLBACKMASK = LVM_FIRST + 10
constant LVM_SETCALLBACKMASK (line 1328) | LVM_SETCALLBACKMASK = LVM_FIRST + 11
constant LVM_SETUNICODEFORMAT (line 1329) | LVM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
constant LVM_GETNEXTITEM (line 1330) | LVM_GETNEXTITEM = LVM_FIRST + 12
constant LVM_FINDITEM (line 1331) | LVM_FINDITEM = LVM_FIRST + 83
constant LVM_GETITEMRECT (line 1332) | LVM_GETITEMRECT = LVM_FIRST + 14
constant LVM_GETSTRINGWIDTH (line 1333) | LVM_GETSTRINGWIDTH = LVM_FIRST + 87
constant LVM_HITTEST (line 1334) | LVM_HITTEST = LVM_FIRST + 18
constant LVM_ENSUREVISIBLE (line 1335) | LVM_ENSUREVISIBLE = LVM_FIRST + 19
constant LVM_SCROLL (line 1336) | LVM_SCROLL = LVM_FIRST + 20
constant LVM_REDRAWITEMS (line 1337) | LVM_REDRAWITEMS = LVM_FIRST + 21
constant LVM_ARRANGE (line 1338) | LVM_ARRANGE = LVM_FIRST + 22
constant LVM_EDITLABEL (line 1339) | LVM_EDITLABEL = LVM_FIRST + 118
constant LVM_GETEDITCONTROL (line 1340) | LVM_GETEDITCONTROL = LVM_FIRST + 24
constant LVM_GETCOLUMN (line 1341) | LVM_GETCOLUMN = LVM_FIRST + 95
constant LVM_SETCOLUMN (line 1342) | LVM_SETCOLUMN = LVM_FIRST + 96
constant LVM_INSERTCOLUMN (line 1343) | LVM_INSERTCOLUMN = LVM_FIRST + 97
constant LVM_DELETECOLUMN (line 1344) | LVM_DELETECOLUMN = LVM_FIRST + 28
constant LVM_GETCOLUMNWIDTH (line 1345) | LVM_GETCOLUMNWIDTH = LVM_FIRST + 29
constant LVM_SETCOLUMNWIDTH (line 1346) | LVM_SETCOLUMNWIDTH = LVM_FIRST + 30
constant LVM_GETHEADER (line 1347) | LVM_GETHEADER = LVM_FIRST + 31
constant LVM_CREATEDRAGIMAGE (line 1348) | LVM_CREATEDRAGIMAGE = LVM_FIRST + 33
constant LVM_GETVIEWRECT (line 1349) | LVM_GETVIEWRECT = LVM_FIRST + 34
constant LVM_GETTEXTCOLOR (line 1350) | LVM_GETTEXTCOLOR = LVM_FIRST + 35
constant LVM_SETTEXTCOLOR (line 1351) | LVM_SETTEXTCOLOR = LVM_FIRST + 36
constant LVM_GETTEXTBKCOLOR (line 1352) | LVM_GETTEXTBKCOLOR = LVM_FIRST + 37
constant LVM_SETTEXTBKCOLOR (line 1353) | LVM_SETTEXTBKCOLOR = LVM_FIRST + 38
constant LVM_GETTOPINDEX (line 1354) | LVM_GETTOPINDEX = LVM_FIRST + 39
constant LVM_GETCOUNTPERPAGE (line 1355) | LVM_GETCOUNTPERPAGE = LVM_FIRST + 40
constant LVM_GETORIGIN (line 1356) | LVM_GETORIGIN = LVM_FIRST + 41
constant LVM_UPDATE (line 1357) | LVM_UPDATE = LVM_FIRST + 42
constant LVM_SETITEMSTATE (line 1358) | LVM_SETITEMSTATE = LVM_FIRST + 43
constant LVM_GETITEMSTATE (line 1359) | LVM_GETITEMSTATE = LVM_FIRST + 44
constant LVM_GETITEMTEXT (line 1360) | LVM_GETITEMTEXT = LVM_FIRST + 115
constant LVM_SETITEMTEXT (line 1361) | LVM_SETITEMTEXT = LVM_FIRST + 116
constant LVM_SETITEMCOUNT (line 1362) | LVM_SETITEMCOUNT = LVM_FIRST + 47
constant LVM_SORTITEMS (line 1363) | LVM_SORTITEMS = LVM_FIRST + 48
constant LVM_SETITEMPOSITION32 (line 1364) | LVM_SETITEMPOSITION32 = LVM_FIRST + 49
constant LVM_GETSELECTEDCOUNT (line 1365) | LVM_GETSELECTEDCOUNT = LVM_FIRST + 50
constant LVM_GETITEMSPACING (line 1366) | LVM_GETITEMSPACING = LVM_FIRST + 51
constant LVM_GETISEARCHSTRING (line 1367) | LVM_GETISEARCHSTRING = LVM_FIRST + 117
constant LVM_SETICONSPACING (line 1368) | LVM_SETICONSPACING = LVM_FIRST + 53
constant LVM_SETEXTENDEDLISTVIEWSTYLE (line 1369) | LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54
constant LVM_GETEXTENDEDLISTVIEWSTYLE (line 1370) | LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
constant LVM_GETSUBITEMRECT (line 1371) | LVM_GETSUBITEMRECT = LVM_FIRST + 56
constant LVM_SUBITEMHITTEST (line 1372) | LVM_SUBITEMHITTEST = LVM_FIRST + 57
constant LVM_SETCOLUMNORDERARRAY (line 1373) | LVM_SETCOLUMNORDERARRAY = LVM_FIRST + 58
constant LVM_GETCOLUMNORDERARRAY (line 1374) | LVM_GETCOLUMNORDERARRAY = LVM_FIRST + 59
constant LVM_SETHOTITEM (line 1375) | LVM_SETHOTITEM = LVM_FIRST + 60
constant LVM_GETHOTITEM (line 1376) | LVM_GETHOTITEM = LVM_FIRST + 61
constant LVM_SETHOTCURSOR (line 1377) | LVM_SETHOTCURSOR = LVM_FIRST + 62
constant LVM_GETHOTCURSOR (line 1378) | LVM_GETHOTCURSOR = LVM_FIRST + 63
constant LVM_APPROXIMATEVIEWRECT (line 1379) | LVM_APPROXIMATEVIEWRECT = LVM_FIRST + 64
constant LVM_SETWORKAREAS (line 1380) | LVM_SETWORKAREAS = LVM_FIRST + 65
constant LVM_GETWORKAREAS (line 1381) | LVM_GETWORKAREAS = LVM_FIRST + 70
constant LVM_GETNUMBEROFWORKAREAS (line 1382) | LVM_GETNUMBEROFWORKAREAS = LVM_FIRST + 73
constant LVM_GETSELECTIONMARK (line 1383) | LVM_GETSELECTIONMARK = LVM_FIRST + 66
constant LVM_SETSELECTIONMARK (line 1384) | LVM_SETSELECTIONMARK = LVM_FIRST + 67
constant LVM_SETHOVERTIME (line 1385) | LVM_SETHOVERTIME = LVM_FIRST + 71
constant LVM_GETHOVERTIME (line 1386) | LVM_GETHOVERTIME = LVM_FIRST + 72
constant LVM_SETTOOLTIPS (line 1387) | LVM_SETTOOLTIPS = LVM_FIRST + 74
constant LVM_GETTOOLTIPS (line 1388) | LVM_GETTOOLTIPS = LVM_FIRST + 78
constant LVM_SORTITEMSEX (line 1389) | LVM_SORTITEMSEX = LVM_FIRST + 81
constant LVM_SETBKIMAGE (line 1390) | LVM_SETBKIMAGE = LVM_FIRST + 138
constant LVM_GETBKIMAGE (line 1391) | LVM_GETBKIMAGE = LVM_FIRST + 139
constant LVM_SETSELECTEDCOLUMN (line 1392) | LVM_SETSELECTEDCOLUMN = LVM_FIRST + 140
constant LVM_SETVIEW (line 1393) | LVM_SETVIEW = LVM_FIRST + 142
constant LVM_GETVIEW (line 1394) | LVM_GETVIEW = LVM_FIRST + 143
constant LVM_INSERTGROUP (line 1395) | LVM_INSERTGROUP = LVM_FIRST + 145
constant LVM_SETGROUPINFO (line 1396) | LVM_SETGROUPINFO = LVM_FIRST + 147
constant LVM_GETGROUPINFO (line 1397) | LVM_GETGROUPINFO = LVM_FIRST + 149
constant LVM_REMOVEGROUP (line 1398) | LVM_REMOVEGROUP = LVM_FIRST + 150
constant LVM_MOVEGROUP (line 1399) | LVM_MOVEGROUP = LVM_FIRST + 151
constant LVM_GETGROUPCOUNT (line 1400) | LVM_GETGROUPCOUNT = LVM_FIRST + 152
constant LVM_GETGROUPINFOBYINDEX (line 1401) | LVM_GETGROUPINFOBYINDEX = LVM_FIRST + 153
constant LVM_MOVEITEMTOGROUP (line 1402) | LVM_MOVEITEMTOGROUP = LVM_FIRST + 154
constant LVM_GETGROUPRECT (line 1403) | LVM_GETGROUPRECT = LVM_FIRST + 98
constant LVM_SETGROUPMETRICS (line 1404) | LVM_SETGROUPMETRICS = LVM_FIRST + 155
constant LVM_GETGROUPMETRICS (line 1405) | LVM_GETGROUPMETRICS = LVM_FIRST + 156
constant LVM_ENABLEGROUPVIEW (line 1406) | LVM_ENABLEGROUPVIEW = LVM_FIRST + 157
constant LVM_SORTGROUPS (line 1407) | LVM_SORTGROUPS = LVM_FIRST + 158
constant LVM_INSERTGROUPSORTED (line 1408) | LVM_INSERTGROUPSORTED = LVM_FIRST + 159
constant LVM_REMOVEALLGROUPS (line 1409) | LVM_REMOVEALLGROUPS = LVM_FIRST + 160
constant LVM_HASGROUP (line 1410) | LVM_HASGROUP = LVM_FIRST + 161
constant LVM_GETGROUPSTATE (line 1411) | LVM_GETGROUPSTATE = LVM_FIRST + 92
constant LVM_GETFOCUSEDGROUP (line 1412) | LVM_GETFOCUSEDGROUP = LVM_FIRST + 93
constant LVM_SETTILEVIEWINFO (line 1413) | LVM_SETTILEVIEWINFO = LVM_FIRST + 162
constant LVM_GETTILEVIEWINFO (line 1414) | LVM_GETTILEVIEWINFO = LVM_FIRST + 163
constant LVM_SETTILEINFO (line 1415) | LVM_SETTILEINFO = LVM_FIRST + 164
constant LVM_GETTILEINFO (line 1416) | LVM_GETTILEINFO = LVM_FIRST + 165
constant LVM_SETINSERTMARK (line 1417) | LVM_SETINSERTMARK = LVM_FIRST + 166
constant LVM_GETINSERTMARK (line 1418) | LVM_GETINSERTMARK = LVM_FIRST + 167
constant LVM_INSERTMARKHITTEST (line 1419) | LVM_INSERTMARKHITTEST = LVM_FIRST + 168
constant LVM_GETINSERTMARKRECT (line 1420) | LVM_GETINSERTMARKRECT = LVM_FIRST + 169
constant LVM_SETINSERTMARKCOLOR (line 1421) | LVM_SETINSERTMARKCOLOR = LVM_FIRST + 170
constant LVM_GETINSERTMARKCOLOR (line 1422) | LVM_GETINSERTMARKCOLOR = LVM_FIRST + 171
constant LVM_SETINFOTIP (line 1423) | LVM_SETINFOTIP = LVM_FIRST + 173
constant LVM_GETSELECTEDCOLUMN (line 1424) | LVM_GETSELECTEDCOLUMN = LVM_FIRST + 174
constant LVM_ISGROUPVIEWENABLED (line 1425) | LVM_ISGROUPVIEWENABLED = LVM_FIRST + 175
constant LVM_GETOUTLINECOLOR (line 1426) | LVM_GETOUTLINECOLOR = LVM_FIRST + 176
constant LVM_SETOUTLINECOLOR (line 1427) | LVM_SETOUTLINECOLOR = LVM_FIRST + 177
constant LVM_CANCELEDITLABEL (line 1428) | LVM_CANCELEDITLABEL = LVM_FIRST + 179
constant LVM_MAPINDEXTOID (line 1429) | LVM_MAPINDEXTOID = LVM_FIRST + 180
constant LVM_MAPIDTOINDEX (line 1430) | LVM_MAPIDTOINDEX = LVM_FIRST + 181
constant LVM_ISITEMVISIBLE (line 1431) | LVM_ISITEMVISIBLE = LVM_FIRST + 182
constant LVM_GETNEXTITEMINDEX (line 1432) | LVM_GETNEXTITEMINDEX = LVM_FIRST + 211
constant LVN_FIRST (line 1437) | LVN_FIRST = -100
constant LVN_ITEMCHANGING (line 1439) | LVN_ITEMCHANGING = LVN_FIRST - 0
constant LVN_ITEMCHANGED (line 1440) | LVN_ITEMCHANGED = LVN_FIRST - 1
constant LVN_INSERTITEM (line 1441) | LVN_INSERTITEM = LVN_FIRST - 2
constant LVN_DELETEITEM (line 1442) | LVN_DELETEITEM = LVN_FIRST - 3
constant LVN_DELETEALLITEMS (line 1443) | LVN_DELETEALLITEMS = LVN_FIRST - 4
constant LVN_BEGINLABELEDITA (line 1444) | LVN_BEGINLABELEDITA = LVN_FIRST - 5
constant LVN_BEGINLABELEDITW (line 1445) | LVN_BEGINLABELEDITW = LVN_FIRST - 75
constant LVN_ENDLABELEDITA (line 1446) | LVN_ENDLABELEDITA = LVN_FIRST - 6
constant LVN_ENDLABELEDITW (line 1447) | LVN_ENDLABELEDITW = LVN_FIRST - 76
constant LVN_COLUMNCLICK (line 1448) | LVN_COLUMNCLICK = LVN_FIRST - 8
constant LVN_BEGINDRAG (line 1449) | LVN_BEGINDRAG = LVN_FIRST - 9
constant LVN_BEGINRDRAG (line 1450) | LVN_BEGINRDRAG = LVN_FIRST - 11
constant LVN_ODCACHEHINT (line 1451) | LVN_ODCACHEHINT = LVN_FIRST - 13
constant LVN_ODFINDITEMA (line 1452) | LVN_ODFINDITEMA = LVN_FIRST - 52
constant LVN_ODFINDITEMW (line 1453) | LVN_ODFINDITEMW = LVN_FIRST - 79
constant LVN_ITEMACTIVATE (line 1454) | LVN_ITEMACTIVATE = LVN_FIRST - 14
constant LVN_ODSTATECHANGED (line 1455) | LVN_ODSTATECHANGED = LVN_FIRST - 15
constant LVN_HOTTRACK (line 1456) | LVN_HOTTRACK = LVN_FIRST - 21
constant LVN_GETDISPINFO (line 1457) | LVN_GETDISPINFO = LVN_FIRST - 77
constant LVN_SETDISPINFO (line 1458) | LVN_SETDISPINFO = LVN_FIRST - 78
constant LVN_KEYDOWN (line 1459) | LVN_KEYDOWN = LVN_FIRST - 55
constant LVN_MARQUEEBEGIN (line 1460) | LVN_MARQUEEBEGIN = LVN_FIRST - 56
constant LVN_GETINFOTIP (line 1461) | LVN_GETINFOTIP = LVN_FIRST - 58
constant LVN_INCREMENTALSEARCH (line 1462) | LVN_INCREMENTALSEARCH = LVN_FIRST - 63
constant LVN_BEGINSCROLL (line 1463) | LVN_BEGINSCROLL = LVN_FIRST - 80
constant LVN_ENDSCROLL (line 1464) | LVN_ENDSCROLL = LVN_FIRST - 81
constant LVNI_ALL (line 1469) | LVNI_ALL = 0
constant LVNI_FOCUSED (line 1470) | LVNI_FOCUSED = 1
constant LVNI_SELECTED (line 1471) | LVNI_SELECTED = 2
constant LVNI_CUT (line 1472) | LVNI_CUT = 4
constant LVNI_DROPHILITED (line 1473) | LVNI_DROPHILITED = 8
constant LVNI_ABOVE (line 1474) | LVNI_ABOVE = 256
constant LVNI_BELOW (line 1475) | LVNI_BELOW = 512
constant LVNI_TOLEFT (line 1476) | LVNI_TOLEFT = 1024
constant LVNI_TORIGHT (line 1477) | LVNI_TORIGHT = 2048
constant LVS_ICON (line 1482) | LVS_ICON = 0x0000
constant LVS_REPORT (line 1483) | LVS_REPORT = 0x0001
constant LVS_SMALLICON (line 1484) | LVS_SMALLICON = 0x0002
constant LVS_LIST (line 1485) | LVS_LIST = 0x0003
constant LVS_TYPEMASK (line 1486) | LVS_TYPEMASK = 0x0003
constant LVS_SINGLESEL (line 1487) | LVS_SINGLESEL = 0x0004
constant LVS_SHOWSELALWAYS (line 1488) | LVS_SHOWSELALWAYS = 0x0008
constant LVS_SORTASCENDING (line 1489) | LVS_SORTASCENDING = 0x0010
constant LVS_SORTDESCENDING (line 1490) | LVS_SORTDESCENDING = 0x0020
constant LVS_SHAREIMAGELISTS (line 1491) | LVS_SHAREIMAGELISTS = 0x0040
constant LVS_NOLABELWRAP (line 1492) | LVS_NOLABELWRAP = 0x0080
constant LVS_AUTOARRANGE (line 1493) | LVS_AUTOARRANGE = 0x0100
constant LVS_EDITLABELS (line 1494) | LVS_EDITLABELS = 0x0200
constant LVS_OWNERDATA (line 1495) | LVS_OWNERDATA = 0x1000
constant LVS_NOSCROLL (line 1496) | LVS_NOSCROLL = 0x2000
constant LVS_TYPESTYLEMASK (line 1497) | LVS_TYPESTYLEMASK = 0xfc00
constant LVS_ALIGNTOP (line 1498) | LVS_ALIGNTOP = 0x0000
constant LVS_ALIGNLEFT (line 1499) | LVS_ALIGNLEFT = 0x0800
constant LVS_ALIGNMASK (line 1500) | LVS_ALIGNMASK = 0x0c00
constant LVS_OWNERDRAWFIXED (line 1501) | LVS_OWNERDRAWFIXED = 0x0400
constant LVS_NOCOLUMNHEADER (line 1502) | LVS_NOCOLUMNHEADER = 0x4000
constant LVS_NOSORTHEADER (line 1503) | LVS_NOSORTHEADER = 0x8000
constant LVS_EX_GRIDLINES (line 1508) | LVS_EX_GRIDLINES = 0x00000001
constant LVS_EX_SUBITEMIMAGES (line 1509) | LVS_EX_SUBITEMIMAGES = 0x00000002
constant LVS_EX_CHECKBOXES (line 1510) | LVS_EX_CHECKBOXES = 0x00000004
constant LVS_EX_TRACKSELECT (line 1511) | LVS_EX_TRACKSELECT = 0x00000008
constant LVS_EX_HEADERDRAGDROP (line 1512) | LVS_EX_HEADERDRAGDROP = 0x00000010
constant LVS_EX_FULLROWSELECT (line 1513) | LVS_EX_FULLROWSELECT = 0x00000020
constant LVS_EX_ONECLICKACTIVATE (line 1514) | LVS_EX_ONECLICKACTIVATE = 0x00000040
constant LVS_EX_TWOCLICKACTIVATE (line 1515) | LVS_EX_TWOCLICKACTIVATE = 0x00000080
constant LVS_EX_FLATSB (line 1516) | LVS_EX_FLATSB = 0x00000100
constant LVS_EX_REGIONAL (line 1517) | LVS_EX_REGIONAL = 0x00000200
constant LVS_EX_INFOTIP (line 1518) | LVS_EX_INFOTIP = 0x00000400
constant LVS_EX_UNDERLINEHOT (line 1519) | LVS_EX_UNDERLINEHOT = 0x00000800
constant LVS_EX_UNDERLINECOLD (line 1520) | LVS_EX_UNDERLINECOLD = 0x00001000
constant LVS_EX_MULTIWORKAREAS (line 1521) | LVS_EX_MULTIWORKAREAS = 0x00002000
constant LVS_EX_LABELTIP (line 1522) | LVS_EX_LABELTIP = 0x00004000
constant LVS_EX_BORDERSELECT (line 1523) | LVS_EX_BORDERSELECT = 0x00008000
constant LVS_EX_DOUBLEBUFFER (line 1524) | LVS_EX_DOUBLEBUFFER = 0x00010000
constant LVS_EX_HIDELABELS (line 1525) | LVS_EX_HIDELABELS = 0x00020000
constant LVS_EX_SINGLEROW (line 1526) | LVS_EX_SINGLEROW = 0x00040000
constant LVS_EX_SNAPTOGRID (line 1527) | LVS_EX_SNAPTOGRID = 0x00080000
constant LVS_EX_SIMPLESELECT (line 1528) | LVS_EX_SIMPLESELECT = 0x00100000
constant LVCF_FMT (line 1533) | LVCF_FMT = 0x0001
constant LVCF_WIDTH (line 1534) | LVCF_WIDTH = 0x0002
constant LVCF_TEXT (line 1535) | LVCF_TEXT = 0x0004
constant LVCF_SUBITEM (line 1536) | LVCF_SUBITEM = 0x0008
constant LVCF_IMAGE (line 1537) | LVCF_IMAGE = 0x0010
constant LVCF_ORDER (line 1538) | LVCF_ORDER = 0x0020
constant LVCFMT_LEFT (line 1543) | LVCFMT_LEFT = 0x0000
constant LVCFMT_RIGHT (line 1544) | LVCFMT_RIGHT = 0x0001
constant LVCFMT_CENTER (line 1545) | LVCFMT_CENTER = 0x0002
constant LVCFMT_JUSTIFYMASK (line 1546) | LVCFMT_JUSTIFYMASK = 0x0003
constant LVCFMT_IMAGE (line 1547) | LVCFMT_IMAGE = 0x0800
constant LVCFMT_BITMAP_ON_RIGHT (line 1548) | LVCFMT_BITMAP_ON_RIGHT = 0x1000
constant LVCFMT_COL_HAS_IMAGES (line 1549) | LVCFMT_COL_HAS_IMAGES = 0x8000
constant LVIF_TEXT (line 1554) | LVIF_TEXT = 0x00000001
constant LVIF_IMAGE (line 1555) | LVIF_IMAGE = 0x00000002
constant LVIF_PARAM (line 1556) | LVIF_PARAM = 0x00000004
constant LVIF_STATE (line 1557) | LVIF_STATE = 0x00000008
constant LVIF_INDENT (line 1558) | LVIF_INDENT = 0x00000010
constant LVIF_NORECOMPUTE (line 1559) | LVIF_NORECOMPUTE = 0x00000800
constant LVIF_GROUPID (line 1560) | LVIF_GROUPID = 0x00000100
constant LVIF_COLUMNS (line 1561) | LVIF_COLUMNS = 0x00000200
constant LVIS_FOCUSED (line 1566) | LVIS_FOCUSED = 1
constant LVIS_SELECTED (line 1567) | LVIS_SELECTED = 2
constant LVIS_CUT (line 1568) | LVIS_CUT = 4
constant LVIS_DROPHILITED (line 1569) | LVIS_DROPHILITED = 8
constant LVIS_OVERLAYMASK (line 1570) | LVIS_OVERLAYMASK = 0xF00
constant LVIS_STATEIMAGEMASK (line 1571) | LVIS_STATEIMAGEMASK = 0xF000
constant LVHT_NOWHERE (line 1576) | LVHT_NOWHERE = 0x00000001
constant LVHT_ONITEMICON (line 1577) | LVHT_ONITEMICON = 0x00000002
constant LVHT_ONITEMLABEL (line 1578) | LVHT_ONITEMLABEL = 0x00000004
constant LVHT_ONITEMSTATEICON (line 1579) | LVHT_ONITEMSTATEICON = 0x00000008
constant LVHT_ONITEM (line 1580) | LVHT_ONITEM = LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMS...
constant LVHT_ABOVE (line 1582) | LVHT_ABOVE = 0x00000008
constant LVHT_BELOW (line 1583) | LVHT_BELOW = 0x00000010
constant LVHT_TORIGHT (line 1584) | LVHT_TORIGHT = 0x00000020
constant LVHT_TOLEFT (line 1585) | LVHT_TOLEFT = 0x00000040
constant LVSIL_NORMAL (line 1590) | LVSIL_NORMAL = 0
constant LVSIL_SMALL (line 1591) | LVSIL_SMALL = 1
constant LVSIL_STATE (line 1592) | LVSIL_STATE = 2
constant LVSIL_GROUPHEADER (line 1593) | LVSIL_GROUPHEADER = 3
constant ICC_LISTVIEW_CLASSES (line 1598) | ICC_LISTVIEW_CLASSES = 1
constant ICC_TREEVIEW_CLASSES (line 1599) | ICC_TREEVIEW_CLASSES = 2
constant ICC_BAR_CLASSES (line 1600) | ICC_BAR_CLASSES = 4
constant ICC_TAB_CLASSES (line 1601) | ICC_TAB_CLASSES = 8
constant ICC_UPDOWN_CLASS (line 1602) | ICC_UPDOWN_CLASS = 16
constant ICC_PROGRESS_CLASS (line 1603) | ICC_PROGRESS_CLASS = 32
constant ICC_HOTKEY_CLASS (line 1604) | ICC_HOTKEY_CLASS = 64
constant ICC_ANIMATE_CLASS (line 1605) | ICC_ANIMATE_CLASS = 128
constant ICC_WIN95_CLASSES (line 1606) | ICC_WIN95_CLASSES = 255
constant ICC_DATE_CLASSES (line 1607) | ICC_DATE_CLASSES = 256
constant ICC_USEREX_CLASSES (line 1608) | ICC_USEREX_CLASSES = 512
constant ICC_COOL_CLASSES (line 1609) | ICC_COOL_CLASSES = 1024
constant ICC_INTERNET_CLASSES (line 1610) | ICC_INTERNET_CLASSES = 2048
constant ICC_PAGESCROLLER_CLASS (line 1611) | ICC_PAGESCROLLER_CLASS = 4096
constant ICC_NATIVEFNTCTL_CLASS (line 1612) | ICC_NATIVEFNTCTL_CLASS = 8192
constant INFOTIPSIZE (line 1613) | INFOTIPSIZE = 1024
constant ICC_STANDARD_CLASSES (line 1614) | ICC_STANDARD_CLASSES = 0x00004000
constant ICC_LINK_CLASS (line 1615) | ICC_LINK_CLASS = 0x00008000
constant DLGC_WANTARROWS (line 1620) | DLGC_WANTARROWS = 0x0001
constant DLGC_WANTTAB (line 1621) | DLGC_WANTTAB = 0x0002
constant DLGC_WANTALLKEYS (line 1622) | DLGC_WANTALLKEYS = 0x0004
constant DLGC_WANTMESSAGE (line 1623) | DLGC_WANTMESSAGE = 0x0004
constant DLGC_HASSETSEL (line 1624) | DLGC_HASSETSEL = 0x0008
constant DLGC_DEFPUSHBUTTON (line 1625) | DLGC_DEFPUSHBUTTON = 0x0010
constant DLGC_UNDEFPUSHBUTTON (line 1626) | DLGC_UNDEFPUSHBUTTON = 0x0020
constant DLGC_RADIOBUTTON (line 1627) | DLGC_RADIOBUTTON = 0x0040
constant DLGC_WANTCHARS (line 1628) | DLGC_WANTCHARS = 0x0080
constant DLGC_STATIC (line 1629) | DLGC_STATIC = 0x0100
constant DLGC_BUTTON (line 1630) | DLGC_BUTTON = 0x2000
constant DWL_MSGRESULT (line 1635) | DWL_MSGRESULT = 0
constant DWL_DLGPROC (line 1636) | DWL_DLGPROC = 4
constant DWL_USER (line 1637) | DWL_USER = 8
constant HKEY_CLASSES_ROOT (line 1642) | HKEY_CLASSES_ROOT HKEY = 0x80000000
constant HKEY_CURRENT_USER (line 1643) | HKEY_CURRENT_USER HKEY = 0x80000001
constant HKEY_LOCAL_MACHINE (line 1644) | HKEY_LOCAL_MACHINE HKEY = 0x80000002
constant HKEY_USERS (line 1645) | HKEY_USERS HKEY = 0x80000003
constant HKEY_PERFORMANCE_DATA (line 1646) | HKEY_PERFORMANCE_DATA HKEY = 0x80000004
constant HKEY_CURRENT_CONFIG (line 1647) | HKEY_CURRENT_CONFIG HKEY = 0x80000005
constant HKEY_DYN_DATA (line 1648) | HKEY_DYN_DATA HKEY = 0x80000006
constant KEY_ALL_ACCESS (line 1653) | KEY_ALL_ACCESS = 0xF003F
constant KEY_CREATE_SUB_KEY (line 1654) | KEY_CREATE_SUB_KEY = 0x0004
constant KEY_ENUMERATE_SUB_KEYS (line 1655) | KEY_ENUMERATE_SUB_KEYS = 0x0008
constant KEY_NOTIFY (line 1656) | KEY_NOTIFY = 0x0010
constant KEY_QUERY_VALUE (line 1657) | KEY_QUERY_VALUE = 0x0001
constant KEY_SET_VALUE (line 1658) | KEY_SET_VALUE = 0x0002
constant KEY_READ (line 1659) | KEY_READ = 0x20019
constant KEY_WRITE (line 1660) | KEY_WRITE = 0x20006
constant NFR_ANSI (line 1664) | NFR_ANSI = 1
constant NFR_UNICODE (line 1665) | NFR_UNICODE = 2
constant NF_QUERY (line 1666) | NF_QUERY = 3
constant NF_REQUERY (line 1667) | NF_REQUERY = 4
constant RRF_RT_REG_NONE (line 1672) | RRF_RT_REG_NONE = 0x00000001
constant RRF_RT_REG_SZ (line 1673) | RRF_RT_REG_SZ = 0x00000002
constant RRF_RT_REG_EXPAND_SZ (line 1674) | RRF_RT_REG_EXPAND_SZ = 0x00000004
constant RRF_RT_REG_BINARY (line 1675) | RRF_RT_REG_BINARY = 0x00000008
constant RRF_RT_REG_DWORD (line 1676) | RRF_RT_REG_DWORD = 0x00000010
constant RRF_RT_REG_MULTI_SZ (line 1677) | RRF_RT_REG_MULTI_SZ = 0x00000020
constant RRF_RT_REG_QWORD (line 1678) | RRF_RT_REG_QWORD = 0x00000040
constant RRF_RT_DWORD (line 1679) | RRF_RT_DWORD = (RRF_RT_REG_BINARY | RRF_RT_REG_DWORD)
constant RRF_RT_QWORD (line 1680) | RRF_RT_QWORD = (RRF_RT_REG_BINARY | RRF_RT_REG_QWORD)
constant RRF_RT_ANY (line 1681) | RRF_RT_ANY = 0x0000ffff
constant RRF_NOEXPAND (line 1682) | RRF_NOEXPAND = 0x10000000
constant RRF_ZEROONFAILURE (line 1683) | RRF_ZEROONFAILURE = 0x20000000
constant REG_PROCESS_APPKEY (line 1684) | REG_PROCESS_APPKEY = 0x00000001
constant REG_MUI_STRING_TRUNCATE (line 1685) | REG_MUI_STRING_TRUNCATE = 0x00000001
constant PM_NOREMOVE (line 1690) | PM_NOREMOVE = 0x000
constant PM_REMOVE (line 1691) | PM_REMOVE = 0x001
constant PM_NOYIELD (line 1692) | PM_NOYIELD = 0x002
constant ILC_MASK (line 1697) | ILC_MASK = 0x00000001
constant ILC_COLOR (line 1698) | ILC_COLOR = 0x00000000
constant ILC_COLORDDB (line 1699) | ILC_COLORDDB = 0x000000FE
constant ILC_COLOR4 (line 1700) | ILC_COLOR4 = 0x00000004
constant ILC_COLOR8 (line 1701) | ILC_COLOR8 = 0x00000008
constant ILC_COLOR16 (line 1702) | ILC_COLOR16 = 0x00000010
constant ILC_COLOR24 (line 1703) | ILC_COLOR24 = 0x00000018
constant ILC_COLOR32 (line 1704) | ILC_COLOR32 = 0x00000020
constant ILC_PALETTE (line 1705) | ILC_PALETTE = 0x00000800
constant ILC_MIRROR (line 1706) | ILC_MIRROR = 0x00002000
constant ILC_PERITEMMIRROR (line 1707) | ILC_PERITEMMIRROR = 0x00008000
constant ILC_ORIGINALSIZE (line 1708) | ILC_ORIGINALSIZE = 0x00010000
constant ILC_HIGHQUALITYSCALE (line 1709) | ILC_HIGHQUALITYSCALE = 0x00020000
constant KF_EXTENDED (line 1714) | KF_EXTENDED = 0x0100
constant KF_DLGMODE (line 1715) | KF_DLGMODE = 0x0800
constant KF_MENUMODE (line 1716) | KF_MENUMODE = 0x1000
constant KF_ALTDOWN (line 1717) | KF_ALTDOWN = 0x2000
constant KF_REPEAT (line 1718) | KF_REPEAT = 0x4000
constant KF_UP (line 1719) | KF_UP = 0x8000
constant VK_LBUTTON (line 1724) | VK_LBUTTON = 0x01
constant VK_RBUTTON (line 1725) | VK_RBUTTON = 0x02
constant VK_CANCEL (line 1726) | VK_CANCEL = 0x03
constant VK_MBUTTON (line 1727) | VK_MBUTTON = 0x04
constant VK_XBUTTON1 (line 1728) | VK_XBUTTON1 = 0x05
constant VK_XBUTTON2 (line 1729) | VK_XBUTTON2 = 0x06
constant VK_BACK (line 1730) | VK_BACK = 0x08
constant VK_TAB (line 1731) | VK_TAB = 0x09
constant VK_CLEAR (line 1732) | VK_CLEAR = 0x0C
constant VK_RETURN (line 1733) | VK_RETURN = 0x0D
constant VK_SHIFT (line 1734) | VK_SHIFT = 0x10
constant VK_CONTROL (line 1735) | VK_CONTROL = 0x11
constant VK_MENU (line 1736) | VK_MENU = 0x12
constant VK_PAUSE (line 1737) | VK_PAUSE = 0x13
constant VK_CAPITAL (line 1738) | VK_CAPITAL = 0x14
constant VK_KANA (line 1739) | VK_KANA = 0x15
constant VK_HANGEUL (line 1740) | VK_HANGEUL = 0x15
constant VK_HANGUL (line 1741) | VK_HANGUL = 0x15
constant VK_JUNJA (line 1742) | VK_JUNJA = 0x17
constant VK_FINAL (line 1743) | VK_FINAL = 0x18
constant VK_HANJA (line 1744) | VK_HANJA = 0x19
constant VK_KANJI (line 1745) | VK_KANJI = 0x19
constant VK_ESCAPE (line 1746) | VK_ESCAPE = 0x1B
constant VK_CONVERT (line 1747) | VK_CONVERT = 0x1C
constant VK_NONCONVERT (line 1748) | VK_NONCONVERT = 0x1D
constant VK_ACCEPT (line 1749) | VK_ACCEPT = 0x1E
constant VK_MODECHANGE (line 1750) | VK_MODECHANGE = 0x1F
constant VK_SPACE (line 1751) | VK_SPACE = 0x20
constant VK_PRIOR (line 1752) | VK_PRIOR = 0x21
constant VK_NEXT (line 1753) | VK_NEXT = 0x22
constant VK_END (line 1754) | VK_END = 0x23
constant VK_HOME (line 1755) | VK_HOME = 0x24
constant VK_LEFT (line 1756) | VK_LEFT = 0x25
constant VK_UP (line 1757) | VK_UP = 0x26
constant VK_RIGHT (line 1758) | VK_RIGHT = 0x27
constant VK_DOWN (line 1759) | VK_DOWN = 0x28
constant VK_SELECT (line 1760) | VK_SELECT = 0x29
constant VK_PRINT (line 1761) | VK_PRINT = 0x2A
constant VK_EXECUTE (line 1762) | VK_EXECUTE = 0x2B
constant VK_SNAPSHOT (line 1763) | VK_SNAPSHOT = 0x2C
constant VK_INSERT (line 1764) | VK_INSERT = 0x2D
constant VK_DELETE (line 1765) | VK_DELETE = 0x2E
constant VK_HELP (line 1766) | VK_HELP = 0x2F
constant VK_LWIN (line 1767) | VK_LWIN = 0x5B
constant VK_RWIN (line 1768) | VK_RWIN = 0x5C
constant VK_APPS (line 1769) | VK_APPS = 0x5D
constant VK_SLEEP (line 1770) | VK_SLEEP = 0x5F
constant VK_NUMPAD0 (line 1771) | VK_NUMPAD0 = 0x60
constant VK_NUMPAD1 (line 1772) | VK_NUMPAD1 = 0x61
constant VK_NUMPAD2 (line 1773) | VK_NUMPAD2 = 0x62
constant VK_NUMPAD3 (line 1774) | VK_NUMPAD3 = 0x63
constant VK_NUMPAD4 (line 1775) | VK_NUMPAD4 = 0x64
constant VK_NUMPAD5 (line 1776) | VK_NUMPAD5 = 0x65
constant VK_NUMPAD6 (line 1777) | VK_NUMPAD6 = 0x66
constant VK_NUMPAD7 (line 1778) | VK_NUMPAD7 = 0x67
constant VK_NUMPAD8 (line 1779) | VK_NUMPAD8 = 0x68
constant VK_NUMPAD9 (line 1780) | VK_NUMPAD9 = 0x69
constant VK_MULTIPLY (line 1781) | VK_MULTIPLY = 0x6A
constant VK_ADD (line 1782) | VK_ADD = 0x6B
constant VK_SEPARATOR (line 1783) | VK_SEPARATOR = 0x6C
constant VK_SUBTRACT (line 1784) | VK_SUBTRACT = 0x6D
constant VK_DECIMAL (line 1785) | VK_DECIMAL = 0x6E
constant VK_DIVIDE (line 1786) | VK_DIVIDE = 0x6F
constant VK_F1 (line 1787) | VK_F1 = 0x70
constant VK_F2 (line 1788) | VK_F2 = 0x71
constant VK_F3 (line 1789) | VK_F3 = 0x72
constant VK_F4 (line 1790) | VK_F4 = 0x73
constant VK_F5 (line 1791) | VK_F5 = 0x74
constant VK_F6 (line 1792) | VK_F6 = 0x75
constant VK_F7 (line 1793) | VK_F7 = 0x76
constant VK_F8 (line 1794) | VK_F8 = 0x77
constant VK_F9 (line 1795) | VK_F9 = 0x78
constant VK_F10 (line 1796) | VK_F10 = 0x79
constant VK_F11 (line 1797) | VK_F11 = 0x7A
constant VK_F12 (line 1798) | VK_F12 = 0x7B
constant VK_F13 (line 1799) | VK_F13 = 0x7C
constant VK_F14 (line 1800) | VK_F14 = 0x7D
constant VK_F15 (line 1801) | VK_F15 = 0x7E
constant VK_F16 (line 1802) | VK_F16 = 0x7F
constant VK_F17 (line 1803) | VK_F17 = 0x80
constant VK_F18 (line 1804) | VK_F18 = 0x81
constant VK_F19 (line 1805) | VK_F19 = 0x82
constant VK_F20 (line 1806) | VK_F20 = 0x83
constant VK_F21 (line 1807) | VK_F21 = 0x84
constant VK_F22 (line 1808) | VK_F22 = 0x85
constant VK_F23 (line 1809) | VK_F23 = 0x86
constant VK_F24 (line 1810) | VK_F24 = 0x87
constant VK_NUMLOCK (line 1811) | VK_NUMLOCK = 0x90
constant VK_SCROLL (line 1812) | VK_SCROLL = 0x91
constant VK_OEM_NEC_EQUAL (line 1813) | VK_OEM_NEC_EQUAL = 0x92
constant VK_OEM_FJ_JISHO (line 1814) | VK_OEM_FJ_JISHO = 0x92
constant VK_OEM_FJ_MASSHOU (line 1815) | VK_OEM_FJ_MASSHOU = 0x93
constant VK_OEM_FJ_TOUROKU (line 1816) | VK_OEM_FJ_TOUROKU = 0x94
constant VK_OEM_FJ_LOYA (line 1817) | VK_OEM_FJ_LOYA = 0x95
constant VK_OEM_FJ_ROYA (line 1818) | VK_OEM_FJ_ROYA = 0x96
constant VK_LSHIFT (line 1819) | VK_LSHIFT = 0xA0
constant VK_RSHIFT (line 1820) | VK_RSHIFT = 0xA1
constant VK_LCONTROL (line 1821) | VK_LCONTROL = 0xA2
constant VK_RCONTROL (line 1822) | VK_RCONTROL = 0xA3
constant VK_LMENU (line 1823) | VK_LMENU = 0xA4
constant VK_RMENU (line 1824) | VK_RMENU = 0xA5
constant VK_BROWSER_BACK (line 1825) | VK_BROWSER_BACK = 0xA6
constant VK_BROWSER_FORWARD (line 1826) | VK_BROWSER_FORWARD = 0xA7
constant VK_BROWSER_REFRESH (line 1827) | VK_BROWSER_REFRESH = 0xA8
constant VK_BROWSER_STOP (line 1828) | VK_BROWSER_STOP = 0xA9
constant VK_BROWSER_SEARCH (line 1829) | VK_BROWSER_SEARCH = 0xAA
constant VK_BROWSER_FAVORITES (line 1830) | VK_BROWSER_FAVORITES = 0xAB
constant VK_BROWSER_HOME (line 1831) | VK_BROWSER_HOME = 0xAC
constant VK_VOLUME_MUTE (line 1832) | VK_VOLUME_MUTE = 0xAD
constant VK_VOLUME_DOWN (line 1833) | VK_VOLUME_DOWN = 0xAE
constant VK_VOLUME_UP (line 1834) | VK_VOLUME_UP = 0xAF
constant VK_MEDIA_NEXT_TRACK (line 1835) | VK_MEDIA_NEXT_TRACK = 0xB0
constant VK_MEDIA_PREV_TRACK (line 1836) | VK_MEDIA_PREV_TRACK = 0xB1
constant VK_MEDIA_STOP (line 1837) | VK_MEDIA_STOP = 0xB2
constant VK_MEDIA_PLAY_PAUSE (line 1838) | VK_MEDIA_PLAY_PAUSE = 0xB3
constant VK_LAUNCH_MAIL (line 1839) | VK_LAUNCH_MAIL = 0xB4
constant VK_LAUNCH_MEDIA_SELECT (line 1840) | VK_LAUNCH_MEDIA_SELECT = 0xB5
constant VK_LAUNCH_APP1 (line 1841) | VK_LAUNCH_APP1 = 0xB6
constant VK_LAUNCH_APP2 (line 1842) | VK_LAUNCH_APP2 = 0xB7
constant VK_OEM_1 (line 1843) | VK_OEM_1 = 0xBA
constant VK_OEM_PLUS (line 1844) | VK_OEM_PLUS = 0xBB
constant VK_OEM_COMMA (line 1845) | VK_OEM_COMMA = 0xBC
constant VK_OEM_MINUS (line 1846) | VK_OEM_MINUS = 0xBD
constant VK_OEM_PERIOD (line 1847) | VK_OEM_PERIOD = 0xBE
constant VK_OEM_2 (line 1848) | VK_OEM_2 = 0xBF
constant VK_OEM_3 (line 1849) | VK_OEM_3 = 0xC0
constant VK_OEM_4 (line 1850) | VK_OEM_4 = 0xDB
constant VK_OEM_5 (line 1851) | VK_OEM_5 = 0xDC
constant VK_OEM_6 (line 1852) | VK_OEM_6 = 0xDD
constant VK_OEM_7 (line 1853) | VK_OEM_7 = 0xDE
constant VK_OEM_8 (line 1854) | VK_OEM_8 = 0xDF
constant VK_OEM_AX (line 1855) | VK_OEM_AX = 0xE1
constant VK_OEM_102 (line 1856) | VK_OEM_102 = 0xE2
constant VK_ICO_HELP (line 1857) | VK_ICO_HELP = 0xE3
constant VK_ICO_00 (line 1858) | VK_ICO_00 = 0xE4
constant VK_PROCESSKEY (line 1859) | VK_PROCESSKEY = 0xE5
constant
Condensed preview — 150 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (556K chars).
[
{
"path": ".gitignore",
"chars": 299,
"preview": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture spe"
},
{
"path": "LICENSE",
"chars": 1077,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Dean Karn\n\nPermission is hereby granted, free of charge, to any person obtaini"
},
{
"path": "README.md",
"chars": 4058,
"preview": "Package stats\n=============\n\n\n[\n\ntype httpStats struct {\n\tlock s"
},
{
"path": "examples/client/client.go",
"chars": 1603,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"runtime\"\n\n\t\"gopkg.in/go-playground/stats.v1\"\n)\n\nvar statsClient *stats.Clien"
},
{
"path": "examples/server/server.go",
"chars": 546,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"gopkg.in/go-playground/stats.v1\"\n)\n\nfunc main() {\n\n\tconfig := &stats.ServerConfig{\n\t\tDo"
},
{
"path": "http.go",
"chars": 3055,
"preview": "package stats\n\nimport (\n\t\"net/http\"\n\t\"time\"\n)\n\n// LogResponseWritter wraps the standard http.ResponseWritter allowing fo"
},
{
"path": "server.go",
"chars": 1790,
"preview": "package stats\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n)\n\n// ServerConfig is used to initialize a new ServerS"
},
{
"path": "stats.go",
"chars": 7847,
"preview": "package stats\n\nimport (\n\t\"runtime\"\n\n\t\"github.com/shirou/gopsutil/cpu\"\n\t\"github.com/shirou/gopsutil/host\"\n\t\"github.com/sh"
},
{
"path": "stats_test.go",
"chars": 1379,
"preview": "package stats\n\nimport (\n\t\"os\"\n\t\"testing\"\n\t\"time\"\n\n\t. \"gopkg.in/go-playground/assert.v1\"\n)\n\n// NOTES:\n// - Run \"go test\" "
},
{
"path": "vendor/github.com/StackExchange/wmi/LICENSE",
"chars": 1081,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2013 Stack Exchange\n\nPermission is hereby granted, free of charge, to any person ob"
},
{
"path": "vendor/github.com/StackExchange/wmi/README.md",
"chars": 66,
"preview": "wmi\n===\n\nPackage wmi provides a WQL interface for WMI on Windows.\n"
},
{
"path": "vendor/github.com/StackExchange/wmi/wmi.go",
"chars": 11828,
"preview": "// +build windows\n\n/*\nPackage wmi provides a WQL interface for WMI on Windows.\n\nExample code to print names of running p"
},
{
"path": "vendor/github.com/go-ole/go-ole/ChangeLog.md",
"chars": 1986,
"preview": "# Version 1.x.x\n\n* **Add more test cases and reference new test COM server project.** (Placeholder for future additions)"
},
{
"path": "vendor/github.com/go-ole/go-ole/README.md",
"chars": 2257,
"preview": "#Go OLE\n\n[](https://ci.appveyor.co"
},
{
"path": "vendor/github.com/go-ole/go-ole/appveyor.yml",
"chars": 1702,
"preview": "# Notes:\n# - Minimal appveyor.yml file is an empty file. All sections are optional.\n# - Indent each level of configu"
},
{
"path": "vendor/github.com/go-ole/go-ole/com.go",
"chars": 10985,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"errors\"\n\t\"syscall\"\n\t\"time\"\n\t\"unicode/utf16\"\n\t\"unsafe\"\n)\n\nvar (\n\tprocCoInitial"
},
{
"path": "vendor/github.com/go-ole/go-ole/com_func.go",
"chars": 5395,
"preview": "// +build !windows\n\npackage ole\n\nimport (\n\t\"time\"\n\t\"unsafe\"\n)\n\n// coInitialize initializes COM library on current thread"
},
{
"path": "vendor/github.com/go-ole/go-ole/connect.go",
"chars": 4365,
"preview": "package ole\n\n// Connection contains IUnknown for fluent interface interaction.\n//\n// Deprecated. Use oleutil package ins"
},
{
"path": "vendor/github.com/go-ole/go-ole/constants.go",
"chars": 3590,
"preview": "package ole\n\nconst (\n\tCLSCTX_INPROC_SERVER = 1\n\tCLSCTX_INPROC_HANDLER = 2\n\tCLSCTX_LOCAL_SERVER = 4\n\tCLSCTX_INPROC_"
},
{
"path": "vendor/github.com/go-ole/go-ole/error.go",
"chars": 1307,
"preview": "package ole\n\n// OleError stores COM errors.\ntype OleError struct {\n\thr uintptr\n\tdescription string\n\tsubError "
},
{
"path": "vendor/github.com/go-ole/go-ole/error_func.go",
"chars": 119,
"preview": "// +build !windows\n\npackage ole\n\n// errstr converts error code to string.\nfunc errstr(errno int) string {\n\treturn \"\"\n}\n"
},
{
"path": "vendor/github.com/go-ole/go-ole/error_windows.go",
"chars": 650,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n\t\"unicode/utf16\"\n)\n\n// errstr converts error code to string.\n"
},
{
"path": "vendor/github.com/go-ole/go-ole/guid.go",
"chars": 8124,
"preview": "package ole\n\nvar (\n\t// IID_NULL is null Interface ID, used when no other Interface ID is known.\n\tIID_NULL = NewGUID(\"{00"
},
{
"path": "vendor/github.com/go-ole/go-ole/iconnectionpoint.go",
"chars": 434,
"preview": "package ole\n\nimport \"unsafe\"\n\ntype IConnectionPoint struct {\n\tIUnknown\n}\n\ntype IConnectionPointVtbl struct {\n\tIUnknownVt"
},
{
"path": "vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go",
"chars": 450,
"preview": "// +build !windows\n\npackage ole\n\nimport \"unsafe\"\n\nfunc (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 {"
},
{
"path": "vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go",
"chars": 864,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc (v *IConnectionPoint) GetConnectionInterface(piid "
},
{
"path": "vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go",
"chars": 354,
"preview": "package ole\n\nimport \"unsafe\"\n\ntype IConnectionPointContainer struct {\n\tIUnknown\n}\n\ntype IConnectionPointContainerVtbl st"
},
{
"path": "vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go",
"chars": 280,
"preview": "// +build !windows\n\npackage ole\n\nfunc (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error {\n\tr"
},
{
"path": "vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go",
"chars": 501,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc (v *IConnectionPointContainer) EnumConnectionPoint"
},
{
"path": "vendor/github.com/go-ole/go-ole/idispatch.go",
"chars": 2980,
"preview": "package ole\n\nimport \"unsafe\"\n\ntype IDispatch struct {\n\tIUnknown\n}\n\ntype IDispatchVtbl struct {\n\tIUnknownVtbl\n\tGetTypeInf"
},
{
"path": "vendor/github.com/go-ole/go-ole/idispatch_func.go",
"chars": 473,
"preview": "// +build !windows\n\npackage ole\n\nfunc getIDsOfName(disp *IDispatch, names []string) ([]int32, error) {\n\treturn []int32{}"
},
{
"path": "vendor/github.com/go-ole/go-ole/idispatch_windows.go",
"chars": 6313,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n)\n\nfunc getIDsOfName(disp *IDispatch, names []stri"
},
{
"path": "vendor/github.com/go-ole/go-ole/ienumvariant.go",
"chars": 289,
"preview": "package ole\n\nimport \"unsafe\"\n\ntype IEnumVARIANT struct {\n\tIUnknown\n}\n\ntype IEnumVARIANTVtbl struct {\n\tIUnknownVtbl\n\tNext"
},
{
"path": "vendor/github.com/go-ole/go-ole/ienumvariant_func.go",
"chars": 413,
"preview": "// +build !windows\n\npackage ole\n\nfunc (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error) {\n\treturn nil, NewError(E_NOTI"
},
{
"path": "vendor/github.com/go-ole/go-ole/ienumvariant_windows.go",
"chars": 1052,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc (enum *IEnumVARIANT) Clone() (cloned *IEnumVARIANT"
},
{
"path": "vendor/github.com/go-ole/go-ole/iinspectable.go",
"chars": 316,
"preview": "package ole\n\nimport \"unsafe\"\n\ntype IInspectable struct {\n\tIUnknown\n}\n\ntype IInspectableVtbl struct {\n\tIUnknownVtbl\n\tGetI"
},
{
"path": "vendor/github.com/go-ole/go-ole/iinspectable_func.go",
"chars": 323,
"preview": "// +build !windows\n\npackage ole\n\nfunc (v *IInspectable) GetIids() ([]*GUID, error) {\n\treturn []*GUID{}, NewError(E_NOTIM"
},
{
"path": "vendor/github.com/go-ole/go-ole/iinspectable_windows.go",
"chars": 1437,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"reflect\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc (v *IInspec"
},
{
"path": "vendor/github.com/go-ole/go-ole/iprovideclassinfo.go",
"chars": 392,
"preview": "package ole\n\nimport \"unsafe\"\n\ntype IProvideClassInfo struct {\n\tIUnknown\n}\n\ntype IProvideClassInfoVtbl struct {\n\tIUnknown"
},
{
"path": "vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go",
"chars": 143,
"preview": "// +build !windows\n\npackage ole\n\nfunc getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) {\n\treturn nil,"
},
{
"path": "vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go",
"chars": 326,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc getClassInfo(disp *IProvideClassInfo) (tinfo *ITyp"
},
{
"path": "vendor/github.com/go-ole/go-ole/itypeinfo.go",
"chars": 784,
"preview": "package ole\n\nimport \"unsafe\"\n\ntype ITypeInfo struct {\n\tIUnknown\n}\n\ntype ITypeInfoVtbl struct {\n\tIUnknownVtbl\n\tGetTypeAtt"
},
{
"path": "vendor/github.com/go-ole/go-ole/itypeinfo_func.go",
"chars": 123,
"preview": "// +build !windows\n\npackage ole\n\nfunc (v *ITypeInfo) GetTypeAttr() (*TYPEATTR, error) {\n\treturn nil, NewError(E_NOTIMPL)"
},
{
"path": "vendor/github.com/go-ole/go-ole/itypeinfo_windows.go",
"chars": 318,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc (v *ITypeInfo) GetTypeAttr() (tattr *TYPEATTR, err"
},
{
"path": "vendor/github.com/go-ole/go-ole/iunknown.go",
"chars": 1222,
"preview": "package ole\n\nimport \"unsafe\"\n\ntype IUnknown struct {\n\tRawVTable *interface{}\n}\n\ntype IUnknownVtbl struct {\n\tQueryInterfa"
},
{
"path": "vendor/github.com/go-ole/go-ole/iunknown_func.go",
"chars": 384,
"preview": "// +build !windows\n\npackage ole\n\nfunc reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj int"
},
{
"path": "vendor/github.com/go-ole/go-ole/iunknown_windows.go",
"chars": 1068,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"reflect\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc reflectQueryInterface(self interface{},"
},
{
"path": "vendor/github.com/go-ole/go-ole/ole.go",
"chars": 2829,
"preview": "package ole\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// DISPPARAMS are the arguments that passed to methods or property.\ntype DISP"
},
{
"path": "vendor/github.com/go-ole/go-ole/oleutil/connection.go",
"chars": 2242,
"preview": "// +build windows\n\npackage oleutil\n\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n\n\tole \"github.com/go-ole/go-ole\"\n)\n\ntype stdDispatch s"
},
{
"path": "vendor/github.com/go-ole/go-ole/oleutil/connection_func.go",
"chars": 293,
"preview": "// +build !windows\n\npackage oleutil\n\nimport ole \"github.com/go-ole/go-ole\"\n\n// ConnectObject creates a connection point "
},
{
"path": "vendor/github.com/go-ole/go-ole/oleutil/connection_windows.go",
"chars": 1563,
"preview": "// +build windows\n\npackage oleutil\n\nimport (\n\t\"reflect\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\tole \"github.com/go-ole/go-ole\"\n)\n\n// Conn"
},
{
"path": "vendor/github.com/go-ole/go-ole/oleutil/go-get.go",
"chars": 145,
"preview": "// This file is here so go get succeeds as without it errors with:\n// no buildable Go source files in ...\n//\n// +build !"
},
{
"path": "vendor/github.com/go-ole/go-ole/oleutil/oleutil.go",
"chars": 2598,
"preview": "package oleutil\n\nimport ole \"github.com/go-ole/go-ole\"\n\n// ClassIDFrom retrieves class ID whether given is program ID or"
},
{
"path": "vendor/github.com/go-ole/go-ole/safearray.go",
"chars": 638,
"preview": "// Package is meant to retrieve and process safe array data returned from COM.\n\npackage ole\n\n// SafeArrayBound defines t"
},
{
"path": "vendor/github.com/go-ole/go-ole/safearray_func.go",
"chars": 6280,
"preview": "// +build !windows\n\npackage ole\n\nimport (\n\t\"unsafe\"\n)\n\n// safeArrayAccessData returns raw array pointer.\n//\n// AKA: Safe"
},
{
"path": "vendor/github.com/go-ole/go-ole/safearray_windows.go",
"chars": 12025,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"unsafe\"\n)\n\nvar (\n\tprocSafeArrayAccessData, _ = modoleaut32.FindProc(\"S"
},
{
"path": "vendor/github.com/go-ole/go-ole/safearrayconversion.go",
"chars": 3343,
"preview": "// Helper for converting SafeArray to array of objects.\n\npackage ole\n\nimport (\n\t\"unsafe\"\n)\n\ntype SafeArrayConversion str"
},
{
"path": "vendor/github.com/go-ole/go-ole/safearrayslices.go",
"chars": 720,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"unsafe\"\n)\n\nfunc safeArrayFromByteSlice(slice []byte) *SafeArray {\n\tarray, _ :"
},
{
"path": "vendor/github.com/go-ole/go-ole/utility.go",
"chars": 2173,
"preview": "package ole\n\nimport (\n\t\"unicode/utf16\"\n\t\"unsafe\"\n)\n\n// ClassIDFrom retrieves class ID whether given is program ID or app"
},
{
"path": "vendor/github.com/go-ole/go-ole/variables.go",
"chars": 358,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"syscall\"\n)\n\nvar (\n\tmodcombase = syscall.NewLazyDLL(\"combase.dll\")\n\tmodker"
},
{
"path": "vendor/github.com/go-ole/go-ole/variant.go",
"chars": 2407,
"preview": "package ole\n\nimport \"unsafe\"\n\n// NewVariant returns new variant based on type and value.\nfunc NewVariant(vt VT, val int6"
},
{
"path": "vendor/github.com/go-ole/go-ole/variant_386.go",
"chars": 177,
"preview": "// +build 386\n\npackage ole\n\ntype VARIANT struct {\n\tVT VT // 2\n\twReserved1 uint16 // 4\n\twReserved2 uint16 /"
},
{
"path": "vendor/github.com/go-ole/go-ole/variant_amd64.go",
"chars": 210,
"preview": "// +build amd64\n\npackage ole\n\ntype VARIANT struct {\n\tVT VT // 2\n\twReserved1 uint16 // 4\n\twReserved2 uint"
},
{
"path": "vendor/github.com/go-ole/go-ole/vt_string.go",
"chars": 1824,
"preview": "// generated by stringer -output vt_string.go -type VT; DO NOT EDIT\n\npackage ole\n\nimport \"fmt\"\n\nconst (\n\t_VT_name_0 = \"V"
},
{
"path": "vendor/github.com/go-ole/go-ole/winrt.go",
"chars": 2432,
"preview": "// +build windows\n\npackage ole\n\nimport (\n\t\"reflect\"\n\t\"syscall\"\n\t\"unicode/utf8\"\n\t\"unsafe\"\n)\n\nvar (\n\tprocRoInitialize "
},
{
"path": "vendor/github.com/go-ole/go-ole/winrt_doc.go",
"chars": 842,
"preview": "// +build !windows\n\npackage ole\n\n// RoInitialize\nfunc RoInitialize(thread_type uint32) (err error) {\n\treturn NewError(E_"
},
{
"path": "vendor/github.com/shirou/gopsutil/LICENSE",
"chars": 1559,
"preview": "gopsutil is distributed under BSD license reproduced below.\n\nCopyright (c) 2014, WAKAYAMA Shirou\nAll rights reserved.\n\nR"
},
{
"path": "vendor/github.com/shirou/gopsutil/README.rst",
"chars": 7708,
"preview": "gopsutil: psutil for golang\n==============================\n\n.. image:: https://circleci.com/gh/shirou/gopsutil.svg?&styl"
},
{
"path": "vendor/github.com/shirou/gopsutil/circle.yml",
"chars": 340,
"preview": "machine:\n timezone:\n Asia/Tokyo\ntest:\n override:\n - GOOS=linux GOARCH=amd64 go test -v ./...\n - GOOS=linux GO"
},
{
"path": "vendor/github.com/shirou/gopsutil/coverall.sh",
"chars": 552,
"preview": "#/bin/sh\n\n# see http://www.songmu.jp/riji/entry/2015-01-15-goveralls-multi-package.html\n\nset -e\n# cleanup\ncleanup() {\n "
},
{
"path": "vendor/github.com/shirou/gopsutil/cpu/cpu.go",
"chars": 2239,
"preview": "package cpu\n\nimport (\n\t\"encoding/json\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype CPUTimesStat struct {\n\tCPU string "
},
{
"path": "vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go",
"chars": 2488,
"preview": "// +build darwin\n\npackage cpu\n\nimport (\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// sys/resource.h\nconst (\n\tCPUser = 0\n\tCP"
},
{
"path": "vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go",
"chars": 2733,
"preview": "// +build darwin\n// +build cgo\n\npackage cpu\n\n/*\n#include <stdlib.h>\n#include <sys/sysctl.h>\n#include <sys/mount.h>\n#incl"
},
{
"path": "vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_nocgo.go",
"chars": 300,
"preview": "// +build darwin\n// +build !cgo\n\npackage cpu\n\nimport \"github.com/shirou/gopsutil/internal/common\"\n\nfunc perCPUTimes() (["
},
{
"path": "vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go",
"chars": 3366,
"preview": "// +build freebsd\n\npackage cpu\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/shirou/gopsutil"
},
{
"path": "vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go",
"chars": 5301,
"preview": "// +build linux\n\npackage cpu\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/shirou/gopsutil/i"
},
{
"path": "vendor/github.com/shirou/gopsutil/cpu/cpu_unix.go",
"chars": 1220,
"preview": "// +build linux freebsd darwin\n\npackage cpu\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\nfunc CPUPercent(interval time.Duration, percpu b"
},
{
"path": "vendor/github.com/shirou/gopsutil/cpu/cpu_windows.go",
"chars": 2460,
"preview": "// +build windows\n\npackage cpu\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n\n\t\"github.com/StackExchange/wmi\"\n\n\t\"github."
},
{
"path": "vendor/github.com/shirou/gopsutil/doc.go",
"chars": 17,
"preview": "package gopsutil\n"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/host.go",
"chars": 1123,
"preview": "package host\n\nimport (\n\t\"encoding/json\"\n)\n\n// A HostInfoStat describes the host status.\n// This is not in the psutil but"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/host_darwin.go",
"chars": 2729,
"preview": "// +build darwin\n\npackage host\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strconv\""
},
{
"path": "vendor/github.com/shirou/gopsutil/host/host_darwin_amd64.go",
"chars": 318,
"preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_darwin.go\n\npackage host\n\ntype Utmpx struct {\n\tUser [25"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/host_freebsd.go",
"chars": 3748,
"preview": "// +build freebsd\n\npackage host\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strconv"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/host_freebsd_amd64.go",
"chars": 591,
"preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_freebsd.go\n\npackage host\n\nconst (\n\tsizeofPtr = 0x8\n\tsi"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/host_linux.go",
"chars": 9801,
"preview": "// +build linux\n\npackage host\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"run"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/host_linux_386.go",
"chars": 758,
"preview": "// ATTENTION - FILE MANUAL FIXED AFTER CGO.\n// Fixed line: Tv\t\t_Ctype_struct_timeval -> Tv\t\tUtTv\n// Created by cgo -gode"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/host_linux_amd64.go",
"chars": 757,
"preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage host\n\nconst (\n\tsizeofPtr = 0x8\n\tsize"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/host_linux_arm.go",
"chars": 717,
"preview": "// +build linux\n// +build arm\n\npackage host\n\nconst (\n\tsizeofPtr = 0x8\n\tsizeofShort = 0x2\n\tsizeofInt = 0x4\n\t"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/host_windows.go",
"chars": 2351,
"preview": "// +build windows\n\npackage host\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/StackExchange/wmi\"\n\n\t"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/types_darwin.go",
"chars": 211,
"preview": "// +build ignore\n// plus hand editing about timeval\n\n/*\nInput to cgo -godefs.\n*/\n\npackage host\n\n/*\n#include <sys/time.h>"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/types_freebsd.go",
"chars": 612,
"preview": "// +build ignore\n\n/*\nInput to cgo -godefs.\n*/\n\npackage host\n\n/*\n#define KERNEL\n#include <sys/types.h>\n#include <sys/time"
},
{
"path": "vendor/github.com/shirou/gopsutil/host/types_linux.go",
"chars": 620,
"preview": "// +build ignore\n\n/*\nInput to cgo -godefs.\n*/\n\npackage host\n\n/*\n#define KERNEL\n#include <sys/types.h>\n#include <utmp.h>\n"
},
{
"path": "vendor/github.com/shirou/gopsutil/internal/common/binary.go",
"chars": 15368,
"preview": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license"
},
{
"path": "vendor/github.com/shirou/gopsutil/internal/common/common.go",
"chars": 5630,
"preview": "//\n// gopsutil is a port of psutil(http://pythonhosted.org/psutil/).\n// This covers these architectures.\n// - linux (am"
},
{
"path": "vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go",
"chars": 1165,
"preview": "// +build darwin\n\npackage common\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc DoSysctrl(mib string"
},
{
"path": "vendor/github.com/shirou/gopsutil/internal/common/common_freebsd.go",
"chars": 1163,
"preview": "// +build freebsd\n\npackage common\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc DoSysctrl(mib strin"
},
{
"path": "vendor/github.com/shirou/gopsutil/internal/common/common_linux.go",
"chars": 32,
"preview": "// +build linux\n\npackage common\n"
},
{
"path": "vendor/github.com/shirou/gopsutil/internal/common/common_unix.go",
"chars": 1372,
"preview": "// +build linux freebsd darwin\n\npackage common\n\nimport (\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc CallLsof(invoke Invoke"
},
{
"path": "vendor/github.com/shirou/gopsutil/internal/common/common_windows.go",
"chars": 2617,
"preview": "// +build windows\n\npackage common\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// for double values\ntype PDH_FMT_COUNTERVALUE_DOUBL"
},
{
"path": "vendor/github.com/shirou/gopsutil/mem/mem.go",
"chars": 918,
"preview": "package mem\n\nimport (\n\t\"encoding/json\"\n)\n\ntype VirtualMemoryStat struct {\n\tTotal uint64 `json:\"total\"`\n\tAvailable"
},
{
"path": "vendor/github.com/shirou/gopsutil/mem/mem_darwin.go",
"chars": 3238,
"preview": "// +build darwin\n\npackage mem\n\nimport (\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/shirou/gopsutil/internal/common\"\n"
},
{
"path": "vendor/github.com/shirou/gopsutil/mem/mem_freebsd.go",
"chars": 2773,
"preview": "// +build freebsd\n\npackage mem\n\nimport (\n\t\"errors\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/shirou/gopsutil/intern"
},
{
"path": "vendor/github.com/shirou/gopsutil/mem/mem_linux.go",
"chars": 2173,
"preview": "// +build linux\n\npackage mem\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/shirou/gopsutil/internal/common\"\n)"
},
{
"path": "vendor/github.com/shirou/gopsutil/mem/mem_windows.go",
"chars": 1096,
"preview": "// +build windows\n\npackage mem\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/shirou/gopsutil/internal/common\"\n)\n\nvar (\n\tp"
},
{
"path": "vendor/github.com/shirou/gopsutil/mktypes.sh",
"chars": 596,
"preview": "\nDIRS=\"cpu disk docker host load mem net process\"\n\nGOOS=`uname | tr '[:upper:]' '[:lower:]'`\nARCH=`uname -m`\n\ncase $ARCH"
},
{
"path": "vendor/github.com/shirou/gopsutil/net/net.go",
"chars": 6013,
"preview": "package net\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/shirou/gopsutil/inte"
},
{
"path": "vendor/github.com/shirou/gopsutil/net/net_darwin.go",
"chars": 2936,
"preview": "// +build darwin\n\npackage net\n\nimport (\n\t\"errors\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/shirou/gopsutil/interna"
},
{
"path": "vendor/github.com/shirou/gopsutil/net/net_freebsd.go",
"chars": 2427,
"preview": "// +build freebsd\n\npackage net\n\nimport (\n\t\"errors\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/shirou/gopsutil/intern"
},
{
"path": "vendor/github.com/shirou/gopsutil/net/net_linux.go",
"chars": 4625,
"preview": "// +build linux\n\npackage net\n\nimport (\n\t\"errors\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/shirou/gopsutil/internal/common\"\n)\n"
},
{
"path": "vendor/github.com/shirou/gopsutil/net/net_unix.go",
"chars": 1302,
"preview": "// +build linux freebsd darwin\n\npackage net\n\nimport (\n\t\"strings\"\n\n\t\"github.com/shirou/gopsutil/internal/common\"\n)\n\n// Re"
},
{
"path": "vendor/github.com/shirou/gopsutil/net/net_windows.go",
"chars": 2970,
"preview": "// +build windows\n\npackage net\n\nimport (\n\t\"errors\"\n\t\"net\"\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/shirou/gopsutil/inter"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process.go",
"chars": 3399,
"preview": "package process\n\nimport (\n\t\"encoding/json\"\n\t\"runtime\"\n\t\"time\"\n\n\t\"github.com/shirou/gopsutil/cpu\"\n\t\"github.com/shirou/gop"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process_darwin.go",
"chars": 9491,
"preview": "// +build darwin\n\npackage process\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscal"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process_darwin_amd64.go",
"chars": 3598,
"preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_darwin.go\n\npackage process\n\nconst (\n\tsizeofPtr = 0x8\n\t"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process_freebsd.go",
"chars": 6459,
"preview": "// +build freebsd\n\npackage process\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"strings\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\tcpu \"github.c"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process_freebsd_386.go",
"chars": 2624,
"preview": "// +build freebsd\n// +build 386\n\npackage process\n\n// copied from sys/sysctl.h\nconst (\n\tCTLKern = 1 // \"high ke"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process_freebsd_amd64.go",
"chars": 2628,
"preview": "// +build freebsd\n// +build amd64\npackage process\n\n// copied from sys/sysctl.h\nconst (\n\tCTLKern = 1 // \"high k"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process_linux.go",
"chars": 15656,
"preview": "// +build linux\n\npackage process\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strco"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process_linux_386.go",
"chars": 154,
"preview": "// +build linux\n// +build 386\n\npackage process\n\nconst (\n\tClockTicks = 100 // C.sysconf(C._SC_CLK_TCK)\n\tPageSize = 409"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process_linux_amd64.go",
"chars": 156,
"preview": "// +build linux\n// +build amd64\n\npackage process\n\nconst (\n\tClockTicks = 100 // C.sysconf(C._SC_CLK_TCK)\n\tPageSize = 4"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process_linux_arm.go",
"chars": 154,
"preview": "// +build linux\n// +build arm\n\npackage process\n\nconst (\n\tClockTicks = 100 // C.sysconf(C._SC_CLK_TCK)\n\tPageSize = 409"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process_posix.go",
"chars": 1964,
"preview": "// +build linux freebsd darwin\n\npackage process\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"os/user\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n)"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/process_windows.go",
"chars": 8573,
"preview": "// +build windows\n\npackage process\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n\n\t\"github.com/StackExchange/w"
},
{
"path": "vendor/github.com/shirou/gopsutil/process/types_darwin.go",
"chars": 3003,
"preview": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "vendor/github.com/shirou/gopsutil/windows_memo.rst",
"chars": 646,
"preview": "Windows memo\n=====================\n\nSize\n----------\n\nDWORD\n 32-bit unsigned integer\nDWORDLONG\n 64-bit unsigned integer"
},
{
"path": "vendor/github.com/shirou/w32/AUTHORS",
"chars": 434,
"preview": "# This is the official list of 'w32' authors for copyright purposes.\n\n# Names should be added to this file as\n# Name o"
},
{
"path": "vendor/github.com/shirou/w32/LICENSE",
"chars": 1404,
"preview": "Copyright (c) 2010-2012 The w32 Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with o"
},
{
"path": "vendor/github.com/shirou/w32/README.md",
"chars": 873,
"preview": "About w32\n==========\n\nw32 is a wrapper of windows apis for the Go Programming Language.\n\nIt wraps win32 apis to \"Go styl"
},
{
"path": "vendor/github.com/shirou/w32/advapi32.go",
"chars": 7450,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/comctl32.go",
"chars": 2695,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/comdlg32.go",
"chars": 862,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/constants.go",
"chars": 72984,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/dwmapi.go",
"chars": 8493,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/gdi32.go",
"chars": 13132,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/gdiplus.go",
"chars": 4910,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/idispatch.go",
"chars": 1047,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/istream.go",
"chars": 669,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/iunknown.go",
"chars": 566,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/kernel32.go",
"chars": 8385,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/ole32.go",
"chars": 1523,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/oleaut32.go",
"chars": 1271,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/opengl32.go",
"chars": 1576,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/psapi.go",
"chars": 560,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/shell32.go",
"chars": 4315,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/typedef.go",
"chars": 23591,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/user32.go",
"chars": 24844,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/utils.go",
"chars": 5961,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor/github.com/shirou/w32/vars.go",
"chars": 807,
"preview": "// Copyright 2010-2012 The W32 Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// li"
},
{
"path": "vendor.yml",
"chars": 92,
"preview": "vendors:\n- path: github.com/shirou/gopsutil\n rev: 3166d415382aa5bbd8bb151cc50a756730cd5ec4\n"
}
]
About this extraction
This page contains the full source code of the go-playground/stats GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 150 files (491.2 KB), approximately 157.1k tokens, and a symbol index with 3617 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.