From 716e8eab39971ff98d75766e0d3bbcf5b0cfd91b Mon Sep 17 00:00:00 2001 From: Igor Zinkovsky Date: Thu, 1 Sep 2011 13:46:07 -0700 Subject: [PATCH] windows: fix issue with SetFileCompletionNotificationModes on 64bit xp --- src/win/tcp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win/tcp.c b/src/win/tcp.c index 618fc1e9..7f5cb67a 100644 --- a/src/win/tcp.c +++ b/src/win/tcp.c @@ -75,14 +75,14 @@ static int uv_tcp_set_socket(uv_loop_t* loop, uv_tcp_t* handle, } if (pSetFileCompletionNotificationModes) { - if (!pSetFileCompletionNotificationModes((HANDLE) socket, + if (pSetFileCompletionNotificationModes((HANDLE) socket, FILE_SKIP_SET_EVENT_ON_HANDLE | FILE_SKIP_COMPLETION_PORT_ON_SUCCESS)) { + handle->flags |= UV_HANDLE_SYNC_BYPASS_IOCP; + } else if (GetLastError() != ERROR_INVALID_FUNCTION) { uv_set_sys_error(loop, GetLastError()); return -1; } - - handle->flags |= UV_HANDLE_SYNC_BYPASS_IOCP; } handle->socket = socket;