Sorry! Everything is OK with HeapRealloc! I found a stupid bug in my program which causes me to get feeling that something is wrong with HeapRealloc. This bug is caused by using "int" instead of "unsigned int" :-) Sorry again if I made a confusion... Zeljko