Christian Costa titan.costa@gmail.com writes:
- children = (IDirect3DRMFrame3**)HeapAlloc(GetProcessHeap(), 0, (This->nb_children + 1) * sizeof(IDirect3DRMFrame3*));
- if (!children)
return E_OUTOFMEMORY;
- CopyMemory(children, This->children, This->nb_children * sizeof(IDirect3DRMFrame3*));
- HeapFree(GetProcessHeap(), 0, This->children);
HeapReAlloc is your friend. Also you should grow the buffer quadratically.