Re: How come this is different?

eryk sun <[email protected]> Tue, 13 Dec 2016 20:46:05 +0000
Newsgroups gmane.comp.python.ctypes
Message-ID <CACL+1atgSPnLiz-FdK5joqSLeJVSxGG=f0WT-y-YgZaGaZjRpg@mail.gmail.com>
On Tue, Dec 13, 2016 at 8:06 PM, Michael C
<[email protected]> wrote:
> I am trying to sort of whether or not my basic memory information parameter
> has received the proper values for each of the attritubes, so far, this is
> my print out of them, and I don't know if they are right. please take a
> look:

 [snip]

> kernel32.VirtualQueryEx(handle, None, ctypes.byref(mbi),
>         ctypes.sizeof(mbi))
>
> print(mbi.BaseAddress)
> print(mbi.AllocationBase)
> print(mbi.AllocationProtect)
> print(mbi.RegionSize)
> print(mbi.State)
> print(mbi.Protect)
> print(mbi.Type)
>
> ------- print out------
>
> None
> None
> 0
> 2228224
> 65536
> 1
> 0

You passed NULL (0) for lpAddress. In this case the region BaseAddress
is 0, and the RegionSize is a bit more than 2 MB. The region State is
0x10000 (MEM_FREE), so the fields AllocationBase, AllocationProtect,
Protect, and Type are undefined. Windows defaults to leaving this
region unallocated, which helps to ensure bad pointers (e.g. a NULL
pointer) raise an access violation.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot