RtlOemStringToUnicodeString function

The RtlOemStringToUnicodeString routine translates a given source string into a null-terminated Unicode string using the current system OEM code page.

Syntax

NTSYSAPI NTSTATUS RtlOemStringToUnicodeString(
  PUNICODE_STRING DestinationString,
  PCOEM_STRING    SourceString,
  BOOLEAN         AllocateDestinationString
);

Parameters

DestinationString

Pointer to a caller-allocated buffer to receive the translated string. If AllocateDestinationString is FALSE, the caller must also allocate a buffer for the Buffer member of DestinationString to hold the null-terminated Unicode string. If AllocateDestinationString is TRUE, RtlOemStringToUnicodeString 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.

SourceString

Pointer to the OEM string to be translated to Unicode.

AllocateDestinationString

Set to TRUE if RtlOemStringToUnicodeString 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

RtlOemStringToUnicodeString returns STATUS_SUCCESS if it returns a translated string at DestinationString. Otherwise, no storage was allocated and no conversion was done.

Remarks

RtlOemStringToUnicodeString translates the given source string using the OEM code page that was installed as the current system code page at system boot time.

This routine does not modify the source string. It returns a NULL-terminated Unicode string.

For information about other string-handling routines, see Strings.

Requirements

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

See Also

OEM_STRING

RtlFreeUnicodeString

RtlOemStringToCountedUnicodeString

RtlOemStringToUnicodeSize

RtlOemToUnicodeN

RtlUnicodeStringToOemString

UNICODE_STRING