RtlCharToInteger function (winternl.h)

Converts a character string to an integer.


NTSTATUS RtlCharToInteger(
  [in]           PCSZ   String,
  [in, optional] ULONG  Base,
  [out]          PULONG Value


[in] String

A pointer to the string to convert. The format of the string is as follows:

[whitespace] [{+ | -}] [0 [{x | o | b}]] [digits]

[in, optional] Base

ULONG that contains the number base to use for the conversion, such as base 10. Only base 2, 8, 10, and 16 are supported.

[out] Value

A pointer to a ULONG that receives the integer that resulted from the conversion.

Return value

If the function succeeds, the function returns STATUS_SUCCESS.


When converting strings to integers the preferred function to use is strtol, wcstol.

There is no import library for this function. Use GetProcAddress rather than linking to the function directly.


Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winternl.h
DLL Ntdll.dll