Create a thread instead of a new process

This commit is contained in:
Alex 2023-02-06 20:13:11 +02:00
parent a592b85ce5
commit de5d8154ab
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 5 additions and 6 deletions

View File

@ -76,10 +76,10 @@ namespace NetworkInterfaceManager
{ {
TaskManager->GetCurrentThread()->SetPriority(Tasking::TaskPriority::Critical); TaskManager->GetCurrentThread()->SetPriority(Tasking::TaskPriority::Critical);
DeviceInterface *DefaultDevice = nullptr; DeviceInterface *DefaultDevice = nullptr;
foreach (auto var in Interfaces) foreach (auto inf in Interfaces)
if (var && var->DriverCallBackAddress) if (inf && inf->DriverCallBackAddress)
{ {
DefaultDevice = var; DefaultDevice = inf;
break; break;
} }
@ -156,8 +156,8 @@ namespace NetworkInterfaceManager
void NetworkInterface::StartService() void NetworkInterface::StartService()
{ {
this->NetSvcProcess = TaskManager->CreateProcess(TaskManager->GetCurrentProcess(), "Network Service", Tasking::TaskTrustLevel::System); this->NetSvcThread = TaskManager->CreateThread(TaskManager->GetCurrentProcess(), (Tasking::IP)CallStartNetworkStackWrapper);
this->NetSvcThread = TaskManager->CreateThread(this->NetSvcProcess, (Tasking::IP)CallStartNetworkStackWrapper); this->NetSvcThread->Rename("Network Service");
} }
void NetworkInterface::DrvSend(unsigned int DriverID, unsigned char *Data, unsigned short Size) void NetworkInterface::DrvSend(unsigned int DriverID, unsigned char *Data, unsigned short Size)

View File

@ -52,7 +52,6 @@ namespace NetworkInterfaceManager
int CardIDs = 0; int CardIDs = 0;
Vector<DeviceInterface *> Interfaces; Vector<DeviceInterface *> Interfaces;
Tasking::PCB *NetSvcProcess;
Tasking::TCB *NetSvcThread; Tasking::TCB *NetSvcThread;
void StopNetworkStack(); void StopNetworkStack();
void FetchNetworkCards(unsigned long DriverUID); void FetchNetworkCards(unsigned long DriverUID);