Solved

Winsock error : 10091

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures 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.

762 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