Commit 59ffe4e3 authored by Michael Müller's avatar Michael Müller Committed by Alexandre Julliard

ws2_32: Add semi-stub for DisconnectEx.

parent 0625dd8b
...@@ -3552,6 +3552,24 @@ connection_success: ...@@ -3552,6 +3552,24 @@ connection_success:
return TRUE; return TRUE;
} }
/***********************************************************************
* DisconnectEx
*/
static BOOL WINAPI WS2_DisconnectEx( SOCKET s, LPOVERLAPPED ov, DWORD flags, DWORD reserved )
{
TRACE( "socket %04lx, ov %p, flags 0x%x, reserved 0x%x\n", s, ov, flags, reserved );
if (flags & TF_REUSE_SOCKET)
FIXME( "Reusing socket not supported yet\n" );
if (ov)
{
ov->Internal = STATUS_PENDING;
ov->InternalHigh = 0;
}
return !WS_shutdown( s, SD_BOTH );
}
/*********************************************************************** /***********************************************************************
* getpeername (WS2_32.5) * getpeername (WS2_32.5)
...@@ -4767,7 +4785,8 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID ...@@ -4767,7 +4785,8 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
} }
else if ( IsEqualGUID(&disconnectex_guid, in_buff) ) else if ( IsEqualGUID(&disconnectex_guid, in_buff) )
{ {
FIXME("SIO_GET_EXTENSION_FUNCTION_POINTER: unimplemented DisconnectEx\n"); *(LPFN_DISCONNECTEX *)out_buff = WS2_DisconnectEx;
break;
} }
else if ( IsEqualGUID(&acceptex_guid, in_buff) ) else if ( IsEqualGUID(&acceptex_guid, in_buff) )
{ {
......
...@@ -7828,7 +7828,7 @@ static void test_DisconnectEx(void) ...@@ -7828,7 +7828,7 @@ static void test_DisconnectEx(void)
&pDisconnectEx, sizeof(pDisconnectEx), &num_bytes, NULL, NULL); &pDisconnectEx, sizeof(pDisconnectEx), &num_bytes, NULL, NULL);
if (iret) if (iret)
{ {
skip("WSAIoctl failed to get DisconnectEx, error %d\n", WSAGetLastError()); win_skip("WSAIoctl failed to get DisconnectEx, error %d\n", WSAGetLastError());
closesocket(connector); closesocket(connector);
return; return;
} }
...@@ -7859,7 +7859,7 @@ static void test_DisconnectEx(void) ...@@ -7859,7 +7859,7 @@ static void test_DisconnectEx(void)
memset(&overlapped, 0, sizeof(overlapped)); memset(&overlapped, 0, sizeof(overlapped));
bret = pDisconnectEx(connector, &overlapped, 0, 0); bret = pDisconnectEx(connector, &overlapped, 0, 0);
ok(bret == FALSE, "DisconnectEx unexpectedly succeeded\n"); ok(bret == FALSE, "DisconnectEx unexpectedly succeeded\n");
ok(WSAGetLastError() == WSAENOTCONN, "expected WSAENOTCONN, got %d\n", WSAGetLastError()); todo_wine ok(WSAGetLastError() == WSAENOTCONN, "expected WSAENOTCONN, got %d\n", WSAGetLastError());
iret = connect(connector, (struct sockaddr *)&address, addrlen); iret = connect(connector, (struct sockaddr *)&address, addrlen);
ok(iret == 0, "failed to connect, error %d\n", WSAGetLastError()); ok(iret == 0, "failed to connect, error %d\n", WSAGetLastError());
......
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