Indirect Memory Addressing
chris grebeldinger
c_g at cogeco.ca
Thu Jun 3 22:16:12 EDT 2004
It may be overkill, but I've used ctypes for this sort of thing with great
success:
http://starship.python.net/crew/theller/ctypes/
Larry Bates wrote:
> I need to call a function in a vendor supplied
> Windows .DLL file that returns an address that
> points to a list of longs. I am able to call
> the function and get back the pointer (by
> using membuf). Now I need to know how to get
> to the data that is pointed to by the address.
>
> from dynwin.windll import membuf
> abuf=membuf(4*"\x00)
> .
> . Make call to my .DLL function here
> .
> address=abuf.read()
>
>
> address contains memory address that points
> to the first entry in my list of longs, but
> I don't know how to read the contents of that
> address (something like peek).
>
> Thanks in advance,
> Regards,
> Larry Bates
> Syscon, Inc.
More information about the Python-list
mailing list