ptos: ps: Add new VAS per-process

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
2026-07-14 21:27:44 +00:00
parent 181b0fdf61
commit 1601bfe87b
2 changed files with 13 additions and 0 deletions
+10
View File
@@ -18,6 +18,8 @@ PsCreateProcess(const CHAR *Name, ULONG Flags, PROCESS **Result)
{
USIZE NameLen;
PROCESS *Process;
MMU_VAS CurrentVas;
PT_STATUS Status;
if (Name == NULL || Result == NULL) {
return STATUS_INVALID_PARAM;
@@ -43,6 +45,14 @@ PsCreateProcess(const CHAR *Name, ULONG Flags, PROCESS **Result)
return STATUS_NO_MEMORY;
}
/* Fork a new VAS */
HalMmuReadVas(&CurrentVas);
Status = HalMmuForkVas(&CurrentVas, &Process->Vas);
if (PT_ERROR(Status)) {
ExFreePoolWithTag(Process, PS_POOL_TAG);
return Status;
}
RtlMemCpy(Process->Name, Name, NameLen);
Process->Pid = AtomicIncQuad(&ProcessId);
Process->Flags = Flags;