RtlCharToInteger - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

NTSYSAPI
NTSTATUS
NTAPI
RtlCharToInteger(
    _In_z_ PCSTR String,
    _In_opt_ ULONG Base,
    _Out_ PULONG Value
    );

#endif

View code on GitHub
// ntddk.h

NTSYSAPI NTSTATUS RtlCharToInteger(
  [in]           PCSZ   String,
  [in, optional] ULONG  Base,
  [out]          PULONG Value
);
View the official Windows Driver Kit DDI reference
// winternl.h

NTSTATUS RtlCharToInteger(
  [in]           PCSZ   String,
  [in, optional] ULONG  Base,
  [out]          PULONG Value
);
View the official Win32 API reference

NtDoc

This function is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (nf-ntddk-rtlchartointeger)

RtlCharToInteger function

Description

The RtlCharToInteger routine converts a single-byte character string to an integer value in the specified base.

Parameters

String [in]

Pointer to a null-terminated, single-byte character string.

Base [in, optional]

Specifies decimal, binary, octal, or hexadecimal base. If this parameter is not given, the routine will look for 0x, 0o, and 0b prefixes in the input string to determine if the base should be decimal (default), binary, octal, or hexadecimal.

Value [out]

Pointer to a location to which the converted value is returned.

Return value

RtlCharToInteger returns STATUS_SUCCESS if the given character string is converted. Otherwise, it can return STATUS_INVALID_PARAMETER.

Remarks

RtlCharToInteger converts ANSI alphanumeric characters.

See also

RtlInitString

RtlIntegerToUnicodeString


Win32 API reference (nf-winternl-rtlchartointeger)

RtlCharToInteger function

Description

Converts a character string to an integer.

Parameters

String [in]

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

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

Base [in, optional]

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

Value [out]

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.

Remarks

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.