diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2015-07-09 11:43:48 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2015-07-09 11:43:48 +0200 |
commit | 192aa78c90253bede27b2745d4e80aeed79a3aef (patch) | |
tree | 3288344a8695ac4fd53162546fb051229c921e4d /psutil/_psutil_windows.c | |
parent | a6cb7f927f40bd129f31493c37dfe7d0d6f6a070 (diff) | |
parent | 73f54f47a7d4eac329c27af71c7fc5ad432d2e84 (diff) | |
download | psutil-get_open_files_thread.tar.gz |
Merge branch 'master' into get_open_files_threadget_open_files_thread
Diffstat (limited to 'psutil/_psutil_windows.c')
-rw-r--r-- | psutil/_psutil_windows.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c index 9a4c0944..b05db820 100644 --- a/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c @@ -2683,6 +2683,19 @@ psutil_proc_num_handles(PyObject *self, PyObject *args) } +/* + * Get various process information by using NtQuerySystemInformation. + * We use this as a fallback when faster functions fail with access + * denied. This is slower because it iterates over all processes. + * Returned tuple includes the following process info: + * + * - num_threads + * - ctx_switches + * - num_handles (fallback) + * - user/kernel times (fallback) + * - create time (fallback) + * - io counters (fallback) + */ static PyObject * psutil_proc_info(PyObject *self, PyObject *args) { @@ -3180,7 +3193,7 @@ PsutilMethods[] = "seconds since the epoch"}, {"proc_memory_info", psutil_proc_memory_info, METH_VARARGS, "Return a tuple of process memory information"}, - {"proc_memory_info_2", psutil_proc_memory_info, METH_VARARGS, + {"proc_memory_info_2", psutil_proc_memory_info_2, METH_VARARGS, "Alternate implementation"}, {"proc_cwd", psutil_proc_cwd, METH_VARARGS, "Return process current working directory"}, @@ -3387,4 +3400,4 @@ void init_psutil_windows(void) #if PY_MAJOR_VERSION >= 3 return module; #endif -}
\ No newline at end of file +} |