4

I am trying to access a 32-bit DLL via 64-bit Python. Several of the functions in the DLL need access to variables via pointers. I do this by first creating a numpy array, and then passing its pointer via ctypes as such:

arr = np.array([0], dtype=np.uint32) my_c_func(arr.ctypes.data)

This used to work perfectly in Windows 7, but since upgrading to Windows 10, the memory addresses seem to have changed to 64-bit values. Is there any way to create a 32-bit pointer, or alternatively to convert a 64-bit pointer to a 32-bit pointer?

ceving
  • 21,900
  • 13
  • 104
  • 178
  • I suspect the fact that it worked on Win7 was coincidence in the first place (a product of luck and memory usage patterns), and Win10 just exposed a bug you'd eventually have hit anyway by using more of the memory space. – ShadowRanger May 02 '17 at 10:23

0 Answers0