1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-24 13:48:56 +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:
shirou 2024-01-19 22:35:54 +09:00 committed by GitHub
commit e912ebde7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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