Commit f9c82654 authored by Saulius Krasuckas's avatar Saulius Krasuckas Committed by Alexandre Julliard

- Stricten cases for NT in a two tests.

- WSAAddressToString[AW] don't fail on Win9x for those. - Modify it to pass new tests.
parent 056d9693
......@@ -3966,7 +3966,7 @@ INT WINAPI WSAAddressToStringA( LPSOCKADDR sockaddr, DWORD len,
CHAR buffer[22]; /* 12 digits + 3 dots + ':' + 5 digits + '\0' */
CHAR *p;
TRACE( "(%p, %lx, %p, %p, %p)\n", sockaddr, len, info, string, lenstr );
TRACE( "(%p, %ld, %p, %p, %p)\n", sockaddr, len, info, string, lenstr );
if (!sockaddr || len < sizeof(SOCKADDR_IN)) return SOCKET_ERROR;
if (!string || !lenstr) return SOCKET_ERROR;
......@@ -3989,6 +3989,7 @@ INT WINAPI WSAAddressToStringA( LPSOCKADDR sockaddr, DWORD len,
if (*lenstr < size)
{
*lenstr = size;
WSASetLastError(WSAEFAULT);
return SOCKET_ERROR;
}
......
......@@ -1044,6 +1044,7 @@ static void test_WSAAddressToStringA(void)
{
INT ret;
DWORD len;
int GLE;
SOCKADDR_IN sockaddr;
CHAR address[22]; /* 12 digits + 3 dots + ':' + 5 digits + '\0' */
......@@ -1059,8 +1060,10 @@ static void test_WSAAddressToStringA(void)
sockaddr.sin_addr.s_addr = 0;
ret = WSAAddressToStringA( (SOCKADDR*)&sockaddr, sizeof(sockaddr), NULL, address, &len );
ok( ret == SOCKET_ERROR, "WSAAddressToStringA() succeeded! WSAGetLastError()=%x, ret=%d\n",
WSAGetLastError(), ret );
GLE = WSAGetLastError();
ok( (ret == SOCKET_ERROR && GLE == WSAEFAULT) || (ret == 0),
"WSAAddressToStringA() failed unexpectedly: WSAGetLastError()=%d, ret=%d\n",
GLE, ret );
len = sizeof(address);
......@@ -1111,6 +1114,7 @@ static void test_WSAAddressToStringW(void)
{
INT ret;
DWORD len;
int GLE;
SOCKADDR_IN sockaddr;
WCHAR address[22]; /* 12 digits + 3 dots + ':' + 5 digits + '\0' */
......@@ -1127,8 +1131,10 @@ static void test_WSAAddressToStringW(void)
sockaddr.sin_addr.s_addr = 0;
ret = WSAAddressToStringW( (SOCKADDR*)&sockaddr, sizeof(sockaddr), NULL, address, &len );
ok( ret == SOCKET_ERROR, "WSAAddressToStringW() succeeded! WSAGetLastError()=%x, ret=%d\n",
WSAGetLastError(), ret );
GLE = WSAGetLastError();
ok( (ret == SOCKET_ERROR && GLE == WSAEFAULT) || (ret == 0),
"WSAAddressToStringW() failed unexpectedly: WSAGetLastError()=%d, ret=%d\n",
GLE, ret );
len = sizeof(address);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment