Windows, read all pids if there are more than 1024 pids.

Convert bytes read to number of uint32s that were read.
pull/1580/head
Jason Newman 1 year ago committed by GitHub
parent df3c7bdec0
commit 15f7946fcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
}

Loading…
Cancel
Save