﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Tiany 's Blog-随笔分类-内核与驱动</title><link>http://www.cppblog.com/tiany/category/18738.html</link><description>奋斗的路上肯定会遇到很多困难 该不该继续？</description><language>zh-cn</language><lastBuildDate>Sun, 07 Apr 2013 09:05:40 GMT</lastBuildDate><pubDate>Sun, 07 Apr 2013 09:05:40 GMT</pubDate><ttl>60</ttl><item><title>从看雪的一个沙箱代码中扣出的InlineHook代码</title><link>http://www.cppblog.com/tiany/archive/2013/03/26/198824.html</link><dc:creator>Tiany</dc:creator><author>Tiany</author><pubDate>Mon, 25 Mar 2013 16:20:00 GMT</pubDate><guid>http://www.cppblog.com/tiany/archive/2013/03/26/198824.html</guid><wfw:comment>http://www.cppblog.com/tiany/comments/198824.html</wfw:comment><comments>http://www.cppblog.com/tiany/archive/2013/03/26/198824.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/tiany/comments/commentRss/198824.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/tiany/services/trackbacks/198824.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Inlin_Hook.h：Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#pragma&nbsp;once&nbsp;&nbsp;#define&nbsp;__malloc(_s)&nbsp;&nbsp;&nbsp;&nbsp;VirtualAl...&nbsp;&nbsp;<a href='http://www.cppblog.com/tiany/archive/2013/03/26/198824.html'>阅读全文</a><img src ="http://www.cppblog.com/tiany/aggbug/198824.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/tiany/" target="_blank">Tiany</a> 2013-03-26 00:20 <a href="http://www.cppblog.com/tiany/archive/2013/03/26/198824.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>WinDBG命令概览(中) - 元命令</title><link>http://www.cppblog.com/tiany/archive/2013/03/24/198772.html</link><dc:creator>Tiany</dc:creator><author>Tiany</author><pubDate>Sun, 24 Mar 2013 08:10:00 GMT</pubDate><guid>http://www.cppblog.com/tiany/archive/2013/03/24/198772.html</guid><wfw:comment>http://www.cppblog.com/tiany/comments/198772.html</wfw:comment><comments>http://www.cppblog.com/tiany/archive/2013/03/24/198772.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/tiany/comments/commentRss/198772.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/tiany/services/trackbacks/198772.html</trackback:ping><description><![CDATA[<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px auto; font: 14px/25px Verdana, Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">元命令(Meta-Command)用来提供标准命令没有提供的常用调试功能, 与标准命令一样, 元命令也是内建在调试器引擎或者WinDBG程序文件中的. 所有元命令都已一个点(.)开始, 所以元命令也被称为点命令(Dot Command).</p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px auto; font: 14px/25px Verdana, Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px auto; font: 14px/25px Verdana, Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">按照功能, 可以把元命令分成如下几类.</p>
<ul style="widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: disc; text-indent: 0px; font: 14px/25px Verdana, Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); margin-left: 45px; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><li>显示和设置调试会话和调试器选项.</li>
<ul style="list-style-type: disc; margin-left: 45px"><li>用于符号选项的<strong>.symopt</strong>- Set Symbol Options</li><li>用于符号路径的.<strong>sympath</strong>- Set Symbol Path, 和<strong>.symfix</strong>- Set Symbol Store Path.</li><li>用于程序源文件的<strong>.srcpath</strong>- Set Source Path,<span class="Apple-converted-space">&nbsp;</span><strong>.srcnoisy</strong>- Noisy Source Loading,<span class="Apple-converted-space">&nbsp;</span><strong>.srcfix</strong>- Use Source Server</li><li>用于扩展命令模块路径的<strong>.extpath</strong>- Set Extension Path</li><li>用于匹配扩展命令的<strong>.extmatch</strong>- Display All Matching Extensions</li><li>用于可执行文件的<strong>.exepath</strong>- Set Executable Path</li><li>设置反汇编选项的<strong>.asm</strong>- Change Disassembly Options</li><li>控制表达式评估器的<strong>.expr</strong>- Choose Expression Evaluator</li></ul></li><li>控制调试会话或者调试目标.</li>
<ul style="list-style-type: disc; margin-left: 45px"><li>重新开始调试会话的<strong>.restart</strong>- Restart Kernel Connection(Kernel Mode) 或 Restart Target Application(User Mode)</li><li>放弃用户态调试目标(进程)的<strong>.abandon</strong>- Abandon Process</li><li>创建新进程的<strong>.create</strong>- Create Process</li><li>附加到存在进程的<strong>.attach</strong>- Attach to Process</li><li>打开转储文件的<strong>.opendump</strong>- Open Dump File</li><li>分离调试目标的<strong>.detach</strong>- Detach from Process</li><li>用于杀掉进程的<strong>.kill</strong>- Kill Process</li></ul></li><li>管理扩展命令模块</li>
<ul style="list-style-type: disc; margin-left: 45px"><li>加载模块的<strong>.load</strong>- Load Extension DLL</li><li>卸载模块<strong>.unload</strong>- Unload Extension DLL和<strong>.unloadall</strong>- Unload All Extension DLLs</li><li>显示已加载模块的<strong>.chain</strong>- List Debugger Extensions</li></ul></li><li>管理调试器日志文件</li>
<ul style="list-style-type: disc; margin-left: 45px"><li>显示信息<span class="Apple-converted-space">&nbsp;</span><strong>.logfile</strong>- Display Log File Status</li><li>打开<span class="Apple-converted-space">&nbsp;</span><strong>.logopen</strong>- Open Log File</li><li>追加<span class="Apple-converted-space">&nbsp;</span><strong>.logappend</strong>- Append Log File</li><li>关闭<span class="Apple-converted-space">&nbsp;</span><strong>.logclose</strong>- Close Log File</li></ul></li><li>远程调试</li>
<ul style="list-style-type: disc; margin-left: 45px"><li>用于启动remote.exe服务的<strong>.remote</strong>- Create Remote.exe Server</li><li>用于启动调试引擎服务器的<strong>.server</strong>- Create Debugging Server</li><li>列出可用服务器的<strong>.servers</strong>- List Debugging Servers</li><li>用于向远程服务器发送文件的<strong>.send_file</strong>- Send File</li><li>用于结束远程进程服务器的<strong>.endpsrv</strong>- End Process Server</li><li>用于结束引擎服务器的<strong>.endsrv</strong>- End Debugging Server</li></ul></li><li>控制调试器</li>
<ul style="list-style-type: disc; margin-left: 45px"><li>让调试器睡眠一段时间的<strong>.sleep</strong>- Pause Debugger</li><li>唤醒处于睡眠状态的调试器的<strong>.wake</strong>- Wake Debugger</li><li>启动另一个调试器来调试当前调试器的<strong>.dbgdbg</strong>- Debug Current Debugger</li></ul></li><li>编写命令程序</li>
<ul style="list-style-type: disc; margin-left: 45px"><li>包括一系列类似C语言关键字的命令, 如</li>
<ul style="list-style-type: disc; margin-left: 45px"><li>.if, .else, .elsif, .foreach, .do, .while. .continue, .catch, .break, .continue, .leave, .printf, .block. 在&lt;软件调试&gt;一书第30章的第18节有介绍命令程序的编写方法.</li></ul></ul></li><li>显示或者转储调试目标数据</li>
<ul style="list-style-type: disc; margin-left: 45px"><li>产生转储文件的<strong>.dump</strong>- Create Dump File</li><li>将原始内存数据写到文件的<strong>.writemem</strong>- Write Memory to File</li><li>显示调试会话时间的<strong>.time</strong>- Display System Time</li><li>显示线程时间的<strong>.ttime</strong>- Display Thread Times</li><li>显示任务列表的<strong>.tlist</strong>- List Process IDs</li><li>以不同格式显示数字的<strong>.formats</strong>- Show Number Formats</li><li>可以列出所有元命令和每个命令的简单说明的<strong>.help</strong>- Meta-Command Help</li></ul></ul><img src ="http://www.cppblog.com/tiany/aggbug/198772.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/tiany/" target="_blank">Tiany</a> 2013-03-24 16:10 <a href="http://www.cppblog.com/tiany/archive/2013/03/24/198772.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>WinDBG命令概览(上) - 标准命令</title><link>http://www.cppblog.com/tiany/archive/2013/03/24/198770.html</link><dc:creator>Tiany</dc:creator><author>Tiany</author><pubDate>Sun, 24 Mar 2013 08:01:00 GMT</pubDate><guid>http://www.cppblog.com/tiany/archive/2013/03/24/198770.html</guid><wfw:comment>http://www.cppblog.com/tiany/comments/198770.html</wfw:comment><comments>http://www.cppblog.com/tiany/archive/2013/03/24/198770.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/tiany/comments/commentRss/198770.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/tiany/services/trackbacks/198770.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: WinDBG的大多数功能是以命令方式工作的, 本系列将介绍WinDBG的三类命令, 标准命令, 元命令和扩展命令.&nbsp;标准命令===============标准命令用来提供适用于所有调试目标的基本调试功能.所有基本命令都是实现在WinDBG内部的, 执行这些命令时不需要加载任何扩展模块. 大多数标准命令是一两个字符或者符号, 只有version等少数命令除外. 标准命令...&nbsp;&nbsp;<a href='http://www.cppblog.com/tiany/archive/2013/03/24/198770.html'>阅读全文</a><img src ="http://www.cppblog.com/tiany/aggbug/198770.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/tiany/" target="_blank">Tiany</a> 2013-03-24 16:01 <a href="http://www.cppblog.com/tiany/archive/2013/03/24/198770.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VS2008编译驱动环境配置</title><link>http://www.cppblog.com/tiany/archive/2013/03/23/198753.html</link><dc:creator>Tiany</dc:creator><author>Tiany</author><pubDate>Sat, 23 Mar 2013 12:20:00 GMT</pubDate><guid>http://www.cppblog.com/tiany/archive/2013/03/23/198753.html</guid><wfw:comment>http://www.cppblog.com/tiany/comments/198753.html</wfw:comment><comments>http://www.cppblog.com/tiany/archive/2013/03/23/198753.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/tiany/comments/commentRss/198753.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/tiany/services/trackbacks/198753.html</trackback:ping><description><![CDATA[<span style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体">新建一个空的</span><span style="font-family: 'Times New Roman'">win32</span><span style="font-family: 宋体">控制台程序</span></span> 
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'"><span>&nbsp;</span>1</span></span><span style="font-family: 宋体">、选（文件&#8594;新建&#8594;项目&#8594;</span><span style="font-family: 'Times New Roman'">Visual&nbsp;C++</span><span style="font-family: 宋体">项目&#8594;</span><span style="font-family: 'Times New Roman'">win32</span><span style="font-family: 宋体">&#8594;</span><span style="font-family: 'Times New Roman'">win32</span><span style="font-family: 宋体">控制台项目）创建一个</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体">填写上名称</span><span style="font-family: 'Times New Roman'">event</span><span style="font-family: 宋体">然后按确定</span><span><br /></span><span style="font-family: 宋体">在弹出的</span><span style="font-family: 'Times New Roman'">win32</span><span style="font-family: 宋体">应用程序向导里</span><span style="font-family: 'Times New Roman'">&nbsp;</span><span style="font-family: 宋体">选应用程序设置</span><span style="font-family: 'Times New Roman'">&nbsp;</span><span style="font-family: 宋体">&#8594;附加选项</span><span style="font-family: 'Times New Roman'">&nbsp;</span><span style="font-family: 宋体">勾选空项目&#8594;完成。</span><span><br /></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span>&nbsp;</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体">二</span><span><span style="font-family: 'Times New Roman'">&nbsp;、&nbsp;&nbsp;</span></span><span style="font-family: 宋体">选项目菜单&#8594;添加现有项&#8594;添加所有驱动相关的</span><span style="font-family: 'Times New Roman'">*.h,*.c,*.cpp,*.rc</span><span style="font-family: 宋体">之类的文件。</span></p><span style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体">选工具</span><span style="font-family: 'Times New Roman'">(T)</span><span style="font-family: 宋体">&#8594;选项</span><span style="font-family: 'Times New Roman'">(<span>O</span>)....</span><span style="font-family: 宋体">&#8594;项目&#8594;</span><span style="font-family: 'Times New Roman'">VC++</span><span style="font-family: 宋体">目录&#8594;</span></span> 
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 'Times New Roman'"><span>&nbsp;&nbsp;</span>1</span><span style="font-family: 宋体">、在<span style="color: blue">可执行文件</span>目录中添加：</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: red">D:/WINDDK/3790.1830/BIN/X86<span>&nbsp;&nbsp;&nbsp;</span>//VS2003(没测),VS2005(没测),VS2008</span></span></span><span style="font-family: 宋体; color: red; font-size: 10pt">内不需要</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span>&nbsp;</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 'Times New Roman'"><span>&nbsp;&nbsp;</span>2</span><span style="font-family: 宋体">、在<span style="color: blue">包含文件</span>目录添加如下路径</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>D:/WINDDK/3790.1830/inc/wxp<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>D:/WINDDK/3790.1830/inc/crt<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>(</span></span><span style="font-family: 宋体">可选</span><span><span style="font-family: 'Times New Roman'">)<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>D:/WINDDK/3790.1830/inc/ddk/wxp<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>D:/WINDDK/3790.1830/inc/ddk/wdm/wxp</span></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span>&nbsp;</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 'Times New Roman'"><span>&nbsp;&nbsp;</span>3</span><span style="font-family: 宋体">、在<span style="color: blue">库文件</span>目录中添加：</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>D:/WINDDK/3790.1830/LIB/WXP/I386</span></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span>&nbsp;</span></p><span style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体">项目</span><span style="font-family: 'Times New Roman'">event</span><span style="font-family: 宋体">属性设置</span><span style="font-family: 'Times New Roman'">&nbsp;</span></span> 
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><strong><span style="font-family: 宋体; color: red">新建项目配置</span></strong><strong><span style="color: red"><span style="font-family: 'Times New Roman'">check&nbsp;//</span></span></strong><strong><span style="font-family: 宋体; color: red">必选</span></strong></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><strong><span style="color: red"><span style="font-family: 'Times New Roman'">(</span></span></strong><strong><span style="font-family: 宋体; color: red">一</span></strong><strong><span style="color: red"><span style="font-family: 'Times New Roman'">)C/C++</span></span></strong><strong><span style="font-family: 宋体; color: red">属性设置</span></strong></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><strong><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;</span></span></strong><strong><span style="font-family: 宋体">常规选项卡</span></strong></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">1</span></span><span style="font-family: 宋体">调试信息格式</span><span style="font-family: 'Times New Roman'">(C7</span><span style="font-family: 宋体">兼容</span><span style="font-family: 'Times New Roman'">(/Z7)&nbsp;//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">2</span></span><span style="font-family: 宋体">警告等级</span><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">（</span><span style="font-family: 'Times New Roman'">2</span><span style="font-family: 宋体">级</span><span style="font-family: 'Times New Roman'">(/W2)<span>&nbsp;&nbsp;</span>//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">3</span></span><span style="font-family: 宋体">将警告视为错误</span><span style="font-family: 'Times New Roman'">(</span><span style="font-family: 宋体">是</span><span style="font-family: 'Times New Roman'">(/wx)<span>&nbsp;&nbsp;</span>//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><strong><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;</span></span></strong><strong><span style="font-family: 宋体">优化选项卡</span></strong></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">1</span></span><span style="font-family: 宋体">优化</span><span style="font-family: 'Times New Roman'">(</span><span style="font-family: 宋体">禁用</span><span style="font-family: 'Times New Roman'">/Od)<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><strong><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;</span></span></strong><strong><span style="font-family: 宋体">预处理器</span></strong></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: blue"><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体; color: blue">预处理器定义：</span><span style="color: blue"><span style="font-family: 'Times New Roman'">WIN32=100;_X86_=1;WINVER=0x501;DBG=1<span>&nbsp;&nbsp;&nbsp;</span>//</span></span><span style="font-family: 宋体; color: blue">必选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><strong><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;</span></span></strong><strong><span style="font-family: 宋体">代码生成</span></strong></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 'Times New Roman'"><strong><span>&nbsp;&nbsp;</span></strong><span>&nbsp;&nbsp;</span></span><span style="font-family: 宋体">启用最小重新生成：否</span><span style="font-family: 'Times New Roman'"><span>&nbsp;&nbsp;&nbsp;</span>//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">基本运行时检查：默认值</span><span style="font-family: 'Times New Roman'">//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">运行时库：多线程调试</span><span style="font-family: 'Times New Roman'">(/MTd)&nbsp;</span><span style="font-family: 宋体">或</span><span style="font-family: 'Times New Roman'">&nbsp;</span><span style="font-family: 宋体">多线程</span><span style="font-family: 'Times New Roman'">(/MT)<span>&nbsp;&nbsp;</span>//</span><span style="font-family: 宋体">建议选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">缓冲区安全检查：否</span><span style="font-family: 'Times New Roman'"><span>&nbsp;&nbsp;&nbsp;</span>//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'"><span>&nbsp;</span>(</span></span><span style="font-family: 宋体">可避免出现</span><span style="font-family: 'Times New Roman'">LINK&nbsp;:&nbsp;error&nbsp;LNK2001:&nbsp;</span><span style="font-family: 宋体">无法解析外部符号</span><span style="font-family: 'Times New Roman'">__security_cookie)</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><strong><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;</span></span></strong><strong><span style="font-family: 宋体">高级</span></strong></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: blue"><span style="font-family: 'Times New Roman'">&nbsp;</span></span><span style="font-family: 宋体; color: blue">调用约定</span><span style="color: blue"><span style="font-family: 'Times New Roman'">__stdcall(/Gz)<span>&nbsp;&nbsp;&nbsp;</span>//</span></span><span style="font-family: 宋体; color: blue">必选</span></p><span style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong><span style="font-family: 宋体; color: red">链接器</span></strong></span> 
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: red"><span style="font-family: 'Times New Roman'">&nbsp;</span></span><span style="font-family: 宋体; color: red">常规：</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: blue"><span style="font-family: 'Times New Roman'">&nbsp;</span></span><span style="font-family: 宋体; color: blue">输出文件：</span><span style="color: blue"><span style="font-family: 'Times New Roman'">$(OutDir)/$(ProjectName).sys&nbsp;//</span></span><span style="font-family: 宋体; color: blue">必选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;</span></span><span style="font-family: 宋体">启用增量链接：否</span><span style="font-family: 'Times New Roman'">(/INCREMENTAL:NO)&nbsp;//</span><span style="font-family: 宋体">建议选上</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span>&nbsp;</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体">忽略导入库：是</span><span style="font-family: 'Times New Roman'">//</span><span style="font-family: 宋体">可选</span><span style="font-family: 'Times New Roman'">(&nbsp;</span><span style="font-family: 宋体">设置为此值时，必须在附加库目录中加：</span><span style="font-family: 'Times New Roman'">D:/WINDDK/3790.1830/lib/wxp/i386&nbsp;</span><span style="font-family: 宋体">，这样项目就不会依赖</span><span style="font-family: 'Times New Roman'">IDE</span><span style="font-family: 宋体">环境的设置</span><span style="font-family: 'Times New Roman'">)<span>&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">否</span><span style="font-family: 'Times New Roman'">(&nbsp;</span><span style="font-family: 宋体">设置为此值时，将依赖</span><span style="font-family: 'Times New Roman'">IDE&nbsp;</span><span style="font-family: 宋体">的环境的相关设置</span><span style="font-family: 'Times New Roman'">)</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: red"><span style="font-family: 'Times New Roman'">&nbsp;</span></span><span style="font-family: 宋体; color: red">输入：</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体">附加依赖项</span><span style="font-family: 'Times New Roman'">ntoskrnl.lib&nbsp;Hal.lib&nbsp;wdm.lib&nbsp;wdmsec.lib&nbsp;wmilib.lib&nbsp;ndis.lib&nbsp;MSVCRT.LIB&nbsp;LIBCMT.LIB&nbsp;//</span><span style="font-family: 宋体">必选其</span><span style="font-family: 'Times New Roman'">12</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">//NT</span></span><span style="font-family: 宋体">式驱动</span><span style="font-family: 'Times New Roman'">ntoskrnl.lib<span>&nbsp;&nbsp;</span>WDM</span><span style="font-family: 宋体">式驱动</span><span><span style="font-family: 'Times New Roman'"><span>&nbsp;&nbsp;</span>wdm.lib<br /><span>&nbsp;</span>(&nbsp;HalXXX</span></span><span style="font-family: 宋体">函数在</span><span style="font-family: 'Times New Roman'">Hal.lib</span><span style="font-family: 宋体">，</span><span style="font-family: 'Times New Roman'">WmiXXX</span><span style="font-family: 宋体">函数在</span><span style="font-family: 'Times New Roman'">wmilib.lib&nbsp;</span><span style="font-family: 宋体">，</span><span style="font-family: 'Times New Roman'">NdisXXX</span><span style="font-family: 宋体">函数在</span><span><span style="font-family: 'Times New Roman'">ndis.lib&nbsp;)<br /><span>&nbsp;</span>(&nbsp;</span></span><span style="font-family: 宋体">必要时需要增加微软的标准库</span><span style="font-family: 'Times New Roman'">MSVCRT.LIB&nbsp;MSVCRTD.LIB(</span><span style="font-family: 宋体">调试库</span><span style="font-family: 'Times New Roman'">)&nbsp;LIBCMT.LIBIBCMTD.LIB(</span><span style="font-family: 宋体">调试库</span><span><span style="font-family: 'Times New Roman'">)&nbsp;)<br /><span>&nbsp;</span>(&nbsp;</span></span><span style="font-family: 宋体">如果源码中有</span><span style="font-family: 'Times New Roman'">source&nbsp;</span><span style="font-family: 宋体">文件，那么该文件的</span><span style="font-family: 'Times New Roman'">TARGETLIBS&nbsp;</span><span style="font-family: 宋体">字段会列出该项目需要的库</span><span style="font-family: 'Times New Roman'">)</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">忽略所有默认库：是</span><span style="font-family: 'Times New Roman'">(/NODEFAULTLIB)</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: red"><span style="font-family: 'Times New Roman'">&nbsp;</span></span><span style="font-family: 宋体; color: red">清单文件：</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体; color: blue">启用用户账户控制（</span><span style="color: blue"><span style="font-family: 'Times New Roman'">UAC</span></span><span style="font-family: 宋体; color: blue">）</span><span style="color: blue"><span style="font-family: 'Times New Roman'">&nbsp;</span></span><span style="font-family: 宋体; color: blue">否</span><span style="color: blue"><span style="font-family: 'Times New Roman'">//</span></span><span style="font-family: 宋体; color: blue">必选</span><span style="font-family: 'Times New Roman'">&nbsp;</span><span style="font-family: 宋体">不然会出现</span><span style="font-family: 'Times New Roman'">&nbsp;</span><span style="font-size: 9pt"><span style="font-family: 'Times New Roman'">&gt;LINK&nbsp;:&nbsp;fatal&nbsp;error&nbsp;LNK1295:&nbsp;&#8220;/MANIFESTUAC&#8221;</span></span><span style="font-family: 宋体; font-size: 9pt">与</span><span style="font-size: 9pt"><span style="font-family: 'Times New Roman'">&#8220;/DRIVER&#8221;</span></span><span style="font-family: 宋体; font-size: 9pt">规范不兼容；链接时不使用</span><span style="font-family: 'Times New Roman'"><span style="font-size: 9pt">&#8220;/MANIFESTUAC&#8221;</span><span>&nbsp;</span></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: red"><span style="font-family: 'Times New Roman'">&nbsp;</span></span><span style="font-family: 宋体; color: red">调试：</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">生成调试信息</span><span style="font-family: 'Times New Roman'">&nbsp;</span><span style="font-family: 宋体">是</span><span style="font-family: 'Times New Roman'">(/DEBUG)&nbsp;//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">生成映像文件：是</span><span style="font-family: 'Times New Roman'">(/MAP)<span>&nbsp;&nbsp;</span>//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">映像文件名：</span><span style="font-family: 'Times New Roman'">$(TargetDir)$(TargetName).map&nbsp;//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: red"><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;</span></span><span style="font-family: 宋体; color: red">系统</span><span style="color: red"><span style="font-family: 'Times New Roman'">(System)</span></span><span style="font-family: 宋体; color: red">：</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: blue"><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体; color: blue">子系统</span><span style="color: blue"><span style="font-family: 'Times New Roman'">:</span></span><span style="font-family: 宋体; color: blue">控制台</span><span style="color: blue"><span style="font-family: 'Times New Roman'">(/SUBSYSTEM:CONSOLE)&nbsp;//</span></span><span style="font-family: 宋体; color: blue">必选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">堆栈保留大小：</span><span style="font-family: 'Times New Roman'">4194304&nbsp;//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">堆栈提交大小：</span><span style="font-family: 'Times New Roman'">4096<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: blue"><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体; color: blue">驱动程序</span><span style="color: blue"><span style="font-family: 'Times New Roman'">:<span>&nbsp;&nbsp;&nbsp;</span></span></span><span style="font-family: 宋体; color: blue">驱动程序</span><span style="color: blue"><span style="font-family: 'Times New Roman'">(/DRIVER)&nbsp;//</span></span><span style="font-family: 宋体; color: blue">必选</span><span style="color: blue"><span style="font-family: 'Times New Roman'">&nbsp;</span></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'"><span>&nbsp;</span><span style="color: red"><span>&nbsp;&nbsp;&nbsp;</span></span></span></span><span style="font-family: 宋体; color: red">高级：</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体; color: blue">入口点：</span><span style="color: blue"><span style="font-family: 'Times New Roman'">DriverEntry<span>&nbsp;&nbsp;&nbsp;</span>//</span></span><span style="font-family: 宋体; color: blue">必选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体; color: blue">随机基址</span><span style="color: blue"><span style="font-family: 'Times New Roman'">:</span></span><span style="font-family: 宋体; color: blue">默认值</span><span style="color: blue"><span style="font-family: 'Times New Roman'"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>//</span></span><span style="font-family: 宋体; color: blue">必选</span><span style="color: blue"><span style="font-family: 'Times New Roman'">&nbsp;</span></span><span style="font-family: 宋体; color: blue">不然会出现</span><span style="color: blue"><span style="font-family: 'Times New Roman'">&nbsp;</span></span><span style="font-size: 9pt"><span style="font-family: 'Times New Roman'">1&gt;G:/event2008/check/event2008.exe&nbsp;:&nbsp;fatal&nbsp;error&nbsp;LNK1295:&nbsp;&#8220;/DYNAMICBASE&#8221;</span></span><span style="font-family: 宋体; font-size: 9pt">与</span><span style="font-size: 9pt"><span style="font-family: 'Times New Roman'">&#8220;/DRIVER&#8221;</span></span><span style="font-family: 宋体; font-size: 9pt">规范不兼容；链接时不使用</span><span style="font-size: 9pt"><span style="font-family: 'Times New Roman'">&#8220;/DYNAMICBASE&#8221;</span></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体; color: blue; font-size: 9pt">数据执行保护</span><span style="color: blue; font-size: 9pt"><span style="font-family: 'Times New Roman'">(DEP):&nbsp;</span></span><span style="font-family: 宋体; color: blue; font-size: 9pt">默认值</span><span style="color: blue; font-size: 9pt"><span style="font-family: 'Times New Roman'">//</span></span><span style="font-family: 宋体; color: blue; font-size: 9pt">必选</span><span style="font-size: 9pt"><span style="font-family: 'Times New Roman'">&nbsp;</span></span><span style="font-family: 宋体; font-size: 9pt">不然会出现</span><span style="font-size: 9pt"><span style="font-family: 'Times New Roman'">G:/event2008/check/event2008.sys&nbsp;:&nbsp;fatal&nbsp;error&nbsp;LNK1295:&nbsp;&#8220;/NXCOMPAT:NO&#8221;</span></span><span style="font-family: 宋体; font-size: 9pt">与</span><span style="font-size: 9pt"><span style="font-family: 'Times New Roman'">&#8220;/DRIVER&#8221;</span></span><span style="font-family: 宋体; font-size: 9pt">规范不兼容；链接时不使用</span><span style="font-size: 9pt"><span style="font-family: 'Times New Roman'">&#8220;/NXCOMPAT:NO&#8221;</span></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: blue"><span>&nbsp;</span></span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体">设置效应和：是</span><span style="font-family: 'Times New Roman'">(/RELEASE)&nbsp;//</span><span style="font-family: 宋体">可选</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体; color: blue">基址：</span><span style="color: blue"><span style="font-family: 'Times New Roman'">0x10000<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>//</span></span><span style="font-family: 宋体; color: blue">建议选上</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: red"><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;</span></span><span style="font-family: 宋体; color: red">命令行</span><span style="color: red"><span style="font-family: 'Times New Roman'">&#8221;-&gt;</span></span><span style="font-family: 宋体; color: red">附加选项：</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: blue"><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体; color: blue">添加开关：</span><span style="color: blue"><span style="font-family: 'Times New Roman'">/SECTION:INIT,D&nbsp;/IGNORE:4078&nbsp;//</span></span><span style="font-family: 宋体; color: blue">建议填上</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span><span style="font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">可以避免以下错误提示</span><span><br /><span style="font-family: 'Times New Roman'"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>LINK&nbsp;:&nbsp;warning&nbsp;LNK4078:&nbsp;</span></span><span style="font-family: 宋体">找到多个</span><span style="font-family: 'Times New Roman'">&#8220;INIT&#8221;</span><span style="font-family: 宋体">节，它们具有不同的属性</span><span><span style="font-family: 'Times New Roman'">(E2000020)<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>LINK&nbsp;:&nbsp;error&nbsp;LNK2001:&nbsp;</span></span><span style="font-family: 宋体">无法解析的外部符号</span><span style="font-family: 'Times New Roman'">__load_config_used</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体">五．编译，链接。</span></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0cm 0cm 0pt; padding-left: 0px; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: 宋体">一些要修改</span><span style="font-family: 'Times New Roman'">DDK</span><span style="font-family: 宋体">例子源码方能成功的问题，目前不知道什么选项可以不改：</span><span><br /><span>&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="font-family: 宋体">源码中的关键字</span><span style="font-family: 'Times New Roman'">try&nbsp;</span><span style="font-family: 宋体">要改为</span><span style="font-family: 'Times New Roman'">__try&nbsp;,&nbsp;except&nbsp;</span><span style="font-family: 宋体">要改为</span><span style="font-family: 'Times New Roman'">__except&nbsp;.</span></p><img src ="http://www.cppblog.com/tiany/aggbug/198753.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/tiany/" target="_blank">Tiany</a> 2013-03-23 20:20 <a href="http://www.cppblog.com/tiany/archive/2013/03/23/198753.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VMware + WinDbg 配置内核调试 </title><link>http://www.cppblog.com/tiany/archive/2012/03/03/167024.html</link><dc:creator>Tiany</dc:creator><author>Tiany</author><pubDate>Fri, 02 Mar 2012 16:47:00 GMT</pubDate><guid>http://www.cppblog.com/tiany/archive/2012/03/03/167024.html</guid><wfw:comment>http://www.cppblog.com/tiany/comments/167024.html</wfw:comment><comments>http://www.cppblog.com/tiany/archive/2012/03/03/167024.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/tiany/comments/commentRss/167024.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/tiany/services/trackbacks/167024.html</trackback:ping><description><![CDATA[<div class="postText"><span style="font-size: 10pt">借助VMware实现单机使用WinDbg进行调试的方法。 </span>
<p><span style="font-size: 10pt">安裝VMware Workstation 6.0, WinDbg。<br /><br />具体步骤如下：<br /><br /><strong>1 设置 VMware 的虚拟com</strong><br /><br />1.1 运行 VMware ，点击 "Edit virtual machine settings"<br /><br />1.2 点击 "Add..." 来运行 VMware 的 Hardware Wizard </span></p>
<p><span style="font-size: 10pt"><img border="0" alt="" src="http://www.7880.com/Upload/2005-06/CSDN_Dev_Image_2003-10-31517202.GIF" width="614" height="468" /> </span></p>
<p><br /><span style="font-size: 10pt">1.3 选择 "Serial Port"，点 "下一步"<br /><img border="0" alt="" src="http://www.7880.com/Upload/2005-06/CSDN_Dev_Image_2003-10-31517204.GIF" width="441" height="376" /> </span></p>
<p><br /><span style="font-size: 10pt">1.4 选择 "Output to named pipe",点 "下一步" </span></p>
<p><span style="font-size: 10pt"><img border="0" alt="" src="http://www.7880.com/Upload/2005-06/CSDN_Dev_Image_2003-10-31517206.GIF" width="441" height="376" /> </span></p>
<p><br /><span style="font-size: 10pt">1.5 第一框里保持默认的 </span><a href="file://./pipe/com_1"><span style="font-size: 10pt"><font color="#1d58d1">\\.\pipe\com_1</font></span></a><span style="font-size: 10pt"> &lt;==== 此可為任何名<br />第二框里选"This end is the server."<br />第三框里选"The other end is an application."<br />选中 "Connect at power on"<br />然后点击 "Advanced&gt;&gt;"<br /><img border="0" alt="" src="http://www.7880.com/Upload/2005-06/CSDN_Dev_Image_2003-10-31517208.GIF" width="441" height="376" /> </span></p>
<p><br /><span style="font-size: 10pt">1.6 选中 "Yield CPU on poll"（VMware Support 中提到了这一点），然后点完成。<br /><img border="0" alt="" src="http://www.7880.com/Upload/2005-06/CSDN_Dev_Image_2003-10-315172010.GIF" width="441" height="376" /> </span></p>
<p><br /><span style="font-size: 10pt">1.7 这样就完成了虚拟com的设置。<br /><img border="0" alt="" src="http://www.7880.com/Upload/2005-06/CSDN_Dev_Image_2003-10-315172012.GIF" width="614" height="468" /> </span></p>
<p><br /><span style="font-size: 10pt">1.8 重新启动 VM。<br /><br /><strong>2 设置 VMware 虚拟出来的 guest os</strong><br /><br />现在 power on 虚拟出来的 guest os<br /><br />2.1 设置boot.ini<br /><br />在c:\下，可以找到boot.ini，可以用记事本打开它。我们需要在 guest os 的启动项上加些参数，才能够使用WinDbg调试它。我们可以在现有的行后面直接加参数，不过强烈推荐复制一个新行，在新行的后面加参数。这样在调试启动有问题的时候，我们可以方便的换回原来的启动方式。下面就是我改好的boot.ini。<br />其中 " multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows XP Professional" /fastdetect "<br />是原来的行。<br />" multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows XP Professional - debug" /fastdetect /noguiboot <strong><span style="color: red"><strong>/debug /debugport=com1 /baudrate=115200</strong> </span></strong>" 新加為用于 WinDbg 调试的行。<br /><br />------------------------------------------------------------------------------------------<br /><br />[boot loader]<br />timeout=10<br />default=multi(0)disk(0)rdisk(0)partition(1)\WINNT<br />[operating systems]<br />multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows XP Professional" /fastdetect <br />multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows XP Professional - debug" /fastdetect /debug /debugport=com1 /baudrate=115200<br /><br />-------------------------------------------------------------------------------------------<br /><br />这里还要注意的是,timeout不要为0，否则直接启动默认的项。新行后面加上了参数 /debug /debugport=com1 /baudrate=115200 ，可以看到 debugport=com1 ，baudrate=115200 。参数的具体作用，可以参考 WinDbg 的帮助文件。<br /></span></p>
<p><br /><span style="font-size: 10pt">2.2 设置com1端口的速度<br />在 guest os 的设备管理器中把com1端口的速度也就是"每秒位数"项，设为和上面一样的115200。</span></p><br /><span style="font-size: 10pt"><strong>3 设置 WinDbg</strong><br /><br />我们需要告诉WinDbg通过pipe进行连接和连接的速度。可以在命令提示符（cmd.exe）下加参数<br />-b -k com:port=\\.\pipe\com_1,baud=11520,pipe 运行WinDbg（VMware Support 中没有提到 baud=11520 这个参数，其实这是个比较重要的参数）。更方便的方法是在桌面建立一个WinDbg的快捷方式，在该快捷方式的属性，"目标"框中，加上参数 -k com:port=\\.\pipe\com_1,baud=11520,pipe 。这样运行这个快捷方式启动的WinDbg就完成了设置。参数的具体作用，可以参考 WinDbg 的帮助文件。<br /></span>
<p><span style="font-size: 10pt"><strong>4 推荐的操作顺序</strong><br /><br />4.1 首先运行 VMware ，启动 Guest OS ，到系统启动选择，选择 "Microsoft Windows XP Professional - debug" 项，先不要按回车。<br /><br />4.2 通过刚才设置好的快捷方式运行WinDbg。<br /><br />4.3 在 Guest OS 中选择 "Microsoft Windows XP Professional - debug" 项，按回车。<br /><br />4.4 稍等片刻，就连接上了。如果很长时间没有连接上的话，可以按 WinDbg 菜单中的 "Debug"-&gt;"Kernel Connection"-&gt;"Resynchronize"。 </span><span style="font-size: 10pt"><span style="color: red">&lt;=== 如有用命令選項 此應不會發生<br /></span><img border="0" alt="" src="http://www.7880.com/Upload/2005-06/CSDN_Dev_Image_2003-10-315172020.GIF" width="642" height="488" /> </span></p>
<p><br /><span style="font-size: 10pt">4.5 最后按 WinDbg 菜单中的 "Debug"-&gt;"Break" ，你就可以向 WinDbg 下命令了。<br /><img border="0" alt="" src="http://www.7880.com/Upload/2005-06/CSDN_Dev_Image_2003-10-315172022.GIF" width="800" height="576" /> </span></p>
<p><br /><span style="font-size: 10pt"><strong>? 其他</strong><br />?.1 VMware Support 中还提到了可以通过修改虚拟机的配置文件来改变虚拟串口的速度，有兴趣的话可以参考 VMware Support 中的方法。<br />?.2 WinDbg 的菜单项 "View"-&gt;"Show Version" 可以看到一些相关信息。<br /><br />参考 <br />Driver Debugging with WinDbg and VMWare </span><a href="http://silverstr.ufies.org/lotr0/windbg-vmware.html" target="_blank"><span style="font-size: 10pt"><font color="#1d58d1">http://silverstr.ufies.org/lotr0/windbg-vmware.html<br /></font></span></a><span style="font-size: 10pt">VMware Support 相关部分 </span><a href="http://www.vmware.com/support/ws3/doc/ws32_devices3.html"><span style="font-size: 10pt"><font color="#1d58d1">http://www.vmware.com/support/ws3/doc/ws32_devices3.html</font></span></a><span style="font-size: 10pt"> </span></p>
<p><span style="font-size: 10pt"><br /></span></p>
<div class="mainbody">
<p><span style="font-size: 10pt">One of the first useful things you will want to do when in the bowels of ring 0 is attack the thing from a debugger point of view. In my case I like using Windows Debugger [windbg] (hey its free, fully functional and does remote debugging really well), and found it neccessary to find a way to have it work with VMWare. </span></p>
<p><span style="font-size: 10pt">The trick to get it to work in VMWare is to get the host OS to believe it is able to connect to a serial port. Through VMWare, to accomplish this, you need to create a named pipe. The following steps will guide you to configuring VMWare (in my case v3.2): </span></p>
<ol><li><span style="font-size: 10pt">Open up the Configuration Editor (<strong><font color="white">Settings-&gt;Configuration Editor</font></strong>) </span>
<p>&nbsp;</p>
<p><span style="font-size: 10pt"></span></p></li><li><span style="font-size: 10pt">Click <strong><font color="white">Add</font></strong> to run the Hardware Wizard </span>
<p>&nbsp;</p>
<p><span style="font-size: 10pt"></span></p></li><li><span style="font-size: 10pt">Select <strong><font color="white">Serial Port</font></strong>, and then click the <strong><font color="white">Next</font></strong> button </span>
<p><span style="font-size: 10pt"><img border="0" alt="" src="http://silverstr.ufies.org/lotr0/images/vmware-config.png" /> </span></p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt"></span></p></li><li><span style="font-size: 10pt">Select the <strong><font color="white">Use named pipe</font></strong> radio button </span>
<p>&nbsp;</p>
<p><span style="font-size: 10pt"></span></p></li><li><span style="font-size: 10pt">Use the default pipe name. It SHOULD be <strong><font color="white">\\.\pipe\com_1</font></strong>. If it is not, change it to that. </span>
<p>&nbsp;</p>
<p><span style="font-size: 10pt"></span></p></li><li><span style="font-size: 10pt">Select <strong><font color="white">This end is the Server</font></strong>. </span>
<p>&nbsp;</p>
<p><span style="font-size: 10pt"></span></p></li><li><span style="font-size: 10pt">Select <strong><font color="white">The other end is an application</font></strong>. </span>
<p>&nbsp;</p>
<p><span style="font-size: 10pt"></span></p></li><li><span style="font-size: 10pt">Click the <strong><font color="white">Advanced</font></strong> Button. </span>
<p>&nbsp;</p>
<p><span style="font-size: 10pt"></span></p></li><li><span style="font-size: 10pt">Select the <strong><font color="white">Yield CPU on poll</font></strong> checkbox </span>
<p><span style="font-size: 10pt"><img border="0" alt="" src="http://silverstr.ufies.org/lotr0/images/vmware-config-advanced.png" /> </span></p>
<p><span style="font-size: 10pt">This is an important step as the Kernel in the target virtual machine uses the port in polled mode, not interrupt mode. </span></p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt"></span></p></li><li><span style="font-size: 10pt">Click the <strong><font color="white">Finish</font></strong> button, and then click <strong><font color="white">Ok</font></strong> to close the Configuration Editor. </span>
<p><span style="font-size: 10pt">Once you have configured your VMWare session, you need to power it on. You will be able to confirm that the new virtual serial port is added by clicking on the <strong><font color="white">Devices-&gt;serial0</font></strong> menu item. You should note it is saying <strong>"Connecting"</strong>. This means its now ready for a remote connection. </span></p>
<p><span style="font-size: 10pt">Once the actual virtual machine is configured, you need to configure the target operating system installed in the virtual machine to support remote debugging. This is accomplished by editing the <strong>boot.ini</strong> found in the root of the C:\ drive. To do this, you need to add a <strong><font color="white">/debugport=some_com_port /baudrate=some_baud_rate</font></strong> to the end of an <strong>[operating systems]</strong> line. I would not recommend doing it to the one that is there. It would be better to copy the line and paste it with the ammendments, and then use the OS's menu selection to determine which mode you would like to boot into. This is what my boot.ini looks like for XP Pro as the operating system in the virtual machine: </span></p>
<p>&nbsp;</p>
<div class="bootbody"><pre><span style="font-size: 10pt">[boot loader]<br />        timeout=30<br />        default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS<br />        [operating systems]<br />        multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect<br />        multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional - Debug" /fastdetect <strong>/debugport=com1 /baudrate=115200</strong><br /><br />        </span></pre></div>
<p><span style="font-size: 10pt">You will notice that the second option sets the debugport to com1, and sets the baudrate to 115200. I am told you can tweak this out to get even more speed out. But it seems fine for me at this speed, so I haven't mucked with it at all. If you do try this, drop me an </span><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#100;&#97;&#110;&#97;&#64;&#118;&#117;&#108;&#115;&#99;&#97;&#110;&#46;&#99;&#111;&#109;"><span style="font-size: 10pt"><font color="#1d58d1">email</font></span></a><span style="font-size: 10pt"> and let me know how it works out. </span></p>
<p><span style="font-size: 10pt">If you set up your boot.ini fine, save it and reboot. You should be prompted with something that looks like this: </span></p><span style="font-size: 10pt"><img border="0" alt="" src="http://silverstr.ufies.org/lotr0/images/xp-debug-menu.png" /><br /></span>
<p><span style="font-size: 10pt">At this point you have completed setting up the VMWare side of things. Now you need to set up the host to connect to it. This is actually rather easy. You just need to tell windbg at the command like to connect to the pipe, like this: </span></p><pre><span style="font-size: 10pt">windbg -k com:port=\\.\pipe\com_1,pipe<br />        </span></pre><span style="font-size: 10pt">If you are using WinDbg 6.x or newer, a better alternative is to use: </span><pre><span style="font-size: 10pt">windbg -b -k com:pipe,port=\\.\pipe\com_1,resets=0<br />        </span></pre>
<p><span style="font-size: 10pt">Thanks needs to go to </span><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#114;&#97;&#110;&#100;&#104;&#105;&#114;&#64;&#99;&#97;&#108;&#115;&#111;&#102;&#116;&#105;&#110;&#99;&#46;&#99;&#111;&#109;"><span style="font-size: 10pt"><font color="#1d58d1">Randhir Dugal</font></span></a><span style="font-size: 10pt"> for pointing out the new format for the latest Windbg version. </span></p>
<p><span style="font-size: 10pt">I am a rather anal type guy when it comes to security, so I actually made a shortcut on my desktop to WinDbg and added these command line arguments to the <strong>Target</strong> line. Originally this was so I could run WinDbg with differnet credentials as I do not run with administrator privileges on a day to day basis. I found that with XP's normal security settings for com ports, you can still work in a least privileged environment while doing the development WITHOUT having to use 'runas'. (You are logged into W2K/XP as a least priviledged environment aren't you? If not, you really should read my </span><a href="http://www.codeproject.com/useritems/runas.asp"><span style="font-size: 10pt"><font color="#1d58d1">article</font></span></a><span style="font-size: 10pt"> on how, and why this is important to do so.) </span></p>
<p><span style="font-size: 10pt">At this point fire up the debugger. With any luck you should see something that looks like this: </span></p><span style="font-size: 10pt"><img border="0" alt="" src="http://silverstr.ufies.org/lotr0/images/windbg.png" /><br /></span>
<p><span style="font-size: 10pt">If you are using a WinDbg version earlier than 6.x, you will find one issue with this approach. If you cannot seem to connect right away, close Windbg and restart it... it will then work. Seems flaky to me. But it works. And thats a Good Thing&#8482;. With the latest versions of WIndbg (6.x and newer) a new resets flag prevents this sort of hanging. </span></p>
<p><span style="font-size: 10pt">That is all there is to it. At this point, you can now go nuts with remote debugging. To make sure it works for ya just add some <strong>DbgPrint()</strong> messages to your ring 0 driver and watch them echo to the screen. Past that, I will leave it to your imagination how to use the debugger :) </span></p>
<p><span style="font-size: 10pt">Good luck! </span></p></li></ol></div></div><img src ="http://www.cppblog.com/tiany/aggbug/167024.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/tiany/" target="_blank">Tiany</a> 2012-03-03 00:47 <a href="http://www.cppblog.com/tiany/archive/2012/03/03/167024.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VS2008+WDK+DDKWzard 搭建驱动开发环境</title><link>http://www.cppblog.com/tiany/archive/2012/03/01/166901.html</link><dc:creator>Tiany</dc:creator><author>Tiany</author><pubDate>Thu, 01 Mar 2012 10:25:00 GMT</pubDate><guid>http://www.cppblog.com/tiany/archive/2012/03/01/166901.html</guid><wfw:comment>http://www.cppblog.com/tiany/comments/166901.html</wfw:comment><comments>http://www.cppblog.com/tiany/archive/2012/03/01/166901.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/tiany/comments/commentRss/166901.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/tiany/services/trackbacks/166901.html</trackback:ping><description><![CDATA[<div class="post-content">
<p><strong>一、WDK的介绍、下载、安装及配制</strong></p>
<p>1、关于WDK</p>
<p>Windows Driver Kit(<strong>驱动程序工具包</strong>): 是一种完全集成的驱动程序开发系统，它包含 Windows Driver Device Kit (DDK)，用于测试 Windows 驱动程序的可靠性和稳定性，包括：</p>
<ul><li><strong>Windows Driver Foundation (WDF)</strong>&nbsp;简化了 Windows 驱动程序的开发和支持。</li><li><strong>头文件重构</strong>&nbsp;（Windows Vista 和更高版本）通过提供更简单的目录结构、避免声明冲突以及对所有支持的 Windows 版本使用单一头文件集，降低头文件的复杂性。</li><li><strong>Installable File Systems (IFS) Kit</strong>将头、库、示例以及文档作为 WDK 的一部分分发。</li><li><strong>验证程序和静态分析工具</strong>, （如&nbsp;PRE<em>f</em>ast&nbsp;和&nbsp;静态驱动程序验证程序）帮助您在编译时查找 bug。</li></ul>
<p>2、下载WDK</p>
<p>曾经下载WDK好像还必须得http://connect.microsoft.com/注册后才能下载，而且下载后还有一句提示：</p>
<p>&#8220;提醒：您必须接受附带的许可条款才能使用此软件。不得分发下载软件包。&#8221;</p>
<p><span id="more-39"></span></p>
<p>所以当时下载的时候还要走一些不得不走的路。不过，今天好像发现WDK能直接下载了</p>
<p>下载地址：http://download.microsoft.com/download/4/A/2/4A25C7D5-EFBE-4182-B6A9-AE6850409A78/GRMWDK_EN_7600_1.ISO</p>
<p>如果不能正常下载，具体操作请见如何下载WDK</p>
<p>3、安装WDK</p>
<ol><li>用虚拟光驱加载下载好的.ISO镜像文件，双击运行，出现下面亲切的画面&nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb.png" width="244" height="174" />&nbsp;</li><li>接触，出现以下画面，在左侧的树形复选框中选择要安装的组件及工具，建议全部安装，选择好后点击&#8220;OK&#8221;~~后面的就简单了~&nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_3.png" width="566" height="400" />&nbsp;</li><li>尔后，一路确定默认即可<img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_4.png" width="366" height="137" /></li></ol>
<p>&nbsp;</p>
<p><strong>二、DDKWzard的介绍、下载、安装及配制</strong></p>
<p>在VS2008IDE中没有提供驱动开发的项目选项，当然可以用普通工程，然后手动在ＶＳ中配制相应的编辑连接以及调试选项，但是如此只来，每次都要重复些复杂的步骤。在http://ddkwizard.assarbad.net/网站上发现了一个很好用的辅助工具DDKWizard，能够方便地对开发环境进行配置，真是适合想我这样懒人啊，工具的作者也自称是因为懒惰才开发此工具，看来&#8220;懒惰是推动科技发展的动力&#8221;一点不假 。</p>
<ul><li>DDKwzard安装需要三个文件：DDKWzard主程序：安装VS2008的项目模板ddkwizard_setup.exe</li><li>DDKBUILD.CMD：应该是用VS2008调用WDK编辑编译器的一系列脚本dkbuild_cmd.zip</li><li>DDKBUILD.BAT ：估计也是是用VS2008调用WDK编辑编译器的一系列脚本ddkbuild_bat.zip</li></ul>
<ol><li>安装ddkwizard_setup，默认安装，一路Next点过即可，将DDKBUILD.CMD与DDKBUILD.BAT考到WDK的安装目录，或者其它目录也行，只要在后续的设置就行。如：我将其放在wdk的目录下，如图&nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_5.png" width="405" height="210" />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;</li><li>设置环境变量&nbsp;<br />添加相应的环境变量，如要开发XP系统下的驱动则添加WXPBASE，变量值为WDK的根目录，如图&nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_6.png" width="306" height="337" />如果为其它系统开发驱动则填写相应的环境变量&nbsp;<br />NT 4.0 &#8212;&#8212;&#8212;&#8211;NT4BASE 
<p>&nbsp;</p>
<p>windows2000&#8212;-W2KBASE</p>
<p>windowsXP&#8212;&#8212;-WXPBASE</p>
<p>windows2003&#8212;-WNETBASE</p>
<p>win7/2008 R2&#8212;-W7BASE</p></li><li>打开VS 2008，菜单&#8220;工具&#8221;-&gt;&#8220;选项&#8221;-&gt;左侧&#8220;项目和解决方案&#8221;-&gt;&#8220;VC++目录&#8221;-&gt;右侧&#8220;可执行文件&#8221;下拉列表-&gt;添加一项D:/WINDDK(根据你的实际情况，就是第1步中DDKBUILD.CMD与DDKBUILD.BAT所在的路径)。&nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_7.png" width="408" height="225" />&nbsp;<br />&nbsp;</li><li>然后就可以在我们的VS2008中新建项目了，如下图，在Visual C++选项卡中多了DDK Project的项目类型，选择相应的模板添加我们的项目，点击确定&nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_8.png" width="541" height="362" /></li><li>确定后出现DDKWzard的项目创建页面，在&#8220;Choose the DDKBUILD you want to use&#8221;中选择&#8220;ddkbuild.cmd&#8221;或者&#8220;ddkbuild.bat&#8221;，在其下面选择我们要为Who（2000，xp&#8230;&#8230;）开发的驱动。&nbsp;<br />最后finish&nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_9.png" width="542" height="435" /></li><li>在解决方案中便是由DDKWzard为我们自动生成的一个简单的驱动程序框架。&nbsp;<br />&nbsp;<img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_10.png" width="239" height="328" />&nbsp;</li><li>最后点击F6生成解决方案，成功生成后在项目的objchk_win7_x86/i386文件夹下会生成几个文件&nbsp;<br />driver1.obj &#8212;编译生成的2进制文件&nbsp;<br />driver1.pdb&#8212;用于调试时使用的符号文件&nbsp;<br />vc90.pdb&#8212;&#8211;用于调试时使用的符号文件&nbsp;<br /><strong>driver1.sys&#8212;就是我们拭目以待的驱动程序文件&nbsp;<br /></strong></li></ol></div> <img src ="http://www.cppblog.com/tiany/aggbug/166901.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/tiany/" target="_blank">Tiany</a> 2012-03-01 18:25 <a href="http://www.cppblog.com/tiany/archive/2012/03/01/166901.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>