You can't.
For the allocated value you can use _msize function, and if pointing to a valid allocated memory chunk you will get a value that is not exactly what you have allocated, but generally bigger.
Passing a static array on the called function side you always see a char * which size id 4 or 8 bytes (32 or 64 bits compilation).