The Windows Sockets WSALookupServiceEnd function is called to free the handle after previous calls to WSALookupServiceBegin and WSALookupServiceNext.
If you call WSALookupServiceEnd from another thread while an existing WSALookupServiceNext is blocked, the end call will have the same effect as a cancel and will cause the WSALookupServiceNext call to return immediately.
INT WSALookupServiceEnd (
HANDLE hLookup
);
The return value is zero if the operation was successful. Otherwise, the value SOCKET_ERROR is returned, and a specific error number can be retrieved by calling WSAGetLastError.
WSA_INVALID_HANDLE | The handle is not valid |
WSANOTINITIALIZED | The WS2_32.DLL has not been initialized. The application must first call WSAStartup before calling any Windows Socketsfunctions. |
WSA NOT ENOUGH MEMORY | There was insufficient memory to perform the operation. |
Windows NT: Yes
Windows: Yes
Windows CE: Unsupported.
Header: Declared in winsock2.h.
Import Library: Link with ws2_32.lib.
WSALookupServiceBegin, WSALookupServiceNext