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!
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!
Shouldn,t PAGE_READ be PAGE_READONLY ?
Maybe thats your problem.
Also try NULL for your address.
Maybe thats your problem.
Also try NULL for your address.
its PAGE_READWRITE, some how that got appended to the next line.
You might have given a too large value as address....or the page you are trying to alloc already exists
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.
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.
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
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).
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).
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.