为了能用一套代码支持Win32 and Win64机器的编译和使用, 微软API使用了_PTR 标识符来兼容这两种机器带来的差异,*_PTR是描述指针,_PTR是描述值。
目前常用的类型包括:DWORD_PTR, INT_PTR, LONG_PTR, UINT_PTR, ULONG_PTR,它们的声明如下:
#if defined(_WIN64) typedef __int64 INT_PTR, *PINT_PTR; typedef unsigned __int64 UINT_PTR, *PUINT_PTR; typedef __int64 LONG_PTR, *PLONG_PTR; typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; #define __int3264 __int64 #else typedef _W64 int INT_PTR, *PINT_PTR; typedef _W64 unsigned int UINT_PTR, *PUINT_PTR; typedef _W64 long LONG_PTR, *PLONG_PTR; typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR; #define __int3264 __int32
更加详细的Windows Data Types见微软网站,https://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx