RtlUnicodeStringToOemString function (winternl.h)

Converts the specified Unicode source string into an OEM string. The translation is done with respect to the OEM code page (OCP).

Syntax

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

Parameters

[out] DestinationString

A pointer to an OEM_STRING structure that is contains the OEM equivalent to the Unicode source string. The MaximumLength field is set if AllocateDestinationString is TRUE.

[in] SourceString

A pointer to an UNICODE_STRING structure that is to be converted to OEM.

[in] AllocateDestinationString

Controls allocation of the buffer space for the destination string.

TRUE

Buffer space is allocated for DestinationString. If set to TRUE, the buffer must be deallocated using RtlFreeOemString.

FALSE

Buffer space is not allocated for DestinationString.

Return value

The various NTSTATUS values are defined in NTSTATUS.H, which is distributed with the Windows DDK.

Return code Description
STATUS_SUCCESS
The Unicode string was converted to OEM. Otherwise, no storage was allocated, and no conversion was done.

Remarks

This routine allocates a buffer for the DestinationString only.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winternl.h
Library ntdll.lib
DLL ntdll.dll