summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-02-19 16:23:57 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2019-02-19 16:23:57 -0800
commit0baf7049e587270eb7122d9e3d3a62448eec0af8 (patch)
tree9d658a1ab646aad0d3db78f6632d3a6386730162
parent8e2c4b1644053e4e317a99e6d31070de093e57be (diff)
downloadpsutil-0baf7049e587270eb7122d9e3d3a62448eec0af8.tar.gz
port process_handles.c
-rw-r--r--psutil/arch/windows/process_handles.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/psutil/arch/windows/process_handles.c b/psutil/arch/windows/process_handles.c
index 4ac02b91..672a9705 100644
--- a/psutil/arch/windows/process_handles.c
+++ b/psutil/arch/windows/process_handles.c
@@ -8,7 +8,6 @@
#include "process_info.h"
#include "../../_psutil_common.h"
-static _NtQuerySystemInformation __NtQuerySystemInformation = NULL;
static _NtQueryObject __NtQueryObject = NULL;
CRITICAL_SECTION g_cs;
@@ -45,8 +44,6 @@ psutil_get_open_files_init(BOOL threaded) {
return;
// Resolve the Windows API calls
- __NtQuerySystemInformation = psutil_GetProcAddressFromLib(
- "ntdll.dll", "NtQuerySystemInformation");
__NtQueryObject = psutil_GetProcAddressFromLib(
"ntdll.dll", "NtQueryObject");
@@ -81,8 +78,7 @@ psutil_get_open_files_ntqueryobject(long dwPid, HANDLE hProcess) {
// to psutil_get_open_files() is running
EnterCriticalSection(&g_cs);
- if (__NtQuerySystemInformation == NULL ||
- __NtQueryObject == NULL ||
+ if (__NtQueryObject == NULL ||
g_hEvtStart == NULL ||
g_hEvtFinish == NULL)
@@ -117,7 +113,7 @@ psutil_get_open_files_ntqueryobject(long dwPid, HANDLE hProcess) {
error = TRUE;
goto cleanup;
}
- } while ((status = __NtQuerySystemInformation(
+ } while ((status = psutil_NtQuerySystemInformation(
SystemExtendedHandleInformation,
pHandleInfo,
dwInfoSize,
@@ -339,7 +335,7 @@ psutil_get_open_files_getmappedfilename(long dwPid, HANDLE hProcess) {
if (g_initialized == FALSE)
psutil_get_open_files_init(FALSE);
- if (__NtQuerySystemInformation == NULL || __NtQueryObject == NULL) {
+ if (__NtQueryObject == NULL) {
PyErr_SetFromWindowsErr(0);
error = TRUE;
goto cleanup;
@@ -370,7 +366,7 @@ psutil_get_open_files_getmappedfilename(long dwPid, HANDLE hProcess) {
error = TRUE;
goto cleanup;
}
- } while ((status = __NtQuerySystemInformation(
+ } while ((status = psutil_NtQuerySystemInformation(
SystemExtendedHandleInformation,
pHandleInfo,
dwInfoSize,