|
|
|
@ -51,7 +51,7 @@ type Win32_Process struct {
|
|
|
|
|
CommandLine *string
|
|
|
|
|
Priority uint32
|
|
|
|
|
CreationDate *time.Time
|
|
|
|
|
ProcessId uint32
|
|
|
|
|
ProcessID uint32
|
|
|
|
|
ThreadCount uint32
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -71,7 +71,7 @@ type Win32_Process struct {
|
|
|
|
|
OtherTransferCount uint64
|
|
|
|
|
PageFaults uint32
|
|
|
|
|
PageFileUsage uint32
|
|
|
|
|
ParentProcessId uint32
|
|
|
|
|
ParentProcessID uint32
|
|
|
|
|
PeakPageFileUsage uint32
|
|
|
|
|
PeakVirtualSize uint64
|
|
|
|
|
PeakWorkingSetSize uint32
|
|
|
|
@ -167,28 +167,28 @@ func (p *Process) CreateTime() (int64, error) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) Cwd() (string, error) {
|
|
|
|
|
return "", common.NotImplementedError
|
|
|
|
|
return "", common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Parent() (*Process, error) {
|
|
|
|
|
return p, common.NotImplementedError
|
|
|
|
|
return p, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Status() (string, error) {
|
|
|
|
|
return "", common.NotImplementedError
|
|
|
|
|
return "", common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Username() (string, error) {
|
|
|
|
|
return "", common.NotImplementedError
|
|
|
|
|
return "", common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Uids() ([]int32, error) {
|
|
|
|
|
var uids []int32
|
|
|
|
|
|
|
|
|
|
return uids, common.NotImplementedError
|
|
|
|
|
return uids, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Gids() ([]int32, error) {
|
|
|
|
|
var gids []int32
|
|
|
|
|
return gids, common.NotImplementedError
|
|
|
|
|
return gids, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Terminal() (string, error) {
|
|
|
|
|
return "", common.NotImplementedError
|
|
|
|
|
return "", common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Nice returnes priority in Windows
|
|
|
|
@ -200,21 +200,21 @@ func (p *Process) Nice() (int32, error) {
|
|
|
|
|
return int32(dst[0].Priority), nil
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) IOnice() (int32, error) {
|
|
|
|
|
return 0, common.NotImplementedError
|
|
|
|
|
return 0, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Rlimit() ([]RlimitStat, error) {
|
|
|
|
|
var rlimit []RlimitStat
|
|
|
|
|
|
|
|
|
|
return rlimit, common.NotImplementedError
|
|
|
|
|
return rlimit, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) IOCounters() (*IOCountersStat, error) {
|
|
|
|
|
return nil, common.NotImplementedError
|
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) {
|
|
|
|
|
return nil, common.NotImplementedError
|
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) NumFDs() (int32, error) {
|
|
|
|
|
return 0, common.NotImplementedError
|
|
|
|
|
return 0, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) NumThreads() (int32, error) {
|
|
|
|
|
dst, err := GetWin32Proc(p.Pid)
|
|
|
|
@ -225,44 +225,44 @@ func (p *Process) NumThreads() (int32, error) {
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Threads() (map[string]string, error) {
|
|
|
|
|
ret := make(map[string]string, 0)
|
|
|
|
|
return ret, common.NotImplementedError
|
|
|
|
|
return ret, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Times() (*cpu.TimesStat, error) {
|
|
|
|
|
return nil, common.NotImplementedError
|
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) CPUAffinity() ([]int32, error) {
|
|
|
|
|
return nil, common.NotImplementedError
|
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) MemoryInfo() (*MemoryInfoStat, error) {
|
|
|
|
|
return nil, common.NotImplementedError
|
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) {
|
|
|
|
|
return nil, common.NotImplementedError
|
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) Children() ([]*Process, error) {
|
|
|
|
|
return nil, common.NotImplementedError
|
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) OpenFiles() ([]OpenFilesStat, error) {
|
|
|
|
|
return nil, common.NotImplementedError
|
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) Connections() ([]net.ConnectionStat, error) {
|
|
|
|
|
return nil, common.NotImplementedError
|
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) {
|
|
|
|
|
return nil, common.NotImplementedError
|
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) IsRunning() (bool, error) {
|
|
|
|
|
return true, common.NotImplementedError
|
|
|
|
|
return true, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) {
|
|
|
|
|
ret := make([]MemoryMapsStat, 0)
|
|
|
|
|
return &ret, common.NotImplementedError
|
|
|
|
|
var ret []MemoryMapsStat
|
|
|
|
|
return &ret, common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewProcess(pid int32) (*Process, error) {
|
|
|
|
@ -272,20 +272,20 @@ func NewProcess(pid int32) (*Process, error) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) SendSignal(sig syscall.Signal) error {
|
|
|
|
|
return common.NotImplementedError
|
|
|
|
|
return common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) Suspend() error {
|
|
|
|
|
return common.NotImplementedError
|
|
|
|
|
return common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Resume() error {
|
|
|
|
|
return common.NotImplementedError
|
|
|
|
|
return common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Terminate() error {
|
|
|
|
|
return common.NotImplementedError
|
|
|
|
|
return common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
func (p *Process) Kill() error {
|
|
|
|
|
return common.NotImplementedError
|
|
|
|
|
return common.ErrNotImplementedError
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) getFromSnapProcess(pid int32) (int32, int32, string, error) {
|
|
|
|
@ -328,7 +328,7 @@ func processes() ([]*Process, error) {
|
|
|
|
|
}
|
|
|
|
|
results := make([]*Process, 0, len(dst))
|
|
|
|
|
for _, proc := range dst {
|
|
|
|
|
p, err := NewProcess(int32(proc.ProcessId))
|
|
|
|
|
p, err := NewProcess(int32(proc.ProcessID))
|
|
|
|
|
if err != nil {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|