In debug heap I can get size of array, which was created by new[]:
new[]
int size = *((int *)((char *)ptr - 16));
It is working correctl
Any way that involves mining something from the CRT is undefined and cannot work 100%. Your only way is to override operator new[] that will store the size somewhere defined, like allocating bigger object with size prefix.