Howdy, stranger! Ready to join the community? [log in]

Office Hours 2: Fixing Winsock

Engines have belts, Windows has Winsock, and humans have brains. The relation between all three, of course, is that they’re all apt to get completely fouled up without explanation or prior warning. Significantly in the case of the Windows Sockets API (Winsock), the symptoms of such erratic and unprompted disarray are as varied as snowflakes.

It is possible for Windows NT-based operating systems to appear fully-functional in every way, yet in spite of this, fail to yield a functioning connection. It all boils down to the Winsock.

The Winsock is the layer in Windows that exists between the applications you’re trying to run and the protocols that comprise internet communication. When you initiate a TCP/IP session (Protocol) and Firefox (HTTP/Application) it is the Winsock that is facilitating this exchange. Without a common model for protocol/application interaction, I’m pretty sure everyone’s favorite series of tubes would get backed up with pr0n and dump trucks.

Because of the Winsock’s pivotal role in network communication, it presents a single point of failure. Let’s cover some common symptoms and solutions.

1. If you’ve ever infected your PC with Norton Internet Security, or were the victim of an OEM preload, there are few programs more foul. I strongly suggest you grab SymNRT today and give it a run. I recommend many free alternatives to NIS, such as Comodo Firewall, AVG, and the good lads in our SVT forum when crisis arises.

2. The Winsock’s primary configuration is stored in the registry (HKLM\Software\CurrentControlSet\Services\Winsock and Winsock2). Its corruption can be spurred by programs, notably like the aforementioned, or be summoned entirely at random. There’s a fantastic fix that everyone should try first called WinsockFix-XP which replaces these registry keys with the default and correct values. It performs a few other tasks that are also designed to jumpstart an ailing connection, but they’re immaterial. Suffice it to say, if everything appears correct and you’re still coming up snake eyes, do it to it with WinsockFix.


3. Reinstall the protocols by going to Start -> Run and typing ncpa.cpl, then hitting enter. Right-click on the network card that’s giving you trouble and hit properties. On the new window, there will be an entry called “Internet Protocol (TCP/IP).” Select that entry, then hit “Install.” Double-click on “Protocol,” then select “Have disk.” In the new box, type “C:\WINDOWS\INF” and hit okay. Select “Internet Protocol (TCP/IP)” or “TCP/IP Version 4″ from the list and hit okay.

4. Reinstall the virtual devices responsible for creating and maintaining an active internet connection by right-clicking on my computer and hitting properties. Select the “Hardware” tab, then click “Device manager.” With the device manager now open, select “View” and then “Show hidden devices.” An entirely new sub-section of the device manager will open with the name “Non-Plug and Play Drivers.” Remove the following entries by right-clicking on them and hitting “Uninstall. If prompted to reboot, tell Windows no: AFD, HTTP, IPSEC driver, NDIS System Driver, NDIS Usermode I/O Protocol, NetBIOS over TCPIP and TCP/IP Protocol Driver. Now you can reboot.

5. A vastly more drastic step is to copy the contents of C:\WINDOWS\INF and C:\WINDOWS\SYSTEM32\DRIVERS from a PC that is known to have a functioning ethernet connection, atop the same folders on the afflicted PC. After this is done, reboot the PC.

6. If all else fails: Start -> Run -> SFC /SCANNOW. Reboot after it’s finished.

As for what order you attempt these in, I generally suggest steps 2 and 4 as a first line of defense. If you’re really wanting to eradicate the problem with the quickness, hitting 2-5 in one Windows session paints with a large and effective brush. In any case, if you have tried all such resolutions and the problem is still apparent, you may try swapping in another network card (USB adapters are convenient) or start looking elsewhere (Such as in the direction of your ISP).

At the end of the day, any ISP or OEM who tells you that you need to replace your network card is probably mistaken. A preposterously large quantity of connectivity issues in Windows 2000, XP and Vista are as a result of this finicky marriage of drivers, registry entries and protocols, so leave your ISP in the dust and get to troubleshooting.


Share |

3 Comments:

  1. primesuspect
    The Icrontic Guy

    Great advice. Winsock errors used to drive me nuts.

  2. Sean Et Cetera
    New to the neighborhood

    Thanks for writing this article. I helped with an issue I was facing, and will probably be referenced later as needed.

  3. Cyclonite
    Castle Crashin'!

    Nice! I'll be following this frequently, I'm sure.

Hey, be nice. Icrontic is full of good people, we promise.

New Features on Icrontic: