This link has a really good trick for validating 64-bit Winodws code that have been ported from earlier 32-bit apps.

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!

http://msdn.microsoft.com/en-us/library/bb613473%28VS.85%29.aspx