diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-10-29 18:30:43 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-10-29 18:30:43 +0000 |
commit | fa313f28c57769a819c8d4194180571c6772acf8 (patch) | |
tree | b5516547d591fe09e860bcf5ba5dd7466fa13e7f /iocp-internal.h | |
parent | 9976f1e74c1a285a591d8a80af61727af50b4961 (diff) | |
download | libevent-fa313f28c57769a819c8d4194180571c6772acf8.tar.gz |
Extract XP-only functions when initializing the IOCP port
svn:r1479
Diffstat (limited to 'iocp-internal.h')
-rw-r--r-- | iocp-internal.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/iocp-internal.h b/iocp-internal.h index d743bd54..31024cc1 100644 --- a/iocp-internal.h +++ b/iocp-internal.h @@ -53,6 +53,21 @@ struct event_overlapped { iocp_callback cb; }; +/* Mingw's headers don't define LPFN_ACCEPTEX. */ + +typedef BOOL (WINAPI *AcceptExPtr)(SOCKET, SOCKET, PVOID, DWORD, DWORD, DWORD, LPDWORD, LPOVERLAPPED); +typedef BOOL (WINAPI *ConnectExPtr)(SOCKET, const struct sockaddr *, int, PVOID, DWORD, LPDWORD, LPOVERLAPPED); +typedef void (WINAPI *GetAcceptExSockaddrsPtr)(PVOID, DWORD, DWORD, DWORD, LPSOCKADDR *, LPINT, LPSOCKADDR *, LPINT); + +/** Internal use only. Holds pointers to functions that only some versions of + Windows provide. + */ +struct win32_extension_fns { + AcceptExPtr AcceptEx; + ConnectExPtr ConnectEx; + GetAcceptExSockaddrsPtr GetAcceptExSockaddrs; +}; + /** Internal use only. Stores a Windows IO Completion port, along with related data. @@ -73,9 +88,11 @@ struct event_iocp_port { HANDLE *threads; /** Number of threads currently open on this port. */ short n_live_threads; - /* A semaphore to signal when we are done shutting down. */ + /** A semaphore to signal when we are done shutting down. */ HANDLE *shutdownSemaphore; }; + +const struct win32_extension_fns *event_get_win32_extension_fns(void); #else /* Dummy definition so we can test-compile more things on unix. */ struct event_overlapped { |