RtlUnicodeToOemN function

The RtlUnicodeToOemN routine translates a given Unicode string to an OEM string, using the current system OEM code page.

Syntax

NTSYSAPI NTSTATUS RtlUnicodeToOemN(
  PCHAR  OemString,
  ULONG  MaxBytesInOemString,
  PULONG BytesInOemString,
  PCWCH  UnicodeString,
  ULONG  BytesInUnicodeString
);

Parameters

OemString

Pointer to a caller-allocated buffer to receive the translated string.

MaxBytesInOemString

Maximum number of bytes to be written to OemString.

BytesInOemString

Pointer to a caller-allocated variable that receives the number of bytes in the translated string. This parameter can be NULL.

UnicodeString

Pointer to the Unicode source string to be translated.

BytesInUnicodeString

Size, in bytes, of the string at UnicodeString.

Return Value

RtlUnicodeToOemN returns STATUS_SUCCESS if the full string at UnicodeString was translated and returned at OemString.

Remarks

For the return value STATUS_BUFFER_OVERFLOW, the truncated string at OemString was translated without error.

For the return value STATUS_SUCCESS, the value at BytesInOemString, if any, indicates the length of the returned string, rather than the given MaxBytesInOemString.

RtlUnicodeToOemN does not modify the source string. It returns a null-terminated OEM string if the given BytesInUnicodeString included a NULL terminator and if the given MaxBytesInOemString did not cause truncation.

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

RtlOemToUnicodeN

RtlUnicodeStringToCountedOemString

RtlUnicodeStringToOemString