1

I wanted to know How to Disable Windows TCP/IP Stack in VC++ [ Programmatically ].

We are doing some raw socket programming using winpcap. So our application does not need Windows TCP/IP Stack and We Want to uninstall it the moment our application starts.

4

4 回答 4

7

The TCP/IP stack is an essential part of any modern OS, including recent versions of MS Windows. As explained on MS knowlegebase Q299357 (speaking about Win XP):

Because TCP/IP is a core component of Windows, you cannot remove it.

At any rate, even if it were possible, no program that uses TCP/IP (which is most modern software, since most contain some kind of net integration, auto update etc.) would work. And most would probably fail in mysterious ways, since no one tested that configuration.

So the short answer is: Don't do it.

Maybe you could explain why you feel it necessary to remove TCP/IP networking? Then we might be able to help you.

Edit:

Based on your comment below, if you want bypass/disable the ARP handling of the TCP/IP stack, then WinPcap should let you do that. If not, you probably need to write your own Windows network driver. Again, this seems extremely complicated and intrusive. Could you please describe what your application does and why you even need to mess around with low-level networking?

于 2009-04-14T10:36:50.847 回答
1

您需要拨打MSDNWSCDeinstallProvider记录的电话。您还需要使用 枚举提供程序WSCEnumProtocols

我不确定您尝试的方法是否有效,但我祝您好运。让我们知道您是否成功。

于 2009-12-09T02:05:24.823 回答
1

禁用 TCP/IP 并不少见。我们倾向于在我们的主机上禁用它,以便虚拟机可以不间断地使用 IP 堆栈。

您可以通过转到相关适配器的连接属性页面并取消选中 TCP/IP 框来手动禁用它(如果安装了 IPv6,则可能有多个)。

经过一些简短的调查后,WMI 似乎不支持以编程方式更改此属性。但是,看起来 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Linkage\Bind 是存储启用 TCP/IP 的每个适配器的关键。从该列表中删除适配器(使用 win32 注册表 API)可能会禁用 TCP/IP。

测试时要小心...

于 2009-06-06T14:39:04.437 回答
1

我知道它不能直接回答这个问题,但是由于我一整天都在寻找完全相同的东西,我虽然可以给其他人我找到的解决方案。

我找到了一个名为nvspbind的工具,它正是这样做的。它可用于在任何 NIC 上设置正确的绑定和启用/禁用特定绑定。

它使用一个名为INetCfg的接口。如果您不想使用该工具并以编程方式进行操作,我认为这是您应该使用的界面。

我仍然是学生,所以我可能错了。

于 2012-01-18T14:25:04.227 回答