有一个应用程序A,里头调用了pcap_findalldevs函数
通过远程桌面连接到一台机器上,并以管理员Administrator登陆,运行A,pcap_findalldevs得到的却是空列表。请问这可能是什么原因呢?谢谢。
通过远程桌面连接到一台机器上,并以管理员Administrator登陆,运行A,pcap_findalldevs得到的却是空列表。请问这可能是什么原因呢?谢谢。
解决方案 »
- 请教模拟鼠标的程序
- 求大侠指点(关于网络编程这方面有哪些职位)
- 用过VC++编写的CSerialPort类的高手进来说说啊......
- 电子书和视频教程下载
- 如何在CHtmlView中再创建一个WebBrowser出来?
- 求助:多客户端同时向同一服务器发送文件,服务器该如何接收?(SOS,在线等待!)
- 100分求教比较难的问题
- 我想在listbox里新加入一条数据,让它按照我加入的先后顺序从上到下显示,怎么做呀??
- 高分求解sdk系统编程问题
- 一个关于COM方法返回值的问题,请大家帮忙,多谢了!
- 大侠救命啊,怎么让ListView的item支持多行呢?
- 怎么用递归或非递归的方式遍历treeview的所有item?
刚才检查了下,远程机器有安装winpacp
安装winpcap包的过程就已经有那些 sys了,无需拷贝。我在使用中也没这样做过拷贝操作。
#include <stdio.h>int main()
{
pcap_if_t *alldevs;
pcap_if_t *d;
int i=0;
char errbuf[PCAP_ERRBUF_SIZE]; /* Retrieve the device list */
if (pcap_findalldevs(&alldevs, errbuf) == -1)
{
fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf);
exit(1);
} /* Print the list */
for(d=alldevs;d;d=d->next)
{
printf("%d. %s", ++i, d->name);
if (d->description)
printf(" (%s)\n", d->description);
else printf(" (No description available)\n");
} if(i==0)
{
printf("\nNo interfaces found! Make sure WinPcap is installed.\n");
return -1;
} /* We don't need any more the device list. Free it */
pcap_freealldevs(alldevs); return(0);
}
从aa远程桌面登录到bb,运行PcapTest.exe,有结果;
#include "pcap.h"
#include <stdio.h>int main()
{
pcap_if_t *alldevs;
pcap_if_t *d;
int i=0;
char errbuf[PCAP_ERRBUF_SIZE]; /* Retrieve the device list */
if (pcap_findalldevs(&alldevs, errbuf) == -1)
{
fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf);
exit(1);
} /* Print the list */
for(d=alldevs;d;d=d->next)
{
printf("%d. %s", ++i, d->name);
if (d->description)
printf(" (%s)\n", d->description);
else printf(" (No description available)\n");
} if(i==0)
{
printf("\nNo interfaces found! Make sure WinPcap is installed.\n");
return -1;
} /* We don't need any more the device list. Free it */
pcap_freealldevs(alldevs); return(0);
}