-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Process Listing and Attach by PID to Autosplitting API #721
Conversation
Some early thoughts:
|
I'll get to making modifications soon |
I've made some changes locally, let me push them first. I'll get to it after work. |
Hey, I wanted to double check the status of this. Have you made more progress on that work? |
… API This allows for users to list all process pids matching a name and then attach to processes using those pids for when custom picking logic is needed for processes.
…y converting u32 pid to Pid type
c2ab4d9
to
6ecc4f0
Compare
Alright, I made all these changes. The PID is u64 now, just to be safe. And an error is still returned in case process listing would return an error (which also is just to be safe, because |
6ecc4f0
to
cbe2a34
Compare
cbe2a34
to
84472e0
Compare
Adds two functions: `Process::attach_by_pid` attaches to a process by referencing its PID. `Process::list_by_name` / `Process::list_by_name_into` lists all PIDs associated with processes with the name passed in. Together, these allow an autosplitter to define its own logic for discovering and attaching to processes. Sometimes start time or largest PID don't quite get the right process. For example, Tony Hawk's Pro Skater 1+2 has a bootstrap and game process, both with the same name. They start in the same second, so the regular `Process::attach` logic often selects the incorrect process. This pull request allows an author to check each process closer to determine which one is desired. (rather messy) example of usage here: https://github.com/PARTYMANX/thps-autosplitter/blob/thps12-disambiguate/src/lib.rs#L19 Companion pull request to LiveSplit/livesplit-core#721. Solves #50. Co-authored-by: Christopher Serr <[email protected]>
Adds two functions to the API:
process_attach_pid
attaches to a process by referencing its PID.process_list
lists all PIDs associated with processes with the name passed in.Together, these allow an autosplitter to define its own logic for discovering and attaching to processes.
Sometimes start time or largest PID don't quite get the right process. For example, Tony Hawk's Pro Skater 1+2 has a bootstrap and game process, both with the same name. They start in the same second, so the regular
process_attach
logic often selects the incorrect process. This pull request allows an author to check each process closer to determine which one is desired.