Documentation
¶
Index ¶
- Constants
- func GetTokenByPid(pid int) (syscall.Token, error)
- func GetTokenByProcessName(name string) (syscall.Token, error)
- func RunCommandByProcess(processName string, cmd *exec.Cmd) (string, error)
- func RunCommandByToken(token syscall.Token, cmd *exec.Cmd) ([]byte, error)
- type PROCESSENTRY32
- type Process
- type WindowsProcess
Constants ¶
View Source
const ( ERROR_NO_MORE_FILES = 0x12 MAX_PATH = 260 )
Some constants from the Windows API
Variables ¶
This section is empty.
Functions ¶
func GetTokenByProcessName ¶ added in v0.0.7
func RunCommandByProcess ¶ added in v0.0.7
Types ¶
type PROCESSENTRY32 ¶
type PROCESSENTRY32 struct { Size uint32 CntUsage uint32 ProcessID uint32 DefaultHeapID uintptr ModuleID uint32 CntThreads uint32 ParentProcessID uint32 PriorityClassBase int32 Flags uint32 ExeFile [MAX_PATH]uint16 }
PROCESSENTRY32 is the Windows API structure that contains a process's information.
type Process ¶
type Process interface { // Pid is the process ID for this process. Pid() int // PPid is the parent process ID for this process. PPid() int // Executable name running this process. This is not a path to the // executable. Executable() string }
func FindProcess ¶
func FindProcessByName ¶ added in v0.0.7
type WindowsProcess ¶
type WindowsProcess struct {
// contains filtered or unexported fields
}
WindowsProcess is an implementation of Process for Windows.
func (*WindowsProcess) Executable ¶
func (p *WindowsProcess) Executable() string
func (*WindowsProcess) PPid ¶
func (p *WindowsProcess) PPid() int
func (*WindowsProcess) Pid ¶
func (p *WindowsProcess) Pid() int
Click to show internal directories.
Click to hide internal directories.