This link has a really good trick for validating 64-bit Winodws code that have been ported from earlier 32-bit apps.
Set HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management\AllocationPreference = 0x100000 and windows will not allocate memory in the lower 4GB of virtual address space. So, all pointers will have the upper 32 bits non-zero. If you try to use a 32-bit variable to store such a pointer, it will cause a crash as soon as you dereference it because none of the lower 4GB represents valid memory. And fail-fast is good for testing!