The WSARevertImpersonation function terminates the impersonation of a socket peer. This must be called after calling WSAImpersonateSocketPeer and finishing any access checks.
INT WSAAPI WSARevertImpersonation( );
This function has no parameters.
If the function succeeds, the return value is zero. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError.
Some possible error codes are listed below.
|A system call that should never fail has failed.|
The WSARevertImpersonation function causes the calling thread to discontinue the impersonation of a socket peer. If the thread is not currently impersonating a socket peer, no action is taken.
The WSARevertImpersonation function should be called after calling WSAImpersonateSocketPeer and all access checks are finished.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|