2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS WinSock 2 API
5 * PURPOSE: Socket Events
6 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
9 /* INCLUDES ******************************************************************/
16 /* FUNCTIONS *****************************************************************/
23 WSACloseEvent(IN WSAEVENT hEvent
)
27 /* Let the OS handle it */
28 Success
= CloseHandle(hEvent
);
30 /* We need a special WSA return error */
31 if (!Success
) WSASetLastError(WSA_INVALID_HANDLE
);
33 /* Return the Win32 Error */
44 /* CreateEventW can only return the Event or 0 (WSA_INVALID_EVENT) */
45 return CreateEventW(NULL
, TRUE
, FALSE
, NULL
);
53 WSAResetEvent(IN WSAEVENT hEvent
)
56 return ResetEvent(hEvent
);
64 WSASetEvent(IN WSAEVENT hEvent
)
67 return SetEvent(hEvent
);
75 WSAWaitForMultipleEvents(IN DWORD cEvents
,
76 IN CONST WSAEVENT FAR
* lphEvents
,
82 return WaitForMultipleObjectsEx(cEvents
,
94 WSAEnumNetworkEvents(IN SOCKET s
,
95 IN WSAEVENT hEventObject
,
96 OUT LPWSANETWORKEVENTS lpNetworkEvents
)
101 DPRINT("WSAEnumNetworkEvents: %lx\n", s
);
103 /* Check for WSAStartup */
104 if ((ErrorCode
= WsQuickProlog()) == ERROR_SUCCESS
)
106 /* Get the Socket Context */
107 if ((Socket
= WsSockGetSocket(s
)))
110 Status
= Socket
->Provider
->Service
.lpWSPEnumNetworkEvents(s
,
114 /* Deference the Socket Context */
115 WsSockDereference(Socket
);
117 /* Return Provider Value */
118 if (Status
== ERROR_SUCCESS
) return Status
;
122 /* No Socket Context Found */
123 ErrorCode
= WSAENOTSOCK
;
127 /* Return with an Error */
128 SetLastError(ErrorCode
);