Winsock problem

  • Thread starter Thread starter E. Cox
  • Start date Start date
E

E. Cox

My PC has recently developed a problem with Winsock. I think I know what
might have caused it but I don't know the exact cause to fix. I've tried
several of the fixes such as:

Removing my Winsock Registry entries
Removing the Winsock DLLs
Removing the Network components & NIC

Here's what I think caused it. I had some old VB source code that has
always worked and it uses MSWINSCK.OCK. I was adding features to my old
source code and my program was working flawlessly. Then I thought I
would have the Client ping the Server before even trying to Connect. I
grabbed some other old source code (too old) to do the ping and it was
using WSOCK32.DLL. For a while they both worked together but then the
program no longer connected. It would get a "10061: Connection
Forcefully rejected" (and my Server was listening on the correct port).
I think me using V1.0 and V2.0 Winsocks at the same time messed it up.
But now it's not just my VB program that has the problem. When I open up
a DOS window and try to ftp to any server I get:
ftp: connect :Unknown error number
ftp: connect

For anyone still following me there was one other thing that might help.
What made me think it was caused by mixing of the 2 Winsocks is that the
"Winsock_Send.Connect" changed to "Winsock_Send.connect" (lowercase c)
which is how it was in my Module that was using Winsock V1.0.

Can anyone tell me how to fix this problem so I can resume developing my
program?

Thanks,

E. Cox
 
E. Cox said:
My PC has recently developed a problem with Winsock. I think I know what
might have caused it but I don't know the exact cause to fix. I've tried
several of the fixes such as:

Removing my Winsock Registry entries
Removing the Winsock DLLs
Removing the Network components & NIC

Here's what I think caused it. I had some old VB source code that has
always worked and it uses MSWINSCK.OCK. I was adding features to my old
source code and my program was working flawlessly. Then I thought I
would have the Client ping the Server before even trying to Connect. I
grabbed some other old source code (too old) to do the ping and it was
using WSOCK32.DLL. For a while they both worked together but then the
program no longer connected. It would get a "10061: Connection
Forcefully rejected" (and my Server was listening on the correct port).
I think me using V1.0 and V2.0 Winsocks at the same time messed it up.
But now it's not just my VB program that has the problem. When I open up
a DOS window and try to ftp to any server I get:

ftp: connect

For anyone still following me there was one other thing that might help.
What made me think it was caused by mixing of the 2 Winsocks is that the
"Winsock_Send.Connect" changed to "Winsock_Send.connect" (lowercase c)
which is how it was in my Module that was using Winsock V1.0.

Can anyone tell me how to fix this problem so I can resume developing my
program?

Thanks,

E. Cox
====================================================
Recommended method for replacing the winsock and winsock2 registry keys:

Uninstall any third-party proxy software or firewall programs before
proceeding. Then enable the XP ICF.

Step 1: Delete registry keys

A)Open Regedit from the Run line
B)Go to both of the following keys, EXPORT each of them, and then delete
them:
(To export a key, you right click on it and choose "export" - you can choose
where to export them to -
DESKTOP is handy -
and you need to type in a file name such as "exported Winsock key" /
"exported WinSock2 key"
and then click on SAVE)

HKLM\SYSTEM\CurrentControlSet\Services\Winsock
HKLM\SYSTEM\CurrentControlSet\Services\WinSock2
C)Restart the computer

NOTE: It is important to restart the computer after deleting the Winsock
keys.
Doing so causes the XP operating system to recreate shell entries for those
two
keys. If this is not done, the next step does not work correctly.

Step 2: Install TCP/IP on top of itself

A)Open the properties window of the network connection (Local Area
Connection)
B)Click Install
C)Click Protocol, then Add
D)Click Have Disk
E)Type the path to the \%systemroot%\inf folder (usually C:\Windows\inf) and
click OK
(if you try to click Browse, then browse to the \inf folder,
it may not show up in the list)
F)You should now see "Internet Protocol (TCP/IP)" in the list of available
protocols. Select it and click OK.
G)Restart the computer

