RtlUnicodeStringToOemString function (ntifs.h)

The RtlUnicodeStringToOemString routine translates a given Unicode source string into an OEM string using the current system OEM code page.

Syntax

NTSYSAPI NTSTATUS RtlUnicodeStringToOemString(
       POEM_STRING      DestinationString,
  [in] PCUNICODE_STRING SourceString,
  [in] BOOLEAN          AllocateDestinationString
);

Parameters

DestinationString

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

[in] AllocateDestinationString

Set to TRUE if RtlUnicodeStringToOemString 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 RtlFreeOemString.

Return value

RtlUnicodeStringToOemString returns STATUS_SUCCESS if the string at DestinationString is translated. Otherwise, no storage was allocated, and no conversion was performed.

Remarks

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

RtlUnicodeStringToOemString does not modify the source string. It returns a null-terminated OEM 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

RtlFreeOemString

RtlUnicodeStringToCountedOemString

RtlUnicodeStringToOemSize

RtlUnicodeToOemN

RtlUpcaseUnicodeStringToOemString

UNICODE_STRING