mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-26 13:48:59 +08:00
Merge pull request #1580 from jnewmano/patch-1
Windows, read all PIDs if there are more than 1024 PIDs.
This commit is contained in:
commit
e912ebde7a
@ -253,7 +253,7 @@ func pidsWithContext(ctx context.Context) ([]int32, error) {
|
|||||||
if err := windows.EnumProcesses(ps, &read); err != nil {
|
if err := windows.EnumProcesses(ps, &read); err != nil {
|
||||||
return nil, err
|
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
|
psSize += 1024
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user