Creating a 32-bit pointer in 64-bit Python

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

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

This works fine on Windows 7, but since upgrading to Windows 10, the memory addresses seem to have changed to 64-bit values. Is there a way to create a 32-bit pointer, or alternatively convert a 64-bit pointer to a 32-bit pointer?

+4
source share

No one has answered this question yet.

See similar questions:

:

4473
Python
3790
?
3076
++?
2568
Python
1699
, ?

Source: https://habr.com/ru/post/1676125/


All Articles