Pointer Expansion

Pointer expansion is the converse of the pointer truncation problem. When you assign or cast a 32-bit integer to a 64-bit pointer, the high 32 bits are filled with zeroes or ones. This assignment can produce an invalid pointer. You should assign the 32-bit int to a 64-bit __int64 before converting it to a 64-bit pointer.