Hi there!

The following code...

invoke socket, AF_INET, SOCK_DGRAM, 0

.. returns INVALID_SOCKET on WinXP, but runs fine on 9x/Me .
XP says theres a WSAEPROVIDERFAILEDINIT (0000277A) error.

I already dword-aligned all winsock structs but still it won't work.
Xp is evil....really :mad:

Any help?

aweX <-
Posted on 2003-01-12 05:10:08 by aweX
Try passing IPPROTO_UDP for the last parameter instead of IPPROTO_IP (0).
Posted on 2003-01-12 06:12:39 by IRBMe
Thanks for your reply IRBMe, but it still won't work.

I tried different WinSock versions... 1.1 2.0 2.2 ... everytime
it initialized successfully with the requested version in my WSAdata
struct (checked it).

But socket() won't work.

There's no straight programming for XP ... always generates errors
on the easiest things! Incredible........ :mad: :mad:

aweX <-
Posted on 2003-01-12 19:22:57 by aweX
I also tried to include ws2_32.lib instead of wsock32.lib ...

still no worky :(
Posted on 2003-01-12 20:20:14 by aweX
Hmmm sorry for the stupid question, but do you have any firewall on your XP station that may deny the operation ?

When using Tiny Personal Firewall, I got an error once, my connect API refused to work, that was because TFP hooked it and didn't allow it to connect...
Posted on 2003-01-12 20:52:44 by Axial
I don't have a firewall and I've also let others test the app and they also don't
have a firewall (or turned it off for the test). And it seems like it also fails
on 2k, so it's yet another mysterious NT bug ...

I also tried to pack all my WinSock operations into seperate threads. Two, to
be exact. Every thread starts with WSAStartup and ends with WSACleanup,
so it should be one straight thing...

but still... no luck.

aweX <-
Posted on 2003-01-13 03:29:36 by aweX
Hmm... WSAPROVIDERFAILEDINIT ? Well, I read the documentation and it says that the socket function will return the following errors.

WSANOTINITIALISED="A successful WSAStartup() must occur before using this API."

WSAENETDOWN="The Windows Sockets implementation has detected that the network subsystem has failed."

WSAEAFNOSUPPORT="The specified address family is not supported."

WSAEINPROGRESS = "A blocking Windows Sockets operation is in progress."

WSAEMFILE="No more file descriptors are available."

WSAENOBUFS="No buffer space is available. The socket cannot be created."

WSAEPROTONOSUPPORT="The specified protocol is not supported."

WSAEPROTOTYPE="The specified protocol is the wrong type for this socket."

WSAESOCKTNOSUPPORT="The specified socket type is not supported in this address family."

As you see WSAPROVIDERFAILEDINIT is not one of them :confused: Are you sure you called WSAGetLastError?

I did find the entry though:

WSAPROVIDERFAILEDINIT - (OS dependent) - Unable to initialize a service provider. Either a service provider's DLL could not be loaded (LoadLibrary() failed) or the provider's WSPStartup/NSPStartup function failed.

I unfortunately don't know how to solve that though.
Posted on 2003-01-13 03:46:10 by IRBMe
Oh yeah... I really love it! :mad: :mad: :mad:

Posted on 2003-01-27 03:56:18 by aweX