﻿<?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++博客-ngaut</title><link>http://www.cppblog.com/ngaut/</link><description>asm/c/c++/......</description><language>zh-cn</language><lastBuildDate>Thu, 23 Apr 2026 04:14:30 GMT</lastBuildDate><pubDate>Thu, 23 Apr 2026 04:14:30 GMT</pubDate><ttl>60</ttl><item><title>[转]OpenNI里空间坐标系统</title><link>http://www.cppblog.com/ngaut/archive/2011/05/24/147040.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Tue, 24 May 2011 08:22:00 GMT</pubDate><guid>http://www.cppblog.com/ngaut/archive/2011/05/24/147040.html</guid><wfw:comment>http://www.cppblog.com/ngaut/comments/147040.html</wfw:comment><comments>http://www.cppblog.com/ngaut/archive/2011/05/24/147040.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ngaut/comments/commentRss/147040.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ngaut/services/trackbacks/147040.html</trackback:ping><description><![CDATA[<div><span style="font-family: Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif; line-height: 18px; "><div style="padding-left: 3px; font-weight: bolder; font-size: 13px; padding-bottom: 3px; padding-top: 3px; border-bottom-color: #9fb086; border-bottom-width: 1px; border-bottom-style: dashed; background-color: #e0e7b8; "><a id="ctl01_TitleUrl" href="http://www.cnblogs.com/TravelingLight/archive/2011/04/18/2019887.html" style="color: #56662d; text-decoration: none; ">（翻译）OpenNI里空间坐标系统</a></div><div style="padding-right: 10px; padding-left: 3px; font-size: 13px; padding-bottom: 5px; padding-top: 1px; background-color: #f5f5f5; margin-top: 10px; margin-bottom: 10px; line-height: 19px; "><div id="cnblogs_post_body"><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; font-size: 13px; text-indent: 0px; "><span style="color: #808080; font-size: 12px; ">Joint positions and orientations are given in the real world coordinate system.The origin of the system is at the sensor.&nbsp; +X points to the right of the, +Y points up, and +Z points in the direction of increasing depth.&nbsp; The coordinate frame is shown in the figure above.</span><br /><span style="font-size: 12px; ">关节的位置和方向依据于现实世界的坐标系统。坐标原点定位在Sensor。X轴的正方向是人体面对Sensor的右方。Y轴的正方向是朝上。Z轴的正方向是深度值增加的方向。（综合而看，这是一个典型的右手坐标系）</span><br /><br /><span style="color: #808080; font-size: 12px; ">Joint positions are measured in units of mm.</span><br /><span style="font-size: 12px; ">关节的位置是以毫米为单位来衡量的。</span><br /><br /><span style="color: #808080; font-size: 12px; ">Joint orientations are given as a 3x3 rotation (orthonormal) matrix.&nbsp; This represents a&nbsp;rotation between the joint's local coordinates and the world coordinates.&nbsp;&nbsp;<br />The first column is the direction of the joint's +X axis given as a 3-vector in the world coordinate system.&nbsp;<br />The second column is the +Y axis direction, and the third column is the +Z axis direction.&nbsp;&nbsp;<br />Our &#8220;neutral pose&#8221; is the T-pose shown in the figure above.&nbsp; In&nbsp;this pose, each joint's orientation is aligned with the world coordinate system.&nbsp; That is, its orientation is the identity matrix.</span><br /><span style="font-size: 12px; ">关节的方向依据于一个3x3的旋转（正交）矩阵。这个矩阵描绘的是关节的局部坐标和世界坐标之间的旋转。<br /></span><span style="font-size: 12px; ">矩阵的第一列代表的是关节X轴的正方向，一个在世界坐标系里的 3-Vector.</span><br /><span style="font-size: 12px; ">矩阵的第二列代表的是关节Y轴的正方向，</span><span style="font-size: 12px; ">矩阵的第三列代表的是关节Z轴的正方向。</span><br /><span style="font-size: 12px; ">我们的"neutral pose"是一个T-姿势，如上图所示。在这个姿势中，每个关节的方向是一致的与世界坐标系。也就是说，它的方向是单位矩阵。<br />&nbsp;</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; font-size: 13px; text-indent: 0px; "><span style="color: #ff0000; font-size: 12px; ">Known issues 已知问题</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; font-size: 13px; text-indent: 0px; "><span style="font-size: 12px; "><strong style="line-height: 14px; ">1.</strong>&nbsp;<span style="color: #808080; ">Arm tracking is less stable when the arm is close to other body parts, especially the torso. If both arms are close to the torso, as well as to each other, they might get mixed up.&nbsp;</span><br />在手臂贴近身体的其它部位时（特别是躯干），手臂跟踪的稳定性会较差。如果双臂非常接近躯干以及对方的话，那么它们也可能会混淆在一起。<br /></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; font-size: 13px; text-indent: 0px; "><span style="font-size: 12px; "><strong style="line-height: 14px; ">2.</strong>&nbsp;<span style="color: #808080; ">Leg tracking is still somewhat unstable and noisy. It works better when the user&nbsp; stands with legs separated.&nbsp; Fast motions and complex kicks or crouches might cause the tracking to fail.&nbsp;</span><br />腿的跟踪一直有一些不稳定和干扰。当用户把双腿分开站立时，跟踪的效果会更好。快速的运动和复杂的踢或蹲可能会导致跟踪失败。<br /></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; font-size: 13px; text-indent: 0px; "><span style="font-size: 12px; "><strong style="line-height: 14px; ">3.&nbsp;</strong><span style="color: #808080; ">Pose tracking may also become somewhat unstable if the head is not visible.&nbsp;</span><br />如果头是不可见的话，那么姿态跟踪也会变得不稳定。<br /></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; font-size: 13px; text-indent: 0px; "><span style="font-size: 12px; "><strong style="line-height: 14px; ">4.&nbsp;</strong><span style="color: #808080; ">Arms and legs in extremely stretched positions (i.e. near the limits of human flexibility) might be lost by the tracker.&nbsp;</span><br />当手臂和腿处于极限拉伸的位置时（比如达到了人体灵活性的极限），可能会丢失跟踪。<br /></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; font-size: 13px; text-indent: 0px; "><span style="font-size: 12px; "><strong style="line-height: 14px; ">5.</strong>&nbsp;<span style="color: #808080; ">If the skeleton is stuck in a faulty pose, or stuck facing the opposite direction, then returning to a &#8220;simple&#8221; pose (arms away from torso so the sensor can see them and legs separated) should help resolve it.&nbsp;</span><br />如果骨骼卡住在一个错误的姿态，或者面向相反的方向，那么请回到一个简单的姿势（如：手臂远离躯干，双腿分开站立。）这些会帮助解决被卡住的问题。<br /></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; font-size: 13px; text-indent: 0px; "><span style="font-size: 12px; "><strong style="line-height: 14px; ">6.</strong>&nbsp;<span style="color: #808080; ">In general, very fast motions may cause tracking failure.&nbsp;</span><br />在一般情况下，速度非常快的运动可能会导致跟踪失败。<br /></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; font-size: 13px; text-indent: 0px; "><span style="font-size: 12px; "><strong style="line-height: 14px; ">7.</strong>&nbsp;<span style="color: #808080; ">In some cases, overall tracking might be bad. Re-calibrating the user may resolve the problem.&nbsp;</span></span><br /><span style="font-size: 12px; ">在某些情况下，整体跟踪的效果可能不太好。那么重新"Calibrating"会解决问题。<br /><br /><br />来自：</span><a href="http://www.cnblogs.com/TravelingLight/archive/2011/04/18/2019887.html">http://www.cnblogs.com/TravelingLight/archive/2011/04/18/2019887.html</a></p></div></div></span></div><img src ="http://www.cppblog.com/ngaut/aggbug/147040.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ngaut/" target="_blank">ngaut</a> 2011-05-24 16:22 <a href="http://www.cppblog.com/ngaut/archive/2011/05/24/147040.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]openFramework, Tokyo Workshop</title><link>http://www.cppblog.com/ngaut/archive/2011/05/23/146970.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Mon, 23 May 2011 05:48:00 GMT</pubDate><guid>http://www.cppblog.com/ngaut/archive/2011/05/23/146970.html</guid><wfw:comment>http://www.cppblog.com/ngaut/comments/146970.html</wfw:comment><comments>http://www.cppblog.com/ngaut/archive/2011/05/23/146970.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ngaut/comments/commentRss/146970.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ngaut/services/trackbacks/146970.html</trackback:ping><description><![CDATA[<div><span style="font-family: 'MS Sans Serif', Geneva, sans-serif; font-size: 12px; line-height: 15px; "><h2><a href="http://imlab.cc/whale/?p=2495" rel="bookmark" style="text-decoration: none; color: #3f3f3f; ">openFramework, Tokyo Workshop</a></h2><div style="margin-bottom: 1em; "><a href="http://imlab.cc/whale/?p=2495" title="openFramework, Tokyo Workshop" style="text-decoration: none; color: #3f3f3f; "><img src="http://farm6.static.flickr.com/5028/5671454697_98835050e1_z.jpg" width="615" height="410" alt="SDIM0747" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /></a></div><div><p style="font-size: 12px; "><strong>10 小时的车轮战</strong></p><p style="font-size: 12px; ">昨天上下午两场工作坊天壤之别，上午 Zachary Lieberman 解说他的&#8220;艺术是对未来的 R&amp;D, 是通力的合作, Do it with others&#8221;，加上每次都能见到的 Eyebeam 中心跟早已经建起来的 openFrameworks Lab, 老生长谈，但每次看到 ofLab 还会继续羡慕，有一个场所可以给艺术家，黑客，工程师和科学家把因搭档而来的脑力碰撞转化为以艺术表达为诉求的实践。</p><p style="font-size: 12px; ">下午的 Advance section 变了个样，开始最近基于 openFrameworks 的实际项目介绍和运作讲解，一个是为澳大利亚某会议制作的视觉系统，全部由程序控制的基于 Data Visualization 概念的 VI 系统，概念不新鲜但因为艺术家出身又有 Parsons The New School for Design 的背景支持，视觉呈现做的极其好；另一个与 NIKE 的合作项目 Paint With Your Feet ，添加了对 GPS 数据的支持，继续数据可视化的概念但效果出众。联想到最近 MIT 的新 LOGO，事关视觉系统呈现又对自我突破有要求的设计师，学习使用程序来创作已经是必须要考虑的事了，这不是说对新技能的掌握，而是接受一个新的现实和尝试突破过去经验和系统留下的限制。</p><p style="font-size: 12px; ">Zachary Lieberman 公开了他在 Parsons 的两个授课课程网站，新的&nbsp;<a href="http://algo.thesystemis.com/" style="text-decoration: none; color: #3f3f3f; ">http://algo.thesystemis.com/</a>&nbsp;和稍旧的<a href="http://www.makingthingsmove.org/blog/" style="text-decoration: none; color: #3f3f3f; ">http://www.makingthingsmove.org/blog/</a>，有很多的例子可以参考，Parsons 学生很幸福。</p><p style="font-size: 12px; ">Kinect 做为一个已经渡过热潮的话题，现在积累出来极多的案例，Kyle McDonald 和 Zach Lieberman 在 NY ITP 春季期的课程用它在尝试制作廉价的 3D Scanner 并使用数据做 3D Printing，这里有课程 blog 可以看<a href="http://3dsav.blogspot.com/" style="text-decoration: none; color: #3f3f3f; ">http://3dsav.blogspot.com/</a>，新技术带来的尝试能够带来最直观的感官刺激，而附着其后的，对亲身发起者最重要的，是带来新的去探索，尝试和产出的机会，无论艺术创作，设计实践还是学术的研究，从而产出新的乐趣。</p><p style="font-size: 12px; "><strong>艺术家和设计师都在考虑着的东西</strong></p><p style="font-size: 12px; ">比如之于设计师，尤其是愿意扑身于这个社会，人群去做最形而下尝试的设计师类型，这些早就出现但正式成为设计与创作材料不久的东西，给了我们去尝试更深入探索的机会，无论是形而下的实施，还是之后可能会随之而来的形而上的思考。</p><p style="font-size: 12px; ">EyeWriter 是一个预示了新形态设计的典型例子，批量化生产的 PS3 Camera 和可以提供从最低端自制化软件的 openFrameworks 结合在一起，为实现最廉价同时也是因为设计师与工程师共同走完流程而把概念，原型与使用者体验的顺畅结合提供了可能。现在它成为了一个典范，基于最初兴趣的但却在最大程度上为他人而设计，开源的但完成了一个机构的建立。</p><p style="font-size: 12px; "><strong>OF 007</strong></p><p style="font-size: 12px; ">让人期待已久迟迟没有发布的新版本 OF 007 也做了介绍，为 OPENGL 的支持新添加了 ofxShader 库，让动画，3D 生成渲染跟 OPENCV 有了更大的效能转变。配合 Kinect 的 OPENNI 库 bug 还很多，容易崩溃 。有了更好的 web server 的支持，系统文件控制功能也做了补充，但跟 Processing 比起来，那条能够融会贯通整个程序原型制作的线还不够明显，对于非程序背景的人而言，目前 OF 依然是偏创作型的，更适合让艺术家走向的人完成作品原型，而不是像 Processing 一样可以足够完成一个设计产品原型的流程。</p></div></span></div><img src ="http://www.cppblog.com/ngaut/aggbug/146970.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ngaut/" target="_blank">ngaut</a> 2011-05-23 13:48 <a href="http://www.cppblog.com/ngaut/archive/2011/05/23/146970.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>winaoe 笔记</title><link>http://www.cppblog.com/ngaut/archive/2011/01/20/138960.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Thu, 20 Jan 2011 04:37:00 GMT</pubDate><guid>http://www.cppblog.com/ngaut/archive/2011/01/20/138960.html</guid><wfw:comment>http://www.cppblog.com/ngaut/comments/138960.html</wfw:comment><comments>http://www.cppblog.com/ngaut/archive/2011/01/20/138960.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ngaut/comments/commentRss/138960.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ngaut/services/trackbacks/138960.html</trackback:ping><description><![CDATA[用gpxe启动时，先用shell的dhcp net0 来获取dhcp信息，然后用sanboot aoe:e0.0启动<img src ="http://www.cppblog.com/ngaut/aggbug/138960.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ngaut/" target="_blank">ngaut</a> 2011-01-20 12:37 <a href="http://www.cppblog.com/ngaut/archive/2011/01/20/138960.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用winpcap的程序遇到应用程序初始化失败时的处理</title><link>http://www.cppblog.com/ngaut/archive/2010/11/10/133178.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Wed, 10 Nov 2010 01:58:00 GMT</pubDate><guid>http://www.cppblog.com/ngaut/archive/2010/11/10/133178.html</guid><wfw:comment>http://www.cppblog.com/ngaut/comments/133178.html</wfw:comment><comments>http://www.cppblog.com/ngaut/archive/2010/11/10/133178.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ngaut/comments/commentRss/133178.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ngaut/services/trackbacks/133178.html</trackback:ping><description><![CDATA[很可能是npptools.dll的权限被禁用了，打开权限的方法：<div><span  style="font-family: Arial, Helvetica, sans-serif, SimSun; font-size: 14px; line-height: 22px; ">&nbsp;</span><span  style="font-family: Arial, Helvetica, sans-serif, SimSun; font-size: 14px; line-height: 22px; ">硬盘格式为NTFS的，到SYSTEM32下找npptools.dll文件，点右键-安全(如果没有安全选项，打开文件夹选项，里面有个简单共享，去掉)</span></div><img src ="http://www.cppblog.com/ngaut/aggbug/133178.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ngaut/" target="_blank">ngaut</a> 2010-11-10 09:58 <a href="http://www.cppblog.com/ngaut/archive/2010/11/10/133178.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ndis笔记--影响协议驱动行为的卡巴斯基</title><link>http://www.cppblog.com/ngaut/archive/2010/09/11/126390.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Sat, 11 Sep 2010 02:39:00 GMT</pubDate><guid>http://www.cppblog.com/ngaut/archive/2010/09/11/126390.html</guid><wfw:comment>http://www.cppblog.com/ngaut/comments/126390.html</wfw:comment><comments>http://www.cppblog.com/ngaut/archive/2010/09/11/126390.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ngaut/comments/commentRss/126390.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ngaut/services/trackbacks/126390.html</trackback:ping><description><![CDATA[卡巴斯基本身安装了一个ndis中间层驱动，自己在ReceiveHandler中构造完整的包后提交给上层协议驱动，对于本身有处理不完整包逻辑的驱动而已，这部分逻辑不会走到，所以测试ndis驱动最好安装和卸载卡巴斯基两种情况都测试下。另外现在的网卡驱动很少调用ReceiveHandler了，大部分都是调用ReceivePacketHandler，比较老的8139网卡的驱动会调用ReceiveHandler并提供不完整的包。<img src ="http://www.cppblog.com/ngaut/aggbug/126390.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ngaut/" target="_blank">ngaut</a> 2010-09-11 10:39 <a href="http://www.cppblog.com/ngaut/archive/2010/09/11/126390.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>NDIS笔记-不要先入为主的烂兄NdisAllocateMemoryWithTag和烂弟NdisFreeMemoryWithTag</title><link>http://www.cppblog.com/ngaut/archive/2010/09/11/126389.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Sat, 11 Sep 2010 02:34:00 GMT</pubDate><guid>http://www.cppblog.com/ngaut/archive/2010/09/11/126389.html</guid><wfw:comment>http://www.cppblog.com/ngaut/comments/126389.html</wfw:comment><comments>http://www.cppblog.com/ngaut/archive/2010/09/11/126389.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ngaut/comments/commentRss/126389.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ngaut/services/trackbacks/126389.html</trackback:ping><description><![CDATA[最近对自己的一个驱动大改之后死活不被加载(win xp)，DriverEntry也进不了，最后找到原因，竟然是NdisFreeMemoryWithTag惹得祸，查了ddk才知道，NdisAllocateMemoryWithTag可以在ndis 5.1上用，而NdisFreeMemoryWithTag要在ndis 6.2才能用，应该是系统加载驱动前扫描了这个函数发现不兼容，所以不加载驱动。<div><br></div><div>NdisFreeMemoryWithTag</div><div><p><strong>Versions:&nbsp;</strong>Supported for NDIS 6.20 drivers in Windows&nbsp;7.</p></div><img src ="http://www.cppblog.com/ngaut/aggbug/126389.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ngaut/" target="_blank">ngaut</a> 2010-09-11 10:34 <a href="http://www.cppblog.com/ngaut/archive/2010/09/11/126389.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]windbg与虚拟机调试符号文件问题</title><link>http://www.cppblog.com/ngaut/archive/2010/09/11/126388.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Sat, 11 Sep 2010 02:24:00 GMT</pubDate><guid>http://www.cppblog.com/ngaut/archive/2010/09/11/126388.html</guid><wfw:comment>http://www.cppblog.com/ngaut/comments/126388.html</wfw:comment><comments>http://www.cppblog.com/ngaut/archive/2010/09/11/126388.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ngaut/comments/commentRss/126388.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ngaut/services/trackbacks/126388.html</trackback:ping><description><![CDATA[<table style="line-height: 20px !important; table-layout: fixed; color: rgb(31, 3, 33); font-family: Arial; font-size: 12px; width: 770px; "><tbody style="line-height: 20px !important; "><tr style="line-height: 20px !important; "><td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 20px !important; "><div id="blog_text" class="cnt" style="font-family: 宋体; word-wrap: break-word; word-break: normal; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 18px; line-height: 20px; color: rgb(31, 3, 33); letter-spacing: 2px; overflow-x: hidden; overflow-y: hidden; position: static; "><p style="line-height: normal; ">1搭建环境 host机器windows xp sp2 ,安装 windbg, vmware 6 和调试的目标操作系统 vmware 中的gust。比如windows server 2003 sp2,</p><p style="line-height: normal; ">1)配置vmware seting 中添加com,</p><div forimg="1" align="center" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/lgjmfyx/pic/item/cfca73f9b9e1c31a242df2b1.jpg" style="line-height: normal; "></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div class="tmpDiv" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div forimg="1" align="center" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/lgjmfyx/pic/item/bbe87e2a5aff97d8023bf6b1.jpg" width="750" style="line-height: normal; "></div><p style="line-height: normal; "></p><p style="line-height: normal; ">2)配置gust即2003中的com 115200 配置</p><div forimg="1" align="center" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/lgjmfyx/pic/item/d53e51edb8afa00c79f055b0.jpg" width="750" style="line-height: normal; "></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><p style="line-height: normal; ">3)boot.ini</p><p style="line-height: normal; ">[boot loader]<br style="line-height: normal; ">timeout=30<br style="line-height: normal; ">default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS<br style="line-height: normal; ">[operating systems]<br style="line-height: normal; ">multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Standard" /fastdetect<br style="line-height: normal; ">multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Standard - DEBUG" /fastdetect /debug /debugport=com1 /baudrate=115200</p><p style="line-height: normal; ">4)配置host中windbg的启动参数</p><p style="line-height: normal; ">在快捷方式属性里 设置目标</p><p style="line-height: normal; ">"D:\Program Files\Debugging Tools for Windows\windbg.exe" -k com:port=\\.\pipe\com_1,baud=11520,pipe</p><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/lgjmfyx/pic/item/9dfef1b5bf21b68d37d3cab1.jpg" style="line-height: normal; "></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><p style="line-height: normal; ">5)安装符号文件在host机器上,也就是要安装目标机2003的符号文件(<a href="http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx" style="font-size: 12px; color: rgb(31, 3, 33); text-decoration: none; line-height: 20px; font-family: Georgia; ">http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx</a>页面选择版本下载安装)在本机xp上,路径自己设置,比如装在D:\windows\symbol2003</p><p style="line-height: normal; "></p><p style="line-height: normal; ">2启动</p><p style="line-height: normal; ">1） 启动vmware中的gust，选择debug，不要按回车.</p><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><p style="line-height: normal; "><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/lgjmfyx/pic/item/35a1a94f6d3b5475aec3abb1.jpg" style="line-height: normal; "></p><p style="line-height: normal; ">2） 启动windbg 配置symbols file为安装好的符号文件路径。该路径是在host机器上安装的对应target操作系统的符号文件路径。也就是guest操作系统版本类型的符号文件，比如我们目标机器是windows 2003 sp2，那么我们在本机windows xp上就应该安装windows 2003 sp2的符号文件。这个 windbg的帮助里有讲。(该符号文件从微软官方网站上下载) 启动后windbg处于reconnect状态 .</p><p style="line-height: normal; ">set symbol path 中输入</p><p style="line-height: normal; ">SRV*D:\Windows\Symbols2003*http://msdl.microsoft.com/download/symbols</p><p style="line-height: normal; ">其中D:\Windows\Symbols2003为符号安装的路径</p><p style="line-height: normal; "></p><p style="line-height: normal; ">路径设置错误的话会显示*** ERROR: Symbol file could not be found</p><div forimg="1" align="center" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/lgjmfyx/pic/item/572fbfce4e18767ab700c8b1.jpg" width="750" style="line-height: normal; "></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><p style="line-height: normal; ">3)进入vmware在guest按回车进入guest系统.</p><div class="tmpDiv" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div class="tmpDiv" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div class="tmpDiv" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div class="tmpDiv" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div class="tmpDiv" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div class="tmpDiv" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div class="tmpDiv" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div class="tmpDiv" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div class="tmpDiv" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/lgjmfyx/pic/item/a8167f39cccb99b03b87ceb1.jpg" style="line-height: normal; "></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "></div><div forimg="1" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; "><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/lgjmfyx/pic/item/e6355d36b808da720b55a9b1.jpg" style="line-height: normal; "></div></div></td></tr></tbody></table>
<img src ="http://www.cppblog.com/ngaut/aggbug/126388.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ngaut/" target="_blank">ngaut</a> 2010-09-11 10:24 <a href="http://www.cppblog.com/ngaut/archive/2010/09/11/126388.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ndis笔记--ReceiveHandler如何处理不完整的包</title><link>http://www.cppblog.com/ngaut/archive/2010/09/08/126145.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Wed, 08 Sep 2010 02:43:00 GMT</pubDate><guid>http://www.cppblog.com/ngaut/archive/2010/09/08/126145.html</guid><wfw:comment>http://www.cppblog.com/ngaut/comments/126145.html</wfw:comment><comments>http://www.cppblog.com/ngaut/archive/2010/09/08/126145.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/ngaut/comments/commentRss/126145.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ngaut/services/trackbacks/126145.html</trackback:ping><description><![CDATA[
代码参考aoe&nbsp;<div><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">#define</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> htons(x) (USHORT)((((x) &lt;&lt; 8) &amp; 0xff00) | (((x) &gt;&gt; 8) &amp; 0xff))</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">#define</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> ntohs(x) (USHORT)((((x) &lt;&lt; 8) &amp; 0xff00) | (((x) &gt;&gt; 8) &amp; 0xff))</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">#define</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> AOEPROTOCOLID 0x88a2</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">

