- Stricten cases for NT in a two tests.
- WSAAddressToString[AW] don't fail on Win9x for those. - Modify it to pass new tests.
This commit is contained in:
parent
056d96939b
commit
f9c82654be
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue