Ported EnumNext function.
Added HeapSize and SetLastError functions.