views:

795

answers:

3

Hi

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.

Please help.

Thanks in Advance.

+6  A: 

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 softtware, 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?

sleske
sleske,We are building application where in we have ARP Module that sends and reply quires. So we do not want Windows TCP/IP stack handle this ARP Request/Reply, We want to handle it.
mahesh
So it would be great full if you could tell us how to do so. As you can uninstall TCP/IP Stack in "Local Area Connection Properties Dialog" in Windows.
mahesh
sleske
And no, as far as I understand you cannot uninstall TCP/IP stack, at least not on XP (see above).
sleske
sleske : thanks for your answer. I checked it. It have only Enable/Disable Check Box Button. And i wanted to Disable it thats it. :)
mahesh
@sleske, Windows Stack Reply ARP request we dont want that, we want to reply it. We dont want windows stack to eat all ARP request/replies, we want the whole ownership of ARP request/reply. Thank you :
mahesh
+1  A: 

Disabling TCP/IP is not that uncommon. We tend to disable it on our host machine so that the VMs can have uninterrupted use of the IP stack.

You can disable it manually by going to the connection properties page for the adapter in question and unchecking the TCP/IP box (there may be more than one if IPv6 is installed).

After some brief investigation it looks as though WMI does not support changing this property programatically. However, it looks as though HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Linkage\Bind is the key where each adapter with TCP/IP enabled is stored. Removing the adapter from that list (using the win32 registry APIs) may disable TCP/IP.

Be careful when testing this...

Tom
A: 

You will need to call WSCDeinstallProvider which is documented on MSDN. You will also need to enumerate the providers using WSCEnumProtocols.

I'm not sure if what you are attempting will work, but I wish you the best of luck. Let us know if you succeed.

Heath Hunnicutt