RtlOemStringToCountedUnicodeString function (ntifs.h)

The RtlOemStringToCountedUnicodeString routine translates the specified source string into a Unicode string using the current system OEM code page.

Syntax

NTSYSAPI NTSTATUS RtlOemStringToCountedUnicodeString(
       PUNICODE_STRING DestinationString,
  [in] PCOEM_STRING    SourceString,
  [in] BOOLEAN         AllocateDestinationString
);

Parameters

DestinationString

Pointer to a caller-allocated buffer to receive the translated Unicode string. If AllocateDestinationString is FALSE, the caller must also allocate a buffer for the Buffer member of DestinationString to hold the Unicode data. If AllocateDestinationString is TRUE, RtlOemStringToCountedUnicodeString allocates a buffer large enough to hold the string, passes a pointer to it in Buffer, and updates the length and maximum length members of DestinationString accordingly.

[in] SourceString

Pointer to the OEM string to be translated into Unicode.

[in] AllocateDestinationString

Set to TRUE if RtlOemStringToCountedUnicodeString should allocate the buffer space for the DestinationString, FALSE otherwise. If this parameter is TRUE, the caller is responsible for freeing the buffer when it is no longer needed by calling RtlFreeUnicodeString.

Return value

If the operation succeeds, RtlOemStringToCountedUnicodeString returns STATUS_SUCCESS. Otherwise, no storage was allocated and no conversion was done.

Remarks

RtlOemStringToCountedUnicodeString returns a translated string that does not include NULL terminator. It translates the given source string using the OEM code page that was installed as the current system code page at boot time.

RtlOemStringToCountedUnicodeString does not modify the source string.

For information about other string-handling routines, see Run-Time Library (RTL) Routines.

Requirements

Requirement Value
Target Platform Universal
Header ntifs.h (include Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL < DISPATCH_LEVEL

See also

OEM_STRING

RtlFreeUnicodeString

RtlOemStringToCountedUnicodeSize

RtlOemStringToCountedUnicodeString

RtlOemToUnicodeN

UNICODE_STRING