Zebediah Figura : server: Introduce IOCTL_AFD_WINE_GET_INFO.

Alexandre Julliard julliard at winehq.org
Mon Jun 21 16:14:55 CDT 2021


Module: wine
Branch: master
Commit: a4b3ed9f2a2e207ccd05025a7c90ef31b351bfcb
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a4b3ed9f2a2e207ccd05025a7c90ef31b351bfcb

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Sun Jun 20 11:05:55 2021 -0500

server: Introduce IOCTL_AFD_WINE_GET_INFO.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/wine/afd.h |  6 ++++++
 server/sock.c      | 17 +++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/include/wine/afd.h b/include/wine/afd.h
index 6f0a78ca933..e497eece0be 100644
--- a/include/wine/afd.h
+++ b/include/wine/afd.h
@@ -158,6 +158,7 @@ struct afd_get_events_params
 #define IOCTL_AFD_WINE_MESSAGE_SELECT       CTL_CODE(FILE_DEVICE_NETWORK, 215, METHOD_BUFFERED, FILE_ANY_ACCESS)
 #define IOCTL_AFD_WINE_GETPEERNAME          CTL_CODE(FILE_DEVICE_NETWORK, 216, METHOD_BUFFERED, FILE_ANY_ACCESS)
 #define IOCTL_AFD_WINE_DEFER                CTL_CODE(FILE_DEVICE_NETWORK, 217, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_AFD_WINE_GET_INFO             CTL_CODE(FILE_DEVICE_NETWORK, 218, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
 struct afd_create_params
 {
@@ -218,4 +219,9 @@ struct afd_message_select_params
     int mask;
 };
 
+struct afd_get_info_params
+{
+    int family, type, protocol;
+};
+
 #endif
diff --git a/server/sock.c b/server/sock.c
index 547287572d5..46018887692 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -2515,6 +2515,23 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
         return 1;
     }
 
+    case IOCTL_AFD_WINE_GET_INFO:
+    {
+        struct afd_get_info_params params;
+
+        if (get_reply_max_size() < sizeof(params))
+        {
+            set_error( STATUS_BUFFER_TOO_SMALL );
+            return 0;
+        }
+
+        params.family = sock->family;
+        params.type = sock->type;
+        params.protocol = sock->proto;
+        set_reply_data( &params, sizeof(params) );
+        return 0;
+    }
+
     default:
         set_error( STATUS_NOT_SUPPORTED );
         return 0;




More information about the wine-cvs mailing list