Welcome, Guest. Please login or register.

Author Topic: Any OS legal way to traverse an exec memory pool?  (Read 4624 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Doobrey

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 1876
    • Show all replies
    • http://www.doobreynet.co.uk
Re: Any OS legal way to traverse an exec memory pool?
« on: February 12, 2007, 09:08:48 PM »
Quote

CrazyProg wrote:

There is a hack you can use instead.
  1) carefully write you function according to the prototypes  in the interfaces drawer.
  2) open the library (not needed for exec)
  3) remember what the vector is (oldvector = IExec->AllocPooled;)
  3) Set the vector for the function (IExec->AllocPooled = MyAllocPooled;)
  4) do your stuff
  5) restore the function pointer back to what is was (IExec->AllocPooled = oldvector;)
  6) exit your program.



If you're gonna do it that way, add a check to step 5 to only restore the vector if it still points to your function.If it doesn't match then it means something else has SetFunction()'d it too and could possibly call your old function, with no way of knowing you've removed it.
On schedule, and suing