Use HeapWalk, not _heapwalk.
Try locking the heap during your heap enumeration with HeapLock and HeapUnlock.
It certainly sounds like your function calls are modifying the Heap and invalidating the enumeration. Some vague advice, perhaps you can create a new Heap specifically for any memory needed by these function calls. This might require significant reworking of these static functions, I know.
Terry Mahaffey
2010-02-04 18:16:35