From 7a4c82376dde5dc09d4bd90073c8597ff157883d Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath <[email protected]>
Date: Wed, 26 Jun 2024 15:20:41 +0000
Subject: [PATCH] headers: Add wrappers and ioctls for the ideal send backlog in 
ws2tcpip.h

Required for
https://github.com/Azure/azure-sdk-for-cpp/blob/55c241902d6897f9c8b9aee2668c76c5d0723ba4/sdk/core/azure-core/src/http/curl/curl.cpp#L192

Signed-off-by: Biswapriyo Nath <[email protected]>
---
 mingw-w64-headers/include/ws2tcpip.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/mingw-w64-headers/include/ws2tcpip.h 
b/mingw-w64-headers/include/ws2tcpip.h
index 352c179..75ff1fc 100644
--- a/mingw-w64-headers/include/ws2tcpip.h
+++ b/mingw-w64-headers/include/ws2tcpip.h
@@ -24,6 +24,16 @@
 #define SIO_GET_INTERFACE_LIST_EX _IOR('t',126,u_long)
 #define SIO_SET_MULTICAST_FILTER _IOW('t',125,u_long)
 #define SIO_GET_MULTICAST_FILTER _IOW('t',124 | IOC_IN,u_long)
+#define SIOCSIPMSFILTER SIO_SET_MULTICAST_FILTER
+#define SIOCGIPMSFILTER SIO_GET_MULTICAST_FILTER
+#define SIOCSMSFILTER _IOW('t',126,u_long)
+#define SIOCGMSFILTER _IOW('t',127 | IOC_IN,u_long)
+
+#if NTDDI_VERSION >= NTDDI_VISTASP1
+#define IDEAL_SEND_BACKLOG_IOCTLS
+#define SIO_IDEAL_SEND_BACKLOG_QUERY _IOR('t',123,u_long)
+#define SIO_IDEAL_SEND_BACKLOG_CHANGE _IO('t',122)
+#endif
 
 #define UDP_NOCHECKSUM 1
 #define UDP_CHECKSUM_COVERAGE 20
@@ -96,6 +106,18 @@ WS2TCPIP_INLINE void IN6ADDR_SETLOOPBACK(struct 
sockaddr_in6 *a) {
   a->sin6_scope_id = 0;
 }
 
+#ifdef IDEAL_SEND_BACKLOG_IOCTLS
+WS2TCPIP_INLINE int idealsendbacklogquery(SOCKET s, ULONG *isb) {
+  DWORD bytes;
+  return WSAIoctl(s, SIO_IDEAL_SEND_BACKLOG_QUERY, NULL, 0, isb, sizeof(*isb), 
&bytes, NULL, NULL);
+}
+
+WS2TCPIP_INLINE int idealsendbacklognotify(SOCKET s, LPWSAOVERLAPPED 
overlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE routine) {
+  DWORD bytes;
+  return WSAIoctl(s, SIO_IDEAL_SEND_BACKLOG_CHANGE, NULL, 0, NULL, 0, &bytes, 
overlapped, routine);
+}
+#endif
+
 /* Those declarations are mandatory for Open Group Base spec */
 #define IN6_IS_ADDR_UNSPECIFIED IN6_IS_ADDR_UNSPECIFIED
 #define IN6_IS_ADDR_LOOPBACK IN6_IS_ADDR_LOOPBACK
-- 
2.45.2

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to