Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4736565
  • 博文数量: 930
  • 博客积分: 12070
  • 博客等级: 上将
  • 技术积分: 11448
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-15 16:57
文章分类

全部博文(930)

文章存档

2011年(60)

2010年(220)

2009年(371)

2008年(279)

分类: WINDOWS

2010-04-19 17:41:17

1) 直接打印字符串。

  DbgPrint(“Hello World!”);


2) 
空结尾的字符串,你可以用普通得C 语法表示字符串常量 
    char variable_string[] = “Hello World”; 
   DbgPrint(“%s”,variable_string);

 

3) 空结尾的宽字符串(WCHAR 类型 ) 
WCHAR    string_w[] = L“Hello World!”; 
DbgPrint(“%ws”,string_w);

或者

DbgPrint(“%S”,string_w);

 

 

4)Unicode 串,由UNICODE_STRING 结构描述, 包含16 位字符。

typedef   struct _UNICODE_STRING{ 
       USHORT Length; 
       USHORT MaximumLength; 
      PWSTR   Buffer; 
}UNICODE_STRING , *PUNICODE_STRING;

 

UNICODE_STRING    string_unicode;

RtlInitUnicodeString(&string_unicode, L”Hello World!”);

DbgPrint(“%wZ\n”,&string_unicode);     

 

5) ANSI 串,由ANSI_STRING 结构描述,包含8 位字符。

typedef struct _STRING{ 
     USHORT Length; 
     USHORT MaximumLength; 
     PCHAR   Buffer; 
}STRING, *PANSI_STRING;

STRING bar; 
或者: ANSI_STRING bar; 
RtlInitAnsiString(&bar,”Hello World!”); 
DbgPrint(“%Z\n”,&bar);

 

DebugPrint 格式说明符

  

 

 根据DDK 上说明,Unicode 格式(%C, %S, %lc, %ls, %wc, %ws, and %wZ) 只能在 IRQL = PASSIVE_LEVEL 时才能使用.

阅读(1754) | 评论(1) | 转发(0) |
0

上一篇:UNICODE_STRING 总结

下一篇:ftw遍历目录树

给主人留下些什么吧!~~

chinaunix网友2010-06-01 06:29:51

MBT is based on Africa's indigenous people to create innovative walking barefoot, and wear this shoe can stimulate the body to relax the muscles so that the muscles of heat to be released, consumed calories, thus to achieve weight loss results. MBT's pursuit of beauty in order to satisfy customers, design a variety of styles, such as Mbt Chapa shoe, MBT Lami Shoe