RtlCopyUnicodeString routine
The RtlCopyUnicodeString 拷贝源字符串的内容到目的字符串.
Syntax
C++
VOID RtlCopyUnicodeString(
_Inout_ PUNICODE_STRING DestinationString,
_In_opt_ PCUNICODE_STRING SourceString
);
Parameters
DestinationString [in, out]
指向目标UNICODE_STRING的指针
SourceString [in, optional]
指向源UNICODE_STRING 的指针
Return value
None
Remarks
如 SourceString 为 NULL,函数设置DestinationString 的Length 为0
函数不改变DestinationString的MaximumLength 和Buffer
从源拷到目的的字节数取决于源字符串长度(SourceString的Length)与目标缓冲区的最大长度(DestinationString的MaximumLength )之间的较小者。
调用者在调用RtlCopyUnicodeString之前必须适当初始化DestinationString 所有的成员。在调用这个函数前初始化Length 或者是 MaximumLength 成员失败可能将导致一个缓冲区溢出。如果调用者运行在IRQL >= DISPATCH_LEVEL时DestinationString 和 SourceString 的缓冲区必须常驻内存。
Requirements
Target platform | |
Version | Available starting with Windows 2000. |
Header | Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h) |
Library | NtosKrnl.lib |
DLL | NtosKrnl.exe |
IRQL | Any level (See Remarks section) |
See also