To implement WSPAcceptEx in the ReactOS codebase, here’s what you need to know and do:
WSPAcceptEx already has a stub in ReactOS at dll/win32/msafd/misc/stubs.c:BOOL
WSPAPI
WSPAcceptEx(
IN SOCKET sListenSocket,
IN SOCKET sAcceptSocket,
OUT PVOID lpOutputBuffer,
IN DWORD dwReceiveDataLength,
IN DWORD dwLocalAddressLength,
IN DWORD dwRemoteAddressLength,
OUT LPDWORD lpdwBytesReceived,
IN OUT LPOVERLAPPED lpOverlapped)
{
UNIMPLEMENTED;
return FALSE;
}
dll/win32/msafd/msafd.h.FALSE and is marked as UNIMPLEMENTED.A. Understand WSPAcceptEx
B. Implementation Plan
Locate or Create the Implementation File
dll/win32/msafd/misc/stubs.c or move to a more appropriate file inside msafd (e.g., create a new accept.c if logic is complex).Implement the Functionality
sListenSocket that results in a new connection on sAcceptSocket.lpOutputBuffer with address info and initial data if any.lpdwBytesReceived on completion.lpOverlapped is non-NULL.Handle Overlapped I/O
Support Address Extraction
WSPGetAcceptExSockaddrs, which is also stubbed).Testing and Validation
dll/win32/msafd/misc/stubs.cdll/win32/msafd/msafd.hsdk/include/psdk/ws2spi.hWSPAcceptEx is related to WSPConnectEx, WSPDisconnectEx, and WSPGetAcceptExSockaddrs, which are also stubbed.Summary Steps:
msafd/misc/stubs.c with a real implementation based on AcceptEx.If you need a code skeleton or want to see what a minimal AcceptEx implementation looks like, just ask!