VOID ProtocolTransferDataComplete(IN NDIS_HANDLE ProtocolBindingContext, 
                                          IN PNDIS_PACKET Packet, 
                                          IN NDIS_STATUS Status, 
                                          IN UINT BytesTransferred) {
    PNDIS_BUFFER Buffer;
    UINT HeaderSize, DataSize;
    PUCHAR Data </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NULL;
    PEH_HEADER Header </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NULL;
    

    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">通过包描述符的NDIS_BUFFER链表的表头取得包的剩余部分的NDIS_BUFFER描述符, 见ProtocolReceive函数</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">    NdisUnchainBufferAtFront(Packet, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Buffer);
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (Buffer </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">!=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NULL) {
        </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">得到包的剩余部分的内存地址和大小</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">        NdisQueryBuffer(Buffer, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Data, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">DataSize);
        NdisFreeBuffer(Buffer);
    } </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">else</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> {
        DBGPRINT((</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">ProtocolTransferDataComplete Data (front) Buffer == NULL\\n</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">));
    }
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">通过包描述符的NDIS_BUFFER链表的表尾取得包的剩余部分的NDIS_BUFFER描述符, 见ProtocolReceive函数</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">    NdisUnchainBufferAtBack(Packet, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Buffer);
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (Buffer </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">!=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NULL) {
        </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(128, 128, 128); ">///</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">/得到包头的内存地址和大小</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(128, 128, 128); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">        NdisQueryBuffer(Buffer, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Header, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">HeaderSize);
        NdisFreeBuffer(Buffer);
    } </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">else</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> {
        DBGPRINT((</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">ProtocolTransferDataComplete Header (back) Buffer == NULL\\n</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">));
    }
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (Header </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">!=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NULL </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> Data </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">!=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NULL) 
    {
            DBGPRINT((</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">完整包大小为%d</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">, HeaderSize </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">+</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> DataSize));
    }
        </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">AoEReply(Header-&gt;SourceMac, Header-&gt;DestinationMac, Data, DataSize);</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (Header </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">!=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NULL) 
        ExFreePool(Header);
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (Data </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">!=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NULL) 
        ExFreePool(Data);
    NdisFreePacket(Packet);
}

NDIS_STATUS  ProtocolReceive(IN NDIS_HANDLE ProtocolBindingContext, 
                                    IN NDIS_HANDLE MacReceiveContext, 
                                    IN PVOID HeaderBuffer, 
                                    IN UINT HeaderBufferSize, 
                                    IN PVOID LookAheadBuffer, 
                                    IN UINT LookaheadBufferSize, 
                                    IN UINT PacketSize) {
    PADAPTER Context </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (PADAPTER)ProtocolBindingContext;
    NDIS_STATUS Status;
    PNDIS_PACKET Packet;
    PNDIS_BUFFER Buffer;
    PEH_HEADER Header;
    PUCHAR HeaderCopy, Data;
    UINT BytesTransferred;

    DBGPRINT((</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">ProtocolReceive\\n</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">));


    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (HeaderBufferSize </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">!=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">sizeof</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">(ETH_HEADER)) {
        DbgPrint(</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">ProtocolReceive HeaderBufferSize %d != sizeof(HEADER) %d\\n</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">);
        </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">return</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NDIS_STATUS_NOT_ACCEPTED;
    }
    Header </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (PEH_HEADER)HeaderBuffer;
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">/*</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
    if (ntohs(Header-&gt;EthType) != AOEPROTOCOLID) 
        return NDIS_STATUS_NOT_ACCEPTED;
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">*/</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">

    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (LookaheadBufferSize </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">==</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> PacketSize) {
        </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">AoEReply(Header-&gt;SourceMac, Header-&gt;DestinationMac, LookAheadBuffer, PacketSize);</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">        </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">return</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NDIS_STATUS_SUCCESS;
    }

    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">不完整的包</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">    DBGPRINT((</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">不完整的包</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">));

    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">分配内存把包头保存包头</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> ((HeaderCopy </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (PUCHAR)ExAllocatePool(NonPagedPool, HeaderBufferSize)) </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">==</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NULL) {
        DbgPrint(</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">ProtocolReceive ExAllocatePool HeaderCopy\\n</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">);
        </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">return</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NDIS_STATUS_NOT_ACCEPTED;
    }
    RtlCopyMemory(HeaderCopy, HeaderBuffer, HeaderBufferSize);

    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">分配内存保存包的剩余部分</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> ((Data </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (PUCHAR)ExAllocatePool(NonPagedPool, PacketSize)) </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">==</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NULL) {
        DbgPrint(</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">ProtocolReceive ExAllocatePool HeaderData\\n</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">);
        ExFreePool(HeaderCopy);
        </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">return</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NDIS_STATUS_NOT_ACCEPTED;
    }

    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">分配一个包描述符</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">    NdisAllocatePacket(</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Status, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Packet, Context</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">-&gt;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">RecvPacketPoolHandle);
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">!</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">NT_SUCCESS(Status)) {
        DBGPRINT((</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">ProtocolReceive NdisAllocatePacket</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">, Status));
        ExFreePool(Data);
        ExFreePool(HeaderCopy);
        </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">return</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NDIS_STATUS_NOT_ACCEPTED;
    }

    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">分配一个NDIS_BUFFER描述符，关联内存Data</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">    NdisAllocateBuffer(</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Status, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Buffer, Context</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">-&gt;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">RecvBufferPool, Data, PacketSize);
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">!</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">NT_SUCCESS(Status)) {
        DBGPRINT((</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">ProtocolReceive NdisAllocateBuffer (Data)</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">, Status));
        NdisFreePacket(Packet);
        ExFreePool(Data);
        ExFreePool(HeaderCopy);
        </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">return</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NDIS_STATUS_NOT_ACCEPTED;
    }
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">即将这个NDIS_BUFFER放到包描述符的NDIS_BUFFER链表的表头</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">    NdisChainBufferAtFront(Packet, Buffer);

    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">在分配一个NDIS_BUFFER描述符，关联内存HeaderCopy</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">    NdisAllocateBuffer(</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Status, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Buffer, Context</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">-&gt;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">RecvBufferPool, HeaderCopy, PacketSize);
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">!</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">NT_SUCCESS(Status)) {
        DBGPRINT((</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">ProtocolReceive NdisAllocateBuffer (HeaderCopy)</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">"</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">, Status));
        NdisUnchainBufferAtFront(Packet, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Buffer);
        NdisFreeBuffer(Buffer);
        NdisFreePacket(Packet);
        ExFreePool(Data);
        ExFreePool(HeaderCopy);
        </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">return</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NDIS_STATUS_NOT_ACCEPTED;
    }
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">//</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">将描述包头的NDIS_BUFFER放到包描述符的NDIS_BUFFER链表的尾节点</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 128, 0); ">
</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">    NdisChainBufferAtBack(Packet, Buffer);

    NdisTransferData(</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">Status, Context</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">-&gt;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">BindingHandle, MacReceiveContext, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">0</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">, PacketSize, Packet, </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">&amp;</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">BytesTransferred);
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">if</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> (Status </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); ">!=</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> NDIS_STATUS_PENDING) 
        ProtocolTransferDataComplete(ProtocolBindingContext, Packet, Status, BytesTransferred);
    </span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 255); ">return</span></span><span style="font-family: monospace; font-size: 13px; white-space: pre; "><span style="color: rgb(0, 0, 0); "> Status;
}</span></span></div><img src ="http://www.cppblog.com/ngaut/aggbug/126145.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ngaut/" target="_blank">ngaut</a> 2010-09-08 10:43 <a href="http://www.cppblog.com/ngaut/archive/2010/09/08/126145.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>windows应用patch的笔记</title><link>http://www.cppblog.com/ngaut/archive/2010/08/26/124891.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Thu, 26 Aug 2010 14:24:00 GMT</pubDate><guid>http://www.cppblog.com/ngaut/archive/2010/08/26/124891.html</guid><wfw:comment>http://www.cppblog.com/ngaut/comments/124891.html</wfw:comment><comments>http://www.cppblog.com/ngaut/archive/2010/08/26/124891.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ngaut/comments/commentRss/124891.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ngaut/services/trackbacks/124891.html</trackback:ping><description><![CDATA[如果遇到这个问题：<div><span  style="color: rgb(51, 51, 51); font-family: Verdana, Tahoma, Arial, Calibri, Geneva, sans-serif; font-size: 13px; ">/patch.exe -p1 &lt; xx.patch</span><br><div><span  style="color: rgb(51, 51, 51); font-family: Verdana, Tahoma, Arial, Calibri, Geneva, sans-serif; font-size: 13px; ">Assertion failed: hunk, file ../patch-2.5.9-src/patch.c line 354</span></div><div><span  style="color: rgb(51, 51, 51); font-family: Verdana, Tahoma, Arial, Calibri, Geneva, sans-serif; font-size: 13px; ">可以用这个命令来patch</span></div><div><span  style="color: rgb(51, 51, 51); font-family: Verdana, Tahoma, Arial, Calibri, Geneva, sans-serif; font-size: 13px; "><span  style="color: rgb(0, 49, 80); font-family: 'Bitstream Vera Sans', Verdana, Helvetica; line-height: 17px; ">patch -i xx.patch --verbose --binary</span></span></div></div><img src ="http://www.cppblog.com/ngaut/aggbug/124891.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ngaut/" target="_blank">ngaut</a> 2010-08-26 22:24 <a href="http://www.cppblog.com/ngaut/archive/2010/08/26/124891.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>其实用dllexport导出函数和用.def文件导出函数是不一样的</title><link>http://www.cppblog.com/ngaut/archive/2010/07/15/120490.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Thu, 15 Jul 2010 14:37:00 GMT</pubDate><guid>http://www.cppblog.com/ngaut/archive/2010/07/15/120490.html</guid><wfw:comment>http://www.cppblog.com/ngaut/comments/120490.html</wfw:comment><comments>http://www.cppblog.com/ngaut/archive/2010/07/15/120490.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ngaut/comments/commentRss/120490.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ngaut/services/trackbacks/120490.html</trackback:ping><description><![CDATA[如题
<img src ="http://www.cppblog.com/ngaut/aggbug/120490.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ngaut/" target="_blank">ngaut</a> 2010-07-15 22:37 <a href="http://www.cppblog.com/ngaut/archive/2010/07/15/120490.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>