-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
OpenProcess : change logic when requesting PROCESS_QUERY_INFORMATION which fails for protected processes (win 8+) #1372
Conversation
…which fails for protected processes (win 8+)
Uhm... this may be very good in principle as it would allow collecting info for more processes which right now raise Note: could you please limit lines length to 80 chars per line? Thanks. |
I'm experimenting with this. Here's my findings. I wrote a script which calls psutil_proc_cpu_times() directly against all process PIDs:
...so it seems using |
Note: could you please limit lines length to 80 chars per line? Thanks. As per your concerns, from my experience, the various checks are performed only when getting a handle with specific rights, not when actually getting the data from a function or syscall. On a "normal" process, On protected processes, The "fallback" mechanism written here is only meant for those situations and is normally triggered only for protected processes
You can get details here : https://docs.microsoft.com/en-us/windows/desktop/procthread/process-security-and-access-rights But this page can be misleading : I succeeded in opening |
I opted making a brand new PR (#1376) which:
I preferred to do it this way so that it is clear what access right is being used in every function. |
I integrated your changes regarding the |
without this change, getting some fields (username(), nice(), ..) on protected processes fails due to requesting too much rights (PROCESS_QUERY_INFORMATION instead of PROCESS_QUERY_LIMITED_INFORMATION)