Solved

Winsock error : 10091

Posted on 1998-09-22
4
1,857 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
My eclipse editor won't start ? 4 161
Test against App 49 138
Unable to start eclipse ? 17 152
Test the speeds on my PC Drives 12 62
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

808 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