Why to use WSAGetLastError instead of GetLastError?

Himanshu Singh 1 Reputation point

On Windows WSAGetLastError and GetLastError both the api are giving same values.


So , Can I use GetLastError() api instead of WSAGetLastError()?

Is there any benefit we will get if we use WSAGetLastError instead of GetLastError

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,440 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 81,941 Reputation points

    WSAGetLastError just calls GetLastError in Ws2_32.dll