From a5ace91ccec87b4604f36faf80567ec7ef25c0b9 Mon Sep 17 00:00:00 2001 From: Lomanic Date: Thu, 20 Dec 2018 23:41:38 +0100 Subject: [PATCH] [process][windows] Propagate context internally --- process/process_windows.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/process/process_windows.go b/process/process_windows.go index 19ddc57..d64a056 100644 --- a/process/process_windows.go +++ b/process/process_windows.go @@ -190,7 +190,7 @@ func (p *Process) ExeWithContext(ctx context.Context) (string, error) { } } } - dst, err := GetWin32Proc(p.Pid) + dst, err := GetWin32ProcWithContext(ctx, p.Pid) if err != nil { return "", fmt.Errorf("could not get ExecutablePath: %s", err) } @@ -202,7 +202,7 @@ func (p *Process) Cmdline() (string, error) { } func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { - dst, err := GetWin32Proc(p.Pid) + dst, err := GetWin32ProcWithContext(ctx, p.Pid) if err != nil { return "", fmt.Errorf("could not get CommandLine: %s", err) } @@ -217,7 +217,7 @@ func (p *Process) CmdlineSlice() ([]string, error) { } func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { - cmdline, err := p.Cmdline() + cmdline, err := p.CmdlineWithContext(ctx) if err != nil { return nil, err } @@ -331,7 +331,7 @@ func (p *Process) Nice() (int32, error) { } func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { - dst, err := GetWin32Proc(p.Pid) + dst, err := GetWin32ProcWithContext(ctx, p.Pid) if err != nil { return 0, fmt.Errorf("could not get Priority: %s", err) } @@ -368,7 +368,7 @@ func (p *Process) IOCounters() (*IOCountersStat, error) { } func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { - dst, err := GetWin32Proc(p.Pid) + dst, err := GetWin32ProcWithContext(ctx, p.Pid) if err != nil || len(dst) == 0 { return nil, fmt.Errorf("could not get Win32Proc: %s", err) } @@ -400,7 +400,7 @@ func (p *Process) NumThreads() (int32, error) { } func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { - dst, err := GetWin32Proc(p.Pid) + dst, err := GetWin32ProcWithContext(ctx, p.Pid) if err != nil { return 0, fmt.Errorf("could not get ThreadCount: %s", err) }