Author: tkreuzer
Date: Sun Aug 31 13:41:14 2014
New Revision: 64009
URL:
http://svn.reactos.org/svn/reactos?rev=64009&view=rev
Log:
[winnt.h]
Change the order of definitions to more closely match ntdef.h
Modified:
trunk/reactos/include/psdk/winnt.h
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] Sun Aug 31 13:41:14 2014
@@ -7,9 +7,26 @@
#endif
#endif
+#include <ctype.h>
#ifdef __GNUC__
#include <msvctarget.h>
#endif
+
+#include <excpt.h>
+#include <basetsd.h>
+#include <guiddef.h>
+#include "intrin.h"
+
+#undef __need_wchar_t
+#include <winerror.h>
+#include <stddef.h>
+#include <sdkddkver.h>
+#ifndef RC_INVOKED
+#include <string.h>
+#endif
+
+
+#define ANYSIZE_ARRAY 1
#ifndef __ANONYMOUS_DEFINED
#define __ANONYMOUS_DEFINED
@@ -66,112 +83,6 @@
#endif
#endif /* __ANONYMOUS_DEFINED */
-#undef __C89_NAMELESS
-#undef __C89_NAMELESSSTRUCTNAME
-#undef __C89_NAMELESSSTRUCTNAME1
-#undef __C89_NAMELESSSTRUCTNAME2
-#undef __C89_NAMELESSSTRUCTNAME3
-#undef __C89_NAMELESSSTRUCTNAME4
-#undef __C89_NAMELESSSTRUCTNAME5
-#undef __C89_NAMELESSUNIONNAME
-#undef __C89_NAMELESSUNIONNAME1
-#undef __C89_NAMELESSUNIONNAME2
-#undef __C89_NAMELESSUNIONNAME3
-#undef __C89_NAMELESSUNIONNAME4
-#undef __C89_NAMELESSUNIONNAME5
-#undef __C89_NAMELESSUNIONNAME6
-#undef __C89_NAMELESSUNIONNAME7
-#undef __C89_NAMELESSUNIONNAME8
-
-#if !defined(__WINESRC__) && !defined(WINE_NO_NAMELESS_EXTENSION)
-# ifdef __GNUC__
- /* Anonymous structs support starts with gcc 2.96/g++ 2.95 */
-# if (__GNUC__ > 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ > 95) ||
((__GNUC_MINOR__ == 95) && defined(__cplusplus))))
-# define __C89_NAMELESS __extension__
-# endif
-# elif defined(_MSC_VER)
-# define __C89_NAMELESS
-# endif
-#endif
-
-#ifdef __C89_NAMELESS
-# define __C89_NAMELESSSTRUCTNAME
-# define __C89_NAMELESSSTRUCTNAME1
-# define __C89_NAMELESSSTRUCTNAME2
-# define __C89_NAMELESSSTRUCTNAME3
-# define __C89_NAMELESSSTRUCTNAME4
-# define __C89_NAMELESSSTRUCTNAME5
-# define __C89_NAMELESSUNIONNAME
-# define __C89_NAMELESSUNIONNAME1
-# define __C89_NAMELESSUNIONNAME2
-# define __C89_NAMELESSUNIONNAME3
-# define __C89_NAMELESSUNIONNAME4
-# define __C89_NAMELESSUNIONNAME5
-# define __C89_NAMELESSUNIONNAME6
-# define __C89_NAMELESSUNIONNAME7
-# define __C89_NAMELESSUNIONNAME8
-#else
-# define __C89_NAMELESS
-# define __C89_NAMELESSSTRUCTNAME DUMMYSTRUCTNAME
-# define __C89_NAMELESSSTRUCTNAME1 DUMMYSTRUCTNAME1
-# define __C89_NAMELESSSTRUCTNAME2 DUMMYSTRUCTNAME2
-# define __C89_NAMELESSSTRUCTNAME3 DUMMYSTRUCTNAME3
-# define __C89_NAMELESSSTRUCTNAME4 DUMMYSTRUCTNAME4
-# define __C89_NAMELESSSTRUCTNAME5 DUMMYSTRUCTNAME5
-# define __C89_NAMELESSUNIONNAME DUMMYUNIONNAME
-# define __C89_NAMELESSUNIONNAME1 DUMMYUNIONNAME1
-# define __C89_NAMELESSUNIONNAME2 DUMMYUNIONNAME2
-# define __C89_NAMELESSUNIONNAME3 DUMMYUNIONNAME3
-# define __C89_NAMELESSUNIONNAME4 DUMMYUNIONNAME4
-# define __C89_NAMELESSUNIONNAME5 DUMMYUNIONNAME5
-# define __C89_NAMELESSUNIONNAME6 DUMMYUNIONNAME6
-# define __C89_NAMELESSUNIONNAME7 DUMMYUNIONNAME7
-# define __C89_NAMELESSUNIONNAME8 DUMMYUNIONNAME8
-#endif
-
-#define UNREFERENCED_PARAMETER(P) {(P)=(P);}
-#define UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L))
-#define DBG_UNREFERENCED_PARAMETER(P) {(P)=(P);}
-#define DBG_UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L))
-
-#ifndef DECLSPEC_ALIGN
-# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
-# define DECLSPEC_ALIGN(x) __declspec(align(x))
-# elif defined(__GNUC__)
-# define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
-# else
-# define DECLSPEC_ALIGN(x)
-# endif
-#endif
-
-#ifndef NOP_FUNCTION
-#if (_MSC_VER >= 1210)
-#define NOP_FUNCTION __noop
-#else
-#define NOP_FUNCTION (void)0
-#endif
-#endif
-
-# define DECLSPEC_HIDDEN
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <excpt.h>
-#include <basetsd.h>
-#include <guiddef.h>
-
-#include <ctype.h>
-#undef __need_wchar_t
-
-#include <winerror.h>
-#include <stddef.h>
-#include <sdkddkver.h>
-
-#ifndef RC_INVOKED
-#include <string.h>
-
#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) ||
defined(_M_AMD64)
#define ALIGNMENT_MACHINE
#define UNALIGNED __unaligned
@@ -194,6 +105,32 @@
#define MEMORY_ALLOCATION_ALIGNMENT 8
#endif
+/* C99 restrict support */
+#if defined(ENABLE_RESTRICTED) && !defined(MIDL_PASS) &&
!defined(RC_INVOKED)
+ #if defined(_MSC_VER) && defined(_M_MRX000)
+ #define RESTRICTED_POINTER __restrict
+ #elif defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) &&
(__GNUC_MINOR__ >= 95)))
+ #define RESTRICTED_POINTER __restrict
+ #else
+ #define RESTRICTED_POINTER
+ #endif
+#else
+ #define RESTRICTED_POINTER
+#endif
+
+
+#ifndef CONTAINING_RECORD
+#define CONTAINING_RECORD(address, type, field) \
+ ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
+#endif
+
+/* Also in winddk.h */
+#if !defined(__GNUC__)
+#define FIELD_OFFSET(t,f) ((LONG)(LONG_PTR)&(((t*) 0)->f))
+#else
+#define FIELD_OFFSET(t,f) ((LONG)__builtin_offsetof(t,f))
+#endif
+
/* Returns the type's alignment */
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#define TYPE_ALIGNMENT(t) __alignof(t)
@@ -209,21 +146,30 @@
#error "unknown architecture"
#endif
-#ifndef DECLSPEC_NOVTABLE
-# if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus)
-# define DECLSPEC_NOVTABLE __declspec(novtable)
-# else
-# define DECLSPEC_NOVTABLE
-# endif
-#endif
-
-#ifndef DECLSPEC_SELECTANY
-#if (_MSC_VER >= 1100) || defined(__GNUC__)
-#define DECLSPEC_SELECTANY __declspec(selectany)
+#ifdef __cplusplus
+# define EXTERN_C extern "C"
#else
-#define DECLSPEC_SELECTANY
-#endif
-#endif
+# define EXTERN_C extern
+#endif
+
+
+#define NTAPI __stdcall
+
+#define STDMETHODCALLTYPE __stdcall
+#define STDMETHODVCALLTYPE __cdecl
+#define STDAPICALLTYPE __stdcall
+#define STDAPIVCALLTYPE __cdecl
+#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
+#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE
+#define STDMETHODIMP HRESULT STDMETHODCALLTYPE
+#define STDMETHODIMP_(type) type STDMETHODCALLTYPE
+#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
+#define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE
+#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
+#define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE
+
+
+
#ifndef DECLSPEC_ADDRSAFE
#if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64))
@@ -231,15 +177,28 @@
#else
#define DECLSPEC_ADDRSAFE
#endif
-#endif
-
-/*#ifdef _WINE*/
-#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) &&
(__GNUC_MINOR__ >= 3)))
-#define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
+#endif /* DECLSPEC_ADDRSAFE */
+
+
+#ifndef NOP_FUNCTION
+#if (_MSC_VER >= 1210)
+#define NOP_FUNCTION __noop
#else
-#define __WINE_ALLOC_SIZE(x)
-#endif
-/*#endif*/
+#define NOP_FUNCTION (void)0
+#endif
+#endif
+
+#if !defined(_NTSYSTEM_)
+#define NTSYSAPI DECLSPEC_IMPORT
+#define NTSYSCALLAPI DECLSPEC_IMPORT
+#else
+#define NTSYSAPI
+#if defined(_NTDLLBUILD_)
+#define NTSYSCALLAPI
+#else
+#define NTSYSCALLAPI DECLSPEC_ADDRSAFE
+#endif
+#endif
#ifndef FORCEINLINE
#if (_MSC_VER >= 1200)
@@ -253,74 +212,115 @@
# define FORCEINLINE extern __inline__ __attribute__((__always_inline__))
# endif
#endif
-#endif
-
-#if !defined(_NTSYSTEM_)
-#define NTSYSAPI DECLSPEC_IMPORT
-#define NTSYSCALLAPI DECLSPEC_IMPORT
+#endif /* FORCEINLINE */
+
+
+
+#ifndef DECLSPEC_ALIGN
+# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
+# define DECLSPEC_ALIGN(x) __declspec(align(x))
+# elif defined(__GNUC__)
+# define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
+# else
+# define DECLSPEC_ALIGN(x)
+# endif
+#endif /* DECLSPEC_ALIGN */
+
+
+#ifndef DECLSPEC_NOVTABLE
+# if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus)
+# define DECLSPEC_NOVTABLE __declspec(novtable)
+# else
+# define DECLSPEC_NOVTABLE
+# endif
+#endif
+
+#ifndef DECLSPEC_SELECTANY
+#if (_MSC_VER >= 1100) || defined(__GNUC__)
+#define DECLSPEC_SELECTANY __declspec(selectany)
#else
-#define NTSYSAPI
-#if defined(_NTDLLBUILD_)
-#define NTSYSCALLAPI
+#define DECLSPEC_SELECTANY
+#endif
+#endif
+
+#define UNREFERENCED_PARAMETER(P) {(P)=(P);}
+#define UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L))
+#define DBG_UNREFERENCED_PARAMETER(P) {(P)=(P);}
+#define DBG_UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L))
+
+typedef void *PVOID;
+
+#ifdef STRICT
+typedef void *HANDLE;
+#define DECLARE_HANDLE(n) typedef struct n##__{int i;}*n
#else
-#define NTSYSCALLAPI DECLSPEC_ADDRSAFE
-#endif
-#endif
+typedef PVOID HANDLE;
+#define DECLARE_HANDLE(n) typedef HANDLE n
+#endif
+typedef HANDLE *PHANDLE;
#ifndef VOID
#define VOID void
#endif
+
typedef char CHAR;
typedef short SHORT;
+
#if !defined(__ROS_LONG64__) || defined(_M_AMD64)
typedef long LONG;
+
+
#else
typedef int LONG;
#endif
-typedef char CCHAR, *PCCHAR;
-typedef void *PVOID;
-
-/* FIXME for __WIN64 */
-#ifndef __ptr64
-#define __ptr64
-#endif
-typedef void* __ptr64 PVOID64;
-
-#ifdef __cplusplus
-# define EXTERN_C extern "C"
+
+typedef SHORT *PSHORT;
+typedef LONG *PLONG;
+
+typedef BYTE FCHAR;
+typedef WORD FSHORT;
+typedef DWORD FLONG;
+
+typedef BYTE BOOLEAN,*PBOOLEAN;
+
+#ifdef __GNUC__
+ #define _HAVE_INT64
+ #ifndef _INTEGRAL_MAX_BITS
+ #define _INTEGRAL_MAX_BITS 64
+ #endif
+ #undef __int64
+ #define __int64 long long
+#elif (defined(__WATCOMC__) || defined(_MSC_VER)) && (defined(_INTEGRAL_MAX_BITS)
&& _INTEGRAL_MAX_BITS >= 64 )
+ #define _HAVE_INT64
+#endif /* __GNUC__/__WATCOMC */
+
+#if defined(_HAVE_INT64) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS
>= 64)
+ typedef __int64 LONGLONG;
+ typedef unsigned __int64 DWORDLONG;
#else
-# define EXTERN_C extern
-#endif
-
-#define STDMETHODCALLTYPE __stdcall
-#define STDMETHODVCALLTYPE __cdecl
-#define STDAPICALLTYPE __stdcall
-#define STDAPIVCALLTYPE __cdecl
-
-#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
-#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE
-#define STDMETHODIMP HRESULT STDMETHODCALLTYPE
-#define STDMETHODIMP_(type) type STDMETHODCALLTYPE
-#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
-#define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE
-#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
-#define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE
-
-/* C99 restrict support */
-#if defined(ENABLE_RESTRICTED) && !defined(MIDL_PASS) &&
!defined(RC_INVOKED)
- #if defined(_MSC_VER) && defined(_M_MRX000)
- #define RESTRICTED_POINTER __restrict
- #elif defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) &&
(__GNUC_MINOR__ >= 95)))
- #define RESTRICTED_POINTER __restrict
- #else
- #define RESTRICTED_POINTER
- #endif
-#else
- #define RESTRICTED_POINTER
-#endif
+ typedef double LONGLONG,DWORDLONG;
+#endif
+
+typedef LONGLONG *PLONGLONG;
+typedef DWORDLONG *PDWORDLONG;
+typedef DWORDLONG ULONGLONG,*PULONGLONG;
+typedef LONGLONG USN;
+
+typedef CHAR *PCHAR, *LPCH, *PCH;
+typedef CONST CHAR *LPCCH, *PCCH;
+typedef _Null_terminated_ CHAR *NPSTR, *LPSTR, *PSTR;
+typedef _Null_terminated_ PSTR *PZPSTR;
+typedef _Null_terminated_ CONST PSTR *PCZPSTR;
+typedef _Null_terminated_ CONST CHAR *LPCSTR, *PCSTR;
+typedef _Null_terminated_ PCSTR *PZPCSTR;
+
+typedef _NullNull_terminated_ CHAR *PZZSTR;
+typedef _NullNull_terminated_ CONST CHAR *PCZZSTR;
+
typedef wchar_t WCHAR;
-
+typedef WCHAR *PWCHAR, *LPWCH, *PWCH;
+typedef CONST WCHAR *LPCWCH, *PCWCH;
typedef _Null_terminated_ WCHAR *NWPSTR, *LPWSTR, *PWSTR;
typedef _Null_terminated_ PWSTR *PZPWSTR;
typedef _Null_terminated_ CONST PWSTR *PCZPWSTR;
@@ -334,93 +334,195 @@
typedef _NullNull_terminated_ WCHAR UNALIGNED *PUZZWSTR;
typedef _NullNull_terminated_ CONST WCHAR UNALIGNED *PCUZZWSTR;
-typedef WCHAR *PWCHAR, *LPWCH, *PWCH;
-typedef CONST WCHAR *LPCWCH, *PCWCH;
-typedef CHAR *PCHAR, *LPCH, *PCH;
-typedef CONST CHAR *LPCCH, *PCCH;
-
-typedef _Null_terminated_ CHAR *NPSTR, *LPSTR, *PSTR;
-typedef _Null_terminated_ PSTR *PZPSTR;
-typedef _Null_terminated_ CONST PSTR *PCZPSTR;
-typedef _Null_terminated_ CONST CHAR *LPCSTR, *PCSTR;
-typedef _Null_terminated_ PCSTR *PZPCSTR;
-
-typedef _NullNull_terminated_ CHAR *PZZSTR;
-typedef _NullNull_terminated_ CONST CHAR *PCZZSTR;
-
#ifdef UNICODE
-#ifndef _TCHAR_DEFINED
-#define _TCHAR_DEFINED
+ #ifndef _TCHAR_DEFINED
+ #define _TCHAR_DEFINED
typedef WCHAR TCHAR,*PTCHAR;
typedef WCHAR TBYTE ,*PTBYTE;
-#endif
- typedef LPWSTR LPTCH,PTCH,PTSTR,LPTSTR,LP;
- typedef LPCWSTR PCTSTR,LPCTSTR;
- typedef LPUWSTR PUTSTR,LPUTSTR;
- typedef LPCUWSTR PCUTSTR,LPCUTSTR;
-#define __TEXT(quote) L##quote
-#else
-#ifndef _TCHAR_DEFINED
-#define _TCHAR_DEFINED
+ #endif
+ typedef LPWSTR LPTCH,PTCH,PTSTR,LPTSTR,LP;
+ typedef LPCWSTR PCTSTR,LPCTSTR;
+ typedef LPUWSTR PUTSTR,LPUTSTR;
+ typedef LPCUWSTR PCUTSTR,LPCUTSTR;
+ #define __TEXT(quote) L##quote
+
+#else /* UNICODE */
+
+ #ifndef _TCHAR_DEFINED
+ #define _TCHAR_DEFINED
typedef char TCHAR,*PTCHAR;
typedef unsigned char TBYTE ,*PTBYTE;
-#endif
- typedef LPSTR LPTCH,PTCH,PTSTR,LPTSTR,PUTSTR,LPUTSTR;
- typedef LPCSTR PCTSTR,LPCTSTR,PCUTSTR,LPCUTSTR;
-#define __TEXT(quote) quote
-#endif
+ #endif
+ typedef LPSTR LPTCH,PTCH,PTSTR,LPTSTR,PUTSTR,LPUTSTR;
+ typedef LPCSTR PCTSTR,LPCTSTR,PCUTSTR,LPCUTSTR;
+ #define __TEXT(quote) quote
+#endif /* UNICODE */
#define TEXT(quote) __TEXT(quote)
-typedef SHORT *PSHORT;
-typedef LONG *PLONG;
-#ifdef STRICT
-typedef void *HANDLE;
-#define DECLARE_HANDLE(n) typedef struct n##__{int i;}*n
-#else
-typedef PVOID HANDLE;
-#define DECLARE_HANDLE(n) typedef HANDLE n
-#endif
-typedef HANDLE *PHANDLE;
+typedef char CCHAR, *PCCHAR;
+
typedef DWORD LCID;
typedef PDWORD PLCID;
typedef WORD LANGID;
-#ifdef __GNUC__
-#define _HAVE_INT64
-#ifndef _INTEGRAL_MAX_BITS
-# define _INTEGRAL_MAX_BITS 64
-#endif
-#undef __int64
-#define __int64 long long
-#elif (defined(__WATCOMC__) || defined(_MSC_VER)) && (defined(_INTEGRAL_MAX_BITS)
&& _INTEGRAL_MAX_BITS >= 64 )
-#define _HAVE_INT64
-#endif /* __GNUC__/__WATCOMC */
-#if defined(_HAVE_INT64) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS
>= 64)
-typedef __int64 LONGLONG;
-typedef unsigned __int64 DWORDLONG;
+
+
+#ifdef _M_PPC
+#define LARGE_INTEGER_ORDER(x) x HighPart; DWORD LowPart;
#else
-typedef double LONGLONG,DWORDLONG;
-#endif
-typedef LONGLONG *PLONGLONG;
-typedef DWORDLONG *PDWORDLONG;
-typedef DWORDLONG ULONGLONG,*PULONGLONG;
-typedef LONGLONG USN;
-#ifdef _HAVE_INT64
-#define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b))
-#define UInt32x32To64(a,b) ((DWORDLONG)(a)*(DWORDLONG)(b))
-#define Int64ShllMod32(a,b) ((DWORDLONG)(a)<<(b))
-#define Int64ShraMod32(a,b) ((LONGLONG)(a)>>(b))
-#define Int64ShrlMod32(a,b) ((DWORDLONG)(a)>>(b))
-#endif
+#define LARGE_INTEGER_ORDER(x) DWORD LowPart; x HighPart;
+#endif
+typedef union _LARGE_INTEGER {
+#if ! defined(NONAMELESSUNION) || defined(__cplusplus)
+ _ANONYMOUS_STRUCT struct {
+ LARGE_INTEGER_ORDER(LONG)
+ };
+#endif /* NONAMELESSUNION */
+ struct {
+ LARGE_INTEGER_ORDER(LONG)
+ } u;
+ LONGLONG QuadPart;
+} LARGE_INTEGER, *PLARGE_INTEGER;
+
+typedef union _ULARGE_INTEGER {
+#if ! defined(NONAMELESSUNION) || defined(__cplusplus)
+ _ANONYMOUS_STRUCT struct {
+ LARGE_INTEGER_ORDER(DWORD)
+ };
+#endif /* NONAMELESSUNION */
+ struct {
+ LARGE_INTEGER_ORDER(DWORD)
+ } u;
+ ULONGLONG QuadPart;
+} ULARGE_INTEGER, *PULARGE_INTEGER;
+
+typedef struct _LUID {
+ LARGE_INTEGER_ORDER(LONG)
+} LUID, *PLUID;
+
+#define APPLICATION_ERROR_MASK 0x20000000
+#define ERROR_SEVERITY_SUCCESS 0x00000000
+#define ERROR_SEVERITY_INFORMATIONAL 0x40000000
+#define ERROR_SEVERITY_WARNING 0x80000000
+#define ERROR_SEVERITY_ERROR 0xC0000000
+
+
+
#define ANSI_NULL ((CHAR)0)
#define UNICODE_NULL ((WCHAR)0)
#define UNICODE_STRING_MAX_BYTES ((USHORT) 65534)
#define UNICODE_STRING_MAX_CHARS (32767)
-typedef BYTE BOOLEAN,*PBOOLEAN;
-#endif
-typedef BYTE FCHAR;
-typedef WORD FSHORT;
-typedef DWORD FLONG;
+
+
+typedef struct _LIST_ENTRY {
+ struct _LIST_ENTRY *Flink;
+ struct _LIST_ENTRY *Blink;
+} LIST_ENTRY, *PLIST_ENTRY, *RESTRICTED_POINTER PRLIST_ENTRY;
+
+typedef struct _LIST_ENTRY32 {
+ DWORD Flink;
+ DWORD Blink;
+} LIST_ENTRY32,*PLIST_ENTRY32;
+
+typedef struct _LIST_ENTRY64 {
+ ULONGLONG Flink;
+ ULONGLONG Blink;
+} LIST_ENTRY64,*PLIST_ENTRY64;
+
+typedef struct _SINGLE_LIST_ENTRY {
+ struct _SINGLE_LIST_ENTRY *Next;
+} SINGLE_LIST_ENTRY,*PSINGLE_LIST_ENTRY;
+
+
+typedef struct _PROCESSOR_NUMBER {
+ WORD Group;
+ BYTE Number;
+ BYTE Reserved;
+} PROCESSOR_NUMBER, *PPROCESSOR_NUMBER;
+
+typedef
+_IRQL_requires_same_
+_Function_class_(EXCEPTION_ROUTINE)
+EXCEPTION_DISPOSITION
+NTAPI
+EXCEPTION_ROUTINE(
+ _Inout_ struct _EXCEPTION_RECORD *ExceptionRecord,
+ _In_ PVOID EstablisherFrame,
+ _Inout_ struct _CONTEXT *ContextRecord,
+ _In_ PVOID DispatcherContext);
+
+typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE;
+
+typedef struct _GROUP_AFFINITY {
+ KAFFINITY Mask;
+ WORD Group;
+ WORD Reserved[3];
+} GROUP_AFFINITY, *PGROUP_AFFINITY;
+
+#define RTL_FIELD_TYPE(type, field) (((type*)0)->field)
+#define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8)
+#define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field)))
+#define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
+
+#define RTL_SIZEOF_THROUGH_FIELD(type, field) \
+ (FIELD_OFFSET(type, field) + RTL_FIELD_SIZE(type, field))
+
+#define RTL_CONTAINS_FIELD(Struct, Size, Field) \
+ ((((PCHAR) (&(Struct)->Field)) + sizeof((Struct)->Field)) <= (((PCHAR)
(Struct)) + (Size)))
+
+#define RTL_NUMBER_OF_V1(A) (sizeof(A)/sizeof((A)[0]))
+
+#if defined(__cplusplus) && \
+ !defined(MIDL_PASS) && \
+ !defined(RC_INVOKED) && \
+ !defined(_PREFAST_) && \
+ (_MSC_FULL_VER >= 13009466) && \
+ !defined(SORTPP_PASS)
+#define RTL_NUMBER_OF_V2(A) (sizeof(*RtlpNumberOf(A)))
+#else
+#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
+#endif
+
+#ifdef ENABLE_RTL_NUMBER_OF_V2
+#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V2(A)
+#else
+#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A)
+#endif
+
+#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
+#define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A)
+
+#define RTL_NUMBER_OF_FIELD(type, field) (RTL_NUMBER_OF(RTL_FIELD_TYPE(type, field)))
+
+#define RTL_PADDING_BETWEEN_FIELDS(T, F1, F2) \
+ ((FIELD_OFFSET(T, F2) > FIELD_OFFSET(T, F1)) \
+ ? (FIELD_OFFSET(T, F2) - FIELD_OFFSET(T, F1) - RTL_FIELD_SIZE(T, F1)) \
+ : (FIELD_OFFSET(T, F1) - FIELD_OFFSET(T, F2) - RTL_FIELD_SIZE(T, F2)))
+
+#if defined(__cplusplus)
+#define RTL_CONST_CAST(type) const_cast<type>
+#else
+#define RTL_CONST_CAST(type) (type)
+#endif
+
+#define MINCHAR 0x80
+#define MAXCHAR 0x7f
+#define MINSHORT 0x8000
+#define MAXSHORT 0x7fff
+#define MINLONG 0x80000000
+#define MAXLONG 0x7fffffff
+#define MAXBYTE 0xff
+#define MAXWORD 0xffff
+#define MAXDWORD 0xffffffff
+#define MAXLONGLONG (((LONGLONG)0x7fffffff << 32) | 0xffffffff)
+
+#ifdef _HAVE_INT64
+ #define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b))
+ #define UInt32x32To64(a,b) ((DWORDLONG)(a)*(DWORDLONG)(b))
+ #define Int64ShllMod32(a,b) ((DWORDLONG)(a)<<(b))
+ #define Int64ShraMod32(a,b) ((LONGLONG)(a)>>(b))
+ #define Int64ShrlMod32(a,b) ((DWORDLONG)(a)>>(b))
+#endif
#define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1]
@@ -433,546 +535,24 @@
# define DEFAULT_UNREACHABLE default: break
#endif
-#include "intrin.h"
-
-#define NTAPI __stdcall
-#include <basetsd.h>
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4201)
-#pragma warning(disable:4214)
-#pragma warning(disable:4820)
-#endif
-
-#define ACE_OBJECT_TYPE_PRESENT 0x00000001
-#define ACE_INHERITED_OBJECT_TYPE_PRESENT 0x00000002
-#define APPLICATION_ERROR_MASK 0x20000000
-#define ERROR_SEVERITY_SUCCESS 0x00000000
-#define ERROR_SEVERITY_INFORMATIONAL 0x40000000
-#define ERROR_SEVERITY_WARNING 0x80000000
-#define ERROR_SEVERITY_ERROR 0xC0000000
-
-#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)
-#define COMPRESSION_FORMAT_DEFAULT (0x0001)
-#define COMPRESSION_FORMAT_LZNT1 (0x0002)
-#define COMPRESSION_ENGINE_STANDARD (0x0000)
-#define COMPRESSION_ENGINE_MAXIMUM (0x0100)
-#define COMPRESSION_ENGINE_HIBER (0x0200)
-#define ACCESS_ALLOWED_ACE_TYPE (0x0)
-#define ACCESS_DENIED_ACE_TYPE (0x1)
-#define SYSTEM_AUDIT_ACE_TYPE (0x2)
-#define SYSTEM_ALARM_ACE_TYPE (0x3)
-/*end ntifs.h */
-#define ANYSIZE_ARRAY 1
-#define OBJECT_INHERIT_ACE 1
-#define CONTAINER_INHERIT_ACE 2
-#define NO_PROPAGATE_INHERIT_ACE 4
-#define INHERIT_ONLY_ACE 8
-#define INHERITED_ACE 16
-#define VALID_INHERIT_FLAGS 0x1F
-#define SUCCESSFUL_ACCESS_ACE_FLAG 64
-#define FAILED_ACCESS_ACE_FLAG 128
-#define DELETE 0x00010000L
-#define READ_CONTROL 0x20000L
-#define WRITE_DAC 0x40000L
-#define WRITE_OWNER 0x80000L
-#define SYNCHRONIZE 0x100000L
-#define STANDARD_RIGHTS_REQUIRED 0xF0000
-#define STANDARD_RIGHTS_READ 0x20000
-#define STANDARD_RIGHTS_WRITE 0x20000
-#define STANDARD_RIGHTS_EXECUTE 0x20000
-#define STANDARD_RIGHTS_ALL 0x1F0000
-#define SPECIFIC_RIGHTS_ALL 0xFFFF
-#define ACCESS_SYSTEM_SECURITY 0x1000000
-
-#define REG_STANDARD_FORMAT 1
-#define REG_LATEST_FORMAT 2
-#define REG_NO_COMPRESSION 4
-
-#ifndef WIN32_NO_STATUS
-
-#define STATUS_WAIT_0 ((DWORD)0x00000000)
-#define STATUS_ABANDONED_WAIT_0 ((DWORD)0x00000080)
-#define STATUS_USER_APC ((DWORD)0x000000C0)
-#define STATUS_TIMEOUT ((DWORD)0x00000102)
-#define STATUS_PENDING ((DWORD)0x00000103)
-#define STATUS_SEGMENT_NOTIFICATION ((DWORD)0x40000005)
-#define STATUS_GUARD_PAGE_VIOLATION ((DWORD)0x80000001)
-#define STATUS_DATATYPE_MISALIGNMENT ((DWORD)0x80000002)
-#define STATUS_BREAKPOINT ((DWORD)0x80000003)
-#define STATUS_SINGLE_STEP ((DWORD)0x80000004)
-#define STATUS_ACCESS_VIOLATION ((DWORD)0xC0000005)
-#define STATUS_IN_PAGE_ERROR ((DWORD)0xC0000006)
-#define STATUS_INVALID_HANDLE ((DWORD)0xC0000008)
-#define STATUS_NO_MEMORY ((DWORD)0xC0000017)
-#define STATUS_ILLEGAL_INSTRUCTION ((DWORD)0xC000001D)
-#define STATUS_NONCONTINUABLE_EXCEPTION ((DWORD)0xC0000025)
-#define STATUS_INVALID_DISPOSITION ((DWORD)0xC0000026)
-#define STATUS_ARRAY_BOUNDS_EXCEEDED ((DWORD)0xC000008C)
-#define STATUS_FLOAT_DENORMAL_OPERAND ((DWORD)0xC000008D)
-#define STATUS_FLOAT_DIVIDE_BY_ZERO ((DWORD)0xC000008E)
-#define STATUS_FLOAT_INEXACT_RESULT ((DWORD)0xC000008F)
-#define STATUS_FLOAT_INVALID_OPERATION ((DWORD)0xC0000090)
-#define STATUS_FLOAT_OVERFLOW ((DWORD)0xC0000091)
-#define STATUS_FLOAT_STACK_CHECK ((DWORD)0xC0000092)
-#define STATUS_FLOAT_UNDERFLOW ((DWORD)0xC0000093)
-#define STATUS_INTEGER_DIVIDE_BY_ZERO ((DWORD)0xC0000094)
-#define STATUS_INTEGER_OVERFLOW ((DWORD)0xC0000095)
-#define STATUS_PRIVILEGED_INSTRUCTION ((DWORD)0xC0000096)
-#define STATUS_STACK_OVERFLOW ((DWORD)0xC00000FD)
-#define STATUS_CONTROL_C_EXIT ((DWORD)0xC000013A)
-#define STATUS_FLOAT_MULTIPLE_FAULTS ((DWORD)0xC00002B4)
-#define STATUS_FLOAT_MULTIPLE_TRAPS ((DWORD)0xC00002B5)
-#define STATUS_REG_NAT_CONSUMPTION ((DWORD)0xC00002C9)
-#define STATUS_SXS_EARLY_DEACTIVATION ((DWORD)0xC015000F)
-#define STATUS_SXS_INVALID_DEACTIVATION ((DWORD)0xC0150010)
-
-#define DBG_EXCEPTION_HANDLED ((DWORD)0x00010001)
-#define DBG_CONTINUE ((DWORD)0x00010002)
-#define DBG_TERMINATE_THREAD ((DWORD)0x40010003)
-#define DBG_TERMINATE_PROCESS ((DWORD)0x40010004)
-#define DBG_CONTROL_C ((DWORD)0x40010005)
-#define DBG_CONTROL_BREAK ((DWORD)0x40010008)
-#define DBG_COMMAND_EXCEPTION ((DWORD)0x40010009)
-#define DBG_EXCEPTION_NOT_HANDLED ((DWORD)0x80010001)
-
-#endif /* WIN32_NO_STATUS */
-
-#define MAXIMUM_ALLOWED 0x2000000
-#define GENERIC_READ 0x80000000
-#define GENERIC_WRITE 0x40000000
-#define GENERIC_EXECUTE 0x20000000
-#define GENERIC_ALL 0x10000000
-
-#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
-
-/* Also in ddk/winddk.h */
-#define FILE_LIST_DIRECTORY 0x00000001
-#define FILE_READ_DATA 0x00000001
-#define FILE_ADD_FILE 0x00000002
-#define FILE_WRITE_DATA 0x00000002
-#define FILE_ADD_SUBDIRECTORY 0x00000004
-#define FILE_APPEND_DATA 0x00000004
-#define FILE_CREATE_PIPE_INSTANCE 0x00000004
-#define FILE_READ_EA 0x00000008
-#define FILE_READ_PROPERTIES 0x00000008
-#define FILE_WRITE_EA 0x00000010
-#define FILE_WRITE_PROPERTIES 0x00000010
-#define FILE_EXECUTE 0x00000020
-#define FILE_TRAVERSE 0x00000020
-#define FILE_DELETE_CHILD 0x00000040
-#define FILE_READ_ATTRIBUTES 0x00000080
-#define FILE_WRITE_ATTRIBUTES 0x00000100
-
-#define FILE_SHARE_READ 0x00000001
-#define FILE_SHARE_WRITE 0x00000002
-#define FILE_SHARE_DELETE 0x00000004
-#define FILE_SHARE_VALID_FLAGS 0x00000007
-
-#define FILE_ATTRIBUTE_READONLY 0x00000001
-#define FILE_ATTRIBUTE_HIDDEN 0x00000002
-#define FILE_ATTRIBUTE_SYSTEM 0x00000004
-#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
-#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
-#define FILE_ATTRIBUTE_DEVICE 0x00000040
-#define FILE_ATTRIBUTE_NORMAL 0x00000080
-#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
-#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
-#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
-#define FILE_ATTRIBUTE_COMPRESSED 0x00000800
-#define FILE_ATTRIBUTE_OFFLINE 0x00001000
-#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
-#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
-#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
-#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
-
-#define FILE_COPY_STRUCTURED_STORAGE 0x00000041
-#define FILE_STRUCTURED_STORAGE 0x00000441
-
-#define FILE_VALID_OPTION_FLAGS 0x00ffffff
-#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032
-#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032
-#define FILE_VALID_SET_FLAGS 0x00000036
-
-#define FILE_DIRECTORY_FILE 0x00000001
-#define FILE_WRITE_THROUGH 0x00000002
-#define FILE_SEQUENTIAL_ONLY 0x00000004
-#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
-#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
-#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
-#define FILE_NON_DIRECTORY_FILE 0x00000040
-#define FILE_CREATE_TREE_CONNECTION 0x00000080
-#define FILE_COMPLETE_IF_OPLOCKED 0x00000100
-#define FILE_NO_EA_KNOWLEDGE 0x00000200
-#define FILE_OPEN_REMOTE_INSTANCE 0x00000400
-#define FILE_RANDOM_ACCESS 0x00000800
-#define FILE_DELETE_ON_CLOSE 0x00001000
-#define FILE_OPEN_BY_FILE_ID 0x00002000
-#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
-#define FILE_NO_COMPRESSION 0x00008000
-#define FILE_RESERVE_OPFILTER 0x00100000
-#define FILE_OPEN_REPARSE_POINT 0x00200000
-#define FILE_OPEN_NO_RECALL 0x00400000
-#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
-
-#define FILE_ALL_ACCESS \
- (STANDARD_RIGHTS_REQUIRED | \
- SYNCHRONIZE | \
- 0x1FF)
-
-#define FILE_GENERIC_EXECUTE \
- (STANDARD_RIGHTS_EXECUTE | \
- FILE_READ_ATTRIBUTES | \
- FILE_EXECUTE | \
- SYNCHRONIZE)
-
-#define FILE_GENERIC_READ \
- (STANDARD_RIGHTS_READ | \
- FILE_READ_DATA | \
- FILE_READ_ATTRIBUTES | \
- FILE_READ_EA | \
- SYNCHRONIZE)
-
-#define FILE_GENERIC_WRITE \
- (STANDARD_RIGHTS_WRITE | \
- FILE_WRITE_DATA | \
- FILE_WRITE_ATTRIBUTES | \
- FILE_WRITE_EA | \
- FILE_APPEND_DATA | \
- SYNCHRONIZE)
-/* end winddk.h */
-/* also in ddk/ntifs.h */
-#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
-#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
-#define FILE_NOTIFY_CHANGE_NAME 0x00000003
-#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
-#define FILE_NOTIFY_CHANGE_SIZE 0x00000008
-#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
-#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
-#define FILE_NOTIFY_CHANGE_CREATION 0x00000040
-#define FILE_NOTIFY_CHANGE_EA 0x00000080
-#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
-#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
-#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
-#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
-#define FILE_NOTIFY_VALID_MASK 0x00000fff
-
-#define FILE_CASE_SENSITIVE_SEARCH 0x00000001
-#define FILE_CASE_PRESERVED_NAMES 0x00000002
-#define FILE_UNICODE_ON_DISK 0x00000004
-#define FILE_PERSISTENT_ACLS 0x00000008
-#define FILE_FILE_COMPRESSION 0x00000010
-#define FILE_VOLUME_QUOTAS 0x00000020
-#define FILE_SUPPORTS_SPARSE_FILES 0x00000040
-#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
-#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
-#define FS_LFN_APIS 0x00004000
-#define FILE_VOLUME_IS_COMPRESSED 0x00008000
-#define FILE_SUPPORTS_OBJECT_IDS 0x00010000
-#define FILE_SUPPORTS_ENCRYPTION 0x00020000
-#define FILE_NAMED_STREAMS 0x00040000
-
-#define IO_COMPLETION_QUERY_STATE 0x0001
-#define IO_COMPLETION_MODIFY_STATE 0x0002
-#define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
-/* end ntifs.h */
-
-/* also in ddk/winddk.h */
-#define DUPLICATE_CLOSE_SOURCE 0x00000001
-#define DUPLICATE_SAME_ACCESS 0x00000002
-/* end winddk.k */
-
-#define MAILSLOT_NO_MESSAGE ((DWORD)-1)
-#define MAILSLOT_WAIT_FOREVER ((DWORD)-1)
-#define PROCESS_TERMINATE 1
-#define PROCESS_CREATE_THREAD 2
-#define PROCESS_SET_SESSIONID 4
-#define PROCESS_VM_OPERATION 8
-#define PROCESS_VM_READ 16
-#define PROCESS_VM_WRITE 32
-#define PROCESS_CREATE_PROCESS 128
-#define PROCESS_SET_QUOTA 256
-#define PROCESS_SET_INFORMATION 512
-#define PROCESS_QUERY_INFORMATION 1024
-#define PROCESS_SUSPEND_RESUME 2048
-#define PROCESS_QUERY_LIMITED_INFORMATION 0x1000
-#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xFFF)
-#define PROCESS_DUP_HANDLE 64
-#define THREAD_TERMINATE 1
-#define THREAD_SUSPEND_RESUME 2
-#define THREAD_GET_CONTEXT 8
-#define THREAD_SET_CONTEXT 16
-#define THREAD_SET_INFORMATION 32
-#define THREAD_QUERY_INFORMATION 64
-#define THREAD_SET_THREAD_TOKEN 128
-#define THREAD_IMPERSONATE 256
-#define THREAD_DIRECT_IMPERSONATION 0x200
-#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF)
-#define MUTANT_QUERY_STATE 0x0001
-#define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)
-#define TIMER_QUERY_STATE 0x0001
-#define TIMER_MODIFY_STATE 0x0002
-#define
TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE)
-#define THREAD_BASE_PRIORITY_LOWRT 15
-#define THREAD_BASE_PRIORITY_MAX 2
-#define THREAD_BASE_PRIORITY_MIN (-2)
-#define THREAD_BASE_PRIORITY_IDLE (-15)
-/*
- * To prevent gcc compiler warnings, bracket these defines when initialising
- * a SID_IDENTIFIER_AUTHORITY, eg.
- * SID_IDENTIFIER_AUTHORITY aNullSidAuthority = {SECURITY_NULL_SID_AUTHORITY};
- */
-#define SID_MAX_SUB_AUTHORITIES 15
-
-/* security entities */
-#define SECURITY_NULL_RID (0x00000000L)
-#define SECURITY_WORLD_RID (0x00000000L)
-#define SECURITY_LOCAL_RID (0X00000000L)
-
-#define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
-
-/* S-1-1 */
-#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
-
-/* S-1-2 */
-#define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
-
-/* S-1-3 */
-#define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
-#define SECURITY_CREATOR_OWNER_RID (0x00000000L)
-#define SECURITY_CREATOR_GROUP_RID (0x00000001L)
-#define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L)
-#define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L)
-
-/* S-1-4 */
-#define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
-
-/* S-1-5 */
-#define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
-#define SECURITY_DIALUP_RID 0x00000001L
-#define SECURITY_NETWORK_RID 0x00000002L
-#define SECURITY_BATCH_RID 0x00000003L
-#define SECURITY_INTERACTIVE_RID 0x00000004L
-#define SECURITY_LOGON_IDS_RID 0x00000005L
-#define SECURITY_SERVICE_RID 0x00000006L
-#define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L
-#define SECURITY_PROXY_RID 0x00000008L
-#define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L
-#define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
-#define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL
-#define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL
-#define SECURITY_RESTRICTED_CODE_RID 0x0000000CL
-#define SECURITY_TERMINAL_SERVER_RID 0x0000000DL
-#define SECURITY_REMOTE_LOGON_RID 0x0000000EL
-#define SECURITY_THIS_ORGANIZATION_RID 0x0000000FL
-#define SECURITY_LOCAL_SYSTEM_RID 0x00000012L
-#define SECURITY_LOCAL_SERVICE_RID 0x00000013L
-#define SECURITY_NETWORK_SERVICE_RID 0x00000014L
-#define SECURITY_NT_NON_UNIQUE 0x00000015L
-#define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L
-
-#define SECURITY_PACKAGE_BASE_RID 0x00000040L
-#define SECURITY_PACKAGE_NTLM_RID 0x0000000AL
-#define SECURITY_PACKAGE_SCHANNEL_RID 0x0000000EL
-#define SECURITY_PACKAGE_DIGEST_RID 0x00000015L
-#define SECURITY_OTHER_ORGANIZATION_RID 0x000003E8L
-
-#define SECURITY_LOGON_IDS_RID_COUNT 0x3
-#define SID_REVISION 1
-
-#define FOREST_USER_RID_MAX 0x000001F3L
-#define DOMAIN_USER_RID_ADMIN 0x000001F4L
-#define DOMAIN_USER_RID_GUEST 0x000001F5L
-#define DOMAIN_USER_RID_KRBTGT 0x000001F6L
-#define DOMAIN_USER_RID_MAX 0x000003E7L
-
-#define DOMAIN_GROUP_RID_ADMINS 0x00000200L
-#define DOMAIN_GROUP_RID_USERS 0x00000201L
-#define DOMAIN_GROUP_RID_GUESTS 0x00000202L
-#define DOMAIN_GROUP_RID_COMPUTERS 0x00000203L
-#define DOMAIN_GROUP_RID_CONTROLLERS 0x00000204L
-#define DOMAIN_GROUP_RID_CERT_ADMINS 0x00000205L
-#define DOMAIN_GROUP_RID_SCHEMA_ADMINS 0x00000206L
-#define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS 0x00000207L
-#define DOMAIN_GROUP_RID_POLICY_ADMINS 0x00000208L
-
-#define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16}
-#define SECURITY_MANDATORY_UNTRUSTED_RID 0x00000000L
-#define SECURITY_MANDATORY_LOW_RID 0x00001000L
-#define SECURITY_MANDATORY_MEDIUM_RID 0x00002000L
-#define SECURITY_MANDATORY_HIGH_RID 0x00003000L
-#define SECURITY_MANDATORY_SYSTEM_RID 0x00004000L
-#define SECURITY_MANDATORY_PROTECTED_PROCESS_RID 0x00005000L
-
-#define DOMAIN_ALIAS_RID_ADMINS 0x00000220L
-#define DOMAIN_ALIAS_RID_USERS 0x00000221L
-#define DOMAIN_ALIAS_RID_GUESTS 0x00000222L
-#define DOMAIN_ALIAS_RID_POWER_USERS 0x00000223L
-
-#define DOMAIN_ALIAS_RID_ACCOUNT_OPS 0x00000224L
-#define DOMAIN_ALIAS_RID_SYSTEM_OPS 0x00000225L
-#define DOMAIN_ALIAS_RID_PRINT_OPS 0x00000226L
-#define DOMAIN_ALIAS_RID_BACKUP_OPS 0x00000227L
-
-#define DOMAIN_ALIAS_RID_REPLICATOR 0x00000228L
-#define DOMAIN_ALIAS_RID_RAS_SERVERS 0x00000229L
-#define DOMAIN_ALIAS_RID_PREW2KCOMPACCESS 0x0000022AL
-#define DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS 0x0000022BL
-#define DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS 0x0000022CL
-#define DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS 0x0000022DL
-
-#define DOMAIN_ALIAS_RID_MONITORING_USERS 0x0000022EL
-#define DOMAIN_ALIAS_RID_LOGGING_USERS 0x0000022FL
-#define DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS 0x00000230L
-#define DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS 0x00000231L
-#define DOMAIN_ALIAS_RID_DCOM_USERS 0x00000232L
-
-#define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16}
-
-typedef enum {
- WinNullSid = 0,
- WinWorldSid = 1,
- WinLocalSid = 2,
- WinCreatorOwnerSid = 3,
- WinCreatorGroupSid = 4,
- WinCreatorOwnerServerSid = 5,
- WinCreatorGroupServerSid = 6,
- WinNtAuthoritySid = 7,
- WinDialupSid = 8,
- WinNetworkSid = 9,
- WinBatchSid = 10,
- WinInteractiveSid = 11,
- WinServiceSid = 12,
- WinAnonymousSid = 13,
- WinProxySid = 14,
- WinEnterpriseControllersSid = 15,
- WinSelfSid = 16,
- WinAuthenticatedUserSid = 17,
- WinRestrictedCodeSid = 18,
- WinTerminalServerSid = 19,
- WinRemoteLogonIdSid = 20,
- WinLogonIdsSid = 21,
- WinLocalSystemSid = 22,
- WinLocalServiceSid = 23,
- WinNetworkServiceSid = 24,
- WinBuiltinDomainSid = 25,
- WinBuiltinAdministratorsSid = 26,
- WinBuiltinUsersSid = 27,
- WinBuiltinGuestsSid = 28,
- WinBuiltinPowerUsersSid = 29,
- WinBuiltinAccountOperatorsSid = 30,
- WinBuiltinSystemOperatorsSid = 31,
- WinBuiltinPrintOperatorsSid = 32,
- WinBuiltinBackupOperatorsSid = 33,
- WinBuiltinReplicatorSid = 34,
- WinBuiltinPreWindows2000CompatibleAccessSid = 35,
- WinBuiltinRemoteDesktopUsersSid = 36,
- WinBuiltinNetworkConfigurationOperatorsSid = 37,
- WinAccountAdministratorSid = 38,
- WinAccountGuestSid = 39,
- WinAccountKrbtgtSid = 40,
- WinAccountDomainAdminsSid = 41,
- WinAccountDomainUsersSid = 42,
- WinAccountDomainGuestsSid = 43,
- WinAccountComputersSid = 44,
- WinAccountControllersSid = 45,
- WinAccountCertAdminsSid = 46,
- WinAccountSchemaAdminsSid = 47,
- WinAccountEnterpriseAdminsSid = 48,
- WinAccountPolicyAdminsSid = 49,
- WinAccountRasAndIasServersSid = 50,
- WinNTLMAuthenticationSid = 51,
- WinDigestAuthenticationSid = 52,
- WinSChannelAuthenticationSid = 53,
- WinThisOrganizationSid = 54,
- WinOtherOrganizationSid = 55,
- WinBuiltinIncomingForestTrustBuildersSid = 56,
- WinBuiltinPerfMonitoringUsersSid = 57,
- WinBuiltinPerfLoggingUsersSid = 58,
- WinBuiltinAuthorizationAccessSid = 59,
- WinBuiltinTerminalServerLicenseServersSid = 60,
- WinBuiltinDCOMUsersSid = 61,
- WinBuiltinIUsersSid = 62,
- WinIUserSid = 63,
- WinBuiltinCryptoOperatorsSid = 64,
- WinUntrustedLabelSid = 65,
- WinLowLabelSid = 66,
- WinMediumLabelSid = 67,
- WinHighLabelSid = 68,
- WinSystemLabelSid = 69,
- WinWriteRestrictedCodeSid = 70,
- WinCreatorOwnerRightsSid = 71,
- WinCacheablePrincipalsGroupSid = 72,
- WinNonCacheablePrincipalsGroupSid = 73,
- WinEnterpriseReadonlyControllersSid = 74,
- WinAccountReadonlyControllersSid = 75,
- WinBuiltinEventLogReadersGroup = 76,
- WinNewEnterpriseReadonlyControllersSid = 77,
- WinBuiltinCertSvcDComAccessGroup = 78,
- WinMediumPlusLabelSid = 79,
- WinLocalLogonSid = 80,
- WinConsoleLogonSid = 81,
- WinThisOrganizationCertificateSid = 82,
-} WELL_KNOWN_SID_TYPE;
-
-#define SE_CREATE_TOKEN_NAME TEXT("SeCreateTokenPrivilege")
-#define SE_ASSIGNPRIMARYTOKEN_NAME TEXT("SeAssignPrimaryTokenPrivilege")
-#define SE_LOCK_MEMORY_NAME TEXT("SeLockMemoryPrivilege")
-#define SE_INCREASE_QUOTA_NAME TEXT("SeIncreaseQuotaPrivilege")
-#define SE_UNSOLICITED_INPUT_NAME TEXT("SeUnsolicitedInputPrivilege")
-#define SE_MACHINE_ACCOUNT_NAME TEXT("SeMachineAccountPrivilege")
-#define SE_TCB_NAME TEXT("SeTcbPrivilege")
-#define SE_SECURITY_NAME TEXT("SeSecurityPrivilege")
-#define SE_TAKE_OWNERSHIP_NAME TEXT("SeTakeOwnershipPrivilege")
-#define SE_LOAD_DRIVER_NAME TEXT("SeLoadDriverPrivilege")
-#define SE_SYSTEM_PROFILE_NAME TEXT("SeSystemProfilePrivilege")
-#define SE_SYSTEMTIME_NAME TEXT("SeSystemtimePrivilege")
-#define SE_PROF_SINGLE_PROCESS_NAME TEXT("SeProfileSingleProcessPrivilege")
-#define SE_INC_BASE_PRIORITY_NAME TEXT("SeIncreaseBasePriorityPrivilege")
-#define SE_CREATE_PAGEFILE_NAME TEXT("SeCreatePagefilePrivilege")
-#define SE_CREATE_PERMANENT_NAME TEXT("SeCreatePermanentPrivilege")
-#define SE_BACKUP_NAME TEXT("SeBackupPrivilege")
-#define SE_RESTORE_NAME TEXT("SeRestorePrivilege")
-#define SE_SHUTDOWN_NAME TEXT("SeShutdownPrivilege")
-#define SE_DEBUG_NAME TEXT("SeDebugPrivilege")
-#define SE_AUDIT_NAME TEXT("SeAuditPrivilege")
-#define SE_SYSTEM_ENVIRONMENT_NAME TEXT("SeSystemEnvironmentPrivilege")
-#define SE_CHANGE_NOTIFY_NAME TEXT("SeChangeNotifyPrivilege")
-#define SE_REMOTE_SHUTDOWN_NAME TEXT("SeRemoteShutdownPrivilege")
-#define SE_UNDOCK_NAME TEXT("SeUndockPrivilege")
-#define SE_SYNC_AGENT_NAME TEXT("SeSyncAgentPrivilege")
-#define SE_ENABLE_DELEGATION_NAME TEXT("SeEnableDelegationPrivilege")
-#define SE_MANAGE_VOLUME_NAME TEXT("SeManageVolumePrivilege")
-#define SE_IMPERSONATE_NAME TEXT("SeImpersonatePrivilege")
-#define SE_CREATE_GLOBAL_NAME TEXT("SeCreateGlobalPrivilege")
-
-#define SE_GROUP_MANDATORY 0x00000001
-#define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
-#define SE_GROUP_ENABLED 0x00000004
-#define SE_GROUP_OWNER 0x00000008
-#define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
-#define SE_GROUP_INTEGRITY 0x00000020
-#define SE_GROUP_INTEGRITY_ENABLED 0x00000040
-#define SE_GROUP_LOGON_ID 0xC0000000
-#define SE_GROUP_RESOURCE 0x20000000
-#define SE_GROUP_VALID_ATTRIBUTES 0xE000007F
+#define VER_WORKSTATION_NT 0x40000000
+#define VER_SERVER_NT 0x80000000
+#define VER_SUITE_SMALLBUSINESS 1
+#define VER_SUITE_ENTERPRISE 2
+#define VER_SUITE_BACKOFFICE 4
+#define VER_SUITE_COMMUNICATIONS 8
+#define VER_SUITE_TERMINAL 16
+#define VER_SUITE_SMALLBUSINESS_RESTRICTED 32
+#define VER_SUITE_EMBEDDEDNT 64
+#define VER_SUITE_DATACENTER 128
+#define VER_SUITE_SINGLEUSERTS 256
+#define VER_SUITE_PERSONAL 512
+#define VER_SUITE_BLADE 1024
+#define VER_SUITE_EMBEDDED_RESTRICTED 2048
+#define VER_SUITE_SECURITY_APPLIANCE 4096
+#define VER_SUITE_STORAGE_SERVER 8192
+#define VER_SUITE_COMPUTE_SERVER 16384
+#define VER_SUITE_WH_SERVER 32768
/*
* Product types
@@ -1063,6 +643,17 @@
#define PRODUCT_CORE 0x00000065
#define PRODUCT_PROFESSIONAL_WMC 0x00000067
#define PRODUCT_UNLICENSED 0xABCDABCD
+
+#define MAKELANGID(p,s) ((((WORD)(s))<<10)|(WORD)(p))
+#define PRIMARYLANGID(l) ((WORD)(l)&0x3ff)
+#define SUBLANGID(l) ((WORD)(l)>>10)
+#define MAKELCID(l,s) ((DWORD)((((DWORD)((WORD)(s)))<<16)|((DWORD)((WORD)(l)))))
+#define LANGIDFROMLCID(l) ((WORD)(l))
+#define SORTIDFROMLCID(l) ((WORD)((((DWORD)(l))&NLS_VALID_LOCALE_MASK)>>16))
+#define SORTVERSIONFROMLCID(l) ((WORD)((((DWORD)(l))>>20)&0xf))
+
+#define NLS_VALID_LOCALE_MASK 1048575
+#define LOCALE_NAME_MAX_LENGTH 85
#define LANG_NEUTRAL 0x00
#define LANG_INVARIANT 0x7f
@@ -1193,26 +784,12 @@
#define LANG_YORUBA 0x6a
#define LANG_ZULU 0x35
-/* FIXME: non-standard */
-#define LANG_ESPERANTO 0x8f
-#define LANG_WALON 0x90
-#define LANG_CORNISH 0x92
-
-/* FIXME: not present in the official headers */
-#define LANG_MALAGASY 0x8d
-#define LANG_GAELIC 0x94
-#define LANG_SAAMI 0x3b
-#define LANG_SUTU 0x30
-#define LANG_TSONGA 0x31
-#define LANG_VENDA 0x33
-#define LANG_MANX_GAELIC 0x94
-
+#define SUBLANG_NEUTRAL 0x00
+#define SUBLANG_DEFAULT 0x01
+#define SUBLANG_SYS_DEFAULT 0x02
+#define SUBLANG_CUSTOM_DEFAULT 0x03
#define SUBLANG_CUSTOM_UNSPECIFIED 0x04
-#define SUBLANG_CUSTOM_DEFAULT 0x03
#define SUBLANG_UI_CUSTOM_DEFAULT 0x05
-#define SUBLANG_NEUTRAL 0x00
-#define SUBLANG_SYS_DEFAULT 0x02
-#define SUBLANG_DEFAULT 0x01
#define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01
#define SUBLANG_ALBANIAN_ALBANIA 0x01
#define SUBLANG_ALSATIAN_FRANCE 0x01
@@ -1307,15 +884,15 @@
#define SUBLANG_ICELANDIC_ICELAND 0x01
#define SUBLANG_IGBO_NIGERIA 0x01
#define SUBLANG_INDONESIAN_INDONESIA 0x01
+#define SUBLANG_INUKTITUT_CANADA 0x01
#define SUBLANG_INUKTITUT_CANADA_LATIN 0x02
-#define SUBLANG_INUKTITUT_CANADA 0x01
#define SUBLANG_IRISH_IRELAND 0x02
#define SUBLANG_ITALIAN 0x01
#define SUBLANG_ITALIAN_SWISS 0x02
#define SUBLANG_JAPANESE_JAPAN 0x01
#define SUBLANG_KANNADA_INDIA 0x01
+#define SUBLANG_KASHMIRI_SASIA 0x02
#define SUBLANG_KASHMIRI_INDIA 0x02
-#define SUBLANG_KASHMIRI_SASIA 0x02
#define SUBLANG_KAZAK_KAZAKHSTAN 0x01
#define SUBLANG_KHMER_CAMBODIA 0x01
#define SUBLANG_KICHE_GUATEMALA 0x01
@@ -1331,8 +908,8 @@
#define SUBLANG_LOWER_SORBIAN_GERMANY 0x02
#define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01
#define SUBLANG_MACEDONIAN_MACEDONIA 0x01
+#define SUBLANG_MALAY_MALAYSIA 0x01
#define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
-#define SUBLANG_MALAY_MALAYSIA 0x01
#define SUBLANG_MALAYALAM_INDIA 0x01
#define SUBLANG_MALTESE_MALTA 0x01
#define SUBLANG_MAORI_NEW_ZEALAND 0x01
@@ -1341,8 +918,8 @@
#define SUBLANG_MOHAWK_MOHAWK 0x01
#define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01
#define SUBLANG_MONGOLIAN_PRC 0x02
+#define SUBLANG_NEPALI_INDIA 0x02
#define SUBLANG_NEPALI_NEPAL 0x01
-#define SUBLANG_NEPALI_INDIA 0x02
#define SUBLANG_NORWEGIAN_BOKMAL 0x01
#define SUBLANG_NORWEGIAN_NYNORSK 0x02
#define SUBLANG_OCCITAN_FRANCE 0x01
@@ -1350,9 +927,8 @@
#define SUBLANG_PASHTO_AFGHANISTAN 0x01
#define SUBLANG_PERSIAN_IRAN 0x01
#define SUBLANG_POLISH_POLAND 0x01
+#define SUBLANG_PORTUGUESE 0x02
#define SUBLANG_PORTUGUESE_BRAZILIAN 0x01
-#define SUBLANG_PORTUGUESE 0x02
-#define SUBLANG_PORTUGUESE_PORTUGAL 0x02
#define SUBLANG_PUNJABI_INDIA 0x01
#define SUBLANG_QUECHUA_BOLIVIA 0x01
#define SUBLANG_QUECHUA_ECUADOR 0x02
@@ -1423,10 +999,10 @@
#define SUBLANG_UIGHUR_PRC 0x01
#define SUBLANG_UKRAINIAN_UKRAINE 0x01
#define SUBLANG_UPPER_SORBIAN_GERMANY 0x01
+#define SUBLANG_URDU_PAKISTAN 0x01
#define SUBLANG_URDU_INDIA 0x02
-#define SUBLANG_URDU_PAKISTAN 0x01
+#define SUBLANG_UZBEK_LATIN 0x01
#define SUBLANG_UZBEK_CYRILLIC 0x02
-#define SUBLANG_UZBEK_LATIN 0x01
#define SUBLANG_VIETNAMESE_VIETNAM 0x01
#define SUBLANG_WELSH_UNITED_KINGDOM 0x01
#define SUBLANG_WOLOF_SENEGAL 0x01
@@ -1435,7 +1011,7 @@
#define SUBLANG_YI_PRC 0x01
#define SUBLANG_YORUBA_NIGERIA 0x01
#define SUBLANG_ZULU_SOUTH_AFRICA 0x01
-#define NLS_VALID_LOCALE_MASK 1048575
+
#define SORT_DEFAULT 0
#define SORT_JAPANESE_XJIS 0
#define SORT_JAPANESE_UNICODE 1
@@ -1451,20 +1027,649 @@
#define SORT_HUNGARIAN_TECHNICAL 1
#define SORT_GEORGIAN_TRADITIONAL 0
#define SORT_GEORGIAN_MODERN 1
-#define MAKELANGID(p,s) ((((WORD)(s))<<10)|(WORD)(p))
-#define MAKELCID(l,s) ((DWORD)((((DWORD)((WORD)(s)))<<16)|((DWORD)((WORD)(l)))))
-#define PRIMARYLANGID(l) ((WORD)(l)&0x3ff)
-#define SORTIDFROMLCID(l) ((WORD)((((DWORD)(l))&NLS_VALID_LOCALE_MASK)>>16))
-#define SORTVERSIONFROMLCID(l) ((WORD)((((DWORD)(l))>>20)&0xf))
-#define SUBLANGID(l) ((WORD)(l)>>10)
-#define LANGIDFROMLCID(l) ((WORD)(l))
+
#define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT)
#define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT)
+
#define LOCALE_SYSTEM_DEFAULT MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)
#define LOCALE_USER_DEFAULT MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)
#define LOCALE_NEUTRAL MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT)
#define LOCALE_INVARIANT MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL),
SORT_DEFAULT)
-#define LOCALE_NAME_MAX_LENGTH 85
+
+#undef __C89_NAMELESS
+#undef __C89_NAMELESSSTRUCTNAME
+#undef __C89_NAMELESSSTRUCTNAME1
+#undef __C89_NAMELESSSTRUCTNAME2
+#undef __C89_NAMELESSSTRUCTNAME3
+#undef __C89_NAMELESSSTRUCTNAME4
+#undef __C89_NAMELESSSTRUCTNAME5
+#undef __C89_NAMELESSUNIONNAME
+#undef __C89_NAMELESSUNIONNAME1
+#undef __C89_NAMELESSUNIONNAME2
+#undef __C89_NAMELESSUNIONNAME3
+#undef __C89_NAMELESSUNIONNAME4
+#undef __C89_NAMELESSUNIONNAME5
+#undef __C89_NAMELESSUNIONNAME6
+#undef __C89_NAMELESSUNIONNAME7
+#undef __C89_NAMELESSUNIONNAME8
+
+#if !defined(__WINESRC__) && !defined(WINE_NO_NAMELESS_EXTENSION)
+# ifdef __GNUC__
+ /* Anonymous structs support starts with gcc 2.96/g++ 2.95 */
+# if (__GNUC__ > 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ > 95) ||
((__GNUC_MINOR__ == 95) && defined(__cplusplus))))
+# define __C89_NAMELESS __extension__
+# endif
+# elif defined(_MSC_VER)
+# define __C89_NAMELESS
+# endif
+#endif
+
+#ifdef __C89_NAMELESS
+# define __C89_NAMELESSSTRUCTNAME
+# define __C89_NAMELESSSTRUCTNAME1
+# define __C89_NAMELESSSTRUCTNAME2
+# define __C89_NAMELESSSTRUCTNAME3
+# define __C89_NAMELESSSTRUCTNAME4
+# define __C89_NAMELESSSTRUCTNAME5
+# define __C89_NAMELESSUNIONNAME
+# define __C89_NAMELESSUNIONNAME1
+# define __C89_NAMELESSUNIONNAME2
+# define __C89_NAMELESSUNIONNAME3
+# define __C89_NAMELESSUNIONNAME4
+# define __C89_NAMELESSUNIONNAME5
+# define __C89_NAMELESSUNIONNAME6
+# define __C89_NAMELESSUNIONNAME7
+# define __C89_NAMELESSUNIONNAME8
+#else
+# define __C89_NAMELESS
+# define __C89_NAMELESSSTRUCTNAME DUMMYSTRUCTNAME
+# define __C89_NAMELESSSTRUCTNAME1 DUMMYSTRUCTNAME1
+# define __C89_NAMELESSSTRUCTNAME2 DUMMYSTRUCTNAME2
+# define __C89_NAMELESSSTRUCTNAME3 DUMMYSTRUCTNAME3
+# define __C89_NAMELESSSTRUCTNAME4 DUMMYSTRUCTNAME4
+# define __C89_NAMELESSSTRUCTNAME5 DUMMYSTRUCTNAME5
+# define __C89_NAMELESSUNIONNAME DUMMYUNIONNAME
+# define __C89_NAMELESSUNIONNAME1 DUMMYUNIONNAME1
+# define __C89_NAMELESSUNIONNAME2 DUMMYUNIONNAME2
+# define __C89_NAMELESSUNIONNAME3 DUMMYUNIONNAME3
+# define __C89_NAMELESSUNIONNAME4 DUMMYUNIONNAME4
+# define __C89_NAMELESSUNIONNAME5 DUMMYUNIONNAME5
+# define __C89_NAMELESSUNIONNAME6 DUMMYUNIONNAME6
+# define __C89_NAMELESSUNIONNAME7 DUMMYUNIONNAME7
+# define __C89_NAMELESSUNIONNAME8 DUMMYUNIONNAME8
+#endif
+
+# define DECLSPEC_HIDDEN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef RC_INVOKED
+
+/*#ifdef _WINE*/
+#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) &&
(__GNUC_MINOR__ >= 3)))
+ #define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
+#else
+ #define __WINE_ALLOC_SIZE(x)
+#endif
+/*#endif*/
+
+
+/* FIXME for __WIN64 */
+#ifndef __ptr64
+ #define __ptr64
+#endif
+typedef void* __ptr64 PVOID64;
+
+
+#endif /* RC_INVOKED */
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4201)
+#pragma warning(disable:4214)
+#pragma warning(disable:4820)
+#endif
+
+#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)
+#define COMPRESSION_FORMAT_DEFAULT (0x0001)
+#define COMPRESSION_FORMAT_LZNT1 (0x0002)
+#define COMPRESSION_ENGINE_STANDARD (0x0000)
+#define COMPRESSION_ENGINE_MAXIMUM (0x0100)
+#define COMPRESSION_ENGINE_HIBER (0x0200)
+#define ACCESS_ALLOWED_ACE_TYPE (0x0)
+#define ACCESS_DENIED_ACE_TYPE (0x1)
+#define SYSTEM_AUDIT_ACE_TYPE (0x2)
+#define SYSTEM_ALARM_ACE_TYPE (0x3)
+/*end ntifs.h */
+#define OBJECT_INHERIT_ACE 1
+#define CONTAINER_INHERIT_ACE 2
+#define NO_PROPAGATE_INHERIT_ACE 4
+#define INHERIT_ONLY_ACE 8
+#define INHERITED_ACE 16
+#define VALID_INHERIT_FLAGS 0x1F
+#define SUCCESSFUL_ACCESS_ACE_FLAG 64
+#define FAILED_ACCESS_ACE_FLAG 128
+#define DELETE 0x00010000L
+#define READ_CONTROL 0x20000L
+#define WRITE_DAC 0x40000L
+#define WRITE_OWNER 0x80000L
+#define SYNCHRONIZE 0x100000L
+#define STANDARD_RIGHTS_REQUIRED 0xF0000
+#define STANDARD_RIGHTS_READ 0x20000
+#define STANDARD_RIGHTS_WRITE 0x20000
+#define STANDARD_RIGHTS_EXECUTE 0x20000
+#define STANDARD_RIGHTS_ALL 0x1F0000
+#define SPECIFIC_RIGHTS_ALL 0xFFFF
+#define ACCESS_SYSTEM_SECURITY 0x1000000
+
+#define REG_STANDARD_FORMAT 1
+#define REG_LATEST_FORMAT 2
+#define REG_NO_COMPRESSION 4
+
+#ifndef WIN32_NO_STATUS
+
+#define STATUS_WAIT_0 ((DWORD)0x00000000)
+#define STATUS_ABANDONED_WAIT_0 ((DWORD)0x00000080)
+#define STATUS_USER_APC ((DWORD)0x000000C0)
+#define STATUS_TIMEOUT ((DWORD)0x00000102)
+#define STATUS_PENDING ((DWORD)0x00000103)
+#define STATUS_SEGMENT_NOTIFICATION ((DWORD)0x40000005)
+#define STATUS_GUARD_PAGE_VIOLATION ((DWORD)0x80000001)
+#define STATUS_DATATYPE_MISALIGNMENT ((DWORD)0x80000002)
+#define STATUS_BREAKPOINT ((DWORD)0x80000003)
+#define STATUS_SINGLE_STEP ((DWORD)0x80000004)
+#define STATUS_ACCESS_VIOLATION ((DWORD)0xC0000005)
+#define STATUS_IN_PAGE_ERROR ((DWORD)0xC0000006)
+#define STATUS_INVALID_HANDLE ((DWORD)0xC0000008)
+#define STATUS_NO_MEMORY ((DWORD)0xC0000017)
+#define STATUS_ILLEGAL_INSTRUCTION ((DWORD)0xC000001D)
+#define STATUS_NONCONTINUABLE_EXCEPTION ((DWORD)0xC0000025)
+#define STATUS_INVALID_DISPOSITION ((DWORD)0xC0000026)
+#define STATUS_ARRAY_BOUNDS_EXCEEDED ((DWORD)0xC000008C)
+#define STATUS_FLOAT_DENORMAL_OPERAND ((DWORD)0xC000008D)
+#define STATUS_FLOAT_DIVIDE_BY_ZERO ((DWORD)0xC000008E)
+#define STATUS_FLOAT_INEXACT_RESULT ((DWORD)0xC000008F)
+#define STATUS_FLOAT_INVALID_OPERATION ((DWORD)0xC0000090)
+#define STATUS_FLOAT_OVERFLOW ((DWORD)0xC0000091)
+#define STATUS_FLOAT_STACK_CHECK ((DWORD)0xC0000092)
+#define STATUS_FLOAT_UNDERFLOW ((DWORD)0xC0000093)
+#define STATUS_INTEGER_DIVIDE_BY_ZERO ((DWORD)0xC0000094)
+#define STATUS_INTEGER_OVERFLOW ((DWORD)0xC0000095)
+#define STATUS_PRIVILEGED_INSTRUCTION ((DWORD)0xC0000096)
+#define STATUS_STACK_OVERFLOW ((DWORD)0xC00000FD)
+#define STATUS_CONTROL_C_EXIT ((DWORD)0xC000013A)
+#define STATUS_FLOAT_MULTIPLE_FAULTS ((DWORD)0xC00002B4)
+#define STATUS_FLOAT_MULTIPLE_TRAPS ((DWORD)0xC00002B5)
+#define STATUS_REG_NAT_CONSUMPTION ((DWORD)0xC00002C9)
+#define STATUS_SXS_EARLY_DEACTIVATION ((DWORD)0xC015000F)
+#define STATUS_SXS_INVALID_DEACTIVATION ((DWORD)0xC0150010)
+
+#define DBG_EXCEPTION_HANDLED ((DWORD)0x00010001)
+#define DBG_CONTINUE ((DWORD)0x00010002)
+#define DBG_TERMINATE_THREAD ((DWORD)0x40010003)
+#define DBG_TERMINATE_PROCESS ((DWORD)0x40010004)
+#define DBG_CONTROL_C ((DWORD)0x40010005)
+#define DBG_CONTROL_BREAK ((DWORD)0x40010008)
+#define DBG_COMMAND_EXCEPTION ((DWORD)0x40010009)
+#define DBG_EXCEPTION_NOT_HANDLED ((DWORD)0x80010001)
+
+#endif /* WIN32_NO_STATUS */
+
+#define MAXIMUM_ALLOWED 0x2000000
+#define GENERIC_READ 0x80000000
+#define GENERIC_WRITE 0x40000000
+#define GENERIC_EXECUTE 0x20000000
+#define GENERIC_ALL 0x10000000
+
+#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
+
+/* Also in ddk/winddk.h */
+#define FILE_LIST_DIRECTORY 0x00000001
+#define FILE_READ_DATA 0x00000001
+#define FILE_ADD_FILE 0x00000002
+#define FILE_WRITE_DATA 0x00000002
+#define FILE_ADD_SUBDIRECTORY 0x00000004
+#define FILE_APPEND_DATA 0x00000004
+#define FILE_CREATE_PIPE_INSTANCE 0x00000004
+#define FILE_READ_EA 0x00000008
+#define FILE_READ_PROPERTIES 0x00000008
+#define FILE_WRITE_EA 0x00000010
+#define FILE_WRITE_PROPERTIES 0x00000010
+#define FILE_EXECUTE 0x00000020
+#define FILE_TRAVERSE 0x00000020
+#define FILE_DELETE_CHILD 0x00000040
+#define FILE_READ_ATTRIBUTES 0x00000080
+#define FILE_WRITE_ATTRIBUTES 0x00000100
+
+#define FILE_SHARE_READ 0x00000001
+#define FILE_SHARE_WRITE 0x00000002
+#define FILE_SHARE_DELETE 0x00000004
+#define FILE_SHARE_VALID_FLAGS 0x00000007
+
+#define FILE_ATTRIBUTE_READONLY 0x00000001
+#define FILE_ATTRIBUTE_HIDDEN 0x00000002
+#define FILE_ATTRIBUTE_SYSTEM 0x00000004
+#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
+#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
+#define FILE_ATTRIBUTE_DEVICE 0x00000040
+#define FILE_ATTRIBUTE_NORMAL 0x00000080
+#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
+#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
+#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
+#define FILE_ATTRIBUTE_COMPRESSED 0x00000800
+#define FILE_ATTRIBUTE_OFFLINE 0x00001000
+#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
+#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
+#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
+#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
+
+#define FILE_COPY_STRUCTURED_STORAGE 0x00000041
+#define FILE_STRUCTURED_STORAGE 0x00000441
+
+#define FILE_VALID_OPTION_FLAGS 0x00ffffff
+#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032
+#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032
+#define FILE_VALID_SET_FLAGS 0x00000036
+
+#define FILE_DIRECTORY_FILE 0x00000001
+#define FILE_WRITE_THROUGH 0x00000002
+#define FILE_SEQUENTIAL_ONLY 0x00000004
+#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
+#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
+#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
+#define FILE_NON_DIRECTORY_FILE 0x00000040
+#define FILE_CREATE_TREE_CONNECTION 0x00000080
+#define FILE_COMPLETE_IF_OPLOCKED 0x00000100
+#define FILE_NO_EA_KNOWLEDGE 0x00000200
+#define FILE_OPEN_REMOTE_INSTANCE 0x00000400
+#define FILE_RANDOM_ACCESS 0x00000800
+#define FILE_DELETE_ON_CLOSE 0x00001000
+#define FILE_OPEN_BY_FILE_ID 0x00002000
+#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
+#define FILE_NO_COMPRESSION 0x00008000
+#define FILE_RESERVE_OPFILTER 0x00100000
+#define FILE_OPEN_REPARSE_POINT 0x00200000
+#define FILE_OPEN_NO_RECALL 0x00400000
+#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
+
+#define FILE_ALL_ACCESS \
+ (STANDARD_RIGHTS_REQUIRED | \
+ SYNCHRONIZE | \
+ 0x1FF)
+
+#define FILE_GENERIC_EXECUTE \
+ (STANDARD_RIGHTS_EXECUTE | \
+ FILE_READ_ATTRIBUTES | \
+ FILE_EXECUTE | \
+ SYNCHRONIZE)
+
+#define FILE_GENERIC_READ \
+ (STANDARD_RIGHTS_READ | \
+ FILE_READ_DATA | \
+ FILE_READ_ATTRIBUTES | \
+ FILE_READ_EA | \
+ SYNCHRONIZE)
+
+#define FILE_GENERIC_WRITE \
+ (STANDARD_RIGHTS_WRITE | \
+ FILE_WRITE_DATA | \
+ FILE_WRITE_ATTRIBUTES | \
+ FILE_WRITE_EA | \
+ FILE_APPEND_DATA | \
+ SYNCHRONIZE)
+/* end winddk.h */
+/* also in ddk/ntifs.h */
+#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
+#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
+#define FILE_NOTIFY_CHANGE_NAME 0x00000003
+#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
+#define FILE_NOTIFY_CHANGE_SIZE 0x00000008
+#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
+#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
+#define FILE_NOTIFY_CHANGE_CREATION 0x00000040
+#define FILE_NOTIFY_CHANGE_EA 0x00000080
+#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
+#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
+#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
+#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
+#define FILE_NOTIFY_VALID_MASK 0x00000fff
+
+#define FILE_CASE_SENSITIVE_SEARCH 0x00000001
+#define FILE_CASE_PRESERVED_NAMES 0x00000002
+#define FILE_UNICODE_ON_DISK 0x00000004
+#define FILE_PERSISTENT_ACLS 0x00000008
+#define FILE_FILE_COMPRESSION 0x00000010
+#define FILE_VOLUME_QUOTAS 0x00000020
+#define FILE_SUPPORTS_SPARSE_FILES 0x00000040
+#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
+#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
+#define FS_LFN_APIS 0x00004000
+#define FILE_VOLUME_IS_COMPRESSED 0x00008000
+#define FILE_SUPPORTS_OBJECT_IDS 0x00010000
+#define FILE_SUPPORTS_ENCRYPTION 0x00020000
+#define FILE_NAMED_STREAMS 0x00040000
+
+#define IO_COMPLETION_QUERY_STATE 0x0001
+#define IO_COMPLETION_MODIFY_STATE 0x0002
+#define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
+/* end ntifs.h */
+
+/* also in ddk/winddk.h */
+#define DUPLICATE_CLOSE_SOURCE 0x00000001
+#define DUPLICATE_SAME_ACCESS 0x00000002
+/* end winddk.k */
+
+#define MAILSLOT_NO_MESSAGE ((DWORD)-1)
+#define MAILSLOT_WAIT_FOREVER ((DWORD)-1)
+#define PROCESS_TERMINATE 1
+#define PROCESS_CREATE_THREAD 2
+#define PROCESS_SET_SESSIONID 4
+#define PROCESS_VM_OPERATION 8
+#define PROCESS_VM_READ 16
+#define PROCESS_VM_WRITE 32
+#define PROCESS_CREATE_PROCESS 128
+#define PROCESS_SET_QUOTA 256
+#define PROCESS_SET_INFORMATION 512
+#define PROCESS_QUERY_INFORMATION 1024
+#define PROCESS_SUSPEND_RESUME 2048
+#define PROCESS_QUERY_LIMITED_INFORMATION 0x1000
+#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xFFF)
+#define PROCESS_DUP_HANDLE 64
+#define THREAD_TERMINATE 1
+#define THREAD_SUSPEND_RESUME 2
+#define THREAD_GET_CONTEXT 8
+#define THREAD_SET_CONTEXT 16
+#define THREAD_SET_INFORMATION 32
+#define THREAD_QUERY_INFORMATION 64
+#define THREAD_SET_THREAD_TOKEN 128
+#define THREAD_IMPERSONATE 256
+#define THREAD_DIRECT_IMPERSONATION 0x200
+#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF)
+#define MUTANT_QUERY_STATE 0x0001
+#define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)
+#define TIMER_QUERY_STATE 0x0001
+#define TIMER_MODIFY_STATE 0x0002
+#define
TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE)
+#define THREAD_BASE_PRIORITY_LOWRT 15
+#define THREAD_BASE_PRIORITY_MAX 2
+#define THREAD_BASE_PRIORITY_MIN (-2)
+#define THREAD_BASE_PRIORITY_IDLE (-15)
+/*
+ * To prevent gcc compiler warnings, bracket these defines when initialising
+ * a SID_IDENTIFIER_AUTHORITY, eg.
+ * SID_IDENTIFIER_AUTHORITY aNullSidAuthority = {SECURITY_NULL_SID_AUTHORITY};
+ */
+#define SID_MAX_SUB_AUTHORITIES 15
+
+/* security entities */
+#define SECURITY_NULL_RID (0x00000000L)
+#define SECURITY_WORLD_RID (0x00000000L)
+#define SECURITY_LOCAL_RID (0X00000000L)
+
+#define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
+
+/* S-1-1 */
+#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
+
+/* S-1-2 */
+#define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
+
+/* S-1-3 */
+#define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
+#define SECURITY_CREATOR_OWNER_RID (0x00000000L)
+#define SECURITY_CREATOR_GROUP_RID (0x00000001L)
+#define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L)
+#define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L)
+
+/* S-1-4 */
+#define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
+
+/* S-1-5 */
+#define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
+#define SECURITY_DIALUP_RID 0x00000001L
+#define SECURITY_NETWORK_RID 0x00000002L
+#define SECURITY_BATCH_RID 0x00000003L
+#define SECURITY_INTERACTIVE_RID 0x00000004L
+#define SECURITY_LOGON_IDS_RID 0x00000005L
+#define SECURITY_SERVICE_RID 0x00000006L
+#define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L
+#define SECURITY_PROXY_RID 0x00000008L
+#define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L
+#define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
+#define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL
+#define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL
+#define SECURITY_RESTRICTED_CODE_RID 0x0000000CL
+#define SECURITY_TERMINAL_SERVER_RID 0x0000000DL
+#define SECURITY_REMOTE_LOGON_RID 0x0000000EL
+#define SECURITY_THIS_ORGANIZATION_RID 0x0000000FL
+#define SECURITY_LOCAL_SYSTEM_RID 0x00000012L
+#define SECURITY_LOCAL_SERVICE_RID 0x00000013L
+#define SECURITY_NETWORK_SERVICE_RID 0x00000014L
+#define SECURITY_NT_NON_UNIQUE 0x00000015L
+#define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L
+
+#define SECURITY_PACKAGE_BASE_RID 0x00000040L
+#define SECURITY_PACKAGE_NTLM_RID 0x0000000AL
+#define SECURITY_PACKAGE_SCHANNEL_RID 0x0000000EL
+#define SECURITY_PACKAGE_DIGEST_RID 0x00000015L
+#define SECURITY_OTHER_ORGANIZATION_RID 0x000003E8L
+
+#define SECURITY_LOGON_IDS_RID_COUNT 0x3
+#define SID_REVISION 1
+
+#define FOREST_USER_RID_MAX 0x000001F3L
+#define DOMAIN_USER_RID_ADMIN 0x000001F4L
+#define DOMAIN_USER_RID_GUEST 0x000001F5L
+#define DOMAIN_USER_RID_KRBTGT 0x000001F6L
+#define DOMAIN_USER_RID_MAX 0x000003E7L
+
+#define DOMAIN_GROUP_RID_ADMINS 0x00000200L
+#define DOMAIN_GROUP_RID_USERS 0x00000201L
+#define DOMAIN_GROUP_RID_GUESTS 0x00000202L
+#define DOMAIN_GROUP_RID_COMPUTERS 0x00000203L
+#define DOMAIN_GROUP_RID_CONTROLLERS 0x00000204L
+#define DOMAIN_GROUP_RID_CERT_ADMINS 0x00000205L
+#define DOMAIN_GROUP_RID_SCHEMA_ADMINS 0x00000206L
+#define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS 0x00000207L
+#define DOMAIN_GROUP_RID_POLICY_ADMINS 0x00000208L
+
+#define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16}
+#define SECURITY_MANDATORY_UNTRUSTED_RID 0x00000000L
+#define SECURITY_MANDATORY_LOW_RID 0x00001000L
+#define SECURITY_MANDATORY_MEDIUM_RID 0x00002000L
+#define SECURITY_MANDATORY_HIGH_RID 0x00003000L
+#define SECURITY_MANDATORY_SYSTEM_RID 0x00004000L
+#define SECURITY_MANDATORY_PROTECTED_PROCESS_RID 0x00005000L
+
+#define DOMAIN_ALIAS_RID_ADMINS 0x00000220L
+#define DOMAIN_ALIAS_RID_USERS 0x00000221L
+#define DOMAIN_ALIAS_RID_GUESTS 0x00000222L
+#define DOMAIN_ALIAS_RID_POWER_USERS 0x00000223L
+
+#define DOMAIN_ALIAS_RID_ACCOUNT_OPS 0x00000224L
+#define DOMAIN_ALIAS_RID_SYSTEM_OPS 0x00000225L
+#define DOMAIN_ALIAS_RID_PRINT_OPS 0x00000226L
+#define DOMAIN_ALIAS_RID_BACKUP_OPS 0x00000227L
+
+#define DOMAIN_ALIAS_RID_REPLICATOR 0x00000228L
+#define DOMAIN_ALIAS_RID_RAS_SERVERS 0x00000229L
+#define DOMAIN_ALIAS_RID_PREW2KCOMPACCESS 0x0000022AL
+#define DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS 0x0000022BL
+#define DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS 0x0000022CL
+#define DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS 0x0000022DL
+
+#define DOMAIN_ALIAS_RID_MONITORING_USERS 0x0000022EL
+#define DOMAIN_ALIAS_RID_LOGGING_USERS 0x0000022FL
+#define DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS 0x00000230L
+#define DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS 0x00000231L
+#define DOMAIN_ALIAS_RID_DCOM_USERS 0x00000232L
+
+#define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16}
+
+typedef enum {
+ WinNullSid = 0,
+ WinWorldSid = 1,
+ WinLocalSid = 2,
+ WinCreatorOwnerSid = 3,
+ WinCreatorGroupSid = 4,
+ WinCreatorOwnerServerSid = 5,
+ WinCreatorGroupServerSid = 6,
+ WinNtAuthoritySid = 7,
+ WinDialupSid = 8,
+ WinNetworkSid = 9,
+ WinBatchSid = 10,
+ WinInteractiveSid = 11,
+ WinServiceSid = 12,
+ WinAnonymousSid = 13,
+ WinProxySid = 14,
+ WinEnterpriseControllersSid = 15,
+ WinSelfSid = 16,
+ WinAuthenticatedUserSid = 17,
+ WinRestrictedCodeSid = 18,
+ WinTerminalServerSid = 19,
+ WinRemoteLogonIdSid = 20,
+ WinLogonIdsSid = 21,
+ WinLocalSystemSid = 22,
+ WinLocalServiceSid = 23,
+ WinNetworkServiceSid = 24,
+ WinBuiltinDomainSid = 25,
+ WinBuiltinAdministratorsSid = 26,
+ WinBuiltinUsersSid = 27,
+ WinBuiltinGuestsSid = 28,
+ WinBuiltinPowerUsersSid = 29,
+ WinBuiltinAccountOperatorsSid = 30,
+ WinBuiltinSystemOperatorsSid = 31,
+ WinBuiltinPrintOperatorsSid = 32,
+ WinBuiltinBackupOperatorsSid = 33,
+ WinBuiltinReplicatorSid = 34,
+ WinBuiltinPreWindows2000CompatibleAccessSid = 35,
+ WinBuiltinRemoteDesktopUsersSid = 36,
+ WinBuiltinNetworkConfigurationOperatorsSid = 37,
+ WinAccountAdministratorSid = 38,
+ WinAccountGuestSid = 39,
+ WinAccountKrbtgtSid = 40,
+ WinAccountDomainAdminsSid = 41,
+ WinAccountDomainUsersSid = 42,
+ WinAccountDomainGuestsSid = 43,
+ WinAccountComputersSid = 44,
+ WinAccountControllersSid = 45,
+ WinAccountCertAdminsSid = 46,
+ WinAccountSchemaAdminsSid = 47,
+ WinAccountEnterpriseAdminsSid = 48,
+ WinAccountPolicyAdminsSid = 49,
+ WinAccountRasAndIasServersSid = 50,
+ WinNTLMAuthenticationSid = 51,
+ WinDigestAuthenticationSid = 52,
+ WinSChannelAuthenticationSid = 53,
+ WinThisOrganizationSid = 54,
+ WinOtherOrganizationSid = 55,
+ WinBuiltinIncomingForestTrustBuildersSid = 56,
+ WinBuiltinPerfMonitoringUsersSid = 57,
+ WinBuiltinPerfLoggingUsersSid = 58,
+ WinBuiltinAuthorizationAccessSid = 59,
+ WinBuiltinTerminalServerLicenseServersSid = 60,
+ WinBuiltinDCOMUsersSid = 61,
+ WinBuiltinIUsersSid = 62,
+ WinIUserSid = 63,
+ WinBuiltinCryptoOperatorsSid = 64,
+ WinUntrustedLabelSid = 65,
+ WinLowLabelSid = 66,
+ WinMediumLabelSid = 67,
+ WinHighLabelSid = 68,
+ WinSystemLabelSid = 69,
+ WinWriteRestrictedCodeSid = 70,
+ WinCreatorOwnerRightsSid = 71,
+ WinCacheablePrincipalsGroupSid = 72,
+ WinNonCacheablePrincipalsGroupSid = 73,
+ WinEnterpriseReadonlyControllersSid = 74,
+ WinAccountReadonlyControllersSid = 75,
+ WinBuiltinEventLogReadersGroup = 76,
+ WinNewEnterpriseReadonlyControllersSid = 77,
+ WinBuiltinCertSvcDComAccessGroup = 78,
+ WinMediumPlusLabelSid = 79,
+ WinLocalLogonSid = 80,
+ WinConsoleLogonSid = 81,
+ WinThisOrganizationCertificateSid = 82,
+} WELL_KNOWN_SID_TYPE;
+
+#define SE_CREATE_TOKEN_NAME TEXT("SeCreateTokenPrivilege")
+#define SE_ASSIGNPRIMARYTOKEN_NAME TEXT("SeAssignPrimaryTokenPrivilege")
+#define SE_LOCK_MEMORY_NAME TEXT("SeLockMemoryPrivilege")
+#define SE_INCREASE_QUOTA_NAME TEXT("SeIncreaseQuotaPrivilege")
+#define SE_UNSOLICITED_INPUT_NAME TEXT("SeUnsolicitedInputPrivilege")
+#define SE_MACHINE_ACCOUNT_NAME TEXT("SeMachineAccountPrivilege")
+#define SE_TCB_NAME TEXT("SeTcbPrivilege")
+#define SE_SECURITY_NAME TEXT("SeSecurityPrivilege")
+#define SE_TAKE_OWNERSHIP_NAME TEXT("SeTakeOwnershipPrivilege")
+#define SE_LOAD_DRIVER_NAME TEXT("SeLoadDriverPrivilege")
+#define SE_SYSTEM_PROFILE_NAME TEXT("SeSystemProfilePrivilege")
+#define SE_SYSTEMTIME_NAME TEXT("SeSystemtimePrivilege")
+#define SE_PROF_SINGLE_PROCESS_NAME TEXT("SeProfileSingleProcessPrivilege")
+#define SE_INC_BASE_PRIORITY_NAME TEXT("SeIncreaseBasePriorityPrivilege")
+#define SE_CREATE_PAGEFILE_NAME TEXT("SeCreatePagefilePrivilege")
+#define SE_CREATE_PERMANENT_NAME TEXT("SeCreatePermanentPrivilege")
+#define SE_BACKUP_NAME TEXT("SeBackupPrivilege")
+#define SE_RESTORE_NAME TEXT("SeRestorePrivilege")
+#define SE_SHUTDOWN_NAME TEXT("SeShutdownPrivilege")
+#define SE_DEBUG_NAME TEXT("SeDebugPrivilege")
+#define SE_AUDIT_NAME TEXT("SeAuditPrivilege")
+#define SE_SYSTEM_ENVIRONMENT_NAME TEXT("SeSystemEnvironmentPrivilege")
+#define SE_CHANGE_NOTIFY_NAME TEXT("SeChangeNotifyPrivilege")
+#define SE_REMOTE_SHUTDOWN_NAME TEXT("SeRemoteShutdownPrivilege")
+#define SE_UNDOCK_NAME TEXT("SeUndockPrivilege")
+#define SE_SYNC_AGENT_NAME TEXT("SeSyncAgentPrivilege")
+#define SE_ENABLE_DELEGATION_NAME TEXT("SeEnableDelegationPrivilege")
+#define SE_MANAGE_VOLUME_NAME TEXT("SeManageVolumePrivilege")
+#define SE_IMPERSONATE_NAME TEXT("SeImpersonatePrivilege")
+#define SE_CREATE_GLOBAL_NAME TEXT("SeCreateGlobalPrivilege")
+
+#define SE_GROUP_MANDATORY 0x00000001
+#define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
+#define SE_GROUP_ENABLED 0x00000004
+#define SE_GROUP_OWNER 0x00000008
+#define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
+#define SE_GROUP_INTEGRITY 0x00000020
+#define SE_GROUP_INTEGRITY_ENABLED 0x00000040
+#define SE_GROUP_LOGON_ID 0xC0000000
+#define SE_GROUP_RESOURCE 0x20000000
+#define SE_GROUP_VALID_ATTRIBUTES 0xE000007F
+
+/* FIXME: non-standard */
+#define LANG_ESPERANTO 0x8f
+#define LANG_WALON 0x90
+#define LANG_CORNISH 0x92
+
+/* FIXME: not present in the official headers */
+#define LANG_MALAGASY 0x8d
+#define LANG_GAELIC 0x94
+#define LANG_SAAMI 0x3b
+#define LANG_SUTU 0x30
+#define LANG_TSONGA 0x31
+#define LANG_VENDA 0x33
+#define LANG_MANX_GAELIC 0x94
+#define SUBLANG_PORTUGUESE_PORTUGAL 0x02
+
#define ACL_REVISION 2
#define ACL_REVISION_DS 4
#define ACL_REVISION1 1
@@ -1473,16 +1678,6 @@
#define ACL_REVISION4 4
#define MIN_ACL_REVISION 2
#define MAX_ACL_REVISION 4
-#define MINCHAR 0x80
-#define MAXCHAR 0x7f
-#define MINSHORT 0x8000
-#define MAXSHORT 0x7fff
-#define MINLONG 0x80000000
-#define MAXLONG 0x7fffffff
-#define MAXBYTE 0xff
-#define MAXWORD 0xffff
-#define MAXDWORD 0xffffffff
-#define MAXLONGLONG (((LONGLONG)0x7fffffff << 32) | 0xffffffff)
#define PROCESSOR_INTEL_386 386
#define PROCESSOR_INTEL_486 486
#define PROCESSOR_INTEL_PENTIUM 586
@@ -1637,63 +1832,6 @@
#define MESSAGE_RESOURCE_UNICODE 1
#define RTL_CRITSECT_TYPE 0
#define RTL_RESOURCE_TYPE 1
-
-#define RTL_FIELD_TYPE(type, field) (((type*)0)->field)
-#define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8)
-#define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field)))
-
-/* Also in winddk.h */
-#if !defined(__GNUC__)
-#define FIELD_OFFSET(t,f) ((LONG)(LONG_PTR)&(((t*) 0)->f))
-#else
-#define FIELD_OFFSET(t,f) ((LONG)__builtin_offsetof(t,f))
-#endif
-#ifndef CONTAINING_RECORD
-#define CONTAINING_RECORD(address, type, field) \
- ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
-#endif
-
-#define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
-#define RTL_SIZEOF_THROUGH_FIELD(type, field) \
- (FIELD_OFFSET(type, field) + RTL_FIELD_SIZE(type, field))
-#define RTL_CONTAINS_FIELD(Struct, Size, Field) \
- ((((PCHAR) (&(Struct)->Field)) + sizeof((Struct)->Field)) <= (((PCHAR)
(Struct)) + (Size)))
-#define RTL_NUMBER_OF_V1(A) (sizeof(A)/sizeof((A)[0]))
-
-#if defined(__cplusplus) && \
- !defined(MIDL_PASS) && \
- !defined(RC_INVOKED) && \
- !defined(_PREFAST_) && \
- (_MSC_FULL_VER >= 13009466) && \
- !defined(SORTPP_PASS)
-#define RTL_NUMBER_OF_V2(A) (sizeof(*RtlpNumberOf(A)))
-#else
-#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
-#endif
-
-#ifdef ENABLE_RTL_NUMBER_OF_V2
-#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V2(A)
-#else
-#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A)
-#endif
-#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
-#define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A)
-
-#define RTL_FIELD_TYPE(type, field) (((type*)0)->field)
-#define RTL_NUMBER_OF_FIELD(type, field) (RTL_NUMBER_OF(RTL_FIELD_TYPE(type, field)))
-#define RTL_PADDING_BETWEEN_FIELDS(T, F1, F2) \
- ((FIELD_OFFSET(T, F2) > FIELD_OFFSET(T, F1)) \
- ? (FIELD_OFFSET(T, F2) - FIELD_OFFSET(T, F1) - RTL_FIELD_SIZE(T, F1)) \
- : (FIELD_OFFSET(T, F1) - FIELD_OFFSET(T, F2) - RTL_FIELD_SIZE(T, F2)))
-
-#if defined(__cplusplus)
-#define RTL_CONST_CAST(type) const_cast<type>
-#else
-#define RTL_CONST_CAST(type) (type)
-#endif
-
-#define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8)
-#define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field)))
/* end winddk.h */
#define IMAGE_SIZEOF_FILE_HEADER 20
@@ -2220,30 +2358,14 @@
#define VER_AND 6
#define VER_OR 7
#endif
-#define VER_SERVER_NT 0x80000000
-#define VER_WORKSTATION_NT 0x40000000
+
#define VER_PLATFORM_WIN32s 0
#define VER_PLATFORM_WIN32_WINDOWS 1
#define VER_PLATFORM_WIN32_NT 2
#define VER_NT_WORKSTATION 1
#define VER_NT_DOMAIN_CONTROLLER 2
#define VER_NT_SERVER 3
-#define VER_SUITE_SMALLBUSINESS 1
-#define VER_SUITE_ENTERPRISE 2
-#define VER_SUITE_BACKOFFICE 4
-#define VER_SUITE_COMMUNICATIONS 8
-#define VER_SUITE_TERMINAL 16
-#define VER_SUITE_SMALLBUSINESS_RESTRICTED 32
-#define VER_SUITE_EMBEDDEDNT 64
-#define VER_SUITE_DATACENTER 128
-#define VER_SUITE_SINGLEUSERTS 256
-#define VER_SUITE_PERSONAL 512
-#define VER_SUITE_BLADE 1024
-#define VER_SUITE_EMBEDDED_RESTRICTED 2048
-#define VER_SUITE_SECURITY_APPLIANCE 4096
-#define VER_SUITE_STORAGE_SERVER 8192
-#define VER_SUITE_COMPUTE_SERVER 16384
-#define VER_SUITE_WH_SERVER 32768
+
#define WT_EXECUTEDEFAULT 0x00000000
#define WT_EXECUTEINIOTHREAD 0x00000001
#define WT_EXECUTEINUITHREAD 0x00000002
@@ -2503,18 +2625,6 @@
DWORD AclBytesFree;
} ACL_SIZE_INFORMATION, *PACL_SIZE_INFORMATION;
-typedef
-_IRQL_requires_same_
-_Function_class_(EXCEPTION_ROUTINE)
-EXCEPTION_DISPOSITION
-NTAPI
-EXCEPTION_ROUTINE(
- _Inout_ struct _EXCEPTION_RECORD *ExceptionRecord,
- _In_ PVOID EstablisherFrame,
- _Inout_ struct _CONTEXT *ContextRecord,
- _In_ PVOID DispatcherContext);
-
-typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE;
#ifndef _LDT_ENTRY_DEFINED
#define _LDT_ENTRY_DEFINED
@@ -3420,38 +3530,6 @@
PCONTEXT ContextRecord;
} EXCEPTION_POINTERS,*PEXCEPTION_POINTERS, *LPEXCEPTION_POINTERS;
-#ifdef _M_PPC
-#define LARGE_INTEGER_ORDER(x) x HighPart; DWORD LowPart;
-#else
-#define LARGE_INTEGER_ORDER(x) DWORD LowPart; x HighPart;
-#endif
-
-typedef union _LARGE_INTEGER {
-#if ! defined(NONAMELESSUNION) || defined(__cplusplus)
- _ANONYMOUS_STRUCT struct {
- LARGE_INTEGER_ORDER(LONG)
- };
-#endif /* NONAMELESSUNION */
- struct {
- LARGE_INTEGER_ORDER(LONG)
- } u;
- LONGLONG QuadPart;
-} LARGE_INTEGER, *PLARGE_INTEGER;
-typedef union _ULARGE_INTEGER {
-#if ! defined(NONAMELESSUNION) || defined(__cplusplus)
- _ANONYMOUS_STRUCT struct {
- LARGE_INTEGER_ORDER(DWORD)
- };
-#endif /* NONAMELESSUNION */
- struct {
- LARGE_INTEGER_ORDER(DWORD)
- } u;
- ULONGLONG QuadPart;
-} ULARGE_INTEGER, *PULARGE_INTEGER;
-typedef struct _LUID {
- LARGE_INTEGER_ORDER(LONG)
-} LUID, *PLUID;
-
#include <pshpack4.h>
typedef struct _LUID_AND_ATTRIBUTES {
@@ -3816,25 +3894,6 @@
MESSAGE_RESOURCE_BLOCK Blocks[1];
} MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA;
-typedef struct _LIST_ENTRY {
- struct _LIST_ENTRY *Flink;
- struct _LIST_ENTRY *Blink;
-} LIST_ENTRY, *PLIST_ENTRY, *RESTRICTED_POINTER PRLIST_ENTRY;
-
-typedef struct _LIST_ENTRY32 {
- DWORD Flink;
- DWORD Blink;
-} LIST_ENTRY32,*PLIST_ENTRY32;
-
-typedef struct _LIST_ENTRY64 {
- ULONGLONG Flink;
- ULONGLONG Blink;
-} LIST_ENTRY64,*PLIST_ENTRY64;
-
-typedef struct _SINGLE_LIST_ENTRY {
- struct _SINGLE_LIST_ENTRY *Next;
-} SINGLE_LIST_ENTRY,*PSINGLE_LIST_ENTRY;
-
//
// Slist Header
//
@@ -4038,18 +4097,6 @@
(NTAPI *PVECTORED_EXCEPTION_HANDLER)(
struct _EXCEPTION_POINTERS *ExceptionInfo
);
-
-typedef struct _PROCESSOR_NUMBER {
- WORD Group;
- BYTE Number;
- BYTE Reserved;
-} PROCESSOR_NUMBER, *PPROCESSOR_NUMBER;
-
-typedef struct _GROUP_AFFINITY {
- KAFFINITY Mask;
- WORD Group;
- WORD Reserved[3];
-} GROUP_AFFINITY, *PGROUP_AFFINITY;
typedef struct _EVENTLOGRECORD {
DWORD Length;