#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
+
+
+/* Defines the "size" of an any-size array */
+#ifndef ANYSIZE_ARRAY
+#define ANYSIZE_ARRAY 1
+#endif
+
#ifndef __ANONYMOUS_DEFINED
#define __ANONYMOUS_DEFINED
#ifndef NONAMELESSUNION
#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
#define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG)
#define MEMORY_ALLOCATION_ALIGNMENT 16
#else
-#define MAX_NATURAL_ALIGNMENT sizeof(ULONG)
+ #define MAX_NATURAL_ALIGNMENT sizeof(DWORD)
#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)
#endif
#if defined(_AMD64_) || defined(_X86_)
-#define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(ULONG)
+ #define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(DWORD)
#elif defined(_IA64_) || defined(_ARM_)
-#define PROBE_ALIGNMENT(_s) max((TYPE_ALIGNMENT(_s), TYPE_ALIGNMENT(ULONG))
+ #define PROBE_ALIGNMENT(_s) max((TYPE_ALIGNMENT(_s), TYPE_ALIGNMENT(DWORD))
#else
#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
+#if defined(_WIN64)
+ #define PROBE_ALIGNMENT32(_s) TYPE_ALIGNMENT(DWORD)
#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
+# 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))
#define DECLSPEC_ADDRSAFE __declspec(address_safe)
#else
#define DECLSPEC_ADDRSAFE
#endif
+#endif /* DECLSPEC_ADDRSAFE */
+
+#ifndef DECLSPEC_NOTHROW
+ #if !defined(MIDL_PASS)
+ #define DECLSPEC_NOTHROW __declspec(nothrow)
+ #else
+ #define DECLSPEC_NOTHROW
+ #endif
#endif
-/*#ifdef _WINE*/
-#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
-#define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
+#ifndef NOP_FUNCTION
+#if (_MSC_VER >= 1210)
+#define NOP_FUNCTION __noop
#else
-#define __WINE_ALLOC_SIZE(x)
+#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
-/*#endif*/
#ifndef FORCEINLINE
#if (_MSC_VER >= 1200)
# define FORCEINLINE extern __inline__ __attribute__((__always_inline__))
# endif
#endif
+#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 SYSTEM_CACHE_ALIGNMENT_SIZE
+ #if defined(_AMD64_) || defined(_X86_)
+ #define SYSTEM_CACHE_ALIGNMENT_SIZE 64
+ #else
+ #define SYSTEM_CACHE_ALIGNMENT_SIZE 128
+ #endif
+#endif /* SYSTEM_CACHE_ALIGNMENT_SIZE */
+
+#ifndef DECLSPEC_CACHEALIGN
+ #define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE)
+#endif /* DECLSPEC_CACHEALIGN */
+
+#ifndef DECLSPEC_UUID
+ #if defined(_MSC_VER) && defined(__cplusplus)
+ #define DECLSPEC_UUID(x) __declspec(uuid(x))
+ #else
+ #define DECLSPEC_UUID(x)
+ #endif
+#endif /* DECLSPEC_UUID */
+
+#ifndef DECLSPEC_NOVTABLE
+# if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus)
+# define DECLSPEC_NOVTABLE __declspec(novtable)
+# else
+# define DECLSPEC_NOVTABLE
+# endif
#endif
-#if !defined(_NTSYSTEM_)
-#define NTSYSAPI DECLSPEC_IMPORT
-#define NTSYSCALLAPI DECLSPEC_IMPORT
-#else
-#define NTSYSAPI
-#if defined(_NTDLLBUILD_)
-#define NTSYSCALLAPI
+#ifndef DECLSPEC_SELECTANY
+#if (_MSC_VER >= 1100) || defined(__GNUC__)
+#define DECLSPEC_SELECTANY __declspec(selectany)
#else
-#define NTSYSCALLAPI DECLSPEC_ADDRSAFE
+#define DECLSPEC_SELECTANY
+#endif
#endif
+
+#ifndef DECLSPEC_DEPRECATED
+ #if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(MIDL_PASS)
+ #define DECLSPEC_DEPRECATED __declspec(deprecated)
+ #define DEPRECATE_SUPPORTED
+ #else
+ #define DECLSPEC_DEPRECATED
+ #undef DEPRECATE_SUPPORTED
+ #endif
+#endif /* DECLSPEC_DEPRECATED */
+
+#ifdef DEPRECATE_DDK_FUNCTIONS
+ #ifdef _NTDDK_
+ #define DECLSPEC_DEPRECATED_DDK DECLSPEC_DEPRECATED
+ #ifdef DEPRECATE_SUPPORTED
+ #define PRAGMA_DEPRECATED_DDK 1
+ #endif
+ #else
+ #define DECLSPEC_DEPRECATED_DDK
+ #define PRAGMA_DEPRECATED_DDK 1
+ #endif
+#else
+ #define DECLSPEC_DEPRECATED_DDK
+ #define PRAGMA_DEPRECATED_DDK 0
+#endif /* DEPRECATE_DDK_FUNCTIONS */
+
+/* Use to silence unused variable warnings when it is intentional */
+#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
+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;
+typedef SHORT *PSHORT;
+typedef LONG *PLONG;
-#ifdef __cplusplus
-# define EXTERN_C extern "C"
-#else
-# define EXTERN_C extern
-#endif
+typedef BYTE FCHAR;
+typedef WORD FSHORT;
+typedef DWORD FLONG;
-#define STDMETHODCALLTYPE __stdcall
-#define STDMETHODVCALLTYPE __cdecl
-#define STDAPICALLTYPE __stdcall
-#define STDAPIVCALLTYPE __cdecl
+typedef BYTE BOOLEAN,*PBOOLEAN;
-#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
+#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 */
-/* 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
+#if defined(_HAVE_INT64) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64)
+ typedef __int64 LONGLONG;
+ typedef unsigned __int64 DWORDLONG;
#else
- #define RESTRICTED_POINTER
+ typedef double LONGLONG,DWORDLONG;
#endif
-typedef wchar_t WCHAR;
+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;
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;
+
+#ifndef __COMPARTMENT_ID_DEFINED__
+#define __COMPARTMENT_ID_DEFINED__
+typedef enum
+{
+ UNSPECIFIED_COMPARTMENT_ID = 0,
+ DEFAULT_COMPARTMENT_ID
+} COMPARTMENT_ID, *PCOMPARTMENT_ID;
+#endif /* __COMPARTMENT_ID_DEFINED__ */
+
+#ifndef __OBJECTID_DEFINED
+#define __OBJECTID_DEFINED
+typedef struct _OBJECTID {
+ GUID Lineage;
+ DWORD Uniquifier;
+} OBJECTID;
+#endif /* __OBJECTID_DEFINED */
+
+#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))
+#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;
+
+
+/* Doubly Linked Lists */
+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;
+
+/* Singly Linked Lists */
+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;
+
+#define ALL_PROCESSOR_GROUPS 0xffff
+
+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 (0x7fffffffffffffffLL)
+
+#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
-typedef BYTE FCHAR;
-typedef WORD FSHORT;
-typedef DWORD FLONG;
#define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1]
# 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 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
-#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
+/* Product types */
+#define PRODUCT_UNDEFINED 0x00000000
+#define PRODUCT_ULTIMATE 0x00000001
+#define PRODUCT_HOME_BASIC 0x00000002
+#define PRODUCT_HOME_PREMIUM 0x00000003
+#define PRODUCT_ENTERPRISE 0x00000004
+#define PRODUCT_HOME_BASIC_N 0x00000005
+#define PRODUCT_BUSINESS 0x00000006
+#define PRODUCT_STANDARD_SERVER 0x00000007
+#define PRODUCT_DATACENTER_SERVER 0x00000008
+#define PRODUCT_SMALLBUSINESS_SERVER 0x00000009
+#define PRODUCT_ENTERPRISE_SERVER 0x0000000A
+#define PRODUCT_STARTER 0x0000000B
+#define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C
+#define PRODUCT_STANDARD_SERVER_CORE 0x0000000D
+#define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E
+#define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F
+#define PRODUCT_BUSINESS_N 0x00000010
+#define PRODUCT_WEB_SERVER 0x00000011
+#define PRODUCT_CLUSTER_SERVER 0x00000012
+#define PRODUCT_HOME_SERVER 0x00000013
+#define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014
+#define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015
+#define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016
+#define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017
+#define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018
+#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019
+#define PRODUCT_HOME_PREMIUM_N 0x0000001A
+#define PRODUCT_ENTERPRISE_N 0x0000001B
+#define PRODUCT_ULTIMATE_N 0x0000001C
+#define PRODUCT_WEB_SERVER_CORE 0x0000001D
+#define PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT 0x0000001E
+#define PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY 0x0000001F
+#define PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING 0x00000020
+#define PRODUCT_SERVER_FOUNDATION 0x00000021
+#define PRODUCT_HOME_PREMIUM_SERVER 0x00000022
+#define PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023
+#define PRODUCT_STANDARD_SERVER_V 0x00000024
+#define PRODUCT_DATACENTER_SERVER_V 0x00000025
+#define PRODUCT_ENTERPRISE_SERVER_V 0x00000026
+#define PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027
+#define PRODUCT_STANDARD_SERVER_CORE_V 0x00000028
+#define PRODUCT_ENTERPRISE_SERVER_CORE_V 0x00000029
+#define PRODUCT_HYPERV 0x0000002A
+#define PRODUCT_STORAGE_EXPRESS_SERVER_CORE 0x0000002B
+#define PRODUCT_STORAGE_STANDARD_SERVER_CORE 0x0000002C
+#define PRODUCT_STORAGE_WORKGROUP_SERVER_CORE 0x0000002D
+#define PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE 0x0000002E
+#define PRODUCT_STARTER_N 0x0000002F
+#define PRODUCT_PROFESSIONAL 0x00000030
+#define PRODUCT_PROFESSIONAL_N 0x00000031
+#define PRODUCT_SB_SOLUTION_SERVER 0x00000032
+#define PRODUCT_SERVER_FOR_SB_SOLUTIONS 0x00000033
+#define PRODUCT_STANDARD_SERVER_SOLUTIONS 0x00000034
+#define PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE 0x00000035
+#define PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036
+#define PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037
+#define PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038
+#define PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE 0x00000039
+#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B
+#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C
+#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D
+#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC 0x0000003E
+#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE 0x0000003F
+#define PRODUCT_CLUSTER_SERVER_V 0x00000040
+#define PRODUCT_EMBEDDED 0x00000041
+#define PRODUCT_STARTER_E 0x00000042
+#define PRODUCT_HOME_BASIC_E 0x00000043
+#define PRODUCT_HOME_PREMIUM_E 0x00000044
+#define PRODUCT_PROFESSIONAL_E 0x00000045
+#define PRODUCT_ENTERPRISE_E 0x00000046
+#define PRODUCT_ULTIMATE_E 0x00000047
+#define PRODUCT_ENTERPRISE_EVALUATION 0x00000048
+#define PRODUCT_MULTIPOINT_STANDARD_SERVER 0x0000004C
+#define PRODUCT_MULTIPOINT_PREMIUM_SERVER 0x0000004D
+#define PRODUCT_STANDARD_EVALUATION_SERVER 0x0000004F
+#define PRODUCT_DATACENTER_EVALUATION_SERVER 0x00000050
+#define PRODUCT_ENTERPRISE_N_EVALUATION 0x00000054
+#define PRODUCT_EMBEDDED_AUTOMOTIVE 0x00000055
+#define PRODUCT_EMBEDDED_INDUSTRY_A 0x00000056
+#define PRODUCT_THINPC 0x00000057
+#define PRODUCT_EMBEDDED_A 0x00000058
+#define PRODUCT_EMBEDDED_INDUSTRY 0x00000059
+#define PRODUCT_EMBEDDED_E 0x0000005A
+#define PRODUCT_EMBEDDED_INDUSTRY_E 0x0000005B
+#define PRODUCT_EMBEDDED_INDUSTRY_A_E 0x0000005C
+#define PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER 0x0000005F
+#define PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER 0x00000060
+#define PRODUCT_CORE_ARM 0x00000061
+#define PRODUCT_CORE_N 0x00000062
+#define PRODUCT_CORE_COUNTRYSPECIFIC 0x00000063
+#define PRODUCT_CORE_SINGLELANGUAGE 0x00000064
+#define PRODUCT_CORE 0x00000065
+#define PRODUCT_PROFESSIONAL_WMC 0x00000067
+#define PRODUCT_UNLICENSED 0xABCDABCD
-/* 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 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 FILE_SHARE_READ 0x00000001
-#define FILE_SHARE_WRITE 0x00000002
-#define FILE_SHARE_DELETE 0x00000004
-#define FILE_SHARE_VALID_FLAGS 0x00000007
+#define NLS_VALID_LOCALE_MASK 0x000fffff
+#define LOCALE_NAME_MAX_LENGTH 85
-#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 */
+/* Primary language IDs. */
+#define LANG_NEUTRAL 0x00
+#define LANG_INVARIANT 0x7f
+#define LANG_AFRIKAANS 0x36
+#define LANG_ALBANIAN 0x1c
+#define LANG_ALSATIAN 0x84
+#define LANG_AMHARIC 0x5e
+#define LANG_ARABIC 0x01
+#define LANG_ARMENIAN 0x2b
+#define LANG_ASSAMESE 0x4d
+#define LANG_AZERI 0x2c
+#define LANG_AZERBAIJANI 0x2c
+#define LANG_BANGLA 0x45
+#define LANG_BASHKIR 0x6d
+#define LANG_BASQUE 0x2d
+#define LANG_BELARUSIAN 0x23
+#define LANG_BENGALI 0x45
+#define LANG_BOSNIAN 0x1a
+#define LANG_BOSNIAN_NEUTRAL 0x781a
+#define LANG_BRETON 0x7e
+#define LANG_BULGARIAN 0x02
+#define LANG_CATALAN 0x03
+#define LANG_CENTRAL_KURDISH 0x92
+#define LANG_CHEROKEE 0x5c
+#define LANG_CHINESE 0x04
+#define LANG_CHINESE_SIMPLIFIED 0x04
+#define LANG_CHINESE_TRADITIONAL 0x7c04
+#define LANG_CORSICAN 0x83
+#define LANG_CROATIAN 0x1a
+#define LANG_CZECH 0x05
+#define LANG_DANISH 0x06
+#define LANG_DARI 0x8c
+#define LANG_DIVEHI 0x65
+#define LANG_DUTCH 0x13
+#define LANG_ENGLISH 0x09
+#define LANG_ESTONIAN 0x25
+#define LANG_FAEROESE 0x38
+#define LANG_FARSI 0x29
+#define LANG_FILIPINO 0x64
+#define LANG_FINNISH 0x0b
+#define LANG_FRENCH 0x0c
+#define LANG_FRISIAN 0x62
+#define LANG_FULAH 0x67
+#define LANG_GALICIAN 0x56
+#define LANG_GEORGIAN 0x37
+#define LANG_GERMAN 0x07
+#define LANG_GREEK 0x08
+#define LANG_GREENLANDIC 0x6f
+#define LANG_GUJARATI 0x47
+#define LANG_HAUSA 0x68
+#define LANG_HAWAIIAN 0x75
+#define LANG_HEBREW 0x0d
+#define LANG_HINDI 0x39
+#define LANG_HUNGARIAN 0x0e
+#define LANG_ICELANDIC 0x0f
+#define LANG_IGBO 0x70
+#define LANG_INDONESIAN 0x21
+#define LANG_INUKTITUT 0x5d
+#define LANG_IRISH 0x3c
+#define LANG_ITALIAN 0x10
+#define LANG_JAPANESE 0x11
+#define LANG_KANNADA 0x4b
+#define LANG_KASHMIRI 0x60
+#define LANG_KAZAK 0x3f
+#define LANG_KHMER 0x53
+#define LANG_KICHE 0x86
+#define LANG_KINYARWANDA 0x87
+#define LANG_KONKANI 0x57
+#define LANG_KOREAN 0x12
+#define LANG_KYRGYZ 0x40
+#define LANG_LAO 0x54
+#define LANG_LATVIAN 0x26
+#define LANG_LITHUANIAN 0x27
+#define LANG_LOWER_SORBIAN 0x2e
+#define LANG_LUXEMBOURGISH 0x6e
+#define LANG_MACEDONIAN 0x2f
+#define LANG_MALAY 0x3e
+#define LANG_MALAYALAM 0x4c
+#define LANG_MALTESE 0x3a
+#define LANG_MANIPURI 0x58
+#define LANG_MAORI 0x81
+#define LANG_MAPUDUNGUN 0x7a
+#define LANG_MARATHI 0x4e
+#define LANG_MOHAWK 0x7c
+#define LANG_MONGOLIAN 0x50
+#define LANG_NEPALI 0x61
+#define LANG_NORWEGIAN 0x14
+#define LANG_OCCITAN 0x82
+#define LANG_ODIA 0x48
+#define LANG_ORIYA 0x48
+#define LANG_PASHTO 0x63
+#define LANG_PERSIAN 0x29
+#define LANG_POLISH 0x15
+#define LANG_PORTUGUESE 0x16
+#define LANG_PULAR 0x67
+#define LANG_PUNJABI 0x46
+#define LANG_QUECHUA 0x6b
+#define LANG_ROMANIAN 0x18
+#define LANG_ROMANSH 0x17
+#define LANG_RUSSIAN 0x19
+#define LANG_SAKHA 0x85
+#define LANG_SAMI 0x3b
+#define LANG_SANSKRIT 0x4f
+#define LANG_SCOTTISH_GAELIC 0x91
+#define LANG_SERBIAN 0x1a
+#define LANG_SERBIAN_NEUTRAL 0x7c1a
+#define LANG_SINDHI 0x59
+#define LANG_SINHALESE 0x5b
+#define LANG_SLOVAK 0x1b
+#define LANG_SLOVENIAN 0x24
+#define LANG_SOTHO 0x6c
+#define LANG_SPANISH 0x0a
+#define LANG_SWAHILI 0x41
+#define LANG_SWEDISH 0x1d
+#define LANG_SYRIAC 0x5a
+#define LANG_TAJIK 0x28
+#define LANG_TAMAZIGHT 0x5f
+#define LANG_TAMIL 0x49
+#define LANG_TATAR 0x44
+#define LANG_TELUGU 0x4a
+#define LANG_THAI 0x1e
+#define LANG_TIBETAN 0x51
+#define LANG_TIGRIGNA 0x73
+#define LANG_TIGRINYA 0x73
+#define LANG_TSWANA 0x32
+#define LANG_TURKISH 0x1f
+#define LANG_TURKMEN 0x42
+#define LANG_UIGHUR 0x80
+#define LANG_UKRAINIAN 0x22
+#define LANG_UPPER_SORBIAN 0x2e
+#define LANG_URDU 0x20
+#define LANG_UZBEK 0x43
+#define LANG_VALENCIAN 0x03
+#define LANG_VIETNAMESE 0x2a
+#define LANG_WELSH 0x52
+#define LANG_WOLOF 0x88
+#define LANG_XHOSA 0x34
+#define LANG_YAKUT 0x85
+#define LANG_YI 0x78
+#define LANG_YORUBA 0x6a
+#define LANG_ZULU 0x35
-#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 SUBLANG_NEUTRAL 0x00
+#define SUBLANG_DEFAULT 0x01
+#define SUBLANG_SYS_DEFAULT 0x02
+#define SUBLANG_CUSTOM_DEFAULT 0x03
+#define SUBLANG_CUSTOM_UNSPECIFIED 0x04
+#define SUBLANG_UI_CUSTOM_DEFAULT 0x05
+#define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01
+#define SUBLANG_ALBANIAN_ALBANIA 0x01
+#define SUBLANG_ALSATIAN_FRANCE 0x01
+#define SUBLANG_AMHARIC_ETHIOPIA 0x01
+#define SUBLANG_ARABIC_ALGERIA 0x05
+#define SUBLANG_ARABIC_BAHRAIN 0x0f
+#define SUBLANG_ARABIC_EGYPT 0x03
+#define SUBLANG_ARABIC_IRAQ 0x02
+#define SUBLANG_ARABIC_JORDAN 0x0b
+#define SUBLANG_ARABIC_KUWAIT 0x0d
+#define SUBLANG_ARABIC_LEBANON 0x0c
+#define SUBLANG_ARABIC_LIBYA 0x04
+#define SUBLANG_ARABIC_MOROCCO 0x06
+#define SUBLANG_ARABIC_OMAN 0x08
+#define SUBLANG_ARABIC_QATAR 0x10
+#define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
+#define SUBLANG_ARABIC_SYRIA 0x0a
+#define SUBLANG_ARABIC_TUNISIA 0x07
+#define SUBLANG_ARABIC_UAE 0x0e
+#define SUBLANG_ARABIC_YEMEN 0x09
+#define SUBLANG_ARMENIAN_ARMENIA 0x01
+#define SUBLANG_ASSAMESE_INDIA 0x01
+#define SUBLANG_AZERI_CYRILLIC 0x02
+#define SUBLANG_AZERI_LATIN 0x01
+#define SUBLANG_BASHKIR_RUSSIA 0x01
+#define SUBLANG_BASQUE_BASQUE 0x01
+#define SUBLANG_BELARUSIAN_BELARUS 0x01
+#define SUBLANG_BENGALI_BANGLADESH 0x02
+#define SUBLANG_BENGALI_INDIA 0x01
+#define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08
+#define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05
+#define SUBLANG_BRETON_FRANCE 0x01
+#define SUBLANG_BULGARIAN_BULGARIA 0x01
+#define SUBLANG_CATALAN_CATALAN 0x01
+#define SUBLANG_CHINESE_HONGKONG 0x03
+#define SUBLANG_CHINESE_MACAU 0x05
+#define SUBLANG_CHINESE_SINGAPORE 0x04
+#define SUBLANG_CHINESE_SIMPLIFIED 0x02
+#define SUBLANG_CHINESE_TRADITIONAL 0x01
+#define SUBLANG_CORSICAN_FRANCE 0x01
+#define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04
+#define SUBLANG_CROATIAN_CROATIA 0x01
+#define SUBLANG_CZECH_CZECH_REPUBLIC 0x01
+#define SUBLANG_DANISH_DENMARK 0x01
+#define SUBLANG_DARI_AFGHANISTAN 0x01
+#define SUBLANG_DIVEHI_MALDIVES 0x01
+#define SUBLANG_DUTCH_BELGIAN 0x02
+#define SUBLANG_DUTCH 0x01
+#define SUBLANG_ENGLISH_AUS 0x03
+#define SUBLANG_ENGLISH_BELIZE 0x0a
+#define SUBLANG_ENGLISH_CAN 0x04
+#define SUBLANG_ENGLISH_CARIBBEAN 0x09
+#define SUBLANG_ENGLISH_INDIA 0x10
+#define SUBLANG_ENGLISH_EIRE 0x06
+#define SUBLANG_ENGLISH_IRELAND 0x06
+#define SUBLANG_ENGLISH_JAMAICA 0x08
+#define SUBLANG_ENGLISH_MALAYSIA 0x11
+#define SUBLANG_ENGLISH_NZ 0x05
+#define SUBLANG_ENGLISH_PHILIPPINES 0x0d
+#define SUBLANG_ENGLISH_SINGAPORE 0x12
+#define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
+#define SUBLANG_ENGLISH_TRINIDAD 0x0b
+#define SUBLANG_ENGLISH_UK 0x02
+#define SUBLANG_ENGLISH_US 0x01
+#define SUBLANG_ENGLISH_ZIMBABWE 0x0c
+#define SUBLANG_ESTONIAN_ESTONIA 0x01
+#define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01
+#define SUBLANG_FILIPINO_PHILIPPINES 0x01
+#define SUBLANG_FINNISH_FINLAND 0x01
+#define SUBLANG_FRENCH_BELGIAN 0x02
+#define SUBLANG_FRENCH_CANADIAN 0x03
+#define SUBLANG_FRENCH 0x01
+#define SUBLANG_FRENCH_LUXEMBOURG 0x05
+#define SUBLANG_FRENCH_MONACO 0x06
+#define SUBLANG_FRENCH_SWISS 0x04
+#define SUBLANG_FRISIAN_NETHERLANDS 0x01
+#define SUBLANG_GALICIAN_GALICIAN 0x01
+#define SUBLANG_GEORGIAN_GEORGIA 0x01
+#define SUBLANG_GERMAN_AUSTRIAN 0x03
+#define SUBLANG_GERMAN 0x01
+#define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
+#define SUBLANG_GERMAN_LUXEMBOURG 0x04
+#define SUBLANG_GERMAN_SWISS 0x02
+#define SUBLANG_GREEK_GREECE 0x01
+#define SUBLANG_GREENLANDIC_GREENLAND 0x01
+#define SUBLANG_GUJARATI_INDIA 0x01
+#define SUBLANG_HAUSA_NIGERIA_LATIN 0x01
+#define SUBLANG_HAUSA_NIGERIA 0x01
+#define SUBLANG_HEBREW_ISRAEL 0x01
+#define SUBLANG_HINDI_INDIA 0x01
+#define SUBLANG_HUNGARIAN_HUNGARY 0x01
+#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_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_KAZAK_KAZAKHSTAN 0x01
+#define SUBLANG_KHMER_CAMBODIA 0x01
+#define SUBLANG_KICHE_GUATEMALA 0x01
+#define SUBLANG_KINYARWANDA_RWANDA 0x01
+#define SUBLANG_KONKANI_INDIA 0x01
+#define SUBLANG_KOREAN 0x01
+#define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01
+#define SUBLANG_LAO_LAO 0x01
+#define SUBLANG_LAO_LAO_PDR 0x01
+#define SUBLANG_LATVIAN_LATVIA 0x01
+#define SUBLANG_LITHUANIAN_LITHUANIA 0x01
+#define SUBLANG_LITHUANIAN 0x01
+#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_MALAYALAM_INDIA 0x01
+#define SUBLANG_MALTESE_MALTA 0x01
+#define SUBLANG_MAORI_NEW_ZEALAND 0x01
+#define SUBLANG_MAPUDUNGUN_CHILE 0x01
+#define SUBLANG_MARATHI_INDIA 0x01
+#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_NORWEGIAN_BOKMAL 0x01
+#define SUBLANG_NORWEGIAN_NYNORSK 0x02
+#define SUBLANG_OCCITAN_FRANCE 0x01
+#define SUBLANG_ORIYA_INDIA 0x01
+#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_PUNJABI_INDIA 0x01
+#define SUBLANG_QUECHUA_BOLIVIA 0x01
+#define SUBLANG_QUECHUA_ECUADOR 0x02
+#define SUBLANG_QUECHUA_PERU 0x03
+#define SUBLANG_ROMANIAN_ROMANIA 0x01
+#define SUBLANG_ROMANSH_SWITZERLAND 0x01
+#define SUBLANG_RUSSIAN_RUSSIA 0x01
+#define SUBLANG_SAMI_INARI_FINLAND 0x09
+#define SUBLANG_SAMI_LULE_NORWAY 0x04
+#define SUBLANG_SAMI_LULE_SWEDEN 0x05
+#define SUBLANG_SAMI_NORTHERN_FINLAND 0x03
+#define SUBLANG_SAMI_NORTHERN_NORWAY 0x01
+#define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02
+#define SUBLANG_SAMI_SKOLT_FINLAND 0x08
+#define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06
+#define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07
+#define SUBLANG_SANSKRIT_INDIA 0x01
+#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x07
+#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN 0x06
+#define SUBLANG_SERBIAN_CROATIA 0x01
+#define SUBLANG_SERBIAN_CYRILLIC 0x03
+#define SUBLANG_SERBIAN_LATIN 0x02
+#define SUBLANG_SERBIAN_SERBIA_LATIN 0x09
+#define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01
+#define SUBLANG_TSWANA_SOUTH_AFRICA 0x01
+#define SUBLANG_SINDHI_AFGHANISTAN 0x02
+#define SUBLANG_SINDHI_PAKISTAN 0x02
+#define SUBLANG_SINHALESE_SRI_LANKA 0x01
+#define SUBLANG_SLOVAK_SLOVAKIA 0x01
+#define SUBLANG_SLOVENIAN_SLOVENIA 0x01
+#define SUBLANG_SPANISH_ARGENTINA 0x0b
+#define SUBLANG_SPANISH_BOLIVIA 0x10
+#define SUBLANG_SPANISH_CHILE 0x0d
+#define SUBLANG_SPANISH_COLOMBIA 0x09
+#define SUBLANG_SPANISH_COSTA_RICA 0x05
+#define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
+#define SUBLANG_SPANISH_ECUADOR 0x0c
+#define SUBLANG_SPANISH_EL_SALVADOR 0x11
+#define SUBLANG_SPANISH_GUATEMALA 0x04
+#define SUBLANG_SPANISH_HONDURAS 0x12
+#define SUBLANG_SPANISH_MEXICAN 0x02
+#define SUBLANG_SPANISH_MODERN 0x03
+#define SUBLANG_SPANISH_NICARAGUA 0x13
+#define SUBLANG_SPANISH_PANAMA 0x06
+#define SUBLANG_SPANISH_PARAGUAY 0x0f
+#define SUBLANG_SPANISH_PERU 0x0a
+#define SUBLANG_SPANISH_PUERTO_RICO 0x14
+#define SUBLANG_SPANISH 0x01
+#define SUBLANG_SPANISH_US 0x15
+#define SUBLANG_SPANISH_URUGUAY 0x0e
+#define SUBLANG_SPANISH_VENEZUELA 0x08
+#define SUBLANG_SWAHILI 0x01
+#define SUBLANG_SWAHILI_KENYA 0x01
+#define SUBLANG_SWEDISH_FINLAND 0x02
+#define SUBLANG_SWEDISH 0x01
+#define SUBLANG_SWEDISH_SWEDEN 0x01
+#define SUBLANG_SYRIAC 0x01
+#define SUBLANG_TAJIK_TAJIKISTAN 0x01
+#define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02
+#define SUBLANG_TAMIL_INDIA 0x01
+#define SUBLANG_TATAR_RUSSIA 0x01
+#define SUBLANG_TELUGU_INDIA 0x01
+#define SUBLANG_THAI_THAILAND 0x01
+#define SUBLANG_TIBETAN_PRC 0x01
+#define SUBLANG_TIGRIGNA_ERITREA 0x02
+#define SUBLANG_TURKISH_TURKEY 0x01
+#define SUBLANG_TURKMEN_TURKMENISTAN 0x01
+#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_UZBEK_LATIN 0x01
+#define SUBLANG_UZBEK_CYRILLIC 0x02
+#define SUBLANG_VIETNAMESE_VIETNAM 0x01
+#define SUBLANG_WELSH_UNITED_KINGDOM 0x01
+#define SUBLANG_WOLOF_SENEGAL 0x01
+#define SUBLANG_XHOSA_SOUTH_AFRICA 0x01
+#define SUBLANG_YAKUT_RUSSIA 0x01
+#define SUBLANG_YI_PRC 0x01
+#define SUBLANG_YORUBA_NIGERIA 0x01
+#define SUBLANG_ZULU_SOUTH_AFRICA 0x01
-#define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
+#define SORT_DEFAULT 0x0
+#define SORT_INVARIANT_MATH 0x1
+#define SORT_JAPANESE_XJIS 0x0
+#define SORT_JAPANESE_UNICODE 0x1
+#define SORT_JAPANESE_RADICALSTROKE 0x4
+#define SORT_CHINESE_BIG5 0x0
+#define SORT_CHINESE_PRCP 0x0
+#define SORT_CHINESE_UNICODE 0x1
+#define SORT_CHINESE_PRC 0x2
+#define SORT_CHINESE_BOPOMOFO 0x3
+#define SORT_CHINESE_RADICALSTROKE 0x4
+#define SORT_KOREAN_KSC 0x0
+#define SORT_KOREAN_UNICODE 0x1
+#define SORT_GERMAN_PHONE_BOOK 0x1
+#define SORT_HUNGARIAN_DEFAULT 0x0
+#define SORT_HUNGARIAN_TECHNICAL 0x1
+#define SORT_GEORGIAN_TRADITIONAL 0x0
+#define SORT_GEORGIAN_MODERN 0x1
-/* S-1-1 */
-#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
+#define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT)
+#define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT)
-/* 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)
+#define LOCALE_SYSTEM_DEFAULT MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)
+#define LOCALE_USER_DEFAULT MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)
+#define LOCALE_CUSTOM_DEFAULT MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT)
+#define LOCALE_CUSTOM_UNSPECIFIED MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_UNSPECIFIED), SORT_DEFAULT)
+#define LOCALE_CUSTOM_UI_DEFAULT MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_UI_CUSTOM_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)
-/* S-1-4 */
-#define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
+#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
-/* 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
+#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
-#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
+#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 SECURITY_LOGON_IDS_RID_COUNT 0x3
-#define SID_REVISION 1
+# define DECLSPEC_HIDDEN
-#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
+#ifdef __cplusplus
+extern "C" {
+#endif
-#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
+#ifndef RC_INVOKED
-#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
+/*#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*/
-#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
+/* FIXME for __WIN64 */
+#ifndef __ptr64
+ #define __ptr64
+#endif
+typedef void* __ptr64 PVOID64;
-#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
+#endif /* RC_INVOKED */
-#define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16}
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4201)
+#pragma warning(disable:4214)
+#pragma warning(disable:4820)
+#endif
-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 ACE_OBJECT_TYPE_PRESENT 0x00000001
+#define ACE_INHERITED_OBJECT_TYPE_PRESENT 0x00000002
-#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")
+#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 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
+/* 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
-/*
- * Product types
- */
-#define PRODUCT_UNDEFINED 0x00000000
-#define PRODUCT_ULTIMATE 0x00000001
-#define PRODUCT_HOME_BASIC 0x00000002
-#define PRODUCT_HOME_PREMIUM 0x00000003
-#define PRODUCT_ENTERPRISE 0x00000004
-#define PRODUCT_HOME_BASIC_N 0x00000005
-#define PRODUCT_BUSINESS 0x00000006
-#define PRODUCT_STANDARD_SERVER 0x00000007
-#define PRODUCT_DATACENTER_SERVER 0x00000008
-#define PRODUCT_SMALLBUSINESS_SERVER 0x00000009
-#define PRODUCT_ENTERPRISE_SERVER 0x0000000A
-#define PRODUCT_STARTER 0x0000000B
-#define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C
-#define PRODUCT_STANDARD_SERVER_CORE 0x0000000D
-#define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E
-#define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F
-#define PRODUCT_BUSINESS_N 0x00000010
-#define PRODUCT_WEB_SERVER 0x00000011
-#define PRODUCT_CLUSTER_SERVER 0x00000012
-#define PRODUCT_HOME_SERVER 0x00000013
-#define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014
-#define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015
-#define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016
-#define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017
-#define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018
-#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019
-#define PRODUCT_HOME_PREMIUM_N 0x0000001A
-#define PRODUCT_ENTERPRISE_N 0x0000001B
-#define PRODUCT_ULTIMATE_N 0x0000001C
-#define PRODUCT_WEB_SERVER_CORE 0x0000001D
-#define PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT 0x0000001E
-#define PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY 0x0000001F
-#define PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING 0x00000020
-#define PRODUCT_SERVER_FOUNDATION 0x00000021
-#define PRODUCT_HOME_PREMIUM_SERVER 0x00000022
-#define PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023
-#define PRODUCT_STANDARD_SERVER_V 0x00000024
-#define PRODUCT_DATACENTER_SERVER_V 0x00000025
-#define PRODUCT_SERVER_V 0x00000025
-#define PRODUCT_ENTERPRISE_SERVER_V 0x00000026
-#define PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027
-#define PRODUCT_STANDARD_SERVER_CORE_V 0x00000028
-#define PRODUCT_ENTERPRISE_SERVER_CORE_V 0x00000029
-#define PRODUCT_HYPERV 0x0000002A
-#define PRODUCT_STORAGE_EXPRESS_SERVER_CORE 0x0000002B
-#define PRODUCT_STORAGE_STANDARD_SERVER_CORE 0x0000002C
-#define PRODUCT_STORAGE_WORKGROUP_SERVER_CORE 0x0000002D
-#define PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE 0x0000002E
-#define PRODUCT_STARTER_N 0x0000002F
-#define PRODUCT_PROFESSIONAL 0x00000030
-#define PRODUCT_PROFESSIONAL_N 0x00000031
-#define PRODUCT_SB_SOLUTION_SERVER 0x00000032
-#define PRODUCT_SERVER_FOR_SB_SOLUTIONS 0x00000033
-#define PRODUCT_STANDARD_SERVER_SOLUTIONS 0x00000034
-#define PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE 0x00000035
-#define PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036
-#define PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037
-#define PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038
-#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B
-#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C
-#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D
-#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC 0x0000003E
-#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE 0x0000003F
-#define PRODUCT_CLUSTER_SERVER_V 0x00000040
-#define PRODUCT_EMBEDDED 0x00000041
-#define PRODUCT_STARTER_E 0x00000042
-#define PRODUCT_HOME_BASIC_E 0x00000043
-#define PRODUCT_HOME_PREMIUM_E 0x00000044
-#define PRODUCT_PROFESSIONAL_E 0x00000045
-#define PRODUCT_ENTERPRISE_E 0x00000046
-#define PRODUCT_ULTIMATE_E 0x00000047
-#define PRODUCT_ENTERPRISE_EVALUATION 0x00000048
-#define PRODUCT_MULTIPOINT_STANDARD_SERVER 0x0000004C
-#define PRODUCT_MULTIPOINT_PREMIUM_SERVER 0x0000004D
-#define PRODUCT_STANDARD_EVALUATION_SERVER 0x0000004F
-#define PRODUCT_DATACENTER_EVALUATION_SERVER 0x00000050
-#define PRODUCT_ENTERPRISE_N_EVALUATION 0x00000054
-#define PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER 0x0000005F
-#define PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER 0x00000060
-#define PRODUCT_CORE_ARM 0x00000061
-#define PRODUCT_CORE_N 0x00000062
-#define PRODUCT_CORE_COUNTRYSPECIFIC 0x00000063
-#define PRODUCT_CORE_LANGUAGESPECIFIC 0x00000064
-#define PRODUCT_CORE 0x00000065
-#define PRODUCT_PROFESSIONAL_WMC 0x00000067
-#define PRODUCT_UNLICENSED 0xABCDABCD
+#define REG_STANDARD_FORMAT 1
+#define REG_LATEST_FORMAT 2
+#define REG_NO_COMPRESSION 4
-#define LANG_NEUTRAL 0x00
-#define LANG_INVARIANT 0x7f
-#define LANG_AFRIKAANS 0x36
-#define LANG_ALBANIAN 0x1c
-#define LANG_ALSATIAN 0x84
-#define LANG_AMHARIC 0x5e
-#define LANG_ARABIC 0x01
-#define LANG_ARMENIAN 0x2b
-#define LANG_ASSAMESE 0x4d
-#define LANG_AZERI 0x2c
-#define LANG_BASHKIR 0x6d
-#define LANG_BASQUE 0x2d
-#define LANG_BELARUSIAN 0x23
-#define LANG_BENGALI 0x45
-#define LANG_BOSNIAN 0x1a
-#define LANG_BRETON 0x7e
-#define LANG_BULGARIAN 0x02
-#define LANG_CATALAN 0x03
-#define LANG_CHINESE 0x04
-#define LANG_CHINESE_SIMPLIFIED 0x04
-#define LANG_CHINESE_TRADITIONAL 0x7c04
-#define LANG_CORSICAN 0x83
-#define LANG_CROATIAN 0x1a
-#define LANG_CROATIAN 0x1a
-#define LANG_CZECH 0x05
-#define LANG_DANISH 0x06
-#define LANG_DARI 0x8c
-#define LANG_DIVEHI 0x65
-#define LANG_DUTCH 0x13
-#define LANG_ENGLISH 0x09
-#define LANG_ESTONIAN 0x25
-#define LANG_FAEROESE 0x38
-#define LANG_FILIPINO 0x64
-#define LANG_FINNISH 0x0b
-#define LANG_FRENCH 0x0c
-#define LANG_FRISIAN 0x62
-#define LANG_GALICIAN 0x56
-#define LANG_GEORGIAN 0x37
-#define LANG_GERMAN 0x07
-#define LANG_GREEK 0x08
-#define LANG_GREENLANDIC 0x6f
-#define LANG_GUJARATI 0x47
-#define LANG_HAUSA 0x68
-#define LANG_HEBREW 0x0d
-#define LANG_HINDI 0x39
-#define LANG_HUNGARIAN 0x0e
-#define LANG_ICELANDIC 0x0f
-#define LANG_IGBO 0x70
-#define LANG_INDONESIAN 0x21
-#define LANG_INUKTITUT 0x5d
-#define LANG_IRISH 0x3c
-#define LANG_ITALIAN 0x10
-#define LANG_JAPANESE 0x11
-#define LANG_KANNADA 0x4b
-#define LANG_KASHMIRI 0x60
-#define LANG_KAZAK 0x3f
-#define LANG_KHMER 0x53
-#define LANG_KICHE 0x86
-#define LANG_KINYARWANDA 0x87
-#define LANG_KONKANI 0x57
-#define LANG_KOREAN 0x12
-#define LANG_KYRGYZ 0x40
-#define LANG_LAO 0x54
-#define LANG_LATVIAN 0x26
-#define LANG_LITHUANIAN 0x27
-#define LANG_LOWER_SORBIAN 0x2e
-#define LANG_LUXEMBOURGISH 0x6e
-#define LANG_MACEDONIAN 0x2f
-#define LANG_MALAY 0x3e
-#define LANG_MALAYALAM 0x4c
-#define LANG_MALTESE 0x3a
-#define LANG_MANIPURI 0x58
-#define LANG_MAORI 0x81
-#define LANG_MAPUDUNGUN 0x7a
-#define LANG_MARATHI 0x4e
-#define LANG_MOHAWK 0x7c
-#define LANG_MONGOLIAN 0x50
-#define LANG_NEPALI 0x61
-#define LANG_NORWEGIAN 0x14
-#define LANG_OCCITAN 0x82
-#define LANG_ORIYA 0x48
-#define LANG_PASHTO 0x63
-#define LANG_FARSI 0x29
-#define LANG_PERSIAN 0x29
-#define LANG_POLISH 0x15
-#define LANG_PORTUGUESE 0x16
-#define LANG_PUNJABI 0x46
-#define LANG_QUECHUA 0x6b
-#define LANG_ROMANIAN 0x18
-#define LANG_ROMANSH 0x17
-#define LANG_RUSSIAN 0x19
-#define LANG_SAMI 0x3b
-#define LANG_SANSKRIT 0x4f
-#define LANG_SCOTTISH_GAELIC 0x91
-#define LANG_SERBIAN 0x1a
-#define LANG_SOTHO 0x6c
-#define LANG_TSWANA 0x32
-#define LANG_SINDHI 0x59
-#define LANG_SINHALESE 0x5b
-#define LANG_SLOVAK 0x1b
-#define LANG_SLOVENIAN 0x24
-#define LANG_SPANISH 0x0a
-#define LANG_SWAHILI 0x41
-#define LANG_SWEDISH 0x1d
-#define LANG_SYRIAC 0x5a
-#define LANG_TAJIK 0x28
-#define LANG_TAMAZIGHT 0x5f
-#define LANG_TAMIL 0x49
-#define LANG_TATAR 0x44
-#define LANG_TELUGU 0x4a
-#define LANG_THAI 0x1e
-#define LANG_TIBETAN 0x51
-#define LANG_TIGRIGNA 0x73
-#define LANG_TURKISH 0x1f
-#define LANG_TURKMEN 0x42
-#define LANG_UIGHUR 0x80
-#define LANG_UKRAINIAN 0x22
-#define LANG_UPPER_SORBIAN 0x2e
-#define LANG_URDU 0x20
-#define LANG_UZBEK 0x43
-#define LANG_VIETNAMESE 0x2a
-#define LANG_WELSH 0x52
-#define LANG_WOLOF 0x88
-#define LANG_XHOSA 0x34
-#define LANG_YAKUT 0x85
-#define LANG_YI 0x78
-#define LANG_YORUBA 0x6a
-#define LANG_ZULU 0x35
+#ifndef WIN32_NO_STATUS
-/* FIXME: non-standard */
-#define LANG_ESPERANTO 0x8f
-#define LANG_WALON 0x90
-#define LANG_CORNISH 0x92
+#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)
-/* 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 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 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
-#define SUBLANG_AMHARIC_ETHIOPIA 0x01
-#define SUBLANG_ARABIC_ALGERIA 0x05
-#define SUBLANG_ARABIC_BAHRAIN 0x0f
-#define SUBLANG_ARABIC_EGYPT 0x03
-#define SUBLANG_ARABIC_IRAQ 0x02
-#define SUBLANG_ARABIC_JORDAN 0x0b
-#define SUBLANG_ARABIC_KUWAIT 0x0d
-#define SUBLANG_ARABIC_LEBANON 0x0c
-#define SUBLANG_ARABIC_LIBYA 0x04
-#define SUBLANG_ARABIC_MOROCCO 0x06
-#define SUBLANG_ARABIC_OMAN 0x08
-#define SUBLANG_ARABIC_QATAR 0x10
-#define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
-#define SUBLANG_ARABIC_SYRIA 0x0a
-#define SUBLANG_ARABIC_TUNISIA 0x07
-#define SUBLANG_ARABIC_UAE 0x0e
-#define SUBLANG_ARABIC_YEMEN 0x09
-#define SUBLANG_ARMENIAN_ARMENIA 0x01
-#define SUBLANG_ASSAMESE_INDIA 0x01
-#define SUBLANG_AZERI_CYRILLIC 0x02
-#define SUBLANG_AZERI_LATIN 0x01
-#define SUBLANG_BASHKIR_RUSSIA 0x01
-#define SUBLANG_BASQUE_BASQUE 0x01
-#define SUBLANG_BELARUSIAN_BELARUS 0x01
-#define SUBLANG_BENGALI_BANGLADESH 0x02
-#define SUBLANG_BENGALI_INDIA 0x01
-#define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08
-#define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05
-#define SUBLANG_BRETON_FRANCE 0x01
-#define SUBLANG_BULGARIAN_BULGARIA 0x01
-#define SUBLANG_CATALAN_CATALAN 0x01
-#define SUBLANG_CHINESE_HONGKONG 0x03
-#define SUBLANG_CHINESE_MACAU 0x05
-#define SUBLANG_CHINESE_SINGAPORE 0x04
-#define SUBLANG_CHINESE_SIMPLIFIED 0x02
-#define SUBLANG_CHINESE_TRADITIONAL 0x01
-#define SUBLANG_CORSICAN_FRANCE 0x01
-#define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04
-#define SUBLANG_CROATIAN_CROATIA 0x01
-#define SUBLANG_CZECH_CZECH_REPUBLIC 0x01
-#define SUBLANG_DANISH_DENMARK 0x01
-#define SUBLANG_DARI_AFGHANISTAN 0x01
-#define SUBLANG_DIVEHI_MALDIVES 0x01
-#define SUBLANG_DUTCH_BELGIAN 0x02
-#define SUBLANG_DUTCH 0x01
-#define SUBLANG_ENGLISH_AUS 0x03
-#define SUBLANG_ENGLISH_BELIZE 0x0a
-#define SUBLANG_ENGLISH_CAN 0x04
-#define SUBLANG_ENGLISH_CARIBBEAN 0x09
-#define SUBLANG_ENGLISH_INDIA 0x10
-#define SUBLANG_ENGLISH_EIRE 0x06
-#define SUBLANG_ENGLISH_IRELAND 0x06
-#define SUBLANG_ENGLISH_JAMAICA 0x08
-#define SUBLANG_ENGLISH_MALAYSIA 0x11
-#define SUBLANG_ENGLISH_NZ 0x05
-#define SUBLANG_ENGLISH_PHILIPPINES 0x0d
-#define SUBLANG_ENGLISH_SINGAPORE 0x12
-#define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
-#define SUBLANG_ENGLISH_TRINIDAD 0x0b
-#define SUBLANG_ENGLISH_UK 0x02
-#define SUBLANG_ENGLISH_US 0x01
-#define SUBLANG_ENGLISH_ZIMBABWE 0x0c
-#define SUBLANG_ESTONIAN_ESTONIA 0x01
-#define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01
-#define SUBLANG_FILIPINO_PHILIPPINES 0x01
-#define SUBLANG_FINNISH_FINLAND 0x01
-#define SUBLANG_FRENCH_BELGIAN 0x02
-#define SUBLANG_FRENCH_CANADIAN 0x03
-#define SUBLANG_FRENCH 0x01
-#define SUBLANG_FRENCH_LUXEMBOURG 0x05
-#define SUBLANG_FRENCH_MONACO 0x06
-#define SUBLANG_FRENCH_SWISS 0x04
-#define SUBLANG_FRISIAN_NETHERLANDS 0x01
-#define SUBLANG_GALICIAN_GALICIAN 0x01
-#define SUBLANG_GEORGIAN_GEORGIA 0x01
-#define SUBLANG_GERMAN_AUSTRIAN 0x03
-#define SUBLANG_GERMAN 0x01
-#define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
-#define SUBLANG_GERMAN_LUXEMBOURG 0x04
-#define SUBLANG_GERMAN_SWISS 0x02
-#define SUBLANG_GREEK_GREECE 0x01
-#define SUBLANG_GREENLANDIC_GREENLAND 0x01
-#define SUBLANG_GUJARATI_INDIA 0x01
-#define SUBLANG_HAUSA_NIGERIA_LATIN 0x01
-#define SUBLANG_HAUSA_NIGERIA 0x01
-#define SUBLANG_HEBREW_ISRAEL 0x01
-#define SUBLANG_HINDI_INDIA 0x01
-#define SUBLANG_HUNGARIAN_HUNGARY 0x01
-#define SUBLANG_ICELANDIC_ICELAND 0x01
-#define SUBLANG_IGBO_NIGERIA 0x01
-#define SUBLANG_INDONESIAN_INDONESIA 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_INDIA 0x02
-#define SUBLANG_KASHMIRI_SASIA 0x02
-#define SUBLANG_KAZAK_KAZAKHSTAN 0x01
-#define SUBLANG_KHMER_CAMBODIA 0x01
-#define SUBLANG_KICHE_GUATEMALA 0x01
-#define SUBLANG_KINYARWANDA_RWANDA 0x01
-#define SUBLANG_KONKANI_INDIA 0x01
-#define SUBLANG_KOREAN 0x01
-#define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01
-#define SUBLANG_LAO_LAO 0x01
-#define SUBLANG_LAO_LAO_PDR 0x01
-#define SUBLANG_LATVIAN_LATVIA 0x01
-#define SUBLANG_LITHUANIAN_LITHUANIA 0x01
-#define SUBLANG_LITHUANIAN 0x01
-#define SUBLANG_LOWER_SORBIAN_GERMANY 0x02
-#define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01
-#define SUBLANG_MACEDONIAN_MACEDONIA 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
-#define SUBLANG_MAPUDUNGUN_CHILE 0x01
-#define SUBLANG_MARATHI_INDIA 0x01
-#define SUBLANG_MOHAWK_MOHAWK 0x01
-#define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01
-#define SUBLANG_MONGOLIAN_PRC 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
-#define SUBLANG_ORIYA_INDIA 0x01
-#define SUBLANG_PASHTO_AFGHANISTAN 0x01
-#define SUBLANG_PERSIAN_IRAN 0x01
-#define SUBLANG_POLISH_POLAND 0x01
-#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
-#define SUBLANG_QUECHUA_PERU 0x03
-#define SUBLANG_ROMANIAN_ROMANIA 0x01
-#define SUBLANG_ROMANSH_SWITZERLAND 0x01
-#define SUBLANG_RUSSIAN_RUSSIA 0x01
-#define SUBLANG_SAMI_INARI_FINLAND 0x09
-#define SUBLANG_SAMI_LULE_NORWAY 0x04
-#define SUBLANG_SAMI_LULE_SWEDEN 0x05
-#define SUBLANG_SAMI_NORTHERN_FINLAND 0x03
-#define SUBLANG_SAMI_NORTHERN_NORWAY 0x01
-#define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02
-#define SUBLANG_SAMI_SKOLT_FINLAND 0x08
-#define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06
-#define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07
-#define SUBLANG_SANSKRIT_INDIA 0x01
-#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x07
-#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN 0x06
-#define SUBLANG_SERBIAN_CROATIA 0x01
-#define SUBLANG_SERBIAN_CYRILLIC 0x03
-#define SUBLANG_SERBIAN_LATIN 0x02
-#define SUBLANG_SERBIAN_SERBIA_LATIN 0x09
-#define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01
-#define SUBLANG_TSWANA_SOUTH_AFRICA 0x01
-#define SUBLANG_SINDHI_AFGHANISTAN 0x02
-#define SUBLANG_SINDHI_PAKISTAN 0x01
-#define SUBLANG_SINHALESE_SRI_LANKA 0x01
-#define SUBLANG_SLOVAK_SLOVAKIA 0x01
-#define SUBLANG_SLOVENIAN_SLOVENIA 0x01
-#define SUBLANG_SPANISH_ARGENTINA 0x0b
-#define SUBLANG_SPANISH_BOLIVIA 0x10
-#define SUBLANG_SPANISH_CHILE 0x0d
-#define SUBLANG_SPANISH_COLOMBIA 0x09
-#define SUBLANG_SPANISH_COSTA_RICA 0x05
-#define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
-#define SUBLANG_SPANISH_ECUADOR 0x0c
-#define SUBLANG_SPANISH_EL_SALVADOR 0x11
-#define SUBLANG_SPANISH_GUATEMALA 0x04
-#define SUBLANG_SPANISH_HONDURAS 0x12
-#define SUBLANG_SPANISH_MEXICAN 0x02
-#define SUBLANG_SPANISH_MODERN 0x03
-#define SUBLANG_SPANISH_NICARAGUA 0x13
-#define SUBLANG_SPANISH_PANAMA 0x06
-#define SUBLANG_SPANISH_PARAGUAY 0x0f
-#define SUBLANG_SPANISH_PERU 0x0a
-#define SUBLANG_SPANISH_PUERTO_RICO 0x14
-#define SUBLANG_SPANISH 0x01
-#define SUBLANG_SPANISH_US 0x15
-#define SUBLANG_SPANISH_URUGUAY 0x0e
-#define SUBLANG_SPANISH_VENEZUELA 0x08
-#define SUBLANG_SWAHILI 0x01
-#define SUBLANG_SWAHILI_KENYA 0x01
-#define SUBLANG_SWEDISH_FINLAND 0x02
-#define SUBLANG_SWEDISH 0x01
-#define SUBLANG_SWEDISH_SWEDEN 0x01
-#define SUBLANG_SYRIAC 0x01
-#define SUBLANG_TAJIK_TAJIKISTAN 0x01
-#define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02
-#define SUBLANG_TAMIL_INDIA 0x01
-#define SUBLANG_TATAR_RUSSIA 0x01
-#define SUBLANG_TELUGU_INDIA 0x01
-#define SUBLANG_THAI_THAILAND 0x01
-#define SUBLANG_TIBETAN_PRC 0x01
-#define SUBLANG_TIGRIGNA_ERITREA 0x02
-#define SUBLANG_TURKISH_TURKEY 0x01
-#define SUBLANG_TURKMEN_TURKMENISTAN 0x01
-#define SUBLANG_UIGHUR_PRC 0x01
-#define SUBLANG_UKRAINIAN_UKRAINE 0x01
-#define SUBLANG_UPPER_SORBIAN_GERMANY 0x01
-#define SUBLANG_URDU_INDIA 0x02
-#define SUBLANG_URDU_PAKISTAN 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
-#define SUBLANG_XHOSA_SOUTH_AFRICA 0x01
-#define SUBLANG_YAKUT_RUSSIA 0x01
-#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
-#define SORT_CHINESE_BIG5 0
-#define SORT_CHINESE_PRCP 0
-#define SORT_CHINESE_UNICODE 1
-#define SORT_CHINESE_PRC 2
-#define SORT_CHINESE_BOPOMOFO 3
-#define SORT_KOREAN_KSC 0
-#define SORT_KOREAN_UNICODE 1
-#define SORT_GERMAN_PHONE_BOOK 1
-#define SORT_HUNGARIAN_DEFAULT 0
-#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_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
#define ACL_REVISION 2
#define ACL_REVISION_DS 4
#define ACL_REVISION1 1
#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
#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
#define IMAGE_FILE_RELOCS_STRIPPED 1
#define IMAGE_FILE_EXECUTABLE_IMAGE 2
#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
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
typedef struct _UNWIND_HISTORY_TABLE_ENTRY
{
- ULONG64 ImageBase;
+ DWORD64 ImageBase;
PRUNTIME_FUNCTION FunctionEntry;
} UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
typedef struct _UNWIND_HISTORY_TABLE
{
- ULONG Count;
+ DWORD Count;
UCHAR Search;
ULONG64 LowAddress;
ULONG64 HighAddress;
/* These are the debug or break registers on the SH3 */
typedef struct _DEBUG_REGISTERS {
- ULONG BarA;
+ DWORD BarA;
UCHAR BasrA;
UCHAR BamrA;
USHORT BbrA;
- ULONG BarB;
+ DWORD BarB;
UCHAR BasrB;
UCHAR BamrB;
USHORT BbrB;
- ULONG BdrB;
- ULONG BdmrB;
+ DWORD BdrB;
+ DWORD BdmrB;
USHORT Brcr;
USHORT Align;
} DEBUG_REGISTERS, *PDEBUG_REGISTERS;
/* The context record is never used as an OUT only parameter. */
- ULONG ContextFlags;
+ DWORD ContextFlags;
/* This section is specified/returned if the ContextFlags word contains */
/* the flag CONTEXT_INTEGER. */
/* considered part of the control context rather than part of the integer */
/* context. */
- ULONG PR;
- ULONG MACH;
- ULONG MACL;
- ULONG GBR;
- ULONG R0;
- ULONG R1;
- ULONG R2;
- ULONG R3;
- ULONG R4;
- ULONG R5;
- ULONG R6;
- ULONG R7;
- ULONG R8;
- ULONG R9;
- ULONG R10;
- ULONG R11;
- ULONG R12;
- ULONG R13;
- ULONG R14;
- ULONG R15;
+ DWORD PR;
+ DWORD MACH;
+ DWORD MACL;
+ DWORD GBR;
+ DWORD R0;
+ DWORD R1;
+ DWORD R2;
+ DWORD R3;
+ DWORD R4;
+ DWORD R5;
+ DWORD R6;
+ DWORD R7;
+ DWORD R8;
+ DWORD R9;
+ DWORD R10;
+ DWORD R11;
+ DWORD R12;
+ DWORD R13;
+ DWORD R14;
+ DWORD R15;
/* This section is specified/returned if the ContextFlags word contains */
/* the flag CONTEXT_CONTROL. */
/* but are considered part of the control context rather than part of */
/* the integer context. */
- ULONG Fir;
- ULONG Psr;
+ DWORD Fir;
+ DWORD Psr;
#if !defined(SH3e) && !defined(SH4)
- ULONG OldStuff[2];
+ DWORD OldStuff[2];
DEBUG_REGISTERS DebugRegisters;
#else
- ULONG Fpscr;
- ULONG Fpul;
- ULONG FRegs[16];
+ DWORD Fpscr;
+ DWORD Fpul;
+ DWORD FRegs[16];
#if defined(SH4)
- ULONG xFRegs[16];
+ DWORD xFRegs[16];
#endif
#endif
} CONTEXT;
DWORD Fill[2];
} CONTEXT;
-#elif defined(ARM)
+#elif defined(_ARM_)
#ifndef PAGE_SIZE
#define PAGE_SIZE 0x1000 // FIXME: This should probably go elsewhere
The context record is never used as an OUT only parameter. */
- ULONG ContextFlags;
+ DWORD ContextFlags;
/* This section is specified/returned if the ContextFlags word contains
the flag CONTEXT_INTEGER. */
- ULONG R0;
- ULONG R1;
- ULONG R2;
- ULONG R3;
- ULONG R4;
- ULONG R5;
- ULONG R6;
- ULONG R7;
- ULONG R8;
- ULONG R9;
- ULONG R10;
- ULONG R11;
- ULONG R12;
-
- ULONG Sp;
- ULONG Lr;
- ULONG Pc;
- ULONG Psr;
+ DWORD R0;
+ DWORD R1;
+ DWORD R2;
+ DWORD R3;
+ DWORD R4;
+ DWORD R5;
+ DWORD R6;
+ DWORD R7;
+ DWORD R8;
+ DWORD R9;
+ DWORD R10;
+ DWORD R11;
+ DWORD R12;
+
+ DWORD Sp;
+ DWORD Lr;
+ DWORD Pc;
+ DWORD Psr;
} CONTEXT;
#else
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 {
LARGE_INTEGER TimeLimit;
} QUOTA_LIMITS,*PQUOTA_LIMITS;
+typedef union _RATE_QUOTA_LIMIT {
+ DWORD RateData;
+ struct {
+ DWORD RatePercent : 7;
+ DWORD Reserved0 : 25;
+ } DUMMYSTRUCTNAME;
+} RATE_QUOTA_LIMIT, *PRATE_QUOTA_LIMIT;
+
typedef struct _QUOTA_LIMITS_EX {
SIZE_T PagedPoolLimit;
SIZE_T NonPagedPoolLimit;
SIZE_T Reserved2;
SIZE_T Reserved3;
SIZE_T Reserved4;
- ULONG Flags;
- ULONG Reserved5;
+ DWORD Flags;
+ RATE_QUOTA_LIMIT CpuRateLimit;
} QUOTA_LIMITS_EX, *PQUOTA_LIMITS_EX;
typedef struct _IO_COUNTERS {
} TAPE_GET_MEDIA_PARAMETERS, *PTAPE_GET_MEDIA_PARAMETERS;
typedef struct _TAPE_GET_POSITION {
- ULONG Type;
- ULONG Partition;
+ DWORD Type;
+ DWORD Partition;
LARGE_INTEGER Offset;
} TAPE_GET_POSITION, *PTAPE_GET_POSITION;
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
//
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;
DWORD Reserved;
_ANONYMOUS_STRUCT struct {
DWORD NameOffset:31;
DWORD NameIsString:1;
- } DUMMYSTRUCTNAME1;
+ } DUMMYSTRUCTNAME;
DWORD Name;
WORD Id;
- } DUMMYUNIONNAME1;
+ } DUMMYUNIONNAME;
_ANONYMOUS_UNION union {
DWORD OffsetToData;
_ANONYMOUS_STRUCT struct {
DWORD DefaultAlert2;
} SYSTEM_BATTERY_STATE, *PSYSTEM_BATTERY_STATE;
+// FIXME: This should not be here!
typedef struct _PROCESSOR_POWER_INFORMATION {
ULONG Number;
ULONG MaxMhz;
ULONG CurrentIdleState;
} PROCESSOR_POWER_INFORMATION, *PPROCESSOR_POWER_INFORMATION;
-typedef DWORD EXECUTION_STATE;
+typedef DWORD EXECUTION_STATE, *PEXECUTION_STATE;
typedef enum _POWER_INFORMATION_LEVEL {
SystemPowerPolicyAc,
#endif
}
#elif defined (_M_ARM)
- PVOID WINAPI GetCurrentFiber(VOID);
+#define CP15_PMSELR 15, 0, 9, 12, 5
+#define CP15_PMXEVCNTR 15, 0, 9, 13, 2
+#define CP15_TPIDRURW 15, 0, 13, 0, 2
+#define CP15_TPIDRURO 15, 0, 13, 0, 3
+#define CP15_TPIDRPRW 15, 0, 13, 0, 4
+FORCEINLINE struct _TEB * NtCurrentTeb(void)
+{
+ return (struct _TEB *)(ULONG_PTR)_MoveFromCoprocessor(CP15_TPIDRURW);
+}
+FORCEINLINE PVOID GetCurrentFiber(VOID)
+{
+ return ((PNT_TIB )(ULONG_PTR)_MoveFromCoprocessor(CP15_TPIDRURW))->FiberData;
+}
#elif defined(_M_PPC)
FORCEINLINE unsigned long _read_teb_dword(const unsigned long Offset)
{
#error Unknown architecture
#endif
-static __inline PVOID GetFiberData(void)
+FORCEINLINE PVOID GetFiberData(void)
{
return *((PVOID *)GetCurrentFiber());
}