我需要为我的应用程序手动创建TCP/IP标头.为此,我使用Raw套接字.我的系统os是win xp(SP3).
我的代码编译很好:)但它会引发运行时错误:
Initialising Winsock...Initialised successfully. Creating Raw TCP Socket...Raw TCP Socket Created successfully. Setting the socket in RAW mode...Successful. Enter hostname : 192.168.1.152
Resolving Hostname...Resolved. Enter Source IP : 192.168.1.151
Sending packet... Error sending Packet : 10022
我已将IP_HDRINCL设置为1.我做错了什么?我也关闭了防火墙,但仍然得到了相同的结果.
从Windows XP SP2开始,Microsoft有意禁用原始套接字.
http://msdn.microsoft.com/en-us/library/ms740548.aspx
http://seclists.org/nmap-hackers/2005/0004.html
http://www.zdnet.com.au/news/security/soa/Microsoft-tries-to-quell-TCP-IP-danger-/0,130061744,139189876,00.htm