22 #ifndef WINPR_WTYPES_H
23 #define WINPR_WTYPES_H
27 #include <winpr/config.h>
28 #include <winpr/platform.h>
34 #include <winpr/windows.h>
36 #include <winpr/spec.h>
44 #if defined(_WIN32) || defined(__MINGW32__)
48 #if defined(WINPR_HAVE_SSIZE_T)
49 typedef ssize_t SSIZE_T;
50 #elif !defined(WINPR_HAVE_WIN_SSIZE_T)
51 typedef intptr_t SSIZE_T;
56 #if defined(__OBJC__) && defined(__APPLE__)
57 #include <objc/objc.h>
68 WINPR_PRAGMA_DIAG_PUSH WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
69 WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
71 #if !defined(_WIN32) && !defined(__MINGW32__)
87 *LPVOID, *PVOID64, *LPVOID64;
95 #include <TargetConditionals.h>
98 #if (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE != 0) && defined(__LP64__)) || \
99 (defined(TARGET_OS_WATCH) && (TARGET_OS_WATCH != 0))
102 typedef signed char BOOL;
108 typedef BOOL *PBOOL, *LPBOOL;
119 typedef uint8_t BYTE;
122 typedef BYTE byte, *PBYTE, *LPBYTE;
123 typedef BYTE BOOLEAN, PBOOLEAN;
127 typedef unsigned char UCHAR;
131 typedef uint8_t UCHAR;
134 typedef CHAR CCHAR, *PCHAR, *LPCH, *PCH, *PSTR, *LPSTR;
135 typedef const CHAR *LPCCH, *PCCH, *LPCSTR, *PCSTR;
136 typedef UCHAR* PUCHAR;
138 typedef uint16_t WCHAR;
140 typedef WCHAR UNICODE, *PWCHAR, *LPWCH, *PWCH, *BSTR, *LMSTR, *LPWSTR, *PWSTR;
141 typedef const WCHAR *LPCWCH, *PCWCH, *LMCSTR, *LPCWSTR, *PCWSTR;
143 typedef int16_t SHORT, *PSHORT;
145 typedef int32_t INT, *PINT, *LPINT;
147 typedef int32_t LONG, *PLONG, *LPLONG;
149 typedef int64_t LONGLONG, *PLONGLONG;
151 typedef uint32_t UINT, *PUINT, *LPUINT;
153 typedef uint16_t USHORT, *PUSHORT;
155 typedef uint32_t ULONG, *PULONG;
157 typedef uint64_t ULONGLONG, *PULONGLONG;
162 typedef int16_t INT16;
164 typedef int32_t INT32;
166 typedef int64_t INT64;
170 typedef INT16* PINT16;
171 typedef INT32* PINT32;
172 typedef INT64* PINT64;
174 typedef int32_t LONG32, *PLONG32;
177 typedef int64_t LONG64, *PLONG64;
181 typedef uint8_t UINT8, *PUINT8;
183 typedef uint16_t UINT16, *PUINT16;
185 typedef uint32_t UINT32, *PUINT32;
187 typedef uint64_t UINT64, *PUINT64;
189 typedef uint64_t ULONG64, *PULONG64;
191 typedef uint16_t WORD, *PWORD, *LPWORD;
193 typedef uint32_t DWORD, DWORD32, *PDWORD, *LPDWORD, *PDWORD32;
195 typedef uint64_t DWORD64, DWORDLONG, QWORD, *PDWORD64, *PDWORDLONG, *PQWORD;
197 typedef intptr_t INT_PTR, *PINT_PTR;
199 typedef uintptr_t UINT_PTR, *PUINT_PTR;
201 typedef intptr_t LONG_PTR, *PLONG_PTR;
203 typedef uintptr_t ULONG_PTR, *PULONG_PTR;
205 typedef uintptr_t DWORD_PTR, *PDWORD_PTR;
207 typedef ULONG_PTR SIZE_T, *PSIZE_T;
208 #if defined(WINPR_HAVE_SSIZE_T)
209 #include <sys/types.h>
210 typedef ssize_t SSIZE_T;
211 #elif !defined(WINPR_HAVE_WIN_SSIZE_T)
212 typedef LONG_PTR SSIZE_T;
217 typedef double DOUBLE;
219 typedef void* HANDLE;
220 typedef HANDLE *PHANDLE, *LPHANDLE;
221 typedef HANDLE HINSTANCE;
222 typedef HANDLE HMODULE;
224 typedef HANDLE HBITMAP;
225 typedef HANDLE HICON;
226 typedef HANDLE HCURSOR;
227 typedef HANDLE HBRUSH;
228 typedef HANDLE HMENU;
232 typedef ULONG error_status_t;
233 typedef LONG HRESULT;
235 typedef SCODE* PSCODE;
237 typedef struct s_POINTL
243 typedef struct tagSIZE
247 }
SIZE, *PSIZE, *LPSIZE;
251 typedef struct s_GUID
257 } GUID,
UUID, *PGUID, *LPGUID, *LPCGUID;
260 typedef struct s_LUID
278 typedef LPWSTR PTSTR;
279 typedef LPWSTR LPTCH;
280 typedef LPWSTR LPTSTR;
281 typedef LPCWSTR LPCTSTR;
285 typedef LPSTR LPTSTR;
286 typedef LPCSTR LPCTSTR;
289 typedef union u_ULARGE_INTEGER
306 typedef union u_LARGE_INTEGER
323 typedef struct s_FILETIME
326 DWORD dwHighDateTime;
327 }
FILETIME, *PFILETIME, *LPFILETIME;
329 typedef struct s_SYSTEMTIME
341 typedef struct s_RPC_SID_IDENTIFIER_AUTHORITY
346 typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION;
348 typedef struct s_RPC_SID
351 UCHAR SubAuthorityCount;
353 ULONG SubAuthority[1];
365 typedef struct s_SECURITY_DESCRIPTOR
376 typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
378 typedef struct s_SECURITY_ATTRIBUTES
381 LPVOID lpSecurityDescriptor;
385 typedef struct s_PROCESS_INFORMATION
393 typedef DWORD (*PTHREAD_START_ROUTINE)(LPVOID lpThreadParameter);
394 typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
396 typedef void* FARPROC;
398 typedef struct tagDEC
424 #define DECIMAL_NEG ((BYTE)0x80)
425 #define DECIMAL_SETZERO(dec) \
429 (dec).signscale = 0; \
433 typedef PDWORD PLCID;
438 typedef void* PCONTEXT_HANDLE;
439 typedef PCONTEXT_HANDLE* PPCONTEXT_HANDLE;
442 typedef LONG NTSTATUS;
443 typedef NTSTATUS* PNTSTATUS;
446 #ifndef _LPCVOID_DEFINED
448 #define _LPCVOID_DEFINED
450 typedef const VOID* LPCVOID;
453 #ifndef _LPCBYTE_DEFINED
455 #define _LPCBYTE_DEFINED
457 typedef const BYTE* LPCBYTE;
461 #if defined(_POSIX_SSIZE_MAX)
462 #define SSIZE_MAX _POSIX_SSIZE_MAX
463 #elif defined(_WIN64)
464 #define SSIZE_MAX _I64_MAX
465 #elif defined(_WIN32)
466 #define SSIZE_MAX LONG_MAX
468 #define SSIZE_MAX INTPTR_MAX
479 #include <winpr/user.h>
485 static inline int _fseeki64(FILE* fp, INT64 offset,
int origin)
487 return fseeko(fp, offset, origin);
491 static inline INT64 _ftelli64(FILE* fp)
497 WINPR_PRAGMA_DIAG_POP