[PATCH] http.sys: Use the SOCKET type for Windows sockets.

Zebediah Figura z.figura12 at gmail.com
Fri Sep 6 08:54:25 CDT 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/http.sys/http.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/dlls/http.sys/http.c b/dlls/http.sys/http.c
index b2400a26b7c..fd30e43dfc7 100644
--- a/dlls/http.sys/http.c
+++ b/dlls/http.sys/http.c
@@ -209,7 +209,7 @@ struct connection
 {
     struct list entry; /* in "connections" below */
 
-    int socket;
+    SOCKET socket;
 
     char *buffer;
     unsigned int len, size;
@@ -246,18 +246,18 @@ struct request_queue
     LIST_ENTRY irp_queue;
     HTTP_URL_CONTEXT context;
     char *url;
-    int socket;
+    SOCKET socket;
 };
 
 static struct list request_queues = LIST_INIT(request_queues);
 
-static void accept_connection(int socket)
+static void accept_connection(SOCKET socket)
 {
     struct connection *conn;
     ULONG true = 1;
-    int peer;
+    SOCKET peer;
 
-    if ((peer = accept(socket, NULL, NULL)) == -1)
+    if ((peer = accept(socket, NULL, NULL)) == INVALID_SOCKET)
         return;
 
     if (!(conn = heap_alloc_zero(sizeof(*conn))))
@@ -1046,10 +1046,11 @@ static NTSTATUS http_add_url(struct request_queue *queue, IRP *irp)
     const struct http_add_url_params *params = irp->AssociatedIrp.SystemBuffer;
     struct sockaddr_in addr;
     struct connection *conn;
+    unsigned int count = 0;
     char *url, *endptr;
-    int s, count = 0;
     ULONG true = 1;
     const char *p;
+    SOCKET s;
 
     TRACE("host %s, context %s.\n", debugstr_a(params->url), wine_dbgstr_longlong(params->context));
 
@@ -1089,7 +1090,7 @@ static NTSTATUS http_add_url(struct request_queue *queue, IRP *irp)
         return STATUS_NOT_IMPLEMENTED;
     }
 
-    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1)
+    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
     {
         ERR("Failed to create socket, error %u.\n", WSAGetLastError());
         LeaveCriticalSection(&http_cs);
-- 
2.22.0




More information about the wine-devel mailing list