Repository navigation
Return every process instead of stopping at 1024 - #101
Open
Johnny Hunter (hackyhunter) wants to merge 1 commit into
Open
Johnny Hunter (hackyhunter) wants to merge 1 commit into
Johnny Hunter (hackyhunter) wants to merge 1 commit into
Conversation
GetRawProcessList stopped reading the toolhelp snapshot after 1024 processes. The limit protected the fixed-size process_info array (592c945, microsoft#9). Since microsoft#67 the list is a std::vector that grows with push_back, so the limit no longer prevents an overflow and only drops processes. The snapshot lists them in creation order, so the ones dropped are the newest: a process the caller just started and its children.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #100
GetRawProcessListstopped after 1024 processes. The limit was there to protect the fixed-sizeprocess_infoarray (592c945, #9). Since #67, the list is astd::vectorthat grows withpush_back, so the limit no longer guards against anything. It only drops processes, and the ones it drops are the newest. This change removes it.Testing
On Windows 11 with Node 22:
ping.exeprocesses started just before the call:npm testpasses, 32 tests, in each of 3 runs.The limit itself has no automated test, because exercising it needs more than 1024 live processes on the runner.