help
i
invoke VirtualAlloc,66F00000h,0FFFFh,MEM_COMMIT,PAGE_READWRITE
invoke GetLastError
the error it returns is
487 Attempt to access invalid address. ERROR_INVALID_ADDRESS
ive tried tons of addresses and it keeps returning that ! why, help! i just want to allocate memory at a specific address!
Posted on 2002-12-25 12:39:20 by Qages
Shouldn,t PAGE_READ be PAGE_READONLY ?

Maybe thats your problem.

Also try NULL for your address.
Posted on 2002-12-25 14:01:00 by IwasTitan
its PAGE_READWRITE, some how that got appended to the next line.
Posted on 2002-12-25 14:06:28 by Qages
You might have given a too large value as address....or the page you are trying to alloc already exists
Posted on 2002-12-25 16:50:07 by DZA
1. windows allows memory allocation from 0 to 7FFFFFFF. 2
MEM_COMMIT Allocates physical storage in memory or in the paging file on disk for the specified region of pages.
An attempt to commit an already committed page will not cause the function to fail. This means that a range of committed or decommitted pages can be committed without having to worry about a failure.
Posted on 2002-12-25 17:59:07 by Qages
Yes, one or more of the pages may be committed already and that doesnt have to be an error. But that doesnt mean that you can alloc addess space that is already allocated. So use a memory tool to view memory at that address or use VirtualQuery to determine that address space is really free.

Japheth
Posted on 2002-12-25 18:14:31 by japheth
Committed memory must also be reserved.
I'm not sure, but you may be able to both RESERVE and COMMIT memory in the same call to VirtualAlloc. So you may want to try combining them (MEM_RESERVE or MEM_COMMIT).
Posted on 2002-12-25 18:45:17 by tenkey
i know that the memory isnt already allocated becuse i get a memory read/write error when i try to read and put memory at the place i want allocated, i cant have it use heapalloc etc that has diff addresses it allocs at as i dont have any where at the time to store its address, thats why im allocating memory at a specific address.
Posted on 2002-12-25 20:20:05 by Qages