OLD | NEW |
1 /* | 1 /* |
2 * $Id: _psutil_mswindows.h 778 2010-11-08 19:59:08Z g.rodola $ | 2 * $Id: _psutil_mswindows.h 1142 2011-10-05 18:45:49Z g.rodola $ |
| 3 * |
| 4 * Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved. |
| 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. |
3 * | 7 * |
4 * Windows platform-specific module methods for _psutil_mswindows | 8 * Windows platform-specific module methods for _psutil_mswindows |
5 * | |
6 */ | 9 */ |
7 | 10 |
8 #include <Python.h> | 11 #include <Python.h> |
9 #include <windows.h> | 12 #include <windows.h> |
10 | 13 |
11 // --- per-process functions | 14 // --- per-process functions |
12 | 15 |
13 static PyObject* kill_process(PyObject* self, PyObject* args); | 16 static PyObject* kill_process(PyObject* self, PyObject* args); |
14 static PyObject* get_process_name(PyObject* self, PyObject* args); | 17 static PyObject* get_process_name(PyObject* self, PyObject* args); |
15 static PyObject* get_process_cmdline(PyObject* self, PyObject* args); | 18 static PyObject* get_process_cmdline(PyObject* self, PyObject* args); |
16 static PyObject* get_process_ppid(PyObject* self, PyObject* args); | 19 static PyObject* get_process_ppid(PyObject* self, PyObject* args); |
17 static PyObject* get_process_cpu_times(PyObject* self, PyObject* args); | 20 static PyObject* get_process_cpu_times(PyObject* self, PyObject* args); |
18 static PyObject* get_process_create_time(PyObject* self, PyObject* args); | 21 static PyObject* get_process_create_time(PyObject* self, PyObject* args); |
19 static PyObject* get_memory_info(PyObject* self, PyObject* args); | 22 static PyObject* get_memory_info(PyObject* self, PyObject* args); |
20 static PyObject* get_process_cwd(PyObject* self, PyObject* args); | 23 static PyObject* get_process_cwd(PyObject* self, PyObject* args); |
21 static PyObject* suspend_process(PyObject* self, PyObject* args); | 24 static PyObject* suspend_process(PyObject* self, PyObject* args); |
22 static PyObject* resume_process(PyObject* self, PyObject* args); | 25 static PyObject* resume_process(PyObject* self, PyObject* args); |
23 static PyObject* get_process_open_files(PyObject* self, PyObject* args); | 26 static PyObject* get_process_open_files(PyObject* self, PyObject* args); |
24 static PyObject* get_process_username(PyObject* self, PyObject* args); | 27 static PyObject* get_process_username(PyObject* self, PyObject* args); |
25 static PyObject* get_process_connections(PyObject* self, PyObject* args); | 28 static PyObject* get_process_connections(PyObject* self, PyObject* args); |
26 static PyObject* get_process_num_threads(PyObject* self, PyObject* args); | 29 static PyObject* get_process_num_threads(PyObject* self, PyObject* args); |
| 30 static PyObject* get_process_threads(PyObject* self, PyObject* args); |
| 31 static PyObject* process_wait(PyObject* self, PyObject* args); |
| 32 static PyObject* get_process_priority(PyObject* self, PyObject* args); |
| 33 static PyObject* set_process_priority(PyObject* self, PyObject* args); |
| 34 static PyObject* get_process_io_counters(PyObject* self, PyObject* args); |
| 35 static PyObject* is_process_suspended(PyObject* self, PyObject* args); |
27 | 36 |
28 // --- system-related functions | 37 // --- system-related functions |
29 | 38 |
30 static PyObject* get_pid_list(PyObject* self, PyObject* args); | 39 static PyObject* get_pid_list(PyObject* self, PyObject* args); |
31 static PyObject* get_num_cpus(PyObject* self, PyObject* args); | 40 static PyObject* get_num_cpus(PyObject* self, PyObject* args); |
32 static PyObject* get_system_uptime(PyObject* self, PyObject* args); | 41 static PyObject* get_system_uptime(PyObject* self, PyObject* args); |
33 static PyObject* get_total_phymem(PyObject* self, PyObject* args); | 42 static PyObject* get_system_phymem(PyObject* self, PyObject* args); |
34 static PyObject* get_total_virtmem(PyObject* self, PyObject* args); | |
35 static PyObject* get_avail_phymem(PyObject* self, PyObject* args); | |
36 static PyObject* get_avail_virtmem(PyObject* self, PyObject* args); | |
37 static PyObject* get_system_cpu_times(PyObject* self, PyObject* args); | 43 static PyObject* get_system_cpu_times(PyObject* self, PyObject* args); |
38 static PyObject* _QueryDosDevice(PyObject* self, PyObject* args); | |
39 static PyObject* pid_exists(PyObject* self, PyObject* args); | 44 static PyObject* pid_exists(PyObject* self, PyObject* args); |
| 45 static PyObject* get_disk_usage(PyObject* self, PyObject* args); |
| 46 static PyObject* get_disk_partitions(PyObject* self, PyObject* args); |
40 | 47 |
41 // --- others | 48 // --- windows API bindings |
42 | 49 |
| 50 static PyObject* win32_QueryDosDevice(PyObject* self, PyObject* args); |
| 51 static PyObject* win32_GetLogicalDriveStrings(PyObject* self, PyObject* args); |
| 52 static PyObject* win32_GetDriveType(PyObject* self, PyObject* args); |
| 53 |
| 54 // --- internal |
43 int suspend_resume_process(DWORD pid, int suspend); | 55 int suspend_resume_process(DWORD pid, int suspend); |
OLD | NEW |