Skip to content

Commit

Permalink
Windows, read all pids if there are more than 1024 pids.
Browse files Browse the repository at this point in the history
Convert bytes read to number of uint32s that were read.
  • Loading branch information
jnewmano authored Jan 11, 2024
1 parent df3c7bd commit 15f7946
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion process/process_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 15f7946

Please sign in to comment.