Author: tkreuzer
Date: Fri Oct 3 12:10:08 2014
New Revision: 64496
URL:
http://svn.reactos.org/svn/reactos?rev=64496&view=rev
Log:
[PSDK/XDK]
Add some missing definitions to ntdef.h and winnt.h
Modified:
trunk/reactos/include/psdk/ntdef.h
trunk/reactos/include/psdk/winnt.h
trunk/reactos/include/xdk/ntbasedef.h
trunk/reactos/include/xdk/ntdef.template.h
trunk/reactos/include/xdk/winnt_old.h
Modified: trunk/reactos/include/psdk/ntdef.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntdef.h?rev=6…
==============================================================================
--- trunk/reactos/include/psdk/ntdef.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/ntdef.h [iso-8859-1] Fri Oct 3 12:10:08 2014
@@ -461,10 +461,6 @@
typedef unsigned short USHORT, *PUSHORT;
typedef unsigned long ULONG, *PULONG;
-typedef CONST UCHAR *PCUCHAR;
-typedef CONST USHORT *PCUSHORT;
-typedef CONST ULONG *PCULONG;
-
typedef double DOUBLE;
/* Signed Types */
@@ -799,6 +795,26 @@
#else
#define RTL_CONST_CAST(type) (type)
#endif
+
+#ifdef __cplusplus
+#define DEFINE_ENUM_FLAG_OPERATORS(_ENUMTYPE) \
+extern "C++" { \
+ inline _ENUMTYPE operator|(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a) |
((int)b)); } \
+ inline _ENUMTYPE &operator|=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE
&)(((int &)a) |= ((int)b)); } \
+ inline _ENUMTYPE operator&(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a)
& ((int)b)); } \
+ inline _ENUMTYPE &operator&=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE
&)(((int &)a) &= ((int)b)); } \
+ inline _ENUMTYPE operator~(_ENUMTYPE a) { return _ENUMTYPE(~((int)a)); } \
+ inline _ENUMTYPE operator^(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a) ^
((int)b)); } \
+ inline _ENUMTYPE &operator^=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE
&)(((int &)a) ^= ((int)b)); } \
+}
+#else
+#define DEFINE_ENUM_FLAG_OPERATORS(_ENUMTYPE)
+#endif
+
+#define COMPILETIME_OR_2FLAGS(a,b) ((UINT)(a)|(UINT)(b))
+#define COMPILETIME_OR_3FLAGS(a,b,c) ((UINT)(a)|(UINT)(b)|(UINT)(c))
+#define COMPILETIME_OR_4FLAGS(a,b,c,d) ((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d))
+#define COMPILETIME_OR_5FLAGS(a,b,c,d,e)
((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d)|(UINT)(e))
/* Type Limits */
#define MINCHAR 0x80
@@ -1401,8 +1417,22 @@
#define LOCALE_NEUTRAL MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
SORT_DEFAULT)
#define LOCALE_INVARIANT MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL),
SORT_DEFAULT)
+typedef _Return_type_success_(return >= 0) LONG NTSTATUS;
+typedef NTSTATUS *PNTSTATUS;
+
+#ifndef __SECSTATUS_DEFINED__
+typedef long SECURITY_STATUS;
+#define __SECSTATUS_DEFINED__
+#endif
+
/* Physical Addresses are always treated as 64-bit wide */
typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
+
+#define TIME LARGE_INTEGER
+#define _TIME _LARGE_INTEGER
+#define PTIME PLARGE_INTEGER
+#define LowTime LowPart
+#define HighTime HighPart
/* Used to store a non-float 8 byte aligned structure */
typedef struct _QUAD
@@ -1413,6 +1443,17 @@
double DoNotUseThisField;
} DUMMYUNIONNAME;
} QUAD, *PQUAD, UQUAD, *PUQUAD;
+
+#if (_WIN32_WINNT >= 0x0600) || (defined(__cplusplus) &&
defined(WINDOWS_ENABLE_CPLUSPLUS))
+typedef CONST UCHAR *PCUCHAR;
+typedef CONST USHORT *PCUSHORT;
+typedef CONST ULONG *PCULONG;
+typedef CONST UQUAD *PCUQUAD;
+typedef CONST SCHAR *PCSCHAR;
+#endif /* (/_WIN32_WINNT >= 0x0600) */
+#if (_WIN32_WINNT >= 0x0600)
+typedef CONST NTSTATUS *PCNTSTATUS;
+#endif /* (/_WIN32_WINNT >= 0x0600) */
/* String Types */
typedef struct _STRING {
@@ -1528,6 +1569,8 @@
} OBJECT_ATTRIBUTES64, *POBJECT_ATTRIBUTES64;
typedef CONST OBJECT_ATTRIBUTES64 *PCOBJECT_ATTRIBUTES64;
+#define OBJ_HANDLE_TAGBITS 0x00000003L
+
/* Values for the Attributes member */
#define OBJ_INHERIT 0x00000002L
#define OBJ_PERMANENT 0x00000010L
@@ -1561,6 +1604,37 @@
#define RTL_INIT_OBJECT_ATTRIBUTES(n, a) \
RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a)
+#ifdef _MSC_VER
+ #pragma warning(push)
+ #pragma warning(disable:4214) /* Bit fields of other types than int */
+#endif /* _MSC_VER */
+typedef struct _RTL_BALANCED_NODE
+{
+ _ANONYMOUS_UNION union
+ {
+ struct _RTL_BALANCED_NODE *Children[2];
+ _ANONYMOUS_STRUCT struct
+ {
+ struct _RTL_BALANCED_NODE *Left;
+ struct _RTL_BALANCED_NODE *Right;
+ } DUMMYSTRUCTNAME;
+ } DUMMYUNIONNAME;
+ _ANONYMOUS_UNION union
+ {
+ UCHAR Red : 1;
+ UCHAR Balance : 2;
+ ULONG_PTR ParentValue;
+ } DUMMYUNIONNAME2;
+} RTL_BALANCED_NODE, *PRTL_BALANCED_NODE;
+#ifdef _MSC_VER
+ #pragma warning(pop)
+#endif /* _MSC_VER */
+
+#define RTL_BALANCED_NODE_RESERVED_PARENT_MASK 3
+#define RTL_BALANCED_NODE_GET_PARENT_POINTER(Node) \
+ ((PRTL_BALANCED_NODE)((Node)->ParentValue & \
+ ~RTL_BALANCED_NODE_RESERVED_PARENT_MASK))
+
/* Product Types */
typedef enum _NT_PRODUCT_TYPE {
NtProductWinNt = 1,
@@ -1583,6 +1657,28 @@
WaitAny
} WAIT_TYPE;
+#ifndef MIDL_PASS
+FORCEINLINE
+VOID
+ListEntry32To64(
+ _In_ PLIST_ENTRY32 ListEntry32,
+ _Out_ PLIST_ENTRY64 ListEntry64)
+{
+ ListEntry64->Flink = (ULONG)ListEntry32->Flink;
+ ListEntry64->Blink = (ULONG)ListEntry32->Blink;
+}
+
+FORCEINLINE
+VOID
+ListEntry64To32(
+ _In_ PLIST_ENTRY64 ListEntry64,
+ _Out_ PLIST_ENTRY32 ListEntry32)
+{
+ ListEntry32->Flink = ListEntry64->Flink & 0xFFFFFFFF;
+ ListEntry32->Blink = ListEntry64->Blink & 0xFFFFFFFF;
+}
+#endif /* !MIDL_PASS */
+
#ifdef __cplusplus
} // extern "C"
#endif
Modified: trunk/reactos/include/psdk/winnt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=6…
==============================================================================
--- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Fri Oct 3 12:10:08 2014
@@ -728,6 +728,26 @@
#else
#define RTL_CONST_CAST(type) (type)
#endif
+
+#ifdef __cplusplus
+#define DEFINE_ENUM_FLAG_OPERATORS(_ENUMTYPE) \
+extern "C++" { \
+ inline _ENUMTYPE operator|(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a) |
((int)b)); } \
+ inline _ENUMTYPE &operator|=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE
&)(((int &)a) |= ((int)b)); } \
+ inline _ENUMTYPE operator&(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a)
& ((int)b)); } \
+ inline _ENUMTYPE &operator&=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE
&)(((int &)a) &= ((int)b)); } \
+ inline _ENUMTYPE operator~(_ENUMTYPE a) { return _ENUMTYPE(~((int)a)); } \
+ inline _ENUMTYPE operator^(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a) ^
((int)b)); } \
+ inline _ENUMTYPE &operator^=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE
&)(((int &)a) ^= ((int)b)); } \
+}
+#else
+#define DEFINE_ENUM_FLAG_OPERATORS(_ENUMTYPE)
+#endif
+
+#define COMPILETIME_OR_2FLAGS(a,b) ((UINT)(a)|(UINT)(b))
+#define COMPILETIME_OR_3FLAGS(a,b,c) ((UINT)(a)|(UINT)(b)|(UINT)(c))
+#define COMPILETIME_OR_4FLAGS(a,b,c,d) ((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d))
+#define COMPILETIME_OR_5FLAGS(a,b,c,d,e)
((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d)|(UINT)(e))
/* Type Limits */
#define MINCHAR 0x80
@@ -1423,21 +1443,6 @@
#define ACE_OBJECT_TYPE_PRESENT 0x00000001
#define ACE_INHERITED_OBJECT_TYPE_PRESENT 0x00000002
-
-#ifdef __cplusplus
-#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
-extern "C++" { \
- inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return
ENUMTYPE(((int)a)|((int)b)); } \
- inline ENUMTYPE operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE
&)(((int &)a) |= ((int)b)); } \
- inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return
ENUMTYPE(((int)a)&((int)b)); } \
- inline ENUMTYPE operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE
&)(((int &)a) &= ((int)b)); } \
- inline ENUMTYPE operator ~ (ENUMTYPE a) { return (ENUMTYPE)(~((int)a)); } \
- inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return
ENUMTYPE(((int)a)^((int)b)); } \
- inline ENUMTYPE operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE
&)(((int &)a) ^= ((int)b)); } \
-}
-#else
-# define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) /* */
-#endif
/* also in ddk/ntifs.h */
#define COMPRESSION_FORMAT_NONE (0x0000)
Modified: trunk/reactos/include/xdk/ntbasedef.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/ntbasedef.h?re…
==============================================================================
--- trunk/reactos/include/xdk/ntbasedef.h [iso-8859-1] (original)
+++ trunk/reactos/include/xdk/ntbasedef.h [iso-8859-1] Fri Oct 3 12:10:08 2014
@@ -351,10 +351,6 @@
typedef unsigned char UCHAR, *PUCHAR;
typedef unsigned short USHORT, *PUSHORT;
typedef unsigned long ULONG, *PULONG;
-
-typedef CONST UCHAR *PCUCHAR;
-typedef CONST USHORT *PCUSHORT;
-typedef CONST ULONG *PCULONG;
typedef double DOUBLE;
$endif(_NTDEF_)
@@ -711,6 +707,26 @@
#else
#define RTL_CONST_CAST(type) (type)
#endif
+
+#ifdef __cplusplus
+#define DEFINE_ENUM_FLAG_OPERATORS(_ENUMTYPE) \
+extern "C++" { \
+ inline _ENUMTYPE operator|(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a) |
((int)b)); } \
+ inline _ENUMTYPE &operator|=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE
&)(((int &)a) |= ((int)b)); } \
+ inline _ENUMTYPE operator&(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a)
& ((int)b)); } \
+ inline _ENUMTYPE &operator&=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE
&)(((int &)a) &= ((int)b)); } \
+ inline _ENUMTYPE operator~(_ENUMTYPE a) { return _ENUMTYPE(~((int)a)); } \
+ inline _ENUMTYPE operator^(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a) ^
((int)b)); } \
+ inline _ENUMTYPE &operator^=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE
&)(((int &)a) ^= ((int)b)); } \
+}
+#else
+#define DEFINE_ENUM_FLAG_OPERATORS(_ENUMTYPE)
+#endif
+
+#define COMPILETIME_OR_2FLAGS(a,b) ((UINT)(a)|(UINT)(b))
+#define COMPILETIME_OR_3FLAGS(a,b,c) ((UINT)(a)|(UINT)(b)|(UINT)(c))
+#define COMPILETIME_OR_4FLAGS(a,b,c,d) ((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d))
+#define COMPILETIME_OR_5FLAGS(a,b,c,d,e)
((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d)|(UINT)(e))
/* Type Limits */
#define MINCHAR 0x80
Modified: trunk/reactos/include/xdk/ntdef.template.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/ntdef.template…
==============================================================================
--- trunk/reactos/include/xdk/ntdef.template.h [iso-8859-1] (original)
+++ trunk/reactos/include/xdk/ntdef.template.h [iso-8859-1] Fri Oct 3 12:10:08 2014
@@ -117,8 +117,22 @@
$define(UCHAR=UCHAR)
$include(ntbasedef.h)
+typedef _Return_type_success_(return >= 0) LONG NTSTATUS;
+typedef NTSTATUS *PNTSTATUS;
+
+#ifndef __SECSTATUS_DEFINED__
+typedef long SECURITY_STATUS;
+#define __SECSTATUS_DEFINED__
+#endif
+
/* Physical Addresses are always treated as 64-bit wide */
typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
+
+#define TIME LARGE_INTEGER
+#define _TIME _LARGE_INTEGER
+#define PTIME PLARGE_INTEGER
+#define LowTime LowPart
+#define HighTime HighPart
/* Used to store a non-float 8 byte aligned structure */
typedef struct _QUAD
@@ -129,6 +143,17 @@
double DoNotUseThisField;
} DUMMYUNIONNAME;
} QUAD, *PQUAD, UQUAD, *PUQUAD;
+
+#if (_WIN32_WINNT >= 0x0600) || (defined(__cplusplus) &&
defined(WINDOWS_ENABLE_CPLUSPLUS))
+typedef CONST UCHAR *PCUCHAR;
+typedef CONST USHORT *PCUSHORT;
+typedef CONST ULONG *PCULONG;
+typedef CONST UQUAD *PCUQUAD;
+typedef CONST SCHAR *PCSCHAR;
+#endif /* (/_WIN32_WINNT >= 0x0600) */
+#if (_WIN32_WINNT >= 0x0600)
+typedef CONST NTSTATUS *PCNTSTATUS;
+#endif /* (/_WIN32_WINNT >= 0x0600) */
/* String Types */
typedef struct _STRING {
@@ -244,6 +269,8 @@
} OBJECT_ATTRIBUTES64, *POBJECT_ATTRIBUTES64;
typedef CONST OBJECT_ATTRIBUTES64 *PCOBJECT_ATTRIBUTES64;
+#define OBJ_HANDLE_TAGBITS 0x00000003L
+
/* Values for the Attributes member */
#define OBJ_INHERIT 0x00000002L
#define OBJ_PERMANENT 0x00000010L
@@ -277,6 +304,37 @@
#define RTL_INIT_OBJECT_ATTRIBUTES(n, a) \
RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a)
+#ifdef _MSC_VER
+ #pragma warning(push)
+ #pragma warning(disable:4214) /* Bit fields of other types than int */
+#endif /* _MSC_VER */
+typedef struct _RTL_BALANCED_NODE
+{
+ _ANONYMOUS_UNION union
+ {
+ struct _RTL_BALANCED_NODE *Children[2];
+ _ANONYMOUS_STRUCT struct
+ {
+ struct _RTL_BALANCED_NODE *Left;
+ struct _RTL_BALANCED_NODE *Right;
+ } DUMMYSTRUCTNAME;
+ } DUMMYUNIONNAME;
+ _ANONYMOUS_UNION union
+ {
+ UCHAR Red : 1;
+ UCHAR Balance : 2;
+ ULONG_PTR ParentValue;
+ } DUMMYUNIONNAME2;
+} RTL_BALANCED_NODE, *PRTL_BALANCED_NODE;
+#ifdef _MSC_VER
+ #pragma warning(pop)
+#endif /* _MSC_VER */
+
+#define RTL_BALANCED_NODE_RESERVED_PARENT_MASK 3
+#define RTL_BALANCED_NODE_GET_PARENT_POINTER(Node) \
+ ((PRTL_BALANCED_NODE)((Node)->ParentValue & \
+ ~RTL_BALANCED_NODE_RESERVED_PARENT_MASK))
+
/* Product Types */
typedef enum _NT_PRODUCT_TYPE {
NtProductWinNt = 1,
@@ -299,6 +357,28 @@
WaitAny
} WAIT_TYPE;
+#ifndef MIDL_PASS
+FORCEINLINE
+VOID
+ListEntry32To64(
+ _In_ PLIST_ENTRY32 ListEntry32,
+ _Out_ PLIST_ENTRY64 ListEntry64)
+{
+ ListEntry64->Flink = (ULONG)ListEntry32->Flink;
+ ListEntry64->Blink = (ULONG)ListEntry32->Blink;
+}
+
+FORCEINLINE
+VOID
+ListEntry64To32(
+ _In_ PLIST_ENTRY64 ListEntry64,
+ _Out_ PLIST_ENTRY32 ListEntry32)
+{
+ ListEntry32->Flink = ListEntry64->Flink & 0xFFFFFFFF;
+ ListEntry32->Blink = ListEntry64->Blink & 0xFFFFFFFF;
+}
+#endif /* !MIDL_PASS */
+
#ifdef __cplusplus
} // extern "C"
#endif
Modified: trunk/reactos/include/xdk/winnt_old.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/winnt_old.h?re…
==============================================================================
--- trunk/reactos/include/xdk/winnt_old.h [iso-8859-1] (original)
+++ trunk/reactos/include/xdk/winnt_old.h [iso-8859-1] Fri Oct 3 12:10:08 2014
@@ -92,21 +92,6 @@
#define ACE_OBJECT_TYPE_PRESENT 0x00000001
#define ACE_INHERITED_OBJECT_TYPE_PRESENT 0x00000002
-
-#ifdef __cplusplus
-#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
-extern "C++" { \
- inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return
ENUMTYPE(((int)a)|((int)b)); } \
- inline ENUMTYPE operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE
&)(((int &)a) |= ((int)b)); } \
- inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return
ENUMTYPE(((int)a)&((int)b)); } \
- inline ENUMTYPE operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE
&)(((int &)a) &= ((int)b)); } \
- inline ENUMTYPE operator ~ (ENUMTYPE a) { return (ENUMTYPE)(~((int)a)); } \
- inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return
ENUMTYPE(((int)a)^((int)b)); } \
- inline ENUMTYPE operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE
&)(((int &)a) ^= ((int)b)); } \
-}
-#else
-# define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) /* */
-#endif
/* also in ddk/ntifs.h */
#define COMPRESSION_FORMAT_NONE (0x0000)