*memoryptr with AllocateMemory

Just starting out? Need help? Post your questions and find answers here.
Duffer123
User
User
Posts: 42
Joined: Fri Nov 30, 2012 11:40 pm

*memoryptr with AllocateMemory

Post by Duffer123 »

Just wondering whether there was any way to fix an AllocateMemory patch of memory to a particular point(er) in the memory rather than just being assigned back *memoryID? (if you see what I mean)
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: *memoryptr with AllocateMemory

Post by Tenaja »

Your *memoryptr is a particular pointer in memory. You may need to rephrase your question.

If you are wanting to preselect the location, then you will likely need to do that with API, IF it is possible. PB's command does not allow it.
Duffer123
User
User
Posts: 42
Joined: Fri Nov 30, 2012 11:40 pm

Re: *memoryptr with AllocateMemory

Post by Duffer123 »

@ Tenaja,

What I want to do is say an AllocateMemory of say 1000 bytes is at xxx pointer in memory rather than have Purebasic allocate me the pointer in memory at which that AllocateMemory is.... hope that makes more sense?
infratec
Always Here
Always Here
Posts: 7622
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: *memoryptr with AllocateMemory

Post by infratec »

I think you want to point to somewhere in the memory of the PC.

That's, in general, not allowed by windows.
It is only possible with a lot of knowledge of windows kernel stuff.

Bernd
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: *memoryptr with AllocateMemory

Post by IdeasVacuum »

That is perhaps because you need to share memory with another app? It can be done with CreateFileMapping_() on Windows OS.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Duffer123
User
User
Posts: 42
Joined: Fri Nov 30, 2012 11:40 pm

Re: *memoryptr with AllocateMemory

Post by Duffer123 »

@ IdeasVacuum,

Could you perhaps add a little more info about that?

(thanks in advance)
juror
Enthusiast
Enthusiast
Posts: 232
Joined: Mon Jul 09, 2007 4:47 pm
Location: Courthouse

Re: *memoryptr with AllocateMemory

Post by juror »

If you already have a memory pointer, you can attempt a memory access operation e.g. peek, poke and see if the OS will let you access it.

If you can't access it then the pointer is really of little use.
Post Reply