| 
			 
					阅读:8936回复:8
				 
				ndisprot 6.0在vista win7下无法收包,但是能发包,能枚举网卡
					最近在研究NDIS 6.0协议驱动,所以拿了WDK中的例子ndisprot 6.0 来学习。因为是用NDIS 6.0的框架,所以拿了vista和win7来做测试。可是发现在两个系统中都出现了一个奇怪的现象,不能收包 
							我的操作过程如下: 1 拿ndisprot 在 Windows Vista and Windows Server 2008 x86 Checked Build Environment 环境下编译,得到ndisprot.sys和prottest.exe 2 在win7(vista)系统中,打开Network and Sharing Center->Local Area Connection->Properties 选择install,选择protocol->add->Have Disk 然后选择INF文件的位置进行安装 3 关闭win7(vista)的UAC功能,如果不关后面一步无法完成,然后重启系统让UAC设置生效 4 进入cmd控制台,敲入 net start ndisprot 启动协议驱动。 提示 The Sample NDIS Protocol Driver service was started successfully. 如果没有第3步,这里会提示错误 5 在cmd控制台中执行prottest.exe prottest.exe -e 枚举网卡 0. \DEVICE\{E6F42967-B001-4C0A-A60F-40E1AF9099F5} - Intel(R) PRO/1000 MT Network Connection prottest.exe -w \DEVICE\{E6F42967-B001-4C0A-A60F-40E1AF9099F5} 发包 ····· DoWriteProc: sent 100 bytes DoWriteProc: sent 100 bytes ····· prottest.exe -r \DEVICE\{E6F42967-B001-4C0A-A60F-40E1AF9099F5} 收包 Trying to access NDIS Device: \DEVICE\{E6F42967-B001-4C0A-A60F-40E1AF9099F5} Opened device \DEVICE\{E6F42967-B001-4C0A-A60F-40E1AF9099F5} successfully! Trying to get src mac address GetSrcMac: IoControl success, BytesReturned = 14 Got local MAC: 00:0c:29:0a:2c:e8 DoReadProc 这里就没反应了 ,一个包都没收到,而此时网络是有流量的,我开了IE 跟到代码里看用户层阻塞在readfile函数了,在驱动中打断点调式发现NdisprotReceiveNetBufferLists也没有得到调用,难怪readfile会阻塞 不知道为什么会这样,求助!  | 
	|
					
						最新喜欢: | 
	
| 
			 沙发# 
								发布于:2009-06-17 11:37				
			
					应该是要改一下filter				 
							 | 
	|
| 
			 板凳# 
								发布于:2009-06-17 12:44				
			回 1楼(vrain) 的帖子 
					谢谢 你的建议很有道理。我的确没往filter设置上想过,因为我用ndis 5.0的例子默认是可以收包的,我改fillter去试试				 | 
	|
| 
			 地下室# 
								发布于:2009-06-18 16:55				
			
					问题解决了 呵呵  
							// // Check the EtherType. If the Ether type indicates presence of // a tag, then the "real" Ether type is 4 bytes further down. // if (pEthHeader->EthType == NPROT_8021P_TAG_TYPE) { USHORT UNALIGNED *pEthType; if (BufferLength < (sizeof(NDISPROT_ETH_HEADER) + 4)) { break; } pEthType = (USHORT UNALIGNED *)((PUCHAR)&pEthHeader->EthType + 4); if (*pEthType != Globals.EthType) { break; } } else if (pEthHeader->EthType != Globals.EthType) { break; } 问题在于6.0比5.0增加了这段过滤的代码,改一下就正常了  | 
	|
| 
			 5楼# 
								发布于:2009-09-07 22:47				
			
					能把全部的代码发到我的邮箱吗?czccit@163.com,谢谢啦				 
							 | 
	|
| 
			 6楼# 
								发布于:2009-11-09 21:30				
			
					windows7下的passthru驱动和XP下有什么区别没?用户和内核层的通信还是通过Win32API么,windows7下的Win32API是否做了相应改动,能和XP兼容么;我在网上看了很多资料,都说的不是很明确,给我解答吧。 
							我的邮箱是:304135053w@sina.com,请大虾给给解答,谢谢。  | 
	|
| 
			 7楼# 
								发布于:2011-01-06 20:39				
			回 4楼(thanfur) 的帖子 
					怎么修改的,能知道一下吗。? 就恢复5.0的状态吗				 | 
	|
| 
			 8楼# 
								发布于:2016-08-24 23:07				
			
					你好,我现在也遇到这个问题,请问 你最后是怎么改的,能 说一下嘛?				 
							 | 
	|
							
				