On Fri, Oct 6, 2017 at 11:05 PM, Michael C
<mysecretrobotfact...@gmail.com> wrote:
> For this read process memory, if I am trying compose a LPCVOID
> lpBaseAddress, am I not making a variable that equals to  mbi.BaseAddress,
> and then making a pointer pointing to it?
>
> start_address = mbi.BaseAddress
>  LPCVOID = ctypes.byref(start_address)

LPCVOID is a pointer type; don't use it as a variable name because
it's confusing to someone who's reading your code.

The `BaseAddress` field is an LPVOID, which is an alias for
ctypes.c_void_p. Simple C types such as c_void_p are automatically
converted to Python native types such as int, bytes, and str. It's
fine that mbi.BaseAddress is a Python int. With argtypes defined for
ReadProcessMemory, ctypes will convert the int back to a void pointer
for you automatically.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to