summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorburlex <burlex@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-13 20:58:51 +0000
committerburlex <burlex@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-13 20:58:51 +0000
commit577e48e540b3a02a5dd1f24a04b985e31a20ec48 (patch)
tree81697ccf081927d01d8c2a82159b8fd8a8b09998 /src
parent908f51760a301caa8d124fa37d0a3dfbee3791e4 (diff)
* Fixed IOCPEngine under x64 (because of incorrect pointer sizes)
- Fixed configure / VC8 projects for x64 compiling. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7293 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/socketengine_iocp.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/socketengine_iocp.cpp b/src/socketengine_iocp.cpp
index 58ce36177..82462f8b9 100644
--- a/src/socketengine_iocp.cpp
+++ b/src/socketengine_iocp.cpp
@@ -46,8 +46,9 @@ bool IOCPEngine::AddFd(EventHandler* eh)
eh->m_writeEvent = 0;
eh->m_acceptEvent = 0;
+ unsigned long completion_key = (ULONG_PTR)eh->m_internalFd;
/* assign the socket to the completion port */
- if(!CreateIoCompletionPort((HANDLE)eh->GetFd(), m_completionPort, (ULONG_PTR)eh->m_internalFd, 0))
+ if(!CreateIoCompletionPort((HANDLE)eh->GetFd(), m_completionPort, completion_key, 0))
return false;
/* set up binding, increase set size */
@@ -124,16 +125,18 @@ void IOCPEngine::WantWrite(EventHandler* eh)
/* Post event - write begin */
if(!eh->m_writeEvent)
{
+ ULONG_PTR completion_key = (ULONG_PTR)eh->m_internalFd;
Overlapped * ov = new Overlapped(SOCKET_IO_EVENT_WRITE_READY, 0);
eh->m_writeEvent = (void*)ov;
- PostQueuedCompletionStatus(m_completionPort, 0, (ULONG_PTR)eh->m_internalFd, &ov->m_overlap);
+ PostQueuedCompletionStatus(m_completionPort, 0, completion_key, &ov->m_overlap);
}
}
bool IOCPEngine::PostCompletionEvent(EventHandler * eh, SocketIOEvent type, int param)
{
Overlapped * ov = new Overlapped(type, param);
- return PostQueuedCompletionStatus(m_completionPort, 0, (ULONG_PTR)eh->m_internalFd, &ov->m_overlap);
+ ULONG_PTR completion_key = (ULONG_PTR)eh->m_internalFd;
+ return PostQueuedCompletionStatus(m_completionPort, 0, completion_key, &ov->m_overlap);
}
void IOCPEngine::PostReadEvent(EventHandler * eh)
@@ -206,11 +209,11 @@ int IOCPEngine::DispatchEvents()
LPOVERLAPPED overlap;
Overlapped * ov;
EventHandler * eh;
- int intfd;
+ ULONG_PTR intfd;
int ret;
unsigned long bytes_recv;
- while(GetQueuedCompletionStatus(m_completionPort, &len, (PULONG_PTR)&intfd, &overlap, 1000))
+ while(GetQueuedCompletionStatus(m_completionPort, &len, &intfd, &overlap, 1000))
{
// woot, we got an event on a socket :P
eh = ref[intfd];