© 2004 Microsoft Corporation. All rights reserved.

Figure 1 New Data Types

Fixed Precision Data Types
Type
Description
DWORD32
32-bit unsigned integer
DWORD64
64-bit unsigned integer
INT32
32-bit signed integer
INT64
64-bit signed integer
LONG32
32-bit signed integer
LONG64
64-bit signed integer
UINT32
Unsigned INT32
UINT64
Unsigned INT64
ULONG32
Unsigned LONG32
ULONG64
Unsigned LONG64
Pointer Precision
Type
Description
DWORD_PTR
Unsigned long type for pointer precision
HALF_PTR
Half the size of a pointer. Use within a structure that contains a pointer and two small fields
INT_PTR
Signed integral type for pointer precision
LONG_PTR
Signed long type for pointer precision
SIZE_T
The maximum number of bytes to which a pointer can refer. Use for a count that must span the full range of a pointer
SSIZE_T
Signed SIZE_T
UHALF_PTR
Unsigned HALF_PTR
UINT_PTR
Unsigned INT_PTR
ULONG_PTR
Unsigned LONG_PTR
Specific Pointer Precision
Type
Definition
POINTER_32
On 32-bit Windows, this is a native 32-bit pointer.
On 64-bit Windows, this is a truncated 64-bit pointer
POINTER_64
On 64-bit Windows, this is a native 64-bit pointer.
On 32-bit Windows, this is a sign-extended 32-bit
Note that it is not safe to assume the state of the high pointer bit
Figure 2 Get Size of DWORD
struct foo {
    DWORD NumberOfPointers;
    PVOID Pointers[1];
} xx;

#ifdef (FALSE)
    // Wrong: 404 bytes 32-bit, 804 bytes 64-bit
    malloc(_sizeof(DWORD)+100*sizeof(PVOID)_); 

#else
    // Correct: 404 bytes 32-bit, 808 bytes 64-bit
    malloc( FIELD_OFFSET(struct foo,Pointers) 
            + 100*sizeof(PVOID) );
#endif