Sorry for the confusion.
I suggested to replace only the line with the `ERROR_INSUFFICIENT_BUFFER` check.
Checking len against zero is still needed.

i.e. the function can return zero on failure, or length when the buffer is too small.