WTypes.inc
Defines and typedefs to help in the C headers adaptation to O2.
' The calling convention for system functions.
#ifndef mode64bit
#define WINAPI stdcall
#else
#define WINAPI ms64
#endif
#define APIENTRY WINAPI
' An atom.
typedef word ATOM;
' A Boolean variable (should be TRUE or FALSE).
typedef int BOOL;
typedef byte BOOLEAN;
' A byte (8 bits).
typedef unsigned char BYTE;
' The calling convention for callback functions.
#ifndef mode64bit
#define CALLBACK stdcall
#else
#define CALLBACK ms64
#endif
' An 8-bit Windows (ANSI) character.
typedef char CHAR;
' An 8-bit Windows (ANSI) character.
typedef char CCHAR;
' The red, green, blue (RGB) color value (32 bits). See COLORREF for information on this type.
' This type is declared in WinDef.h as follows:
typedef dword COLORREF;
' A variable whose value is to remain constant during execution.
#define CONST const
' A 32-bit unsigned integer. The range is 0 through 4294967295 decimal.
typedef unsigned long DWORD;
' A 64-bit unsigned integer. The range is 0 through 18446744073709551615 decimal.
'typedef unsigned __int64 DWORDLONG;
typedef quad DWORDLONG;
' A 32-bit unsigned integer.
typedef dword DWORD32;
' A 64-bit unsigned integer.
'typedef unsigned __int64 DWORD64;
typedef quad DWORD64;
' A floating-point variable.
typedef float FLOAT;
' A handle to an accelerator table.
typedef sys HACCEL;
' Half the size of a pointer. Use within a structure that contains a pointer and two small fields.
'#ifdef _WIN64
' typedef int HALF_PTR;
'#else
' typedef short HALF_PTR;
'#endif
#ifndef mode64bit
typedef word HALF_PTR;
#else
typedef int HALF_PTR;
#endif
' A handle to an object.
'typedef PVOID HANDLE;
typedef sys HANDLE;
' A handle to a bitmap.
'typedef HANDLE HBITMAP;
typedef HANDLE HBITMAP;
' A handle to a brush.
'typedef HANDLE HBRUSH;
typedef HANDLE HBRUSH;
' A handle to a color space.
typedef HANDLE HCOLORSPACE;
' A handle to a dynamic data exchange (DDE) conversation.
typedef HANDLE HCONV;
' A handle to a DDE conversation list.
typedef HANDLE HCONVLIST;
' A handle to a cursor.
'typedef HICON HCURSOR;
typedef HANDLE HCURSOR;
' A handle to a device context (DC).
typedef HANDLE HDC;
' A handle to DDE data.
typedef HANDLE HDDEDATA;
' A handle to a desktop.
typedef HANDLE HDESK;
' A handle to an internal drop structure.
typedef HANDLE HDROP;
' A handle to a deferred window position structure.
typedef HANDLE HDWP;
' A handle to an enhanced metafile.
typedef HANDLE HENHMETAFILE;
' A handle to a file opened by OpenFile, not CreateFile.
typedef int HFILE;
' A handle to a font.
typedef HANDLE HFONT;
' A handle to a GDI object.
typedef HANDLE HGDIOBJ;
' A handle to a global memory block.
typedef HANDLE HGLOBAL;
' A handle to a hook.
typedef HANDLE HHOOK;
' A handle to an icon.
typedef HANDLE HICON;
' A handle to an instance. This is the base address of the module in memory.
' HMODULE and HINSTANCE are the same today, but represented different things in 16-bit Windows.
typedef HANDLE HINSTANCE;
' A handle to a registry key.
typedef HANDLE HKEY;
' An input locale identifier.
typedef HANDLE HKL;
' A handle to a local memory block.
typedef HANDLE HLOCAL;
' A handle to a menu.
typedef HANDLE HMENU;
' A handle to a metafile.
typedef HANDLE HMETAFILE;
' A handle to a module. The is the base address of the module in memory.
' HMODULE and HINSTANCE are the same in current versions of Windows, but represented different things in 16-bit Windows.
'typedef HINSTANCE HMODULE;
typedef HANDLE HMODULE;
' A handle to a display monitor.
' if(WINVER >= 0x0500) typedef HANDLE HMONITOR;
typedef HANDLE HMONITOR;
' A handle to a palette.
typedef HANDLE HPALETTE;
' A handle to a pen.
typedef HANDLE HPEN;
' The return codes used by COM interfaces. To test an HRESULT value, use the FAILED and SUCCEEDED macros.
typedef long HRESULT;
' A handle to a region.
typedef HANDLE HRGN;
' A handle to a resource.
typedef HANDLE HRSRC;
' A handle to a DDE string.
typedef HANDLE HSZ;
' A handle to a window station.
typedef HANDLE WINSTA;
' A handle to a window.
typedef HANDLE HWND;
' A 32-bit signed integer. The range is -2147483648 through 2147483647 decimal.
typedef int INT;
' A signed integer type for pointer precision.
' Use when casting a pointer to an integer to perform pointer arithmetic.
'#if defined(_WIN64)
' typedef __int64 INT_PTR;
'#else
' typedef int INT_PTR;
'#endif
#ifndef mode64bit
typedef int INT_PTR;
#else
typedef quad INT_PTR;
#endif
' An 8-bit signed integer.
'typedef signed char INT8;
typedef sbyte INT8;
' A 16-bit signed integer.
typedef signed short INT16;
' A 32-bit signed integer. The range is -2147483648 through 2147483647 decimal.
typedef signed int INT32;
' A 64-bit signed integer. The range is 9223372036854775808 through 9223372036854775807 decimal.
'typedef signed __int64 INT64;
typedef quad INT64;
' A language identifier.
typedef word LANGID;
' A locale identifier. For more information, see Locale Identifiers.
typedef dword LCID;
' A locale information type.
typedef dword LCTYPE;
' A language group identifier.
typedef dword LGRPID;
' A 32-bit signed integer. The range is 2147483648 through 2147483647 decimal.
typedef long LONG;
' A 64-bit signed integer. The range is 9223372036854775808 through 9223372036854775807 decimal.
'typedef __int64 LONGLONG;
typedef quad LONGLONG;
' A signed long type for pointer precision.
' Use when casting a pointer to a long to perform pointer arithmetic.
'#if defined(_WIN64)
' typedef __int64 LONG_PTR;
'#else
' typedef long LONG_PTR;
'#endif
#ifndef mode64bit
typedef long LONG_PTR;
#else
typedef quad LONG_PTR;
#endif
' A 32-bit signed integer. The range is 2147483648 through 2147483647 decimal.
typedef signed int LONG32;
' A 64-bit signed integer. The range is 9223372036854775808 through 9223372036854775807 decimal.
'typedef __int64 LONG64;
typedef quad LONG64;
' A message parameter.
typedef LONG_PTR LPARAM;
' A pointer to a BOOL.
typedef bool *LPBOOL;
' A pointer to a BYTE.
typedef byte *LPBYTE;
' A pointer to a COLORREF value.
typedef dword *LPCOLORREF;
' A pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters.
'typedef __nullterminated CONST CHAR *LPCSTR;
'typedef __nullterminated CONST CHAR *LPCSTR;
typedef char *LPCSTR;
' A pointer to a constant null-terminated string of 16-bit Unicode characters.
'typedef CONST WCHAR *LPCWSTR;
typedef wchar *LPCWSTR;
' An LPCWSTR if UNICODE is defined, an LPCSTR otherwise.
'#ifdef UNICODE
' typedef LPCWSTR LPCTSTR;
'#else
' typedef LPCSTR LPCTSTR;
'#endif
#ifdef UNICODE
typedef LPCWSTR LPCTSTR;
#else
typedef LPCSTR LPCTSTR;
#endif
' A pointer to a constant of any type.
' typedef CONST void *LPCVOID;
typedef void *LPCVOID;
' A pointer to a DWORD.
typedef dword *LPDWORD;
' A pointer to a HANDLE.
typedef HANDLE *LPHANDLE;
' A pointer to an INT.
typedef int *LPINT;
' A pointer to a LONG.
typedef long *LPLONG;
' A pointer to a null-terminated string of 8-bit Windows (ANSI) characters.
typedef char *LPSTR;
' A pointer to a null-terminated string of 16-bit Unicode characters.
typedef wchar *LPWSTR;
' An LPWSTR if UNICODE is defined, an LPSTR otherwise.
#ifdef UNICODE
typedef LPWSTR LPTSTR;
#else
typedef LPSTR LPTSTR;
#endif
' A pointer to any type.
typedef void *LPVOID;
' A pointer to a WORD.
typedef word *LPWORD;
' Signed result of message processing.
typedef LONG_PTR LRESULT;
' A pointer to a BOOL.
typedef bool *PBOOL;
' A pointer to a BOOLEAN.
typedef boolean *PBOOLEAN;
' A pointer to a BYTE.
typedef byte *PBYTE;
' A pointer to a CHAR.
typedef char *PCHAR;
' A pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters.
'typedef CONST CHAR *PCSTR;
typedef char *PCSTR;
' A PCWSTR if UNICODE is defined, a PCSTR otherwise.
#ifdef UNICODE
typedef LPCWSTR PCTSTR;
#else
typedef LPCSTR PCTSTR;
#endif
' A pointer to a constant null-terminated string of 16-bit Unicode characters.
'typedef CONST WCHAR *PCWSTR;
typedef wchar *PCWSTR;
' A pointer to a DWORD.
typedef dword *PDWORD;
' A pointer to a DWORDLONG.
typedef DWORDLONG *PDWORDLONG;
' A pointer to a DWORD32.
typedef DWORD32 *PDWORD32;
' A pointer to a DWORD64.
typedef DWORD64 *PDWORD64;
' A pointer to a FLOAT.
typedef float *PFLOAT;
' A pointer to a HALF_PTR.
typedef HALF_PTR *PHALF_PTR;
' A pointer to a HANDLE.
typedef HANDLE *PHANDLE;
' A pointer to an HKEY.
typedef HKEY *PHKEY;
' A pointer to an INT.
typedef int *PINT;
' A pointer to an INT_PTR.
typedef INT_PTR *PINT_PTR;
' A pointer to an INT8.
typedef INT8 *PINT8;
' A pointer to an INT16.
typedef INT16 *PINT16;
' A pointer to an INT32.
typedef INT32 *PINT32;
' A pointer to an INT64.
typedef INT64 *PINT64;
' A pointer to an LCID.
typedef PDWORD PLCID;
' A pointer to a LONG.
typedef LONG *PLONG;
' A pointer to a LONGLONG.
typedef LONGLONG *PLONGLONG;
' A pointer to a LONG_PTR.
typedef LONG_PTR *PLONG_PTR;
' A pointer to a LONG32.
typedef LONG32 *PLONG32;
' A pointer to a LONG64.
typedef LONG64 *PLONG64;
' A 32-bit pointer. On a 32-bit system, this is a native pointer.
' On a 64-bit system, this is a truncated 64-bit pointer.
'#if defined(_WIN64)
'#define POINTER_32 __ptr32
'#else
'#define POINTER_32
'#endif
' A 64-bit pointer. On a 64-bit system, this is a native pointer.
' On a 32-bit system, this is a sign-extended 32-bit pointer.
' Note that it is not safe to assume the state of the high pointer bit.
'#if (_MSC_VER >= 1300)
'#define POINTER_64 __ptr64
'#else
'#define POINTER_64
'#endif
' A signed pointer.
'#define POINTER_SIGNED __sptr
' An unsigned pointer.
'#define POINTER_UNSIGNED __uptr
' A pointer to a SHORT.
typedef short *PSHORT;
' A pointer to a null-terminated string of 8-bit Windows (ANSI) characters.
typedef char *PSTR;
' A PWSTR if UNICODE is defined, a PSTR otherwise.
#ifdef UNICODE
typedef LPWSTR PTSTR;
#else
typedef LPSTR PTSTR;
#endif
' A pointer to a UINT.
typedef uint *PUINT;
' A pointer to any type.
typedef void *PVOID;
' A pointer to a WCHAR.
typedef wchar *PWCHAR;
' A pointer to a WORD.
typedef word *PWORD;
' A pointer to a null-terminated string of 16-bit Unicode characters.
typedef wchar *PWSTR;
' A 64-bit unsigned integer.
'typedef unsigned __int64 QWORD;
typedef quad QWORD;
' A handle to a service control manager database.
typedef HANDLE SC_HANDLE;
' A lock to a service control manager database.
typedef LPVOID SC_LOCK;
' A handle to a service status value.
typedef HANDLE SERVICE_STATUS_HANDLE;
' A 16-bit integer. The range is 32768 through 32767 decimal.
typedef short SHORT;
' A WCHAR if UNICODE is defined, a CHAR otherwise.
#ifdef UNICODE
typedef wchar TBYTE;
#else
typedef unsigned char TBYTE;
#endif
' A pointer to a TBYTE.
' This type is declared in WinNT.h as follows:
typedef TBYTE *PTBYTE;
' A WCHAR if UNICODE is defined, a CHAR otherwise.
#ifdef UNICODE
typedef wchar TCHAR;
#else
typedef char TCHAR;
#endif
' A pointer to a TCHAR.
' This type is declared in WinNT.h as follows:
typedef TCHAR *PTCHAR;
' An unsigned CHAR.
typedef unsigned char UCHAR;
' A pointer to a UCHAR.
typedef UCHAR *PUCHAR;
' An unsigned HALF_PTR. Use within a structure that contains a pointer and two small fields.
'#ifdef _WIN64
' typedef unsigned int UHALF_PTR;
'#else
' typedef unsigned short UHALF_PTR;
'#endif
#ifndef mode64bit
typedef unsigned short UHALF_PTR;
#else
typedef unsigned int UHALF_PTR;
#endif
' A pointer to a UHALF_PTR.
typedef UHALF_PTR *PUHALF_PTR;
' An unsigned INT. The range is 0 through 4294967295 decimal.
typedef unsigned int UINT;
' An unsigned INT_PTR.
'#if defined(_WIN64)
' typedef unsigned __int64 UINT_PTR;
'#else
' typedef unsigned int UINT_PTR;
'#endif
#ifndef mode64bit
typedef unsigned int UINT_PTR;
#else
typedef quad UINT_PTR;
#endif
' A pointer to a UINT_PTR.
typedef UINT_PTR *PUINT_PTR;
' An unsigned INT8.
typedef unsigned char UINT8;
' A pointer to a UINT8.
typedef UINT8 *PUINT8;
' An unsigned INT16.
typedef unsigned short UINT16;
' A pointer to a UINT16.
typedef UINT16 *PUINT16;
' An unsigned INT32. The range is 0 through 4294967295 decimal.
typedef unsigned int UINT32;
' A pointer to a UINT32.
typedef UINT32 *PUINT32;
' An unsigned INT64. The range is 0 through 18446744073709551615 decimal.
'typedef usigned __int 64 UINT64;
typedef quad UINT64;
' A pointer to a UINT64.
typedef UINT64 *PUINT64;
' An unsigned LONG. The range is 0 through 4294967295 decimal.
'typedef unsigned long ULONG;
' A pointer to a ULONG.
typedef ulong *PULONG;
' A 64-bit unsigned integer. The range is 0 through 18446744073709551615 decimal.
typedef quad ULONGLONG;
' A pointer to a ULONGLONG.
typedef ULONGLONG *PULONGLONG;
' An unsigned LONG_PTR.
#ifndef mode64bit
typedef unsigned long ULONG_PTR
#else
typedef quad ULONG_PTR;
#endif
' A pointer to a ULONG_PTR.
typedef ULONG_PTR *PULONG_PTR;
' An unsigned long type for pointer precision.
' Use when casting a pointer to a long type to perform pointer arithmetic.
' (Also commonly used for general 32-bit parameters that have been extended to 64 bits in 64-bit Windows.)
'typedef ULONG_PTR DWORD_PTR;
typedef ULONG_PTR DWORD_PTR;
' A pointer to a DWORD_PTR.
typedef DWORD_PTR *PDWORD_PTR;
' The maximum number of bytes to which a pointer can point.
typedef ULONG_PTR SIZE_T;
' A signed version of SIZE_T.
typedef LONG_PTR SSIZE_T;
' A pointer to a SIZE_T.
typedef SIZE_T *PSIZE_T;
' A pointer to a SSIZE_T.
typedef SSIZE_T *PSSIZE_T;
' An unsigned LONG32. The range is 0 through 4294967295 decimal.
typedef unsigned int ULONG32;
' A pointer to a ULONG32.
typedef ULONG32 *PULONG32;
' An unsigned LONG64. The range is 0 through 18446744073709551615 decimal.
'typedef unsigned __int64 ULONG64;
typedef quad ULONG64;
' A pointer to a ULONG64.
typedef ULONG64 *PULONG64;
' An unsigned SHORT. The range is 0 through 65535 decimal.
typedef unsigned short USHORT;
' A pointer to a USHORT.
typedef USHORT *PUSHORT;
' A Unicode string.
typedef struct _UNICODE_STRING {
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} UNICODE_STRING;
typedef UNICODE_STRING *PUNICODE_STRING;
'typedef const UNICODE_STRING *PCUNICODE_STRING;
' An update sequence number (USN).
typedef LONGLONG USN;
' Any type.
#define VOID void
' A 16-bit Unicode character. For more information, see Character Sets Used By Fonts.
'typedef wchar_t WCHAR;
' A 16-bit unsigned integer. The range is 0 through 65535 decimal.
typedef unsigned short WORD;
' A message parameter.
typedef UINT_PTR WPARAM;