[nginx] Win32: fixed wrong type cast.

Maxim Dounin mdounin at mdounin.ru
Tue Oct 14 00:19:44 UTC 2014

details:   http://hg.nginx.org/nginx/rev/de7ec5eef6d2
changeset: 5872:de7ec5eef6d2
user:      Kouhei Sutou <kou at cozmixng.org>
date:      Sat Oct 11 20:56:35 2014 +0900
Win32: fixed wrong type cast.

GetQueuedCompletionStatus() document on MSDN says the
following signature:


    BOOL WINAPI GetQueuedCompletionStatus(
      _In_   HANDLE CompletionPort,
      _Out_  LPDWORD lpNumberOfBytes,
      _Out_  PULONG_PTR lpCompletionKey,
      _Out_  LPOVERLAPPED *lpOverlapped,
      _In_   DWORD dwMilliseconds

In the latest specification, the type of the third argument
(lpCompletionKey) is PULONG_PTR not LPDWORD.


 src/event/modules/ngx_iocp_module.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/src/event/modules/ngx_iocp_module.c b/src/event/modules/ngx_iocp_module.c
--- a/src/event/modules/ngx_iocp_module.c
+++ b/src/event/modules/ngx_iocp_module.c
@@ -247,7 +247,7 @@ ngx_int_t ngx_iocp_process_events(ngx_cy
     ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "iocp timer: %M", timer);
-    rc = GetQueuedCompletionStatus(iocp, &bytes, (LPDWORD) &key,
+    rc = GetQueuedCompletionStatus(iocp, &bytes, (PULONG_PTR) &key,
                                    (LPOVERLAPPED *) &ovlp, (u_long) timer);
     if (rc == 0) {

More information about the nginx-devel mailing list