utils

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MB_OK                = 0x00000000
	MB_OKCANCEL          = 0x00000001
	MB_ABORTRETRYIGNORE  = 0x00000002
	MB_YESNOCANCEL       = 0x00000003
	MB_YESNO             = 0x00000004
	MB_RETRYCANCEL       = 0x00000005
	MB_CANCELTRYCONTINUE = 0x00000006
	MB_ICONHAND          = 0x00000010
	MB_ICONQUESTION      = 0x00000020
	MB_ICONEXCLAMATION   = 0x00000030
	MB_ICONASTERISK      = 0x00000040
	MB_USERICON          = 0x00000080
	MB_ICONWARNING       = MB_ICONEXCLAMATION
	MB_ICONERROR         = MB_ICONHAND
	MB_ICONINFORMATION   = MB_ICONASTERISK
	MB_ICONSTOP          = MB_ICONHAND

	MB_DEFBUTTON1 = 0x00000000
	MB_DEFBUTTON2 = 0x00000100
	MB_DEFBUTTON3 = 0x00000200
	MB_DEFBUTTON4 = 0x00000300

	IDOK     = 1
	IDCANCEL = 2
	IDABORT  = 3
	IDRETRY  = 4
	IDIGNORE = 5
	IDYES    = 6
	IDNO     = 7
)
View Source
const (
	PROCESS_CREATE = iota
	PROCESS_DELETE
	PROCESS_MODIFY
	PROCESS_ERROR
)
View Source
const (
	HyperVServiceRegPath = `SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\GuestCommunicationServices`
)

Variables

View Source
var HyperVServiceGUID = winio.VsockServiceID(servicePort)

Functions

func CheckHVService added in v1.1.0

func CheckHVService() bool

func CheckHvSocket added in v1.1.2

func CheckHvSocket() bool

func CheckSCardSvrStatus added in v1.1.4

func CheckSCardSvrStatus() (bool, error)

func ConnectHyperV added in v1.1.0

func ConnectHyperV() (net.Conn, error)

func GetDefaultSID

func GetDefaultSID() (*windows.SID, error)

func GetHandleSID

func GetHandleSID(h windows.Handle) (*windows.SID, error)

func GetUserSID

func GetUserSID() (*windows.SID, error)

func GetVMIDs added in v1.1.7

func GetVMIDs() []string

func IsAdmin added in v1.1.0

func IsAdmin() bool

func MessageBox

func MessageBox(title, text string, style uintptr) int

func NewPageant

func NewPageant(debug bool) (*pageantWindow, error)

func Notify

func Notify(title, message string)

func OpenFileMapping

func OpenFileMapping(dwDesiredAccess uint32, bInheritHandle uintptr, mapNamePtr uintptr) (windows.Handle, error)

func RandomString added in v1.1.7

func RandomString(n int) string

func RegisterNotifier

func RegisterNotifier(n notify.Notifier)

func RunMeElevated added in v1.1.0

func RunMeElevated() error

func RunMeElevatedWithArgs added in v1.1.0

func RunMeElevatedWithArgs(args string) error

func SetClipBoard

func SetClipBoard(text string) error

func SetFileAttributes

func SetFileAttributes(path string, attr uint32) error

func SetListenerDeadline

func SetListenerDeadline(l net.Listener, t time.Time) error

func SetProcessSystemDpiAware added in v1.1.4

func SetProcessSystemDpiAware() error

func SetWindowLong added in v1.1.7

func SetWindowLong(hWnd windows.Handle, index, value uintptr) int32

func StartSCardSvr added in v1.1.4

func StartSCardSvr() error

func UUIDToString

func UUIDToString(uuid [16]byte) string

Types

type ProcessEvent added in v1.1.7

type ProcessEvent struct {
	Type        int
	Error       error
	TimeStamp   uint64
	ProcessId   uint32
	Name        string
	CommandLine string
}

type ProcessNotify added in v1.1.7

type ProcessNotify struct {
	// contains filtered or unexported fields
}

func NewProcessNotify added in v1.1.7

func NewProcessNotify(name string, ch chan<- *ProcessEvent) (*ProcessNotify, error)

func (*ProcessNotify) Start added in v1.1.7

func (s *ProcessNotify) Start()

func (*ProcessNotify) Stop added in v1.1.7

func (s *ProcessNotify) Stop()

type XAgent added in v1.1.7

type XAgent struct {
	// contains filtered or unexported fields
}

func NewXAgent added in v1.1.7

func NewXAgent(cookie string) (*XAgent, error)

func (*XAgent) Close added in v1.1.7

func (s *XAgent) Close()

func (*XAgent) Listener added in v1.1.7

func (s *XAgent) Listener() net.Listener

Jump to

Keyboard shortcuts

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