aboutsummaryrefslogtreecommitdiff
path: root/driver.cpp
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-09-09 15:53:43 +0200
committerToni Uhlig <matzeton@googlemail.com>2022-09-09 16:36:23 +0200
commitccb717ac524bb8a5c49ae92710864d022eebb401 (patch)
treeacb0a909ad36f2ff317fae2af573198105733d5c /driver.cpp
parent97af3b2fcfa46c6f0d9c010e935e9203b444bcd8 (diff)
Added kernel/user space protocol buffer communication via TCP.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'driver.cpp')
-rw-r--r--driver.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/driver.cpp b/driver.cpp
index b7ecbc1..ceae8ff 100644
--- a/driver.cpp
+++ b/driver.cpp
@@ -117,6 +117,10 @@ DriverEntry(_In_ PDRIVER_OBJECT DriverObject,
socklen_t addrlen = sizeof(addr);
int client_sockfd =
accept(server_sockfd, (struct sockaddr *)&addr, &addrlen);
+ if (client_sockfd < 0) {
+ DebuggerPrint("TCP accept failed\n");
+ return STATUS_FAILED_DRIVER_ENTRY;
+ }
result = recv(client_sockfd, recv_buffer, sizeof(recv_buffer) - 1, 0);
if (result > 0) {