Folks,

I am using Microsoft's Detour Code.

If you are not familary with this code, it allow a DLL to hook into a process and detour any API calls. The idea is that you do as you please with the API call and then pass it onto the API and finally return to the caller.

All is well and good, but one must be careful in how one writes the detoured code. The biggest problem is making sure that the one does not detour the detouring code. The solution is to be very careful in the 3rd party code that is used, INCLUDING THE c runtime, like malloc! Malloc eventually calls the WinAPI function HeapAlloc().

I need to find an implementation of malloc that will allow me to modify it to call the real API funtions, not the detoured ones. Does anyone know where I can find such an open source code?

Sam