RtlUnicodeStringToInteger Equivalent that Check for Incorrect String

The behavior of RtlUnicodeStringToInteger is documented as:

If the string does not contain a valid number, or if the first digit in the string is preceded by a non-white space character other than ‘+’ or ‘-’, the routine sets the output value to zero and returns STATUS_SUCCESS.

Is there something else that can tell the difference between a valid zero value and an invalid string?

If this is important to you, you better roll your own version. atoi implementations come in two general forms - single pass and two pass. The single pass algorithms scan the chars once and accumulate the value while performing minimal validation. The two pass algorithms scan the chars first to validate that the sequence of chars is in a proper format (sometimes determining which of several supported formats like hexadecimal, scientific or exponential notation etc.) and then loop over the chars again to actually calculate the value

If you only care about a single radix (decimal) and a single character encoding (ASCII or UNICODE), a function like this is maybe 20 lines of code. And then you will know exactly what happens to any given input string