Author: fireball Date: Mon Aug 11 03:40:52 2008 New Revision: 35269
URL: http://svn.reactos.org/svn/reactos?rev=35269&view=rev Log: - NDK Fix: DirectoryTableBase member of KPROCESS is ULONG[2] and not LARGE_INTEGER since Windows 2000 ("Inside Windows 2000", Chapter 6), and till Windows 2003.
Modified: trunk/reactos/include/ndk/ketypes.h trunk/reactos/ntoskrnl/include/internal/ke.h trunk/reactos/ntoskrnl/include/internal/mm.h trunk/reactos/ntoskrnl/ke/i386/kiinit.c trunk/reactos/ntoskrnl/ke/procobj.c trunk/reactos/ntoskrnl/mm/i386/page.c trunk/reactos/ntoskrnl/mm/mminit.c trunk/reactos/ntoskrnl/ps/process.c
Modified: trunk/reactos/include/ndk/ketypes.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=3... ============================================================================== --- trunk/reactos/include/ndk/ketypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/ketypes.h [iso-8859-1] Mon Aug 11 03:40:52 2008 @@ -955,7 +955,7 @@ ULONG DirectoryTableBase; ULONG Unused0; #else - LARGE_INTEGER DirectoryTableBase; + ULONG DirectoryTableBase[2]; #endif #if defined(_M_IX86) KGDTENTRY LdtDescriptor;
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/k... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] Mon Aug 11 03:40:52 2008 @@ -537,7 +537,7 @@ struct _KPROCESS *Process, KPRIORITY Priority, KAFFINITY Affinity, - PLARGE_INTEGER DirectoryTableBase, + PULONG DirectoryTableBase, IN BOOLEAN Enable );
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/m... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Mon Aug 11 03:40:52 2008 @@ -1275,14 +1275,14 @@ MmCreateProcessAddressSpace( IN ULONG MinWs, IN PEPROCESS Dest, - IN PLARGE_INTEGER DirectoryTableBase + IN PULONG DirectoryTableBase );
NTSTATUS NTAPI MmInitializeHandBuiltProcess( IN PEPROCESS Process, - IN PLARGE_INTEGER DirectoryTableBase + IN PULONG DirectoryTableBase );
Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/kiinit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c [iso-8859-1] Mon Aug 11 03:40:52 2008 @@ -391,7 +391,7 @@ { BOOLEAN NpxPresent; ULONG FeatureBits; - LARGE_INTEGER PageDirectory; + ULONG PageDirectory[2]; PVOID DpcStack; ULONG Vendor[3];
@@ -503,11 +503,12 @@
/* Initialize the Idle Process and the Process Listhead */ InitializeListHead(&KiProcessListHead); - PageDirectory.QuadPart = 0; + PageDirectory[0] = 0; + PageDirectory[1] = 0; KeInitializeProcess(InitProcess, 0, 0xFFFFFFFF, - &PageDirectory, + PageDirectory, FALSE); InitProcess->QuantumReset = MAXCHAR; }
Modified: trunk/reactos/ntoskrnl/ke/procobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/procobj.c?rev=3... ============================================================================== --- trunk/reactos/ntoskrnl/ke/procobj.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/procobj.c [iso-8859-1] Mon Aug 11 03:40:52 2008 @@ -115,7 +115,7 @@ KeInitializeProcess(IN OUT PKPROCESS Process, IN KPRIORITY Priority, IN KAFFINITY Affinity, - IN PLARGE_INTEGER DirectoryTableBase, + IN PULONG DirectoryTableBase, IN BOOLEAN Enable) { #ifdef CONFIG_SMP @@ -134,7 +134,8 @@ Process->Affinity = Affinity; Process->BasePriority = (CHAR)Priority; Process->QuantumReset = 6; - Process->DirectoryTableBase = *DirectoryTableBase; + Process->DirectoryTableBase[0] = DirectoryTableBase[0]; + Process->DirectoryTableBase[1] = DirectoryTableBase[1]; Process->AutoAlignment = Enable; #if defined(_M_IX86) Process->IopmOffset = KiComputeIopmOffset(IO_ACCESS_MAP_NONE);
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?rev... ============================================================================== --- trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] Mon Aug 11 03:40:52 2008 @@ -162,7 +162,7 @@ ExFreePool((PVOID) LdtBase); }
- PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.u.LowPart)); + PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0])); for (i = 0; i < ADDR_TO_PDE_OFFSET(MmSystemRangeStart); i++) { if (PageDir[i] != 0) @@ -173,16 +173,11 @@ } MmReleasePageMemoryConsumer(MC_NPPOOL, PTE_TO_PFN(PageDir[ADDR_TO_PDE_OFFSET(HYPERSPACE)])); MmDeleteHyperspaceMapping(PageDir); - MmReleasePageMemoryConsumer(MC_NPPOOL, PTE_TO_PFN(Process->Pcb.DirectoryTableBase.u.LowPart)); - -#if defined(__GNUC__) - - Process->Pcb.DirectoryTableBase.QuadPart = 0LL; -#else - - Process->Pcb.DirectoryTableBase.QuadPart = 0; -#endif - + 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); } @@ -190,15 +185,16 @@ NTSTATUS NTAPI MmInitializeHandBuiltProcess(IN PEPROCESS Process, - IN PLARGE_INTEGER DirectoryTableBase) + IN PULONG DirectoryTableBase) { /* Share the directory base with the idle process */ - *DirectoryTableBase = PsGetCurrentProcess()->Pcb.DirectoryTableBase; - + 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; @@ -208,7 +204,7 @@ STDCALL MmCreateProcessAddressSpace(IN ULONG MinWs, IN PEPROCESS Process, - IN PLARGE_INTEGER DirectoryTableBase) + IN PULONG DirectoryTableBase) { NTSTATUS Status; ULONG i, j; @@ -243,8 +239,9 @@
MmDeleteHyperspaceMapping(PageDirectory);
- DirectoryTableBase->QuadPart = PFN_TO_PTE(Pfn[0]); - DPRINT("Finished MmCopyMmInfo(): %I64x\n", DirectoryTableBase->QuadPart); + DirectoryTableBase[0] = PFN_TO_PTE(Pfn[0]); + DirectoryTableBase[1] = 0; + DPRINT("Finished MmCopyMmInfo(): 0x%x\n", DirectoryTableBase[0]); return TRUE; }
@@ -329,7 +326,7 @@
if (Address < MmSystemRangeStart && Process && Process != PsGetCurrentProcess()) { - PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.LowPart)); + PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0])); if (PageDir == NULL) { KEBUGCHECK(0); @@ -1286,7 +1283,7 @@
if (Process != NULL && Process != PsGetCurrentProcess()) { - Pde = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.u.LowPart)); + Pde = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0])); } else {
Modified: trunk/reactos/ntoskrnl/mm/mminit.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=35... ============================================================================== --- trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] Mon Aug 11 03:40:52 2008 @@ -368,13 +368,13 @@ MmInit1(VOID) { PLDR_DATA_TABLE_ENTRY LdrEntry; - LARGE_INTEGER Dummy; + ULONG Dummy[2];
/* Dump memory descriptors */ if (MiDbgEnableMdDump) MiDbgDumpMemoryDescriptors();
/* Set the page directory */ - PsGetCurrentProcess()->Pcb.DirectoryTableBase.LowPart = (ULONG)MmGetPageDirectory(); + PsGetCurrentProcess()->Pcb.DirectoryTableBase[0] = (ULONG)MmGetPageDirectory();
/* Get the size of FreeLDR's image allocations */ MmBootImageSize = KeLoaderBlock->Extension->LoaderPagesSpanned; @@ -396,7 +396,7 @@ DbgPrint("Used memory %dKb\n", (MmNumberOfPhysicalPages * PAGE_SIZE) / 1024);
/* Initialize the kernel address space */ - MmInitializeHandBuiltProcess(PsGetCurrentProcess(), &Dummy); + MmInitializeHandBuiltProcess(PsGetCurrentProcess(), Dummy); MmKernelAddressSpace = MmGetCurrentAddressSpace(); MmInitGlobalKernelPageDirectory();
Modified: trunk/reactos/ntoskrnl/ps/process.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/process.c?rev=3... ============================================================================== --- trunk/reactos/ntoskrnl/ps/process.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/process.c [iso-8859-1] Mon Aug 11 03:40:52 2008 @@ -365,7 +365,7 @@ PDEBUG_OBJECT DebugObject; PSECTION_OBJECT SectionObject; NTSTATUS Status, AccessStatus; - PHYSICAL_ADDRESS DirectoryTableBase = {{0}}; + ULONG DirectoryTableBase[2] = {0,0}; KAFFINITY Affinity; HANDLE_TABLE_ENTRY CidEntry; PETHREAD CurrentThread = PsGetCurrentThread(); @@ -562,7 +562,7 @@ /* Create the address space for the child */ if (!MmCreateProcessAddressSpace(MinWs, Process, - &DirectoryTableBase)) + DirectoryTableBase)) { /* Failed */ Status = STATUS_INSUFFICIENT_RESOURCES; @@ -573,7 +573,7 @@ { /* Otherwise, we are the boot process, we're already semi-initialized */ Process->ObjectTable = CurrentProcess->ObjectTable; - Status = MmInitializeHandBuiltProcess(Process, &DirectoryTableBase); + Status = MmInitializeHandBuiltProcess(Process, DirectoryTableBase); if (!NT_SUCCESS(Status)) goto CleanupWithRef; }
@@ -587,7 +587,7 @@ KeInitializeProcess(&Process->Pcb, PROCESS_PRIORITY_NORMAL, Affinity, - &DirectoryTableBase, + DirectoryTableBase, (BOOLEAN)(Process->DefaultHardErrorProcessing & 4));
/* Duplicate Parent Token */