When the computer reboots you will have functional Winsock keys.
If so, then be sure to delete the exported winsock and winsock2 reg files.
(You don't want to accidentally put them back in the registry)

Side effects and possible problems:

This method will restore basic functionality to the Winsock keys, but is not a
complete rebuild. On a default install of Windows XP the registry key:
HKLM\SYSTEM\CurrentControlSet\Services\Winsock2\
Parameters\Protocol_Catalog9\Catalog_Entries will have 11 sub-keys.
When applying this method, the Catalog_Entries will only have 3 sub-keys.
However, it works and there does not appear to be any side effects.
The missing entries relate back to the:
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces key.
Also, third-party proxy software or firewalls may need to be reinstalled.

If issue is resolved, then be sure to delete the exported Winsock / WinSock2
..reg keys
as you don't want to accidentally end up importing those damaged keys back
into the registry.

Also, be sure to visit the Windows Update site and make sure you have all
critical updates installed.

You also might consider turning off system restore and then turning it back on
so as to remove previous restore points that would take you back to a registry
with the damaged winsock keys. You could then create a restore point manually
and let System Restore continue creating more restore points.

==========================================================
 
Thank you for your reply. I have seen the instructions that you have
given me. I mentioned that I have tried removing the Winsock Registry
keys. But maybe it will be helpful if I elaborate on that. When I
removed them my system would not boot. It would get to the point right
before it would have displayed the login window and then it would reboot.
Any idea why it would do that?

Thank you for your help.

E. Cox
 
E. Cox said:
Thank you for your reply. I have seen the instructions that you have
given me. I mentioned that I have tried removing the Winsock Registry
keys. But maybe it will be helpful if I elaborate on that. When I
removed them my system would not boot. It would get to the point right
before it would have displayed the login window and then it would reboot.
Any idea why it would do that?

Thank you for your help.

E. Cox
=====================================================
Well, then there are some other issues going on here behind the scenes.
Maybe hardware issues or some kind of conflicting software.
If a system is in a reboot loop, generally that means that it is flashing a
blue screen Stop error real fast so that you do not have time to see what
the Stop error is.
If the system is in a reboot loop then try booting to safe mode as a
computer
administrator type account and then go to System Properties | Advanced tab |
Startup and Recovery section | Settings button | System failure section -
uncheck
"Automatically Restart" and click OK and OK to any warnings or messages
and then restart and see what the Stop error is. You can search on Stop
errors
at http://support.microsoft.com/default.aspx?scid=fh;EN-US;KBHOWTO
or try http://www.google.com/

Of course if the computer is not in a reboot loop right now, then uncheck
"Automatically Restart" before trying that winsock fix procedure.
======================================================
 
XPUSER said:
=====================================================
Well, then there are some other issues going on here behind the scenes.
Maybe hardware issues or some kind of conflicting software.
If a system is in a reboot loop, generally that means that it is flashing a
blue screen Stop error real fast so that you do not have time to see what
the Stop error is.
If the system is in a reboot loop then try booting to safe mode as a
computer
administrator type account and then go to System Properties | Advanced tab |
Startup and Recovery section | Settings button | System failure section -
uncheck
"Automatically Restart" and click OK and OK to any warnings or messages
and then restart and see what the Stop error is. You can search on Stop
errors
at http://support.microsoft.com/default.aspx?scid=fh;EN-US;KBHOWTO
or try http://www.google.com/

Of course if the computer is not in a reboot loop right now, then uncheck
"Automatically Restart" before trying that winsock fix procedure.
======================================================

Also, if you get a Stop error that references any certain file such as
"ndis.sys" or
whatever then that probably means that file is damaged and needs to be
replaced
with a new copy of that file.
========================================================
 
OK. I will give that a try now and see what happens. It only reboots
when I have removed the Winsock DLLs or the Winsock Registry entries.


E. Cox
 
@TK2MSFTNGP12.phx.gbl:

XPUSER,

I'm sorry I gave you some incorrect information. I guess the reboots
were only when I deleted the Winsock DLLs hoping that it would either
grab copies for the "dllcache" or ask for them from the CD.

I just tried your original fix but it is still broke. Do you know of any
other way for me to determine what is wrong?

Here's some other information. I can ftp with CuteFTP but not from DOS.
I can ping systems from DOS but the "Network troubleshooter" can't. It
reports "PING: transmit failed, error code 65". It doesn't even ping my
local router (Default Gateway) but yet I am using IE, XNews, AOL IM, and
Outlook to access the Internet.

I can't even ftp to my local system using my internal IP, my external IP
nor 127.0.0.1. Which was one of the things I noticed earlier. It sort
of thought it had more of a Listening problem. But VNC server works.

I hope there's another procedure to fix this. Are there any Registry
Keys that determine the order in which the system uses the various
version of Winsock?

Thank you for your help.


E. Cox
 
E. Cox said:
@TK2MSFTNGP12.phx.gbl:

XPUSER,

I'm sorry I gave you some incorrect information. I guess the reboots
were only when I deleted the Winsock DLLs hoping that it would either
grab copies for the "dllcache" or ask for them from the CD.

I just tried your original fix but it is still broke. Do you know of any
other way for me to determine what is wrong?

Here's some other information. I can ftp with CuteFTP but not from DOS.
I can ping systems from DOS but the "Network troubleshooter" can't. It
reports "PING: transmit failed, error code 65". It doesn't even ping my
local router (Default Gateway) but yet I am using IE, XNews, AOL IM, and
Outlook to access the Internet.

I can't even ftp to my local system using my internal IP, my external IP
nor 127.0.0.1. Which was one of the things I noticed earlier. It sort
of thought it had more of a Listening problem. But VNC server works.

I hope there's another procedure to fix this. Are there any Registry
Keys that determine the order in which the system uses the various
version of Winsock?

Thank you for your help.


E. Cox
========================================================
Start > Run - type in "netsh int ip reset resetlog.txt" (without quotes) press <Enter>

Restart computer

Start > Run - type in "sfc /scannow" (without quotes) press <Enter>
Insert your XP CD if prompted -
When that operation completes, remove the XP CD

Restart computer

Control Panel | Internet Options
Delete all cookies, delete all temporary internet files including all offline content.
Remove all downloaded program files - you click on the "Settings" button and then
click on "View Objects" -
After removing all downloaded program files, close that window and click OK on
the settings window
Clear history
Click on the Advanced tab of Internet Options now and then in the Browser section,
uncheck "Enable third-party browser extensions (requires restart)"
Click OK at the bottom of Internet Options

Restart computer

Try browsing the Internet again.

Still not workng?

If this is a cable connection that uses ethernet,
try browsing the Internet after booting to Safe Mode With Networking.
That is done by restarting the computer and
tapping on F8 as it boots up to get the Advanced Menu.

If it works in Safe Mode With Networking or if this is not
the type of Internet connection that can function in that mode,
then try troubleshooting with System Configuration Utility.
This is called "Clean Boot" troubleshooting.
http://support.microsoft.com/default.aspx?scid=kb;en-us;310353
http://support.microsoft.com/default.aspx?scid=kb;en-us;316434
The end goal is to identify what is causing an issue and to be
able to deal with whatever is causing the issue and be able to
have System Configuration Utility in Normal Startup. You always
want to have System Configuration Utility in Normal Startup
before uninstalling any program.
Here is how I suggest you use System Configuration Utility:
Start > Run - type in "msconfig" (without quotes) press <Enter>
Hopefully we are starting off in Normal
If not, put MSCONFIG in Normal and click Apply and then Close
and Restart

See if you can browse the Internet - NO?

Then with MSCONFIG in normal mode, we want to click on
the Services tab and at the bottom border, put a check in
"Hide all Microsoft Services"
Now take note of the non Microsoft services and click on "Disable All"
Then click on the Startup tab
Take note of these Startup items and click on "Disable All"
Click Apply at the bottom and then Close and then Restart

When you boot back up you will get a message that you are
using MSCONFIG
Click OK and check that all non Microsoft services and all
Startup items stayed unchecked
Click CANCEL at the bottom

See if you can browse the Internet - No?
May as well put MSCONFIG back to Normal and Restart

Yes now you can browse the Internet?

Then use MSCONFIG to start bringing things back a few at a time.
You have to reboot after each change and then test the new configuration.
This is a process of elimination. It can be tedious.
Please post back with results.

By the way, if you see anything like "WINKxx" or "WINKxxx" in
the non Microsoft services, that's the KLEZ virus.

===========================================================
 
Thank you, XPUSER. Thanks for hanging in there for me. I used to be
better at troubleshooting Windows problems but since XP has been pretty
stable I haven't had as much practice.

My problem is fixed. I really appreciate your help. Now I can get on to
working on my programs.

But since that went so well I will probably go ahead and post (in a more
appropriate group) and see if I can get another one of my annoying XP
problems fixed.

Thanks again.

E. Cox
 
E. Cox said:
Thank you, XPUSER. Thanks for hanging in there for me. I used to be
better at troubleshooting Windows problems but since XP has been pretty
stable I haven't had as much practice.

My problem is fixed. I really appreciate your help. Now I can get on to
working on my programs.

But since that went so well I will probably go ahead and post (in a more
appropriate group) and see if I can get another one of my annoying XP
problems fixed.

Thanks again.

E. Cox
===================
Glad that has been resolved.
===================
 
Back
Top