From 15f7946fcb288a213cb59d967bec90793ec704c1 Mon Sep 17 00:00:00 2001 From: Jason Newman Date: Thu, 11 Jan 2024 13:04:15 -0700 Subject: [PATCH] Windows, read all pids if there are more than 1024 pids. Convert bytes read to number of uint32s that were read. --- process/process_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process/process_windows.go b/process/process_windows.go index 14ed0309f..f2053d985 100644 --- a/process/process_windows.go +++ b/process/process_windows.go @@ -253,7 +253,7 @@ func pidsWithContext(ctx context.Context) ([]int32, error) { if err := windows.EnumProcesses(ps, &read); err != nil { return nil, err } - if uint32(len(ps)) == read { // ps buffer was too small to host every results, retry with a bigger one + if uint32(len(ps)) == read/dwordSize { // ps buffer was too small to host every results, retry with a bigger one psSize += 1024 continue }