diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index 35b8ef49d1e..a7153ed79d0 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -311,9 +311,6 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed) current_entry = CacheSegmentLRUListHead.Flink; while (current_entry != &CacheSegmentLRUListHead && Target > 0) { - NTSTATUS Status; - - Status = STATUS_SUCCESS; current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, CacheSegmentLRUListEntry); current_entry = current_entry->Flink; @@ -332,7 +329,7 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed) { PFN_NUMBER Page; Page = (PFN_NUMBER)(MmGetPhysicalAddress((char*)current->BaseAddress + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT); - Status = MmPageOutPhysicalAddress(Page); + MmPageOutPhysicalAddress(Page); } KeAcquireGuardedMutex(&ViewLock); KeAcquireSpinLock(¤t->Bcb->BcbLock, &oldIrql); @@ -1022,7 +1019,6 @@ CcRosDeleteFileCache(PFILE_OBJECT FileObject, PBCB Bcb) { PLIST_ENTRY current_entry; PCACHE_SEGMENT current; - NTSTATUS Status; LIST_ENTRY FreeList; KIRQL oldIrql; @@ -1077,7 +1073,7 @@ CcRosDeleteFileCache(PFILE_OBJECT FileObject, PBCB Bcb) { current_entry = RemoveTailList(&FreeList); current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); - Status = CcRosInternalFreeCacheSegment(current); + CcRosInternalFreeCacheSegment(current); } ExFreeToNPagedLookasideList(&BcbLookasideList, Bcb); KeAcquireGuardedMutex(&ViewLock); diff --git a/reactos/ntoskrnl/config/cmparse.c b/reactos/ntoskrnl/config/cmparse.c index 82635445dda..54851ed3edb 100644 --- a/reactos/ntoskrnl/config/cmparse.c +++ b/reactos/ntoskrnl/config/cmparse.c @@ -999,14 +999,9 @@ CmpBuildHashStackAndLookupCache(IN PCM_KEY_BODY ParseObject, OUT PULONG OuterStackArray, OUT PULONG *LockedKcbs) { - ULONG HashKeyCopy; - /* We don't lock anything for now */ *LockedKcbs = NULL; - /* Make a copy of the hash key */ - HashKeyCopy = (*Kcb)->ConvKey; - /* Calculate hash values */ *TotalRemainingSubkeys = 0xBAADF00D; diff --git a/reactos/ntoskrnl/config/cmsysini.c b/reactos/ntoskrnl/config/cmsysini.c index 3587efe7326..779d902b650 100644 --- a/reactos/ntoskrnl/config/cmsysini.c +++ b/reactos/ntoskrnl/config/cmsysini.c @@ -1194,6 +1194,7 @@ CmpLoadHiveThread(IN PVOID StartContext) if (CmHive->Hive.Cluster != ClusterSize) ASSERT(FALSE); /* Set the file size */ + DPRINT("FIXME: Should set file size: %lx\n", Length); //if (!CmpFileSetSize((PHHIVE)CmHive, HFILE_TYPE_PRIMARY, Length, Length)) { /* This shouldn't fail */ @@ -1232,7 +1233,7 @@ CmpInitializeHiveList(IN USHORT Flag) UNICODE_STRING TempName, FileName, RegName; HANDLE Thread; NTSTATUS Status; - ULONG FileStart, RegStart, i; + ULONG RegStart, i; PSECURITY_DESCRIPTOR SecurityDescriptor; PAGED_CODE(); @@ -1247,7 +1248,6 @@ CmpInitializeHiveList(IN USHORT Flag) CmpGetRegistryPath(ConfigPath); RtlInitUnicodeString(&TempName, ConfigPath); RtlAppendStringToString((PSTRING)&FileName, (PSTRING)&TempName); - FileStart = FileName.Length; /* And build the registry root path */ RtlInitUnicodeString(&TempName, L"\\REGISTRY\\"); diff --git a/reactos/ntoskrnl/config/cmvalche.c b/reactos/ntoskrnl/config/cmvalche.c index 8f598573937..02bbbf9c29b 100644 --- a/reactos/ntoskrnl/config/cmvalche.c +++ b/reactos/ntoskrnl/config/cmvalche.c @@ -340,7 +340,6 @@ CmpQueryKeyValueData(IN PCM_KEY_CONTROL_BLOCK Kcb, OUT PULONG ResultLength, OUT PNTSTATUS Status) { - PHHIVE Hive; PKEY_VALUE_INFORMATION Info = (PKEY_VALUE_INFORMATION)KeyValueInformation; PCELL_DATA CellData; USHORT NameSize; @@ -350,8 +349,7 @@ CmpQueryKeyValueData(IN PCM_KEY_CONTROL_BLOCK Kcb, HCELL_INDEX CellToRelease = HCELL_NIL; VALUE_SEARCH_RETURN_TYPE Result = SearchSuccess; - /* Get the hive and cell data */ - Hive = Kcb->KeyHive; + /* Get the value data */ CellData = (PCELL_DATA)ValueKey; /* Check if the value is compressed */ diff --git a/reactos/ntoskrnl/config/i386/cmhardwr.c b/reactos/ntoskrnl/config/i386/cmhardwr.c index 3f0fe4ff170..ac31d33c914 100644 --- a/reactos/ntoskrnl/config/i386/cmhardwr.c +++ b/reactos/ntoskrnl/config/i386/cmhardwr.c @@ -232,7 +232,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc { UNICODE_STRING KeyName, ValueName, Data, SectionName; OBJECT_ATTRIBUTES ObjectAttributes; - ULONG HavePae, CacheSize, Length, TotalLength = 0, i, Disposition; + ULONG HavePae, Length, TotalLength = 0, i, Disposition; SIZE_T ViewSize; NTSTATUS Status; HANDLE KeyHandle, BiosHandle, SystemHandle, FpuHandle, SectionHandle; @@ -451,9 +451,6 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc } } - /* Get the cache size while we're still localized */ - CacheSize = ((PKIPCR)KeGetPcr())->SecondLevelCacheSize; - /* Go back to user affinity */ KeRevertToUserAffinityThread(); diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index 11da1461f66..ee585576967 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -494,7 +494,6 @@ QSI_DEF(SystemProcessorInformation) { PSYSTEM_PROCESSOR_INFORMATION Spi = (PSYSTEM_PROCESSOR_INFORMATION) Buffer; - PKPRCB Prcb; *ReqSize = sizeof(SYSTEM_PROCESSOR_INFORMATION); @@ -503,7 +502,6 @@ QSI_DEF(SystemProcessorInformation) { return STATUS_INFO_LENGTH_MISMATCH; } - Prcb = KeGetCurrentPrcb(); Spi->ProcessorArchitecture = KeProcessorArchitecture; Spi->ProcessorLevel = KeProcessorLevel; Spi->ProcessorRevision = KeProcessorRevision; @@ -931,7 +929,6 @@ QSI_DEF(SystemProcessorPerformanceInformation) LONG i; ULONG TotalTime; - LARGE_INTEGER CurrentTime; PKPRCB Prcb; *ReqSize = KeNumberProcessors * sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION); @@ -942,7 +939,6 @@ QSI_DEF(SystemProcessorPerformanceInformation) return STATUS_INFO_LENGTH_MISMATCH; } - CurrentTime.QuadPart = KeQueryInterruptTime(); for (i = 0; i < KeNumberProcessors; i++) { /* Get the PRCB on this processor */ diff --git a/reactos/ntoskrnl/ex/xipdisp.c b/reactos/ntoskrnl/ex/xipdisp.c index 3e2eb7bd3c5..aa739c2dfa8 100644 --- a/reactos/ntoskrnl/ex/xipdisp.c +++ b/reactos/ntoskrnl/ex/xipdisp.c @@ -79,6 +79,7 @@ XIPInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* FIXME: TODO */ DPRINT1("ReactOS does not yet support eXecute In Place boot technology\n"); + DPRINT("%s MB requested (XIP = %s)\n", XipMegs, XipBoot); } /* EOF */ diff --git a/reactos/ntoskrnl/inbv/inbv.c b/reactos/ntoskrnl/inbv/inbv.c index 52cc7108386..0e2b3c75dc1 100644 --- a/reactos/ntoskrnl/inbv/inbv.c +++ b/reactos/ntoskrnl/inbv/inbv.c @@ -552,7 +552,7 @@ VOID NTAPI DisplayBootBitmap(IN BOOLEAN SosMode) { - PVOID Header, Band, Bar, Text, Screen; + PVOID Header, Band, Text, Screen; ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED; UCHAR Buffer[64]; @@ -615,7 +615,7 @@ DisplayBootBitmap(IN BOOLEAN SosMode) if (SharedUserData->NtProductType == NtProductWinNt) { /* Workstation product, display appropriate status bar color */ - Bar = InbvGetResourceAddress(IDB_BAR_PRO); + InbvGetResourceAddress(IDB_BAR_PRO); } else { @@ -637,7 +637,7 @@ DisplayBootBitmap(IN BOOLEAN SosMode) } /* Server product, display appropriate status bar color */ - Bar = InbvGetResourceAddress(IDB_BAR_SERVER); + InbvGetResourceAddress(IDB_BAR_SERVER); } /* Make sure we had a logo */ diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c index 7dcb0354ea1..c8ce92fd91e 100644 --- a/reactos/ntoskrnl/io/iomgr/driver.c +++ b/reactos/ntoskrnl/io/iomgr/driver.c @@ -715,7 +715,6 @@ LdrProcessDriverModule(PLDR_DATA_TABLE_ENTRY LdrEntry, PLDR_DATA_TABLE_ENTRY *ModuleObject) { NTSTATUS Status; - PLDR_DATA_TABLE_ENTRY NewEntry; UNICODE_STRING BaseName, BaseDirectory; PLOAD_IMPORTS LoadedImports = (PVOID)-2; PCHAR MissingApiName, Buffer; @@ -763,8 +762,6 @@ LdrProcessDriverModule(PLDR_DATA_TABLE_ENTRY LdrEntry, BaseDirectory.Length -= BaseName.Length; BaseDirectory.MaximumLength = BaseDirectory.Length; - NewEntry = LdrEntry; - /* Resolve imports */ MissingApiName = Buffer; Status = MiResolveImageReferences(DriverBase, diff --git a/reactos/ntoskrnl/io/iomgr/rawfs.c b/reactos/ntoskrnl/io/iomgr/rawfs.c index 36252d575a0..32c396f712e 100755 --- a/reactos/ntoskrnl/io/iomgr/rawfs.c +++ b/reactos/ntoskrnl/io/iomgr/rawfs.c @@ -604,13 +604,11 @@ RawSetInformation(IN PVCB Vcb, IN PIO_STACK_LOCATION IoStackLocation) { NTSTATUS Status = STATUS_INVALID_DEVICE_REQUEST; - PULONG Length; PFILE_POSITION_INFORMATION Buffer; PDEVICE_OBJECT DeviceObject; PAGED_CODE(); /* Get information from the IRP */ - Length = &IoStackLocation->Parameters.QueryFile.Length; Buffer = Irp->AssociatedIrp.SystemBuffer; /* We only handle this request */ diff --git a/reactos/ntoskrnl/io/pnpmgr/pnproot.c b/reactos/ntoskrnl/io/pnpmgr/pnproot.c index 42d9421cce8..638c66557b9 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnproot.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnproot.c @@ -799,10 +799,8 @@ PdoQueryCapabilities( IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp) { - PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; PDEVICE_CAPABILITIES DeviceCapabilities; - DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; DeviceCapabilities = IrpSp->Parameters.DeviceCapabilities.Capabilities; if (DeviceCapabilities->Version != 1) diff --git a/reactos/ntoskrnl/kdbg/i386/i386-dis.c b/reactos/ntoskrnl/kdbg/i386/i386-dis.c index 8a6bbe13428..95425a227a0 100644 --- a/reactos/ntoskrnl/kdbg/i386/i386-dis.c +++ b/reactos/ntoskrnl/kdbg/i386/i386-dis.c @@ -3746,7 +3746,6 @@ OP_sI (bytemode, sizeflag) int sizeflag; { bfd_signed_vma op; - bfd_signed_vma mask = -1; switch (bytemode) { @@ -3755,7 +3754,6 @@ OP_sI (bytemode, sizeflag) op = *codep++; if ((op & 0x80) != 0) op -= 0x100; - mask = 0xffffffff; break; case v_mode: USED_REX (REX_MODE64); @@ -3764,11 +3762,9 @@ OP_sI (bytemode, sizeflag) else if (sizeflag & DFLAG) { op = get32s (); - mask = 0xffffffff; } else { - mask = 0xffffffff; op = get16 (); if ((op & 0x8000) != 0) op -= 0x10000; @@ -3777,7 +3773,6 @@ OP_sI (bytemode, sizeflag) break; case w_mode: op = get16 (); - mask = 0xffffffff; if ((op & 0x8000) != 0) op -= 0x10000; break; diff --git a/reactos/ntoskrnl/kdbg/kdb_cli.c b/reactos/ntoskrnl/kdbg/kdb_cli.c index 5d77e5538f0..ba20dc401ff 100644 --- a/reactos/ntoskrnl/kdbg/kdb_cli.c +++ b/reactos/ntoskrnl/kdbg/kdb_cli.c @@ -790,7 +790,6 @@ KdbpCmdBackTrace( ULONG Argc, PCHAR Argv[]) { - ULONG Count; ULONG ul; ULONGLONG Result = 0; ULONG_PTR Frame = KdbCurrentTrapFrame->Tf.Ebp; @@ -806,7 +805,6 @@ KdbpCmdBackTrace( ul = strtoul(Argv[Argc-1], NULL, 0); if (ul > 0) { - Count = ul; Argc -= 2; } } @@ -815,7 +813,6 @@ KdbpCmdBackTrace( ul = strtoul(Argv[Argc-1] + 1, NULL, 0); if (ul > 0) { - Count = ul; Argc--; } } diff --git a/reactos/ntoskrnl/ke/eventobj.c b/reactos/ntoskrnl/ke/eventobj.c index b6457ce9507..f8f77867cdf 100644 --- a/reactos/ntoskrnl/ke/eventobj.c +++ b/reactos/ntoskrnl/ke/eventobj.c @@ -161,7 +161,6 @@ KeSetEvent(IN PKEVENT Event, { KIRQL OldIrql; LONG PreviousState; - PKWAIT_BLOCK WaitBlock; PKTHREAD Thread; ASSERT_EVENT(Event); ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); @@ -170,7 +169,7 @@ KeSetEvent(IN PKEVENT Event, * Check if this is an signaled notification event without an upcoming wait. * In this case, we can immediately return TRUE, without locking. */ - if ((Event->Header.Type == NotificationEvent) && + if ((Event->Header.Type == EventNotificationObject) && (Event->Header.SignalState == 1) && !(Wait)) { @@ -190,13 +189,8 @@ KeSetEvent(IN PKEVENT Event, /* Check if the event just became signaled now, and it has waiters */ if (!(PreviousState) && !(IsListEmpty(&Event->Header.WaitListHead))) { - /* Get the Wait Block */ - WaitBlock = CONTAINING_RECORD(Event->Header.WaitListHead.Flink, - KWAIT_BLOCK, - WaitListEntry); - /* Check the type of event */ - if (Event->Header.Type == NotificationEvent) + if (Event->Header.Type == EventNotificationObject) { /* Unwait the thread */ KxUnwaitThread(&Event->Header, Increment); @@ -237,7 +231,7 @@ KeSetEventBoostPriority(IN PKEVENT Event, KIRQL OldIrql; PKWAIT_BLOCK WaitBlock; PKTHREAD Thread = KeGetCurrentThread(), WaitThread; - ASSERT(Event->Header.Type == SynchronizationEvent); + ASSERT(Event->Header.Type == EventSynchronizationObject); ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); /* Acquire Dispatcher Database Lock */ diff --git a/reactos/ntoskrnl/ke/i386/traphdlr.c b/reactos/ntoskrnl/ke/i386/traphdlr.c index 41d367e6bbf..2374bf40505 100644 --- a/reactos/ntoskrnl/ke/i386/traphdlr.c +++ b/reactos/ntoskrnl/ke/i386/traphdlr.c @@ -739,6 +739,7 @@ KiTrap07Handler(IN PKTRAP_FRAME TrapFrame) NpxSaveArea = KiGetThreadNpxArea(NpxThread); /* Save FPU state */ + DPRINT("FIXME: Save FPU state: %p\n", NpxSaveArea); //Ke386SaveFpuState(NpxSaveArea); /* Update NPX state */ diff --git a/reactos/ntoskrnl/mm/ARM3/i386/init.c b/reactos/ntoskrnl/mm/ARM3/i386/init.c index 90ed32ef8e4..f18e6b2e72a 100644 --- a/reactos/ntoskrnl/mm/ARM3/i386/init.c +++ b/reactos/ntoskrnl/mm/ARM3/i386/init.c @@ -158,7 +158,6 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock) PMMPTE StartPde, EndPde, PointerPte, LastPte; MMPTE TempPde, TempPte; PVOID NonPagedPoolExpansionVa; - ULONG OldCount; KIRQL OldIrql; /* Check for kernel stack size that's too big */ @@ -519,7 +518,6 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock) // We PDE-aligned the nonpaged system start VA, so haul some extra PTEs! // PointerPte = MiAddressToPte(MmNonPagedSystemStart); - OldCount = MmNumberOfSystemPtes; MmNumberOfSystemPtes = MiAddressToPte(MmNonPagedPoolExpansionStart) - PointerPte; MmNumberOfSystemPtes--; diff --git a/reactos/ntoskrnl/mm/ARM3/mdlsup.c b/reactos/ntoskrnl/mm/ARM3/mdlsup.c index aa0d1f96b4d..2702bb0182f 100644 --- a/reactos/ntoskrnl/mm/ARM3/mdlsup.c +++ b/reactos/ntoskrnl/mm/ARM3/mdlsup.c @@ -578,13 +578,11 @@ MmProbeAndLockPages(IN PMDL Mdl, ULONG LockPages, TotalPages; NTSTATUS Status = STATUS_SUCCESS; PEPROCESS CurrentProcess; - PETHREAD Thread; PMMSUPPORT AddressSpace; NTSTATUS ProbeStatus; PMMPTE PointerPte, LastPte; PMMPDE PointerPde; PFN_NUMBER PageFrameIndex; - PMMPFN Pfn1; BOOLEAN UsePfnLock; KIRQL OldIrql; DPRINT("Probing MDL: %p\n", Mdl); @@ -616,9 +614,8 @@ MmProbeAndLockPages(IN PMDL Mdl, ASSERT(LockPages != 0); // - // Get the thread and process + // Get theprocess // - Thread = PsGetCurrentThread(); if (Address <= MM_HIGHEST_USER_ADDRESS) { // @@ -962,10 +959,6 @@ MmProbeAndLockPages(IN PMDL Mdl, PageFrameIndex = PFN_FROM_PTE(PointerPte); if (PageFrameIndex <= MmHighestPhysicalPage) { - // - // Get the PFN entry - // - Pfn1 = MiGetPfnEntry(PageFrameIndex); ASSERT((CurrentProcess == NULL) || (UsePfnLock == FALSE)); // diff --git a/reactos/ntoskrnl/mm/ARM3/pool.c b/reactos/ntoskrnl/mm/ARM3/pool.c index 39736ffdb5b..1124dfb03a0 100644 --- a/reactos/ntoskrnl/mm/ARM3/pool.c +++ b/reactos/ntoskrnl/mm/ARM3/pool.c @@ -686,6 +686,10 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType, ASSERT(Pfn1->u3.e1.StartOfAllocation == 0); Pfn1->u3.e1.StartOfAllocation = 1; + /* Mark it as special pool if needed */ + ASSERT(Pfn1->u4.VerifierAllocation == 0); + if (PoolType & 64) Pfn1->u4.VerifierAllocation = 1; + // // Check if the allocation is larger than one page // @@ -790,6 +794,10 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType, Pfn1 = MiGetPfnEntry(StartPte->u.Hard.PageFrameNumber); Pfn1->u3.e1.StartOfAllocation = 1; + /* Mark it as a verifier allocation if needed */ + ASSERT(Pfn1->u4.VerifierAllocation == 0); + if (PoolType & 64) Pfn1->u4.VerifierAllocation = 1; + // // Release the PFN and nonpaged pool lock // diff --git a/reactos/ntoskrnl/mm/ARM3/procsup.c b/reactos/ntoskrnl/mm/ARM3/procsup.c index a2280a00cf2..8def3be2f2c 100644 --- a/reactos/ntoskrnl/mm/ARM3/procsup.c +++ b/reactos/ntoskrnl/mm/ARM3/procsup.c @@ -389,7 +389,6 @@ MmGrowKernelStackEx(IN PVOID StackPointer, { PKTHREAD Thread = KeGetCurrentThread(); PMMPTE LimitPte, NewLimitPte, LastPte; - PFN_NUMBER StackPages; KIRQL OldIrql; MMPTE TempPte, InvalidPte; PFN_NUMBER PageFrameIndex; @@ -430,7 +429,6 @@ MmGrowKernelStackEx(IN PVOID StackPointer, // Calculate the number of new pages // LimitPte--; - StackPages = (LimitPte - NewLimitPte + 1); /* Setup the temporary invalid PTE */ MI_MAKE_SOFTWARE_PTE(&InvalidPte, MM_NOACCESS); diff --git a/reactos/ntoskrnl/mm/ARM3/sysldr.c b/reactos/ntoskrnl/mm/ARM3/sysldr.c index 8a86c91ed22..5c716ce73a3 100644 --- a/reactos/ntoskrnl/mm/ARM3/sysldr.c +++ b/reactos/ntoskrnl/mm/ARM3/sysldr.c @@ -559,7 +559,20 @@ MiUpdateThunks(IN PLOADER_PARAMETER_BLOCK LoaderBlock, ULONG_PTR OldBaseTop, Delta; PLDR_DATA_TABLE_ENTRY LdrEntry; PLIST_ENTRY NextEntry; - ULONG ImportSize, i; + ULONG ImportSize; + // + // FIXME: MINGW-W64 must fix LD to generate drivers that Windows can load, + // since a real version of Windows would fail at this point, but they seem + // busy implementing features such as "HotPatch" support in GCC 4.6 instead, + // a feature which isn't even used by Windows. Priorities, priorities... + // Please note that Microsoft WDK EULA and license prohibits using + // the information contained within it for the generation of "non-Windows" + // drivers, which is precisely what LD will generate, since an LD driver + // will not load on Windows. + // +#ifdef _WORKING_LINKER_ + ULONG i; +#endif PULONG_PTR ImageThunk; PIMAGE_IMPORT_DESCRIPTOR ImportDescriptor; @@ -599,7 +612,6 @@ MiUpdateThunks(IN PLOADER_PARAMETER_BLOCK LoaderBlock, } #else /* Get the import table */ - i = ImportSize; ImportDescriptor = RtlImageDirectoryEntryToData(LdrEntry->DllBase, TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, diff --git a/reactos/ntoskrnl/mm/ARM3/virtual.c b/reactos/ntoskrnl/mm/ARM3/virtual.c index c878c1542d4..53ac25023f8 100644 --- a/reactos/ntoskrnl/mm/ARM3/virtual.c +++ b/reactos/ntoskrnl/mm/ARM3/virtual.c @@ -81,6 +81,7 @@ MiDeleteSystemPageableVm(IN PMMPTE PointerPte, MiDecrementShareCount(Pfn1, PageFrameIndex); /* Decrement the page table too */ + DPRINT("FIXME: ARM3 should decrement the PT refcount for: %p\n", Pfn2); #if 0 // ARM3: Dont't trust this yet MiDecrementShareCount(Pfn2, PageTableIndex); #endif diff --git a/reactos/ntoskrnl/mm/freelist.c b/reactos/ntoskrnl/mm/freelist.c index 54715d5ae67..3124c625962 100644 --- a/reactos/ntoskrnl/mm/freelist.c +++ b/reactos/ntoskrnl/mm/freelist.c @@ -180,6 +180,9 @@ MiAllocatePagesForMdl(IN PHYSICAL_ADDRESS LowAddress, if (BYTE_OFFSET(SkipBytes.LowPart)) return NULL; SkipPages = (PFN_NUMBER)(SkipBytes.QuadPart >> PAGE_SHIFT); + /* This isn't supported at all */ + if (SkipPages) DPRINT1("WARNING: Caller requesting SkipBytes, MDL might be mismatched\n"); + // // Now compute the number of pages the MDL will cover // diff --git a/reactos/ntoskrnl/mm/i386/page.c b/reactos/ntoskrnl/mm/i386/page.c index 800e9338310..a93860a0342 100644 --- a/reactos/ntoskrnl/mm/i386/page.c +++ b/reactos/ntoskrnl/mm/i386/page.c @@ -653,8 +653,6 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, ULONG oldPdeOffset, PdeOffset; PULONG Pt = NULL; ULONG Pte; - BOOLEAN NoExecute = FALSE; - DPRINT("MmCreateVirtualMappingUnsafe(%x, %x, %x, %x (%x), %d)\n", Process, Address, flProtect, Pages, *Pages, PageCount); @@ -689,10 +687,6 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, } Attributes = ProtectToPTE(flProtect); - if (Attributes & 0x80000000) - { - NoExecute = TRUE; - } Attributes &= 0xfff; if (Address >= MmSystemRangeStart) { @@ -826,7 +820,6 @@ NTAPI MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) { ULONG Attributes = 0; - BOOLEAN NoExecute = FALSE; PULONG Pt; DPRINT("MmSetPageProtect(Process %x Address %x flProtect %x)\n", @@ -834,10 +827,6 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) Attributes = ProtectToPTE(flProtect); - if (Attributes & 0x80000000) - { - NoExecute = TRUE; - } Attributes &= 0xfff; if (Address >= MmSystemRangeStart) { diff --git a/reactos/ntoskrnl/mm/ppool.c b/reactos/ntoskrnl/mm/ppool.c index bfeb42ba6e2..13b6e58da0c 100644 --- a/reactos/ntoskrnl/mm/ppool.c +++ b/reactos/ntoskrnl/mm/ppool.c @@ -719,10 +719,7 @@ RPoolAlloc ( PR_POOL pool, rulong NumberOfBytes, rulong Tag, rulong align ) { PR_USED NewBlock; PR_FREE BestBlock, - NextBlock, - PreviousBlock, - BestPreviousBlock, - CurrentBlock; + CurrentBlock; void* BestAlignedAddr; int que, queBytes = NumberOfBytes; @@ -785,8 +782,6 @@ try_again: */ BestBlock = NULL; Alignment = pool->Alignments[align]; - PreviousBlock = NULL; - BestPreviousBlock = NULL, CurrentBlock = pool->FirstFree; BestAlignedAddr = NULL; @@ -802,7 +797,6 @@ try_again: if ( Addr == AlignedAddr ) { BestAlignedAddr = AlignedAddr; - BestPreviousBlock = PreviousBlock; BestBlock = CurrentBlock; break; } @@ -820,12 +814,10 @@ try_again: || BestBlock->Size > CurrentBlock->Size ) { BestAlignedAddr = AlignedAddr; - BestPreviousBlock = PreviousBlock; BestBlock = CurrentBlock; } } - PreviousBlock = CurrentBlock; CurrentBlock = CurrentBlock->NextFree; } @@ -876,7 +868,6 @@ try_again: NewFreeBlock, NewFreeBlock->Size, BestBlock->Size, BestBlock->NextFree );*/ /* we want the following code to use our size-aligned block */ - BestPreviousBlock = BestBlock; BestBlock = NewFreeBlock; //VerifyPagedPool(); @@ -893,7 +884,7 @@ try_again: /* * Create the new free block. */ - NextBlock = RFreeSplit ( pool, BestBlock, BlockSize ); + RFreeSplit ( pool, BestBlock, BlockSize ); //ASSERT_SIZE ( NextBlock->Size ); } /* @@ -919,7 +910,9 @@ static void RPoolFree ( PR_POOL pool, void* Addr ) { PR_USED UsedBlock; +#ifndef R_RZ rulong UsedSize; +#endif PR_FREE FreeBlock; rulong UserSize; int que; @@ -936,11 +929,11 @@ RPoolFree ( PR_POOL pool, void* Addr ) R_ASSERT_PTR(pool,Addr); UsedBlock = RBodyToHdr(Addr); - UsedSize = UsedBlock->Size; FreeBlock = (PR_FREE)UsedBlock; #if R_RZ UserSize = UsedBlock->UserSize; #else + UsedSize = UsedBlock->Size; UserSize = UsedSize - sizeof(R_USED) - 2*R_RZ; #endif//R_RZ diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index a09a0a3d7ad..f15b18c0ac6 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -2963,7 +2963,6 @@ MmspPageAlignSegments { ULONG i; ULONG LastSegment; - BOOLEAN Initialized; PMM_SECTION_SEGMENT EffectiveSegment; if (Flags & EXEFMT_LOAD_ASSUME_SEGMENTS_PAGE_ALIGNED) @@ -2972,7 +2971,6 @@ MmspPageAlignSegments return TRUE; } - Initialized = FALSE; LastSegment = 0; EffectiveSegment = &ImageSectionObject->Segments[LastSegment]; @@ -3711,7 +3709,6 @@ NtMapViewOfSection(IN HANDLE SectionHandle, PROS_SECTION_OBJECT Section; PEPROCESS Process; KPROCESSOR_MODE PreviousMode; - PMMSUPPORT AddressSpace; NTSTATUS Status; ULONG tmpProtect; ACCESS_MASK DesiredAccess; @@ -3787,8 +3784,6 @@ NtMapViewOfSection(IN HANDLE SectionHandle, return(Status); } - AddressSpace = &Process->Vm; - /* Convert NT Protection Attr to Access Mask */ if (Protect == PAGE_READONLY) { @@ -4033,7 +4028,7 @@ MmUnmapViewOfSegment(PMMSUPPORT AddressSpace, } MmUnlockSectionSegment(Segment); ObDereferenceObject(Section); - return(STATUS_SUCCESS); + return(Status); } /* diff --git a/reactos/ntoskrnl/ob/obhandle.c b/reactos/ntoskrnl/ob/obhandle.c index 0a741fc698d..20d15651d4c 100644 --- a/reactos/ntoskrnl/ob/obhandle.c +++ b/reactos/ntoskrnl/ob/obhandle.c @@ -462,6 +462,7 @@ ObpChargeQuotaForObject(IN POBJECT_HEADER ObjectHeader, /* Charge the quota */ ObjectHeader->QuotaBlockCharged = (PVOID)1; + DPRINT("FIXME: Should charge: %lx %lx\n", PagedPoolCharge, NonPagedPoolCharge); #if 0 PsChargeSharedPoolQuota(PsGetCurrentProcess(), PagedPoolCharge, @@ -898,7 +899,7 @@ ObpIncrementHandleCount(IN PVOID Object, if (!ObCheckObjectAccess(Object, AccessState, TRUE, - AccessMode, + ProbeMode, &Status)) { /* Access was denied, so fail */ diff --git a/reactos/ntoskrnl/ob/oblife.c b/reactos/ntoskrnl/ob/oblife.c index 181b73ee7d0..7304321d411 100644 --- a/reactos/ntoskrnl/ob/oblife.c +++ b/reactos/ntoskrnl/ob/oblife.c @@ -107,6 +107,15 @@ ObpDeallocateObject(IN PVOID Object) /* Add the SD charge too */ if (Header->Flags & OB_FLAG_SECURITY) PagedPoolCharge += 2048; } + + /* Return the quota */ + DPRINT("FIXME: Should return quotas: %lx %lx\n", PagedPoolCharge, NonPagedPoolCharge); +#if 0 + PsReturnSharedPoolQuota(ObjectHeader->QuotaBlockCharged, + PagedPoolCharge, + NonPagedPoolCharge); +#endif + } } diff --git a/reactos/ntoskrnl/po/power.c b/reactos/ntoskrnl/po/power.c index d745d76e777..ff2631e8bb3 100644 --- a/reactos/ntoskrnl/po/power.c +++ b/reactos/ntoskrnl/po/power.c @@ -370,7 +370,6 @@ PoRequestPowerIrp(IN PDEVICE_OBJECT DeviceObject, PIO_STACK_LOCATION Stack; PIRP Irp; PREQUEST_POWER_ITEM RequestPowerItem; - NTSTATUS Status; if (MinorFunction != IRP_MN_QUERY_POWER && MinorFunction != IRP_MN_SET_POWER @@ -419,7 +418,7 @@ PoRequestPowerIrp(IN PDEVICE_OBJECT DeviceObject, *pIrp = Irp; IoSetCompletionRoutine(Irp, PopRequestPowerIrpCompletion, RequestPowerItem, TRUE, TRUE, TRUE); - Status = IoCallDriver(TopDeviceObject, Irp); + IoCallDriver(TopDeviceObject, Irp); /* Always return STATUS_PENDING. The completion routine * will call CompletionFunction and complete the Irp.