RtlOemStringToCountedUnicodeString 函数 (ntifs.h)

RtlOemStringToCountedUnicodeString 例程使用当前系统 OEM 代码页将指定的源字符串转换为 Unicode 字符串。

语法

NTSYSAPI NTSTATUS RtlOemStringToCountedUnicodeString(
       PUNICODE_STRING DestinationString,
  [in] PCOEM_STRING    SourceString,
  [in] BOOLEAN         AllocateDestinationString
);

参数

DestinationString

指向调用方分配的缓冲区的指针,用于接收已转换的 Unicode 字符串。 如果 AllocateDestinationStringFALSE,则调用方还必须为 DestinationStringBuffer 成员分配缓冲区以保存 Unicode 数据。 如果 AllocateDestinationStringTRUERtlOemStringToCountedUnicodeString 分配足够大的缓冲区来容纳字符串,在 Buffer中传递指向它的指针,并相应地更新 DestinationString 的长度和最大长度成员。

[in] SourceString

指向要转换为 Unicode 的 OEM 字符串的指针。

[in] AllocateDestinationString

如果 RtlOemStringToCountedUnicodeString 应为 DestinationString分配缓冲区空间,则设置为 true;否则 为 FALSE。 如果此参数 TRUE,则调用方负责通过调用 RtlFreeUnicodeString来释放缓冲区。

返回值

如果作成功,RtlOemStringToCountedUnicodeString 返回STATUS_SUCCESS。 否则,未分配任何存储,也没有完成转换。

言论

RtlOemStringToCountedUnicodeString 返回不包含 NULL 终止符的已转换字符串。 它使用在启动时作为当前系统代码页安装的 OEM 代码页转换给定的源字符串。

RtlOemStringToCountedUnicodeString 不会修改源字符串。

有关其他字符串处理例程的信息,请参阅 Run-Time Library (RTL) 例程

要求

要求 价值
目标平台 普遍
标头 ntifs.h (include Ntifs.h)
NtosKrnl.lib
DLL NtosKrnl.exe
IRQL < DISPATCH_LEVEL

另请参阅

OEM_STRING

RtlFreeUnicodeString

RtlOemStringToCountedUnicodeSize

RtlOemStringToCountedUnicodeString

RtlOemToUnicodeN

UNICODE_STRING