winds_ha
驱动牛犊
驱动牛犊
  • 注册日期2007-05-22
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分60分
  • 威望7点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
阅读:2302回复:2

RtlInitUnicodeString与UNICODE_STRING的区别

楼主#
更多 发布于:2007-06-15 11:07
请问各位大侠,RtlInitUnicodeString与UNICODE_STRING的区别在那里呢?

最新喜欢:

精灵dsp精灵dsp
liyunch
驱动小牛
驱动小牛
  • 注册日期2001-06-28
  • 最后登录2014-09-05
  • 粉丝0
  • 关注0
  • 积分13分
  • 威望134点
  • 贡献值0点
  • 好评度94点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2007-06-15 11:37
UNICODE_STRING是一个结构.当你声明一个UNICODE_STRING时它的成员未初始化.而RtlInitUnicodeString是一个函数用来初始化一个UNICODE_STRING.
wiwjhcwt
驱动大牛
驱动大牛
  • 注册日期2002-08-20
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分12分
  • 威望83点
  • 贡献值1点
  • 好评度20点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2007-10-17 11:29
UNICODE_STRING
The UNICODE_STRING structure is used to define Unicode strings.

typedef struct _UNICODE_STRING {
  USHORT  Length;
  USHORT  MaximumLength;
  PWSTR  Buffer;
} UNICODE_STRING *PUNICODE_STRING;
Members
Length
The length in bytes of the string stored in Buffer.
MaximumLength
The maximum length in bytes of Buffer.
Buffer
Pointer to a buffer used to contain a string of wide characters.
Headers
Defined in ntdef.h. Include wdm.h or ntddk.h.

Comments
The UNICODE_STRING structure is used to pass Unicode strings. Use RtlInitUnicodeString to initialize a UNICODE_STRING.

If the string is NULL-terminated, Length does not include the trailing NULL.

The MaximumLength is used to indicate the length of Buffer so that if the string is passed to a conversion routine such as RtlAnsiStringToUnicodeString the returned string does not exceed the buffer size.
游客

返回顶部