summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-02-20 06:39:25 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2019-02-20 06:39:25 -0800
commitd2cdf617ae4248a431c1dbbcbea9354b2b4c5536 (patch)
tree8464b02727cec407b160b9b52f7702fea467cd59
parentec17917a67bd0e3081a46a43a5423751b954e745 (diff)
downloadpsutil-d2cdf617ae4248a431c1dbbcbea9354b2b4c5536.tar.gz
remove unnecessary definitions
-rw-r--r--psutil/arch/windows/ntextapi.h2
-rw-r--r--psutil/arch/windows/process_handles.c4
-rw-r--r--psutil/arch/windows/process_handles.h10
-rw-r--r--psutil/arch/windows/process_info.c4
4 files changed, 6 insertions, 14 deletions
diff --git a/psutil/arch/windows/ntextapi.h b/psutil/arch/windows/ntextapi.h
index edb3f7d6..f6bca591 100644
--- a/psutil/arch/windows/ntextapi.h
+++ b/psutil/arch/windows/ntextapi.h
@@ -9,7 +9,9 @@
#include <iphlpapi.h>
typedef LONG NTSTATUS;
+
#define STATUS_INFO_LENGTH_MISMATCH 0xc0000004
+#define STATUS_BUFFER_TOO_SMALL 0xC0000023L
typedef struct {
LARGE_INTEGER IdleTime;
diff --git a/psutil/arch/windows/process_handles.c b/psutil/arch/windows/process_handles.c
index aa64a57d..8242b99c 100644
--- a/psutil/arch/windows/process_handles.c
+++ b/psutil/arch/windows/process_handles.c
@@ -22,6 +22,10 @@ ULONG g_dwSize = 0;
ULONG g_dwLength = 0;
+#define ObjectNameInformation 1
+#define NTQO_TIMEOUT 100
+
+
static VOID
psutil_get_open_files_init(BOOL threaded) {
if (g_initialized == TRUE)
diff --git a/psutil/arch/windows/process_handles.h b/psutil/arch/windows/process_handles.h
index e14b08b3..d187def5 100644
--- a/psutil/arch/windows/process_handles.h
+++ b/psutil/arch/windows/process_handles.h
@@ -19,16 +19,6 @@
#include <psapi.h>
#include "ntextapi.h"
-#ifndef NT_SUCCESS
-#define NT_SUCCESS(x) ((x) >= 0)
-#endif
-
-#define ObjectBasicInformation 0
-#define ObjectNameInformation 1
-#define ObjectTypeInformation 2
-#define HANDLE_TYPE_FILE 28
-#define NTQO_TIMEOUT 100
-
// Undocumented FILE_INFORMATION_CLASS: FileNameInformation
static const SYSTEM_INFORMATION_CLASS SystemExtendedHandleInformation = (SYSTEM_INFORMATION_CLASS)64;
diff --git a/psutil/arch/windows/process_info.c b/psutil/arch/windows/process_info.c
index f9343d3d..747fe5f0 100644
--- a/psutil/arch/windows/process_info.c
+++ b/psutil/arch/windows/process_info.c
@@ -136,10 +136,6 @@ typedef struct {
(PSYSTEM_PROCESS_INFORMATION)((PCHAR)(Process) + \
((PSYSTEM_PROCESS_INFORMATION)(Process))->NextEntryOffset) : NULL)
-const int STATUS_INFO_LENGTH_MISMATCH = 0xC0000004;
-const int STATUS_BUFFER_TOO_SMALL = 0xC0000023L;
-
-
// A wrapper around GetModuleHandle and GetProcAddress.
PVOID
psutil_GetProcAddress(LPCSTR libname, LPCSTR procname) {