{
if ((Pt && MmUnmapPageTable(Pt)) || Address >= MmSystemRangeStart)
{
- __invlpg(Address);
+ KeInvalidateTlbEntry(Address);
}
}
-PULONG
-MmGetPageDirectory(VOID)
-{
- return (PULONG)(ULONG_PTR)__readcr3();
-}
-
static ULONG
ProtectToPTE(ULONG flProtect)
{
else
{
DPRINT1("Unknown main protection type.\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (flProtect & PAGE_SYSTEM)
return(Attributes);
}
-NTSTATUS
-NTAPI
-Mmi386ReleaseMmInfo(PEPROCESS Process)
-{
- PUSHORT LdtDescriptor;
- ULONG LdtBase;
- PULONG PageDir;
- ULONG i;
-
- DPRINT("Mmi386ReleaseMmInfo(Process %x)\n",Process);
-
- LdtDescriptor = (PUSHORT) &Process->Pcb.LdtDescriptor;
- LdtBase = LdtDescriptor[1] |
- ((LdtDescriptor[2] & 0xff) << 16) |
- ((LdtDescriptor[3] & ~0xff) << 16);
-
- DPRINT("LdtBase: %x\n", LdtBase);
-
- if (LdtBase)
- {
- ExFreePool((PVOID) LdtBase);
- }
-
- PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0]));
- for (i = 0; i < ADDR_TO_PDE_OFFSET(MmSystemRangeStart); i++)
- {
- if (PageDir[i] != 0)
- {
- MiZeroPage(PTE_TO_PFN(PageDir[i]));
- MmReleasePageMemoryConsumer(MC_NPPOOL, PTE_TO_PFN(PageDir[i]));
- }
- }
- MmReleasePageMemoryConsumer(MC_NPPOOL, PTE_TO_PFN(PageDir[ADDR_TO_PDE_OFFSET(HYPERSPACE)]));
- MmDeleteHyperspaceMapping(PageDir);
- MmReleasePageMemoryConsumer(MC_NPPOOL, PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0]));
-
- Process->Pcb.DirectoryTableBase[0] = 0;
- Process->Pcb.DirectoryTableBase[1] = 0;
-
- DPRINT("Finished Mmi386ReleaseMmInfo()\n");
- return(STATUS_SUCCESS);
-}
-
-NTSTATUS
-NTAPI
-MmInitializeHandBuiltProcess(IN PEPROCESS Process,
- IN PULONG DirectoryTableBase)
-{
- /* Share the directory base with the idle process */
- DirectoryTableBase[0] = PsGetCurrentProcess()->Pcb.DirectoryTableBase[0];
- DirectoryTableBase[1] = PsGetCurrentProcess()->Pcb.DirectoryTableBase[1];
-
- /* Initialize the Addresss Space */
- KeInitializeGuardedMutex(&Process->AddressCreationLock);
- Process->VadRoot.BalancedRoot.u1.Parent = NULL;
-
- /* The process now has an address space */
- Process->HasAddressSpace = TRUE;
- return STATUS_SUCCESS;
-}
-
-BOOLEAN
-STDCALL
-MmCreateProcessAddressSpace(IN ULONG MinWs,
- IN PEPROCESS Process,
- IN PULONG DirectoryTableBase)
-{
- NTSTATUS Status;
- ULONG i, j;
- PFN_TYPE Pfn[2];
- PULONG PageDirectory;
-
- DPRINT("MmCopyMmInfo(Src %x, Dest %x)\n", MinWs, Process);
-
- for (i = 0; i < 2; i++)
- {
- Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn[i]);
- if (!NT_SUCCESS(Status))
- {
- for (j = 0; j < i; j++)
- {
- MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn[j]);
- }
-
- return FALSE;
- }
- }
-
- PageDirectory = MmCreateHyperspaceMapping(Pfn[0]);
-
- memcpy(PageDirectory + ADDR_TO_PDE_OFFSET(MmSystemRangeStart),
- MmGlobalKernelPageDirectory + ADDR_TO_PDE_OFFSET(MmSystemRangeStart),
- (1024 - ADDR_TO_PDE_OFFSET(MmSystemRangeStart)) * sizeof(ULONG));
-
- DPRINT("Addr %x\n",ADDR_TO_PDE_OFFSET(PAGETABLE_MAP));
- PageDirectory[ADDR_TO_PDE_OFFSET(PAGETABLE_MAP)] = PFN_TO_PTE(Pfn[0]) | PA_PRESENT | PA_READWRITE;
- PageDirectory[ADDR_TO_PDE_OFFSET(HYPERSPACE)] = PFN_TO_PTE(Pfn[1]) | PA_PRESENT | PA_READWRITE;
-
- MmDeleteHyperspaceMapping(PageDirectory);
-
- DirectoryTableBase[0] = PFN_TO_PTE(Pfn[0]);
- DirectoryTableBase[1] = 0;
- DPRINT("Finished MmCopyMmInfo(): 0x%x\n", DirectoryTableBase[0]);
- return TRUE;
-}
-
-VOID
-NTAPI
-MmDeletePageTable(PEPROCESS Process, PVOID Address)
-{
- PEPROCESS CurrentProcess = PsGetCurrentProcess();
-
- if (Process != NULL && Process != CurrentProcess)
- {
- KeAttachProcess(&Process->Pcb);
- }
-
- MiAddressToPde(Address)->u.Long = 0;
- MiFlushTlb((PULONG)MiAddressToPde(Address),
- MiAddressToPte(Address));
-
- if (Address >= MmSystemRangeStart)
- {
- ASSERT(FALSE);
- // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0;
- }
- if (Process != NULL && Process != CurrentProcess)
- {
- KeDetachProcess();
- }
-}
-
static PULONG
MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create)
{
ULONG PdeOffset = ADDR_TO_PDE_OFFSET(Address);
NTSTATUS Status;
- PFN_TYPE Pfn;
+ PFN_NUMBER Pfn;
ULONG Entry;
PULONG Pt, PageDir;
PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0]));
if (PageDir == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (0 == InterlockedCompareExchangePte(&PageDir[PdeOffset], 0, 0))
{
Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn);
if (!NT_SUCCESS(Status) || Pfn == 0)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Entry = InterlockedCompareExchangePte(&PageDir[PdeOffset], PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0);
if (Entry != 0)
Pt = MmCreateHyperspaceMapping(Pfn);
if (Pt == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
return Pt + ADDR_TO_PTE_OFFSET(Address);
}
{
return NULL;
}
- Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn);
+ Status = MmRequestPageMemoryConsumer(MC_SYSTEM, FALSE, &Pfn);
if (!NT_SUCCESS(Status) || Pfn == 0)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE;
- if (Ke386GlobalPagesEnabled)
- {
- Entry |= PA_GLOBAL;
- }
if(0 != InterlockedCompareExchangePte(&MmGlobalKernelPageDirectory[PdeOffset], Entry, 0))
{
- MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
+ MmReleasePageMemoryConsumer(MC_SYSTEM, Pfn);
}
+ InterlockedExchangePte(PageDir, MmGlobalKernelPageDirectory[PdeOffset]);
+ RtlZeroMemory(MiPteToAddress(PageDir), PAGE_SIZE);
+ return (PULONG)MiAddressToPte(Address);
}
InterlockedExchangePte(PageDir, MmGlobalKernelPageDirectory[PdeOffset]);
}
Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn);
if (!NT_SUCCESS(Status) || Pfn == 0)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Entry = InterlockedCompareExchangePte(PageDir, PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0);
if (Entry != 0)
return 0;
}
-PFN_TYPE
+PFN_NUMBER
NTAPI
MmGetPfnForProcess(PEPROCESS Process,
PVOID Address)
VOID
NTAPI
-MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page)
+MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_NUMBER Page)
/*
* FUNCTION: Delete a virtual mapping
*/
Pt = MmGetPageTableForProcess(Process, Address, FALSE);
if (Pt == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
/*
* Atomically disable the present bit and get the old value.
WasValid = (PAGE_MASK(Pte) != 0);
if (!WasValid)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
/*
VOID
NTAPI
MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage,
- BOOLEAN* WasDirty, PPFN_TYPE Page)
+ BOOLEAN* WasDirty, PPFN_NUMBER Page)
/*
* FUNCTION: Delete a virtual mapping
*/
{
BOOLEAN WasValid = FALSE;
- PFN_TYPE Pfn;
+ PFN_NUMBER Pfn;
ULONG Pte;
PULONG Pt;
if (WasValid)
{
Pfn = PTE_TO_PFN(Pte);
- MmMarkPageUnmapped(Pfn);
}
else
{
if (Address < MmSystemRangeStart && Process == NULL)
{
DPRINT1("MmSetCleanPage is called for user space without a process.\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Pt = MmGetPageTableForProcess(Process, Address, FALSE);
if (Pt == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
do
if (Address < MmSystemRangeStart && Process == NULL)
{
DPRINT1("MmSetDirtyPage is called for user space without a process.\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Pt = MmGetPageTableForProcess(Process, Address, FALSE);
if (Pt == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
do
Pt = MmGetPageTableForProcess(Process, Address, FALSE);
if (Pt == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
do
NTAPI
MmIsPagePresent(PEPROCESS Process, PVOID Address)
{
- return MmGetPageEntryForProcess(Process, Address) & PA_PRESENT ? TRUE : FALSE;
+ return MmGetPageEntryForProcess(Process, Address) & PA_PRESENT;
}
BOOLEAN
{
ULONG Entry;
Entry = MmGetPageEntryForProcess(Process, Address);
- return !(Entry & PA_PRESENT) && Entry != 0 ? TRUE : FALSE;
-}
-
-NTSTATUS
-NTAPI
-MmCreateVirtualMappingForKernel(PVOID Address,
- ULONG flProtect,
- PPFN_TYPE Pages,
- ULONG PageCount)
-{
- ULONG Attributes;
- ULONG i;
- PVOID Addr;
- ULONG PdeOffset, oldPdeOffset;
- PULONG Pt;
- ULONG Pte;
- BOOLEAN NoExecute = FALSE;
-
- DPRINT("MmCreateVirtualMappingForKernel(%x, %x, %x, %d)\n",
- Address, flProtect, Pages, PageCount);
-
- if (Address < MmSystemRangeStart)
- {
- DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n");
- ASSERT(FALSE);
- }
-
- Attributes = ProtectToPTE(flProtect);
- if (Attributes & 0x80000000)
- {
- NoExecute = TRUE;
- }
- Attributes &= 0xfff;
- if (Ke386GlobalPagesEnabled)
- {
- Attributes |= PA_GLOBAL;
- }
-
- Addr = Address;
-
- oldPdeOffset = ADDR_TO_PDE_OFFSET(Addr);
- Pt = MmGetPageTableForProcess(NULL, Addr, TRUE);
- if (Pt == NULL)
- {
- ASSERT(FALSE);
- }
- Pt--;
-
- for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE))
- {
- if (!(Attributes & PA_PRESENT) && Pages[i] != 0)
- {
- DPRINT1("Setting physical address but not allowing access at address "
- "0x%.8X with attributes %x/%x.\n",
- Addr, Attributes, flProtect);
- ASSERT(FALSE);
- }
-
- PdeOffset = ADDR_TO_PDE_OFFSET(Addr);
- if (oldPdeOffset != PdeOffset)
- {
- Pt = MmGetPageTableForProcess(NULL, Addr, TRUE);
- if (Pt == NULL)
- {
- ASSERT(FALSE);
- }
- }
- else
- {
- Pt++;
- }
- oldPdeOffset = PdeOffset;
-
- Pte = *Pt;
- if (Pte != 0)
- {
- ASSERT(FALSE);
- }
- InterlockedExchangePte(Pt, PFN_TO_PTE(Pages[i]) | Attributes);
- }
-
- return(STATUS_SUCCESS);
+ return !(Entry & PA_PRESENT) && (Entry & 0x800) && Entry != 0;
}
NTSTATUS
if (Process == NULL && Address < MmSystemRangeStart)
{
DPRINT1("No process\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (Process != NULL && Address >= MmSystemRangeStart)
{
DPRINT1("Setting kernel address with process context\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
+
if (SwapEntry & (1 << 31))
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Pt = MmGetPageTableForProcess(Process, Address, TRUE);
if (Pt == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Pte = *Pt;
- if (PAGE_MASK((Pte)) != 0)
- {
- MmMarkPageUnmapped(PTE_TO_PFN((Pte)));
- }
InterlockedExchangePte(Pt, SwapEntry << 1);
if (Pte != 0)
{
MmCreateVirtualMappingUnsafe(PEPROCESS Process,
PVOID Address,
ULONG flProtect,
- PPFN_TYPE Pages,
+ PPFN_NUMBER Pages,
ULONG PageCount)
{
ULONG Attributes;
if (Address < MmSystemRangeStart)
{
DPRINT1("No process\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (PageCount > 0x10000 ||
(ULONG_PTR) Address / PAGE_SIZE + PageCount > 0x100000)
{
- DPRINT1("Page count to large\n");
- ASSERT(FALSE);
+ DPRINT1("Page count too large\n");
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
else
if (Address >= MmSystemRangeStart)
{
DPRINT1("Setting kernel address with process context\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE ||
(ULONG_PTR) Address / PAGE_SIZE + PageCount >
(ULONG_PTR)MmSystemRangeStart / PAGE_SIZE)
{
- DPRINT1("Page Count to large\n");
- ASSERT(FALSE);
+ DPRINT1("Page Count too large\n");
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
if (Address >= MmSystemRangeStart)
{
Attributes &= ~PA_USER;
- if (Ke386GlobalPagesEnabled)
- {
- Attributes |= PA_GLOBAL;
- }
}
else
{
DPRINT1("Setting physical address but not allowing access at address "
"0x%.8X with attributes %x/%x.\n",
Addr, Attributes, flProtect);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
PdeOffset = ADDR_TO_PDE_OFFSET(Addr);
if (oldPdeOffset != PdeOffset)
Pt = MmGetPageTableForProcess(Process, Addr, TRUE);
if (Pt == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
else
oldPdeOffset = PdeOffset;
Pte = *Pt;
- MmMarkPageMapped(Pages[i]);
- if (PAGE_MASK((Pte)) != 0 && !((Pte) & PA_PRESENT))
+ if (PAGE_MASK(Pte) != 0 && !(Pte & PA_PRESENT) && (Pte & 0x800))
{
- ASSERT(FALSE);
- }
- if (PAGE_MASK((Pte)) != 0)
- {
- MmMarkPageUnmapped(PTE_TO_PFN((Pte)));
+ DPRINT1("Bad PTE %lx\n", Pte);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
InterlockedExchangePte(Pt, PFN_TO_PTE(Pages[i]) | Attributes);
if (Pte != 0)
MmCreateVirtualMapping(PEPROCESS Process,
PVOID Address,
ULONG flProtect,
- PPFN_TYPE Pages,
+ PPFN_NUMBER Pages,
ULONG PageCount)
{
ULONG i;
if (!MmIsPageInUse(Pages[i]))
{
DPRINT1("Page at address %x not in use\n", PFN_TO_PTE(Pages[i]));
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
Process, Address, flProtect);
Attributes = ProtectToPTE(flProtect);
+
if (Attributes & 0x80000000)
{
NoExecute = TRUE;
if (Address >= MmSystemRangeStart)
{
Attributes &= ~PA_USER;
- if (Ke386GlobalPagesEnabled)
- {
- Attributes |= PA_GLOBAL;
- }
}
else
{
Pt = MmGetPageTableForProcess(Process, Address, FALSE);
if (Pt == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
InterlockedExchangePte(Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY)));
MiFlushTlb(Pt, Address);
/*
* @implemented
*/
-PHYSICAL_ADDRESS STDCALL
+PHYSICAL_ADDRESS NTAPI
MmGetPhysicalAddress(PVOID vaddr)
/*
* FUNCTION: Returns the physical address corresponding to a virtual address
return p;
}
-PVOID
-NTAPI
-MmCreateHyperspaceMapping(PFN_TYPE Page)
-{
- PVOID Address;
- ULONG i;
-
- ULONG Entry;
- PULONG Pte;
- Entry = PFN_TO_PTE(Page) | PA_PRESENT | PA_READWRITE;
- Pte = (PULONG)MiAddressToPte(HYPERSPACE) + Page % 1024;
- if (Page & 1024)
- {
- for (i = Page % 1024; i < 1024; i++, Pte++)
- {
- if (0 == InterlockedCompareExchange((PLONG)Pte, (LONG)Entry, 0))
- {
- break;
- }
- }
- if (i >= 1024)
- {
- Pte = (PULONG)MiAddressToPte(HYPERSPACE);
- for (i = 0; i < Page % 1024; i++, Pte++)
- {
- if (0 == InterlockedCompareExchange((PLONG)Pte, (LONG)Entry, 0))
- {
- break;
- }
- }
- if (i >= Page % 1024)
- {
- ASSERT(FALSE);
- }
- }
- }
- else
- {
- for (i = Page % 1024; (LONG)i >= 0; i--, Pte--)
- {
- if (0 == InterlockedCompareExchange((PLONG)Pte, (LONG)Entry, 0))
- {
- break;
- }
- }
- if ((LONG)i < 0)
- {
- Pte = (PULONG)MiAddressToPte(HYPERSPACE) + 1023;
- for (i = 1023; i > Page % 1024; i--, Pte--)
- {
- if (0 == InterlockedCompareExchange((PLONG)Pte, (LONG)Entry, 0))
- {
- break;
- }
- }
- if (i <= Page % 1024)
- {
- ASSERT(FALSE);
- }
- }
- }
- Address = (PVOID)((ULONG_PTR)HYPERSPACE + i * PAGE_SIZE);
- __invlpg(Address);
- return Address;
-}
-
-PFN_TYPE
-NTAPI
-MmDeleteHyperspaceMapping(PVOID Address)
-{
- PFN_TYPE Pfn;
- ULONG Entry;
-
- ASSERT (IS_HYPERSPACE(Address));
-
- Entry = InterlockedExchangePte(MiAddressToPte(Address), 0);
- Pfn = PTE_TO_PFN(Entry);
-
- __invlpg(Address);
- return Pfn;
-}
-
VOID
NTAPI
MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size)
ULONG StartOffset, EndOffset, Offset;
PULONG Pde;
- if (Address < MmSystemRangeStart)
+ //
+ // Check if the process isn't there anymore
+ // This is probably a bad sign, since it means the caller is setting cr3 to
+ // 0 or something...
+ //
+ if ((PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0]) == 0) && (Process != PsGetCurrentProcess()))
{
+ DPRINT1("Process: %16s is dead: %p\n", Process->ImageFileName, Process->Pcb.DirectoryTableBase[0]);
ASSERT(FALSE);
+ return;
}
-
+
+ if (Address < MmSystemRangeStart)
+ {
+ KeBugCheck(MEMORY_MANAGEMENT);
+ }
+
StartOffset = ADDR_TO_PDE_OFFSET(Address);
EndOffset = ADDR_TO_PDE_OFFSET((PVOID)((ULONG_PTR)Address + Size));
-
+
if (Process != NULL && Process != PsGetCurrentProcess())
{
Pde = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0]));
0 == MmGlobalKernelPageDirectory[i] && 0 != CurrentPageDirectory[i])
{
MmGlobalKernelPageDirectory[i] = CurrentPageDirectory[i];
- if (Ke386GlobalPagesEnabled)
- {
- MmGlobalKernelPageDirectory[i] |= PA_GLOBAL;
- CurrentPageDirectory[i] |= PA_GLOBAL;
- }
}
}
}
-VOID
-INIT_FUNCTION
-NTAPI
-MiInitPageDirectoryMap(VOID)
-{
- MEMORY_AREA* kernel_map_desc = NULL;
- MEMORY_AREA* hyperspace_desc = NULL;
- PHYSICAL_ADDRESS BoundaryAddressMultiple;
- PVOID BaseAddress;
- NTSTATUS Status;
-
- DPRINT("MiInitPageDirectoryMap()\n");
-
- BoundaryAddressMultiple.QuadPart = 0;
- BaseAddress = (PVOID)PAGETABLE_MAP;
- Status = MmCreateMemoryArea(MmGetKernelAddressSpace(),
- MEMORY_AREA_SYSTEM,
- &BaseAddress,
- 0x400000,
- PAGE_READWRITE,
- &kernel_map_desc,
- TRUE,
- 0,
- BoundaryAddressMultiple);
- if (!NT_SUCCESS(Status))
- {
- ASSERT(FALSE);
- }
- BaseAddress = (PVOID)HYPERSPACE;
- Status = MmCreateMemoryArea(MmGetKernelAddressSpace(),
- MEMORY_AREA_SYSTEM,
- &BaseAddress,
- 0x400000,
- PAGE_READWRITE,
- &hyperspace_desc,
- TRUE,
- 0,
- BoundaryAddressMultiple);
- if (!NT_SUCCESS(Status))
- {
- ASSERT(FALSE);
- }
-}
-
/* EOF */