diff --git a/lib/http_ntlm.c b/lib/http_ntlm.c
index 365eab10456b08260d48f828a84dfcbac477f2d8..3e993cbf50fa273996204c30a40df24f93b31fc7 100644
--- a/lib/http_ntlm.c
+++ b/lib/http_ntlm.c
@@ -458,8 +458,9 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
         (PCtxtHandle,PSecBufferDesc);
       HMODULE hSecur32 = GetModuleHandle("secur32.dll");
       if (hSecur32 != NULL) {
-        *((void**)&pCompleteAuthToken) =
-          (void*)GetProcAddress(hSecur32, "CompleteAuthToken");
+        pCompleteAuthToken =
+          (SECURITY_STATUS (__stdcall *)(PCtxtHandle,PSecBufferDesc))
+            GetProcAddress(hSecur32, "CompleteAuthToken");
         if( pCompleteAuthToken != NULL ) {
           pCompleteAuthToken(&ntlm->c_handle, &desc);
         }