I want to thank Josh Williams from the CLR team, for pointing out a couple bugs in my sample code. The bugs were related to some missing IntPtr’s for portability. For those interested in more information on Josh’s posts on 64-bit and PInvoke, check out