Solved

Winsock error : 10091

Posted on 1998-09-22
4
1,844 Views
Last Modified: 2008-03-10
I'm using Winsock 2 on my win95 and I got this error while I call WSAStartUp.
My value for LOBTYE(wVersionRequested) and HIBYTE(wVersionRequested) are both 2. The returned values in LPWSADATA seems to be okay to me, but WSAStartUp still returns with the value 10091. I'm sure the DLLs that
are used are the correct ones.
The documentations say this error means "network subsystem unusable". So what does it mean?
What else should I check?

Thanks.
0
Comment
Question by:totoro030898
4 Comments
 
LVL 1

Expert Comment

by:marvinm
ID: 1252975
WSASYSNOTREADY

(10091)

Network subsystem is unavailable.

This error is returned by WSAStartup if the Windows Sockets implementation cannot function at this time because the underlying system it uses to provide network services is currently unavailable. Users should check:

· that the appropriate Windows Sockets DLL file is in the current path,

· that they are not trying to use more than one Windows Sockets implementation simultaneously. If there is more than one WINSOCK DLL on your system, be sure the first one in the path is appropriate for the network subsystem currently loaded.

· the Windows Sockets implementation documentation to be sure all necessary components are currently installed and configured correctly

0
 
LVL 86

Accepted Solution

by:
jkr earned 150 total points
ID: 1252976
As there's no Winsock 2.2, use
wVersionRequested = MAKEWORD( 2, 0 );
err = WSAStartup( wVersionRequested, &wsaData );

specifying
wVersionRequested = MAKEWORD( 2, 2 );

will lead to an error until MS publishes Winsock 2.2 ;-)


0
 

Author Comment

by:totoro030898
ID: 1252977
Hi jkr,

In the Windows Sockets 2 Application Programming documentation (Revision 2.2.2, Aug 7 1997), there is an example under WSAStartup, pg 192, it shows :

    wVersionRequested = MAKEWORD( 2, 2 );

I have tried with MAKEWORD(1,1) which still gives me the error 10091.
The values returned to me in WSADATA.wVersion and WSADATA.wHighVersion are both 2.2.

FYI, what I did was I intercept the WSAStartup call to ws2_32.dll and logged the parameters. And I have used the Win95 Windows Sockets 2 setup(from Microsoft) to install winsock2 files onto my win95. Without the intercepting dll, everything works fine. But I'm sure the intercepting dll is coded correctly....

So what could be wrong ? I have increased another 50 points, please help if you can..... Thanks....

To: marvinm, thanks for your comment, I have read that before I posted this question, however, that's the point, I do not quite understand what is meant by "network subsystem unusable". And I have done the suggested checks. They all passed.
0
 
LVL 6

Expert Comment

by:snoegler
ID: 1252978
You said, without your intercepting dll it works ...
This sounds as if this is maybe really the problem, don't you think?
If it works without the dll, and it fails with the dll, where else could the problem reside?

Maybe you'd need to set the correct version number (like it is set in the original winsock.dll) ...
As Windows perhaps finds out the supported version using this resource, this could
probably be the cause why it only works with the original dll.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question