| Previous | Next |
| WSAEACCES | WSAEINVAL |
WSAEFAULT
WSAEFAULT points to the calling process's arguments, not to a failed network exchange. Winsock detected that a buffer, pointer, or address structure was invalid for the requested operation, or that the supplied length did not describe enough readable or writable storage.
Where it usually appears
Typical examples are an invalid sockaddr pointer, a length shorter than the structure required by the selected address family, or an output buffer that is no longer valid. In overlapped calls, every buffer and control structure must remain valid until the completion path has finished using it; freeing or reusing memory early can turn an ordinary I/O flow into a difficult-to-reproduce fault.
How to diagnose it
- Validate the lifetime, alignment, and length of every caller-owned buffer passed to the failing API.
- Log the address family and the exact
sockaddrlength, not merely the printable address. - Use memory diagnostics and assertions around ownership hand-off for asynchronous sends and receives.
Microsoft: accept · Microsoft: sendto · The Open Group: sendto
Looking for a different code? Search another status or error code.