Author: cwittich
Date: Sun Feb 16 10:24:08 2014
New Revision: 62210
URL:
http://svn.reactos.org/svn/reactos?rev=62210&view=rev
Log:
[ws2_32]
-do not initialize in case of error
-don't touch vendor info
Modified:
trunk/reactos/dll/win32/ws2_32/misc/dllmain.c
trunk/reactos/dll/win32/ws2_32/misc/ns.c
Modified: trunk/reactos/dll/win32/ws2_32/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/dllm…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/misc/dllmain.c [iso-8859-1] Sun Feb 16 10:24:08 2014
@@ -116,7 +116,6 @@
lpWSAData->wHighVersion = MAKEWORD(2,2);
lstrcpyA(lpWSAData->szDescription, "WinSock 2.0");
lstrcpyA(lpWSAData->szSystemStatus, "Running");
- lpWSAData->lpVendorInfo = NULL;
if (LOBYTE(wVersionRequested) == 1)
{
@@ -131,7 +130,8 @@
/*FIXME: increment internal counter */
- WSASETINITIALIZED;
+ if (ErrorCode == ERROR_SUCCESS)
+ WSASETINITIALIZED;
return ErrorCode;
}
Modified: trunk/reactos/dll/win32/ws2_32/misc/ns.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/ns.c…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/misc/ns.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/misc/ns.c [iso-8859-1] Sun Feb 16 10:24:08 2014
@@ -861,7 +861,7 @@
p = NtCurrentTeb()->WinSockData;
- if( !p )
+ if (!p || !WSAINITIALIZED)
{
WSASetLastError( WSANOTINITIALISED );
return NULL;
@@ -1130,7 +1130,7 @@
DWORD ReadSize = 0;
PWINSOCK_THREAD_BLOCK p = NtCurrentTeb()->WinSockData;
- if( !p )
+ if (!p || !WSAINITIALIZED)
{
WSASetLastError( WSANOTINITIALISED );
return NULL;
@@ -1314,7 +1314,7 @@
DWORD ReadSize = 0, ValidData = 0;
PWINSOCK_THREAD_BLOCK p = NtCurrentTeb()->WinSockData;
- if( !p )
+ if( !p || !WSAINITIALIZED)
{
WSASetLastError( WSANOTINITIALISED );
return NULL;
@@ -1496,7 +1496,7 @@
p = (PCHAR)cp;
- if (!p)
+ if (!p || !WSAINITIALIZED)
{
WSASetLastError(WSAEFAULT);
return INADDR_NONE;