#define ANYSIZE_ARRAY 1
-/* Type definitions */
-typedef void VOID, *PVOID, *HANDLE;
-typedef HANDLE HKEY, *PHKEY;
-typedef unsigned char UCHAR, *PUCHAR, BYTE, *LPBYTE;
+/* Basic types
+ Emulate a LLP64 memory model using a LP64 compiler */
+typedef void VOID, *PVOID;
typedef char CHAR, *PCHAR, *PSTR;
-typedef const char CCHAR;
-typedef const char *PCSTR, *LPCSTR;
+typedef const char CCHAR, *PCSTR, *LPCSTR;
+typedef unsigned char UCHAR, *PUCHAR, BYTE, *LPBYTE, BOOLEAN, *PBOOLEAN;
typedef short SHORT, *PSHORT;
-typedef unsigned short USHORT, *PUSHORT;
-typedef unsigned short WORD, *PWORD, *LPWORD;
-typedef int LONG, *PLONG, *LPLONG;
-typedef unsigned int ULONG, *PULONG, DWORD, *LPDWORD;
+typedef unsigned short USHORT, *PUSHORT, WORD, *PWORD, *LPWORD, WCHAR, *PWCHAR, *PWSTR, *LPWSTR;
+typedef const unsigned short *PCWSTR, *LPCWSTR;
+typedef int INT, LONG, *PLONG, *LPLONG, BOOL;
+typedef unsigned int UINT, *PUINT, *LPUINT, ULONG, *PULONG, DWORD, *LPDWORD;
+typedef long LONG_PTR, *PLONG_PTR, INT_PTR, *PINT_PTR;
+typedef unsigned long ULONG_PTR, DWORD_PTR, *PULONG_PTR, UINT_PTR, *PUINT_PTR;
typedef long long LONGLONG;
typedef unsigned long long ULONGLONG;
-typedef int INT;
-typedef unsigned int UINT, *PUINT, *LPUINT, UINT_PTR, *PUINT_PTR;
-typedef UCHAR BOOLEAN, *PBOOLEAN;
-typedef int BOOL;
-typedef long int LONG_PTR, *PLONG_PTR;
-typedef long unsigned int ULONG_PTR, DWORD_PTR, *PULONG_PTR;
-typedef ULONG_PTR SIZE_T, *PSIZE_T;
-typedef unsigned short WCHAR, *PWCHAR, *PWSTR, *LPWSTR;
-typedef const unsigned short *PCWSTR, *LPCWSTR;
-typedef int NTSTATUS;
-typedef int POOL_TYPE;
+
+/* Derived types */
+typedef PVOID HANDLE, HKEY, *PHKEY;
+typedef INT NTSTATUS, POOL_TYPE;
typedef LONG HRESULT;
+typedef ULONG_PTR SIZE_T, *PSIZE_T;
#define MAXUSHORT USHRT_MAX