From 63d3e3b2bcf32bc3c966c9a595c8835976f3f65e Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Sun, 3 Dec 2017 18:58:43 +0100 Subject: [PATCH] src: merge ntstatus.h into nt.h --- src/afd.h | 2 +- src/error.c | 2 -- src/error.h | 2 +- src/nt.h | 70 +++++++++++++++++++++++++++++++++++++++++++++- src/ntstatus.h | 75 -------------------------------------------------- 5 files changed, 71 insertions(+), 80 deletions(-) delete mode 100644 src/ntstatus.h diff --git a/src/afd.h b/src/afd.h index 5c40a6a..4345174 100644 --- a/src/afd.h +++ b/src/afd.h @@ -2,7 +2,7 @@ #define WEPOLL_AFD_H_ #include "internal.h" -#include "ntstatus.h" +#include "nt.h" #include "util.h" #include "win.h" diff --git a/src/error.c b/src/error.c index 5b4cfd4..b99f40c 100644 --- a/src/error.c +++ b/src/error.c @@ -1,8 +1,6 @@ #include #include "error.h" -#include "nt.h" -#include "ntstatus.h" #include "win.h" #define _ERROR_ERRNO_MAP(X) \ diff --git a/src/error.h b/src/error.h index 38f1f97..04ae9cb 100644 --- a/src/error.h +++ b/src/error.h @@ -4,7 +4,7 @@ #include #include "internal.h" -#include "ntstatus.h" +#include "win.h" #define _return_error_helper(error, value) \ do { \ diff --git a/src/nt.h b/src/nt.h index 69b7dd6..d50656c 100644 --- a/src/nt.h +++ b/src/nt.h @@ -2,11 +2,79 @@ #define WEPOLL_NT_H_ #include "internal.h" -#include "ntstatus.h" #include "win.h" WEPOLL_INTERNAL int nt_global_init(void); +#ifndef _NTDEF_ +typedef LONG NTSTATUS; +typedef NTSTATUS* PNTSTATUS; +#endif + +#ifndef NT_SUCCESS +#define NT_SUCCESS(status) (((NTSTATUS)(status)) >= 0) +#endif + +#ifndef STATUS_SUCCESS +#define STATUS_SUCCESS ((NTSTATUS) 0x00000000L) +#endif + +#ifndef STATUS_WAIT_0 +#define STATUS_WAIT_0 ((NTSTATUS) 0x00000000L) +#endif + +#ifndef STATUS_WAIT_1 +#define STATUS_WAIT_1 ((NTSTATUS) 0x00000001L) +#endif + +#ifndef STATUS_WAIT_2 +#define STATUS_WAIT_2 ((NTSTATUS) 0x00000002L) +#endif + +#ifndef STATUS_WAIT_3 +#define STATUS_WAIT_3 ((NTSTATUS) 0x00000003L) +#endif + +#ifndef STATUS_WAIT_63 +#define STATUS_WAIT_63 ((NTSTATUS) 0x0000003FL) +#endif + +#ifndef STATUS_ABANDONED +#define STATUS_ABANDONED ((NTSTATUS) 0x00000080L) +#endif + +#ifndef STATUS_ABANDONED_WAIT_0 +#define STATUS_ABANDONED_WAIT_0 ((NTSTATUS) 0x00000080L) +#endif + +#ifndef STATUS_ABANDONED_WAIT_63 +#define STATUS_ABANDONED_WAIT_63 ((NTSTATUS) 0x000000BFL) +#endif + +#ifndef STATUS_USER_APC +#define STATUS_USER_APC ((NTSTATUS) 0x000000C0L) +#endif + +#ifndef STATUS_KERNEL_APC +#define STATUS_KERNEL_APC ((NTSTATUS) 0x00000100L) +#endif + +#ifndef STATUS_ALERTED +#define STATUS_ALERTED ((NTSTATUS) 0x00000101L) +#endif + +#ifndef STATUS_TIMEOUT +#define STATUS_TIMEOUT ((NTSTATUS) 0x00000102L) +#endif + +#ifndef STATUS_PENDING +#define STATUS_PENDING ((NTSTATUS) 0x00000103L) +#endif + +#ifndef STATUS_CANCELLED +#define STATUS_CANCELLED ((NTSTATUS) 0xC0000120L) +#endif + typedef struct _IO_STATUS_BLOCK { union { NTSTATUS Status; diff --git a/src/ntstatus.h b/src/ntstatus.h deleted file mode 100644 index a9bbfe2..0000000 --- a/src/ntstatus.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef WEPOLL_NTSTATUS_H_ -#define WEPOLL_NTSTATUS_H_ - -#include "win.h" - -#ifndef _NTDEF_ -typedef LONG NTSTATUS; -typedef NTSTATUS* PNTSTATUS; -#endif - -#ifndef NT_SUCCESS -#define NT_SUCCESS(status) (((NTSTATUS)(status)) >= 0) -#endif - -#ifndef STATUS_SUCCESS -#define STATUS_SUCCESS ((NTSTATUS) 0x00000000L) -#endif - -#ifndef STATUS_WAIT_0 -#define STATUS_WAIT_0 ((NTSTATUS) 0x00000000L) -#endif - -#ifndef STATUS_WAIT_1 -#define STATUS_WAIT_1 ((NTSTATUS) 0x00000001L) -#endif - -#ifndef STATUS_WAIT_2 -#define STATUS_WAIT_2 ((NTSTATUS) 0x00000002L) -#endif - -#ifndef STATUS_WAIT_3 -#define STATUS_WAIT_3 ((NTSTATUS) 0x00000003L) -#endif - -#ifndef STATUS_WAIT_63 -#define STATUS_WAIT_63 ((NTSTATUS) 0x0000003FL) -#endif - -#ifndef STATUS_ABANDONED -#define STATUS_ABANDONED ((NTSTATUS) 0x00000080L) -#endif - -#ifndef STATUS_ABANDONED_WAIT_0 -#define STATUS_ABANDONED_WAIT_0 ((NTSTATUS) 0x00000080L) -#endif - -#ifndef STATUS_ABANDONED_WAIT_63 -#define STATUS_ABANDONED_WAIT_63 ((NTSTATUS) 0x000000BFL) -#endif - -#ifndef STATUS_USER_APC -#define STATUS_USER_APC ((NTSTATUS) 0x000000C0L) -#endif - -#ifndef STATUS_KERNEL_APC -#define STATUS_KERNEL_APC ((NTSTATUS) 0x00000100L) -#endif - -#ifndef STATUS_ALERTED -#define STATUS_ALERTED ((NTSTATUS) 0x00000101L) -#endif - -#ifndef STATUS_TIMEOUT -#define STATUS_TIMEOUT ((NTSTATUS) 0x00000102L) -#endif - -#ifndef STATUS_PENDING -#define STATUS_PENDING ((NTSTATUS) 0x00000103L) -#endif - -#ifndef STATUS_CANCELLED -#define STATUS_CANCELLED ((NTSTATUS) 0xC0000120L) -#endif - -#endif /* WEPOLL_NTSTATUS_H_ */