summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-04-22 05:49:41 +0000
committermidipix <writeonce@midipix.org>2019-04-22 21:21:25 -0400
commitc8cd7a65ae917d3ece71ada95861e081f5223ca5 (patch)
tree26d4d47d4dd3142db2e21e40678d2bbdfe250f52 /src
parent807f38fe1678cfc652724712bfdce5fb8ded23bb (diff)
downloadntapi-c8cd7a65ae917d3ece71ada95861e081f5223ca5.tar.bz2
ntapi-c8cd7a65ae917d3ece71ada95861e081f5223ca5.tar.xz
__ntapi_sc_getsockopt(): support NT_SO_IOCTL_GET_TCP_INFO.
Diffstat (limited to 'src')
-rw-r--r--src/socket/ntapi_sc_getsockopt.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/socket/ntapi_sc_getsockopt.c b/src/socket/ntapi_sc_getsockopt.c
index fa2233f..e70ba28 100644
--- a/src/socket/ntapi_sc_getsockopt.c
+++ b/src/socket/ntapi_sc_getsockopt.c
@@ -24,14 +24,23 @@ int32_t __cdecl __ntapi_sc_getsockopt(
if (!iosb)
return NT_STATUS_INVALID_PARAMETER_6;
+ /* tcp socket info? */
+ if (optname == NT_SO_IOCTL_GET_TCP_INFO) {
+ afd_sockopt.mode = NT_AFD_SOCKOPT_GET | NT_AFD_SOCKOPT_SET;
+ afd_sockopt.optval = &(uint32_t){0};
+ afd_sockopt.optlen = sizeof(uint32_t);
+ } else {
+ afd_sockopt.mode = NT_AFD_SOCKOPT_GET;
+ afd_sockopt.optval = 0;
+ afd_sockopt.optlen = 0;
+ }
+
/* afd_sockopt */
- afd_sockopt.mode = NT_AFD_SOCKOPT_GET;
afd_sockopt.level = level;
afd_sockopt.optname = optname;
- afd_sockopt.optval = 0;
- afd_sockopt.optlen = 0;
afd_sockopt.ding = 1;
+ /* ioctl */
hssocket->iostatus = __ntapi->zw_device_io_control_file(
hssocket->hsocket,
hssocket->hevent,