Why to use WSAGetLastError instead of GetLastError?

Himanshu Singh 1 Reputation point
2022-03-08T08:00:28.467+00:00

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

180915-image.png

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
    2022-03-08T08:36:20.13+00:00

    WSAGetLastError just calls GetLastError in Ws2_32.dll