summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/socket/ntapi_sc_recv.c12
-rw-r--r--src/socket/ntapi_sc_send.c12
2 files changed, 10 insertions, 14 deletions
diff --git a/src/socket/ntapi_sc_recv.c b/src/socket/ntapi_sc_recv.c
index 19a4423..a45eb17 100644
--- a/src/socket/ntapi_sc_recv.c
+++ b/src/socket/ntapi_sc_recv.c
@@ -56,7 +56,7 @@ int32_t __cdecl __ntapi_sc_recv(
afd_recv.afd_recv.afd_flags = (uint32_t)afdflags;
afd_recv.afd_recv.tdi_flags = (uint32_t)tdiflags;
- hssocket->iostatus = __ntapi->zw_device_io_control_file(
+ if ((hssocket->iostatus = __ntapi->zw_device_io_control_file(
hssocket->hsocket,
hssocket->hevent,
0,
@@ -66,13 +66,11 @@ int32_t __cdecl __ntapi_sc_recv(
&afd_recv,
raddr ? sizeof(afd_recv) : sizeof(afd_recv.afd_recv),
0,
- 0);
+ 0)))
+ return hssocket->iostatus;
- if (hssocket->iostatus && (hssocket->ntflags & __NT_FILE_SYNC_IO))
- __ntapi->sc_wait(hssocket,iosb,&hssocket->timeout);
-
- if (!hssocket->iostatus && bytes_received)
+ if (bytes_received)
*bytes_received = iosb->info;
- return hssocket->iostatus;
+ return NT_STATUS_SUCCESS;
}
diff --git a/src/socket/ntapi_sc_send.c b/src/socket/ntapi_sc_send.c
index bf2c0ea..f987cad 100644
--- a/src/socket/ntapi_sc_send.c
+++ b/src/socket/ntapi_sc_send.c
@@ -68,7 +68,7 @@ int32_t __cdecl __ntapi_sc_send(
afd_send.afd_send.afd_flags = (uint32_t)afdflags;
afd_send.afd_send.tdi_flags = (uint32_t)tdiflags;
- hssocket->iostatus = __ntapi->zw_device_io_control_file(
+ if ((hssocket->iostatus = __ntapi->zw_device_io_control_file(
hssocket->hsocket,
hssocket->hevent,
0,
@@ -78,13 +78,11 @@ int32_t __cdecl __ntapi_sc_send(
&afd_send,
addrlen ? sizeof(afd_send) : sizeof(afd_send.afd_send),
0,
- 0);
+ 0)))
+ return hssocket->iostatus;
- if (hssocket->iostatus && (hssocket->ntflags & __NT_FILE_SYNC_IO))
- __ntapi->sc_wait(hssocket,iosb,&hssocket->timeout);
-
- if (!hssocket->iostatus && bytes_sent)
+ if (bytes_sent)
*bytes_sent = iosb->info;
- return hssocket->iostatus;
+ return NT_STATUS_SUCCESS;
}