RtlUnicodeStringToOemString function

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(
  POEM_STRING      DestinationString,
  PCUNICODE_STRING SourceString,
  BOOLEAN          AllocateDestinationString
);

Parameters

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.

SourceString

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

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 RtlFreeUnicodeString.

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

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winternl.h
DLL Ntdll.dll