RtlUnicodeStringToInteger

NTSTATUS
RtlUnicodeStringToInteger(
IN PUNICODE_STRING 
String,
IN ULONG  Base,/* optional */
OUT PULONG  Value
);

RtlUnicodeStringToInteger converts a Unicode string representation of an integer into its integer equivalent.

Parameters

String

Points to the Unicode string to be converted to its integer equivalent.

Base

An optional argument that indicates the base of the number expressed as a Unicode string. 

Value

Points to caller supplied storage of type ULONG.  RtlUnicodeStringToInteger returns the integer conversion results in Value.

Return Value

If the conversion is successful, RtlUnicodeStringToInteger returns STATUS_SUCCESS and Value is set to the integer equivalent of the Unicode string.  Otherwise, the Value is set to 0, and RtlUnicodeStringToInteger returns STATUS_INVALID_PARAMETER.

Comments

If the first character of the string is a “-”, the sign of the output Value is negative, otherwise if the first character is a “+” or there is no sign character, the sign of Value is positive.

If no Base is supplied, RtlUnicodeStringToInteger checks for a leading character to indicate the base of the number. An “x” indicates the string is to be converted as a hexidecimal integer; an “o” indicates the string is to be converted as an octal integer; a “b” indicates the string is to be converted as a binary integer.  Otherwise RtlUnicodeStringToInteger assumes the number is to be converted as a base 10 integer.

Callers of RtlUnicodeStringToInteger must be running at IRQL PASSIVE_LEVEL.

See Also

RtlIntegerToUnicodeString .