/*++ BUILD Version: 0091 Increment this if a change has global effects Copyright (c) Microsoft Corporation. All rights reserved. Module Name: winnt.h Abstract: This module defines the 32-Bit Windows types and constants that are defined by NT, but exposed through the Win32 API. Revision History: --*/ #ifndef _WINNT_ #define _WINNT_ #ifdef __cplusplus extern "C" { #endif #include #define ANYSIZE_ARRAY 1 #include #if defined(_M_MRX000) && !(defined(MIDL_PASS) || defined(RC_INVOKED)) && defined(ENABLE_RESTRICTED) #define RESTRICTED_POINTER __restrict #else #define RESTRICTED_POINTER #endif #if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) #define ALIGNMENT_MACHINE #define UNALIGNED __unaligned #if defined(_WIN64) #define UNALIGNED64 __unaligned #else #define UNALIGNED64 #endif #else #undef ALIGNMENT_MACHINE #define UNALIGNED #define UNALIGNED64 #endif #if defined(_WIN64) || defined(_M_ALPHA) #define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG) #define MEMORY_ALLOCATION_ALIGNMENT 16 #else #define MAX_NATURAL_ALIGNMENT sizeof(DWORD) #define MEMORY_ALLOCATION_ALIGNMENT 8 #endif // // TYPE_ALIGNMENT will return the alignment requirements of a given type for // the current platform. // #ifdef __cplusplus #if _MSC_VER >= 1300 #define TYPE_ALIGNMENT( t ) __alignof(t) #endif #else #define TYPE_ALIGNMENT( t ) \ FIELD_OFFSET( struct { char x; t test; }, test ) #endif #if defined(_WIN64) #if defined(_AMD64_) #define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( DWORD ) #elif defined(_IA64_) #define PROBE_ALIGNMENT( _s ) (TYPE_ALIGNMENT( _s ) > TYPE_ALIGNMENT( DWORD ) ? \ TYPE_ALIGNMENT( _s ) : TYPE_ALIGNMENT( DWORD )) #else #error "No Target Architecture" #endif #define PROBE_ALIGNMENT32( _s ) TYPE_ALIGNMENT( DWORD ) #else #define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( DWORD ) #endif // // C_ASSERT() can be used to perform many compile-time assertions: // type sizes, field offsets, etc. // // An assertion failure results in error C2118: negative subscript. // #ifndef SORTPP_PASS #define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] #else #define C_ASSERT(e) /* nothing */ #endif #include #if (defined(_M_IX86) || defined(_M_IA64) || defined(_M_AMD64)) && !defined(MIDL_PASS) #define DECLSPEC_IMPORT __declspec(dllimport) #else #define DECLSPEC_IMPORT #endif #ifndef DECLSPEC_NORETURN #if (_MSC_VER >= 1200) && !defined(MIDL_PASS) #define DECLSPEC_NORETURN __declspec(noreturn) #else #define DECLSPEC_NORETURN #endif #endif #ifndef DECLSPEC_NOTHROW #if (_MSC_VER >= 1200) && !defined(MIDL_PASS) #define DECLSPEC_NOTHROW __declspec(nothrow) #else #define DECLSPEC_NOTHROW #endif #endif #ifndef DECLSPEC_ALIGN #if (_MSC_VER >= 1300) && !defined(MIDL_PASS) #define DECLSPEC_ALIGN(x) __declspec(align(x)) #else #define DECLSPEC_ALIGN(x) #endif #endif #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 #ifndef DECLSPEC_CACHEALIGN #define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE) #endif #ifndef DECLSPEC_UUID #if (_MSC_VER >= 1100) && defined (__cplusplus) #define DECLSPEC_UUID(x) __declspec(uuid(x)) #else #define DECLSPEC_UUID(x) #endif #endif #ifndef DECLSPEC_NOVTABLE #if (_MSC_VER >= 1100) && defined(__cplusplus) #define DECLSPEC_NOVTABLE __declspec(novtable) #else #define DECLSPEC_NOVTABLE #endif #endif #ifndef DECLSPEC_SELECTANY #if (_MSC_VER >= 1100) #define DECLSPEC_SELECTANY __declspec(selectany) #else #define DECLSPEC_SELECTANY #endif #endif #ifndef NOP_FUNCTION #if (_MSC_VER >= 1210) #define NOP_FUNCTION __noop #else #define NOP_FUNCTION (void)0 #endif #endif #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 #ifndef DECLSPEC_NOINLINE #if (_MSC_VER >= 1300) #define DECLSPEC_NOINLINE __declspec(noinline) #else #define DECLSPEC_NOINLINE #endif #endif #ifndef FORCEINLINE #if (_MSC_VER >= 1200) #define FORCEINLINE __forceinline #else #define FORCEINLINE __inline #endif #endif #ifndef DECLSPEC_DEPRECATED #if (_MSC_VER >= 1300) && !defined(MIDL_PASS) #define DECLSPEC_DEPRECATED __declspec(deprecated) #define DEPRECATE_SUPPORTED #else #define DECLSPEC_DEPRECATED #undef DEPRECATE_SUPPORTED #endif #endif #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 // // Void // typedef void *PVOID; typedef void * POINTER_64 PVOID64; #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) #define NTAPI __stdcall #else #define _cdecl #define NTAPI #endif #if !defined(_M_CEE_PURE) #define NTAPI_INLINE NTAPI #else #define NTAPI_INLINE #endif // // Define API decoration for direct importing system DLL references. // #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 // // Basics // #ifndef VOID #define VOID void typedef char CHAR; typedef short SHORT; typedef long LONG; #if !defined(MIDL_PASS) typedef int INT; #endif #endif // // UNICODE (Wide Character) types // #ifndef _MAC typedef wchar_t WCHAR; // wc, 16-bit UNICODE character #else // some Macintosh compilers don't define wchar_t in a convenient location, or define it as a char typedef unsigned short WCHAR; // wc, 16-bit UNICODE character #endif typedef WCHAR *PWCHAR, *LPWCH, *PWCH; typedef CONST WCHAR *LPCWCH, *PCWCH; typedef __nullterminated WCHAR *NWPSTR, *LPWSTR, *PWSTR; typedef __nullterminated PWSTR *PZPWSTR; typedef __nullterminated CONST PWSTR *PCZPWSTR; typedef __nullterminated WCHAR UNALIGNED *LPUWSTR, *PUWSTR; typedef __nullterminated CONST WCHAR *LPCWSTR, *PCWSTR; typedef __nullterminated PCWSTR *PZPCWSTR; typedef __nullterminated CONST WCHAR UNALIGNED *LPCUWSTR, *PCUWSTR;