Winpcap 和 DeviceIoControl - Win7 上的错误代码 1
我正在尝试使用 Winpcap PacketRequest() 函数(位于 packet32.h 中)将 OID 发送到网络适配器。 它适用于 XP32,不适用于 Win7 32 和 Win7 64(在 Win7 64 中我得到最后一个错误代码 1,在 32 中我不知道 - 我目前无法访问 32 位)。 我查看了 PacketRequest() 函数的源代码 - 它调用 DeviceIoControl(),这是失败的函数,因此 PacketRequest() 失败。
我是否使用了错误的 Winpcap 库? (我已经安装了WinPcap_4_1_2.exe)
为什么在Win7上不起作用?
提前致谢。
I'm trying to use Winpcap PacketRequest() function (located in packet32.h) in order to send OID to a network adapter.
It works on XP32, doesn't work on Win7 32 and Win7 64 (in Win7 64 I get last error code 1, in 32 I don't know - I don't have access to a 32-bit at the moment).
I looked at the source of the PacketRequest() function - It calls DeviceIoControl(), and this is the function that fails and therefore fails PacketRequest().
Am I working with the wrong Winpcap libraries? (I have installed WinPcap_4_1_2.exe)
Why isn't it working on Win7?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可以看看你的启动代码吗?
听起来你正在加载 dll 并尝试调用一些内部方法,
你应该坚持使用 api,直到你完全了解 winpcap 内部是如何工作的。
要将原始数据包写入网卡,您应该使用 api 函数
http://www.winpcap.org/docs/docs_41b5/html/group__wpcapfunc.html#g51dbda0f1ab9da2cfe49d657486d50b2
之前,您必须使用
http://www.winpcap.org/docs/docs_41b5/html/group__wpcapfunc.html#gae6abe06e15c87b803f69773822beca8
没有看到你的代码我无法提供太多帮助。
我写了一个使用 winpcap 的应用程序,
它可以在 xp(32/64)、vista(32/64)、win7(32/64) 上正常运行。
may i see your startup code.
it sounds like your loading the dll and trying to call some internal methonds,
you should stick with the api untill you know exacaly how winpcap works internaly.
to write a raw packet to the network card you should use the api function
http://www.winpcap.org/docs/docs_41b5/html/group__wpcapfunc.html#g51dbda0f1ab9da2cfe49d657486d50b2
before you can do that tho you have to open a network adaptor with
http://www.winpcap.org/docs/docs_41b5/html/group__wpcapfunc.html#gae6abe06e15c87b803f69773822beca8
without seeing your code i can't be of much help.
i've written one app which uses winpcap,
it works on xp(32/64), vista(32/64), win7(32/64) without problems.