ReactOS 0.4.16-dev-1946-g52006dd
basetsd.h
Go to the documentation of this file.
1#ifndef _BASETSD_H_
2#define _BASETSD_H_
3#pragma once
4
5#ifdef __GNUC__
6#include <msvctarget.h>
7#endif
8
9#ifdef __GNUC__
10#ifndef __int64
11#define __int64 long long
12#endif
13#endif
14
15#if defined(_MSC_VER) && (_MSC_VER < 1300)
16#error Old MSVC compiler version.
17#endif
18
19#ifdef _MAC
20#error Not supported.
21#endif
22
23#if defined(_MSC_VER) && !defined(MIDL_PASS) && !defined(RC_INVOKED)
24 #define POINTER_64 __ptr64
25 #if defined(_WIN64)
26 #define POINTER_32 __ptr32
27 #else
28 #define POINTER_32
29 #endif
30#else
31 #define POINTER_64
32 #define POINTER_32
33#endif /* defined(_MSC_VER) && !defined(MIDL_PASS) && !defined(RC_INVOKED) */
34
35#if defined(_M_MRX000) || defined(_M_AMD64) || defined(_M_IA64)
36 typedef unsigned __int64 POINTER_64_INT;
37#else
38 typedef unsigned long POINTER_64_INT;
39#endif
40
41#if defined(_IA64_) || defined(_AMD64_)
42 #define FIRMWARE_PTR
43#else
44 #define FIRMWARE_PTR POINTER_32
45#endif
46
47#if 0 /* Not supported yet */
48#define POINTER_SIGNED __sptr
49#define POINTER_UNSIGNED __uptr
50#else
51#define POINTER_SIGNED
52#define POINTER_UNSIGNED
53#endif
54
55#define SPOINTER_32 POINTER_SIGNED POINTER_32
56#define UPOINTER_32 POINTER_UNSIGNED POINTER_32
57
58#if defined(_WIN64)
59#define __int3264 __int64
60typedef __int64 SHANDLE_PTR;
61typedef unsigned __int64 HANDLE_PTR;
62typedef unsigned int UHALF_PTR, *PUHALF_PTR;
63typedef int HALF_PTR, *PHALF_PTR;
64#define ADDRESS_TAG_BIT 0x40000000000UI64
65#define Handle32ToHandle( h ) ((HANDLE)(LONG_PTR)(LONG)(h))
66#else /* !_WIN64 */
67#define __int3264 __int32
68#define ADDRESS_TAG_BIT 0x80000000UL
69typedef unsigned short UHALF_PTR, *PUHALF_PTR;
70typedef short HALF_PTR, *PHALF_PTR;
71typedef long SHANDLE_PTR;
72typedef unsigned long HANDLE_PTR;
73#define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) )
74#define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )
75#define ULongToHandle( h) ((HANDLE)(ULONG_PTR) (h))
76#define LongToHandle( h) ((HANDLE)(LONG_PTR) (h))
77#define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) )
78#define PtrToLong( p ) ((LONG)(LONG_PTR) (p) )
79#define PtrToUint( p ) ((UINT)(UINT_PTR) (p) )
80#define PtrToInt( p ) ((INT)(INT_PTR) (p) )
81#define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) )
82#define PtrToShort( p ) ((short)(LONG_PTR)(p) )
83#define IntToPtr( i ) ((VOID*)(INT_PTR)((int)i))
84#define UIntToPtr( ui ) ((VOID*)(UINT_PTR)((unsigned int)ui))
85#define LongToPtr( l ) ((VOID*)(LONG_PTR)((long)l))
86#define ULongToPtr( ul ) ((VOID*)(ULONG_PTR)((unsigned long)ul))
87#endif /* !_WIN64 */
88
89#define HandleToULong(h) HandleToUlong(h)
90
91#define UlongToHandle(ul) ULongToHandle(ul)
92#define UlongToPtr(ul) ULongToPtr(ul)
93#define UintToPtr(ui) UIntToPtr(ui)
94#define MAXUINT_PTR (~((UINT_PTR)0))
95#define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1))
96#define MININT_PTR (~MAXINT_PTR)
97#define MAXULONG_PTR (~((ULONG_PTR)0))
98#define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1))
99#define MINLONG_PTR (~MAXLONG_PTR)
100#define MAXUHALF_PTR ((UHALF_PTR)~0)
101#define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1))
102#define MINHALF_PTR (~MAXHALF_PTR)
103
104#if _WIN32_WINNT >= 0x0600
105
106#define MAXUINT ((UINT)~((UINT)0))
107#define MAXULONGLONG ((ULONGLONG)~((ULONGLONG)0))
108
109#endif
110
111#ifndef RC_INVOKED
112#ifdef __cplusplus
113extern "C" {
114#endif
115typedef int LONG32, *PLONG32;
116typedef int INT32, *PINT32;
117typedef unsigned int ULONG32, *PULONG32;
118typedef unsigned int DWORD32, *PDWORD32;
119typedef unsigned int UINT32, *PUINT32;
120
121#if defined(_WIN64)
122typedef __int64 INT_PTR, *PINT_PTR;
123typedef unsigned __int64 UINT_PTR, *PUINT_PTR;
124typedef __int64 LONG_PTR, *PLONG_PTR;
125typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
126
127#if !defined(__midl) && !defined(__WIDL__)
128static inline unsigned long HandleToUlong(const void* h )
129 { return((unsigned long)(ULONG_PTR) h ); }
130static inline long HandleToLong( const void* h )
131 { return((long)(LONG_PTR) h ); }
132static inline void* ULongToHandle( const long h )
133 { return((void*) (UINT_PTR) h ); }
134static inline void* LongToHandle( const long h )
135 { return((void*) (INT_PTR) h ); }
136static inline unsigned long PtrToUlong( const void* p)
137 { return((unsigned long)(ULONG_PTR) p ); }
138static inline unsigned int PtrToUint( const void* p )
139 { return((unsigned int)(UINT_PTR) p ); }
140static inline unsigned short PtrToUshort( const void* p )
141 { return((unsigned short)(ULONG_PTR) p ); }
142static inline long PtrToLong( const void* p )
143 { return((long)(LONG_PTR) p ); }
144static inline int PtrToInt( const void* p )
145 { return((int)(INT_PTR) p ); }
146static inline short PtrToShort( const void* p )
147 { return((short)(INT_PTR) p ); }
148static inline void* IntToPtr( const int i )
149 { return( (void*)(INT_PTR)i ); }
150static inline void* UIntToPtr(const unsigned int ui)
151 { return( (void*)(UINT_PTR)ui ); }
152static inline void* LongToPtr( const long l )
153 { return( (void*)(LONG_PTR)l ); }
154static inline void* ULongToPtr( const unsigned long ul )
155 { return( (void*)(ULONG_PTR)ul ); }
156#endif /* !__midl */
157#else /* !_WIN64 */
158#ifndef __ROS_LONG64__
159typedef int INT_PTR, *PINT_PTR;
160typedef unsigned int UINT_PTR, *PUINT_PTR;
161#else
162typedef long INT_PTR, *PINT_PTR;
163typedef unsigned long UINT_PTR, *PUINT_PTR;
164#endif
165
166#ifndef LONG_PTR_DEFINED
167#define LONG_PTR_DEFINED
168 typedef long LONG_PTR, *PLONG_PTR;
169 typedef unsigned long ULONG_PTR, *PULONG_PTR;
170#endif
171
172#endif /* !_WIN64 */
173
179typedef unsigned __int64 ULONG64, *PULONG64;
180typedef unsigned __int64 DWORD64, *PDWORD64;
181typedef unsigned __int64 UINT64, *PUINT64;
182
183typedef signed char INT8, *PINT8;
184typedef unsigned char UINT8, *PUINT8;
185typedef signed short INT16, *PINT16;
186typedef unsigned short UINT16, *PUINT16;
187
190
191#ifdef __cplusplus
192}
193#endif
194#endif /* !RC_INVOKED */
195
196#endif /* _BASETSD_H_ */
unsigned char * PUINT8
Definition: basetsd.h:184
ULONG_PTR * PSIZE_T
Definition: basetsd.h:174
unsigned short UINT16
Definition: basetsd.h:186
int LONG32
Definition: basetsd.h:115
int * PLONG32
Definition: basetsd.h:115
#define PtrToShort(p)
Definition: basetsd.h:82
LONG_PTR SSIZE_T
Definition: basetsd.h:175
KAFFINITY * PKAFFINITY
Definition: basetsd.h:189
__int64 INT64
Definition: basetsd.h:178
#define PtrToInt(p)
Definition: basetsd.h:80
int * PINT32
Definition: basetsd.h:116
long SHANDLE_PTR
Definition: basetsd.h:71
unsigned int ULONG32
Definition: basetsd.h:117
short HALF_PTR
Definition: basetsd.h:70
signed char * PINT8
Definition: basetsd.h:183
signed short INT16
Definition: basetsd.h:185
#define HandleToLong(h)
Definition: basetsd.h:74
unsigned long POINTER_64_INT
Definition: basetsd.h:38
#define LongToHandle(h)
Definition: basetsd.h:76
#define PtrToLong(p)
Definition: basetsd.h:78
ULONG_PTR KAFFINITY
Definition: basetsd.h:188
unsigned int UINT_PTR
Definition: basetsd.h:160
ULONG_PTR DWORD_PTR
Definition: basetsd.h:176
#define PtrToUint(p)
Definition: basetsd.h:79
unsigned __int64 * PULONG64
Definition: basetsd.h:179
int INT32
Definition: basetsd.h:116
#define IntToPtr(i)
Definition: basetsd.h:83
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:176
int * PINT_PTR
Definition: basetsd.h:159
#define HandleToUlong(h)
Definition: basetsd.h:73
unsigned short UHALF_PTR
Definition: basetsd.h:69
long * PLONG_PTR
Definition: basetsd.h:168
#define ULongToHandle(h)
Definition: basetsd.h:75
signed char INT8
Definition: basetsd.h:183
__int64 LONG64
Definition: basetsd.h:177
#define UIntToPtr(ui)
Definition: basetsd.h:84
unsigned __int64 ULONG64
Definition: basetsd.h:179
unsigned int * PUINT32
Definition: basetsd.h:119
unsigned __int64 DWORD64
Definition: basetsd.h:180
LONG_PTR * PSSIZE_T
Definition: basetsd.h:175
#define ULongToPtr(ul)
Definition: basetsd.h:86
#define PtrToUlong(p)
Definition: basetsd.h:77
int INT_PTR
Definition: basetsd.h:159
unsigned __int64 UINT64
Definition: basetsd.h:181
unsigned short * PUINT16
Definition: basetsd.h:186
unsigned char UINT8
Definition: basetsd.h:184
#define PtrToUshort(p)
Definition: basetsd.h:81
unsigned int DWORD32
Definition: basetsd.h:118
long LONG_PTR
Definition: basetsd.h:168
short * PHALF_PTR
Definition: basetsd.h:70
unsigned long * PULONG_PTR
Definition: basetsd.h:169
#define LongToPtr(l)
Definition: basetsd.h:85
unsigned long ULONG_PTR
Definition: basetsd.h:169
unsigned int * PDWORD32
Definition: basetsd.h:118
signed short * PINT16
Definition: basetsd.h:185
unsigned __int64 * PUINT64
Definition: basetsd.h:181
__int64 * PINT64
Definition: basetsd.h:178
unsigned int UINT32
Definition: basetsd.h:119
unsigned short * PUHALF_PTR
Definition: basetsd.h:69
__int64 * PLONG64
Definition: basetsd.h:177
unsigned __int64 * PDWORD64
Definition: basetsd.h:180
unsigned long HANDLE_PTR
Definition: basetsd.h:72
ULONG_PTR SIZE_T
Definition: basetsd.h:174
unsigned int * PULONG32
Definition: basetsd.h:117
unsigned int * PUINT_PTR
Definition: basetsd.h:160
#define __int64
Definition: basetyps.h:16
r l[0]
Definition: byte_order.h:168
ULONG_PTR KAFFINITY
Definition: compat.h:85
GLfloat GLfloat p
Definition: glext.h:8902
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
UINT ui
Definition: oleauto.h:49
int32_t INT_PTR
Definition: typedefs.h:64
uint32_t ULONG_PTR
Definition: typedefs.h:65