Re: How come this is different?
eryk sun <[email protected]> Sat, 10 Dec 2016 21:25:50 +0000
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <CACL+1au+v87YEWAjq-kiE8ZsbEYGxgjdVTzGhyk=jJ_quuE0iQ@mail.gmail.com> |
On Sat, Dec 10, 2016 at 7:52 PM, Michael C <[email protected]> wrote: > Shouldn't I use VirtualQueryEX to find out these values? > > ph = kernel32.GetCurrentProcess() > source_array = (wintypes.DWORD * 10)(*range(10)) > base_address = ctypes.addressof(source_array) > block_size = ctypes.sizeof(source_array) VirtualQueryEx is used to query for information about a memory block (e.g. the allocation base address, region size, and protection). You would call it to get the base address and size if you wanted to read an entire allocated region, which would typically be a block of memory that's managed by a heap or some other allocator (e.g. Python's small-object allocator). ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today.http://sdm.link/xeonphi