mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Get current process if the Parent is null
This commit is contained in:
parent
581638c256
commit
7aced25dd5
@ -377,7 +377,10 @@ namespace Tasking
|
|||||||
TCB *Thread = new TCB;
|
TCB *Thread = new TCB;
|
||||||
Thread->ID = this->NextTID++;
|
Thread->ID = this->NextTID++;
|
||||||
strcpy(Thread->Name, Parent->Name);
|
strcpy(Thread->Name, Parent->Name);
|
||||||
Thread->Parent = Parent;
|
if (Parent == nullptr)
|
||||||
|
Thread->Parent = this->GetCurrentProcess();
|
||||||
|
else
|
||||||
|
Thread->Parent = Parent;
|
||||||
Thread->EntryPoint = EntryPoint;
|
Thread->EntryPoint = EntryPoint;
|
||||||
Thread->Offset = Offset;
|
Thread->Offset = Offset;
|
||||||
Thread->ExitCode = 0xdeadbeef;
|
Thread->ExitCode = 0xdeadbeef;
|
||||||
@ -477,13 +480,18 @@ namespace Tasking
|
|||||||
PCB *Process = new PCB;
|
PCB *Process = new PCB;
|
||||||
Process->ID = this->NextPID++;
|
Process->ID = this->NextPID++;
|
||||||
strcpy(Process->Name, Name);
|
strcpy(Process->Name, Name);
|
||||||
Process->Parent = Parent;
|
if (Parent == nullptr)
|
||||||
|
Process->Parent = this->GetCurrentProcess();
|
||||||
|
else
|
||||||
|
Process->Parent = Parent;
|
||||||
Process->ExitCode = 0xdeadbeef;
|
Process->ExitCode = 0xdeadbeef;
|
||||||
Process->Status = TaskStatus::Ready;
|
Process->Status = TaskStatus::Ready;
|
||||||
|
|
||||||
Process->Security.TrustLevel = TrustLevel;
|
Process->Security.TrustLevel = TrustLevel;
|
||||||
Process->Security.UniqueToken = SecurityManager.CreateToken();
|
Process->Security.UniqueToken = SecurityManager.CreateToken();
|
||||||
|
|
||||||
|
Process->IPCHandles = new HashMap<InterProcessCommunication::IPCPort, uint64_t>;
|
||||||
|
|
||||||
switch (TrustLevel)
|
switch (TrustLevel)
|
||||||
{
|
{
|
||||||
case TaskTrustLevel::System:
|
case TaskTrustLevel::System:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user