Clear the reference counter in WSACleanup, with regression test.
This commit is contained in:
parent
7888e7a59b
commit
220edd52d4
|
@ -831,8 +831,10 @@ int WINAPI WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData)
|
|||
*/
|
||||
INT WINAPI WSACleanup(void)
|
||||
{
|
||||
if (num_startup)
|
||||
if (num_startup) {
|
||||
num_startup--;
|
||||
return 0;
|
||||
}
|
||||
SetLastError(WSANOTINITIALISED);
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
|
|
@ -709,8 +709,15 @@ static void Init (void)
|
|||
|
||||
static void Exit (void)
|
||||
{
|
||||
INT ret, err;
|
||||
TlsFree ( tls );
|
||||
ok ( WSACleanup() == 0, "WSACleanup failed\n" );
|
||||
ret = WSACleanup();
|
||||
err = WSAGetLastError();
|
||||
ok ( ret == 0, "WSACleanup failed ret = %d GetLastError is %d\n", ret, err);
|
||||
ret = WSACleanup();
|
||||
err = WSAGetLastError();
|
||||
ok ( ret == SOCKET_ERROR && err == WSANOTINITIALISED,
|
||||
"WSACleanup returned %d GetLastError is %d\n", ret, err);
|
||||
}
|
||||
|
||||
static void StartServer (LPTHREAD_START_ROUTINE routine,
|
||||
|
|
Loading…
Reference in New Issue