From de5d8154ab595717ad67eaad8e205ce805ce7a7f Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 6 Feb 2023 20:13:11 +0200 Subject: [PATCH] Create a thread instead of a new process --- Network/NetworkController.cpp | 10 +++++----- include/net/nc.hpp | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Network/NetworkController.cpp b/Network/NetworkController.cpp index 3b64b1c..e70240a 100644 --- a/Network/NetworkController.cpp +++ b/Network/NetworkController.cpp @@ -76,10 +76,10 @@ namespace NetworkInterfaceManager { TaskManager->GetCurrentThread()->SetPriority(Tasking::TaskPriority::Critical); DeviceInterface *DefaultDevice = nullptr; - foreach (auto var in Interfaces) - if (var && var->DriverCallBackAddress) + foreach (auto inf in Interfaces) + if (inf && inf->DriverCallBackAddress) { - DefaultDevice = var; + DefaultDevice = inf; break; } @@ -156,8 +156,8 @@ namespace NetworkInterfaceManager void NetworkInterface::StartService() { - this->NetSvcProcess = TaskManager->CreateProcess(TaskManager->GetCurrentProcess(), "Network Service", Tasking::TaskTrustLevel::System); - this->NetSvcThread = TaskManager->CreateThread(this->NetSvcProcess, (Tasking::IP)CallStartNetworkStackWrapper); + this->NetSvcThread = TaskManager->CreateThread(TaskManager->GetCurrentProcess(), (Tasking::IP)CallStartNetworkStackWrapper); + this->NetSvcThread->Rename("Network Service"); } void NetworkInterface::DrvSend(unsigned int DriverID, unsigned char *Data, unsigned short Size) diff --git a/include/net/nc.hpp b/include/net/nc.hpp index 0fb8703..28cccd3 100644 --- a/include/net/nc.hpp +++ b/include/net/nc.hpp @@ -52,7 +52,6 @@ namespace NetworkInterfaceManager int CardIDs = 0; Vector Interfaces; - Tasking::PCB *NetSvcProcess; Tasking::TCB *NetSvcThread; void StopNetworkStack(); void FetchNetworkCards(unsigned long DriverUID);