Author: sir_richard
Date: Sat Sep 4 08:17:17 2010
New Revision: 48692
URL:
http://svn.reactos.org/svn/reactos?rev=48692&view=rev
Log:
[NTOS]: Remove useless variables in kernel code that were set, but never actually used
(dead code, tests, copy/pasters). If a variable was set but not used because of
missing/#if'ed out code, a note was added instead.
[NTOS]: In the process, fix bugs in the Event dispatcher code that used Win32 EVENT_TYPE
instead of NT KOBJECTS enumeration.
[NTOS]: Fix a bug in ObpInsertHandleCount, where the object access check was being done
with the previous mode, instead of honoring the probe mode, which is defined by
OBJ_FORCE_ACCESS_CHECK.
[NTOS]: Fix a bug in a section function which was always returning STATUS_SUCCESS, now it
returns the result of the previous Status = function assignment. If this isn't
desired, then don't check for the Status anymore.
[NTOS]: Note that MDL code does not support SkipBytes argument. If it is used, MDL could
be invalid.
[NTOS]: Add checks for VerifierAllocation and set it when needed (WIP).
[NTOS]: Clarify what _WORKING_LINKER_ is, and the legal risks in continuing to use a
linker that builds non-Microsoft drivers when used with headers whose EULA specify that
they can only be used for Microsoft drivers.
Modified:
trunk/reactos/ntoskrnl/cc/view.c
trunk/reactos/ntoskrnl/config/cmparse.c
trunk/reactos/ntoskrnl/config/cmsysini.c
trunk/reactos/ntoskrnl/config/cmvalche.c
trunk/reactos/ntoskrnl/config/i386/cmhardwr.c
trunk/reactos/ntoskrnl/ex/sysinfo.c
trunk/reactos/ntoskrnl/ex/xipdisp.c
trunk/reactos/ntoskrnl/inbv/inbv.c
trunk/reactos/ntoskrnl/io/iomgr/driver.c
trunk/reactos/ntoskrnl/io/iomgr/rawfs.c
trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c
trunk/reactos/ntoskrnl/kdbg/i386/i386-dis.c
trunk/reactos/ntoskrnl/kdbg/kdb_cli.c
trunk/reactos/ntoskrnl/ke/eventobj.c
trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c
trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c
trunk/reactos/ntoskrnl/mm/ARM3/pool.c
trunk/reactos/ntoskrnl/mm/ARM3/procsup.c
trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c
trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
trunk/reactos/ntoskrnl/mm/freelist.c
trunk/reactos/ntoskrnl/mm/i386/page.c
trunk/reactos/ntoskrnl/mm/ppool.c
trunk/reactos/ntoskrnl/mm/section.c
trunk/reactos/ntoskrnl/ob/obhandle.c
trunk/reactos/ntoskrnl/ob/oblife.c
trunk/reactos/ntoskrnl/po/power.c
Modified: trunk/reactos/ntoskrnl/cc/view.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=486…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -311,9 +311,6 @@
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 @@
{
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 @@
{
PLIST_ENTRY current_entry;
PCACHE_SEGMENT current;
- NTSTATUS Status;
LIST_ENTRY FreeList;
KIRQL oldIrql;
@@ -1077,7 +1073,7 @@
{
current_entry = RemoveTailList(&FreeList);
current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry);
- Status = CcRosInternalFreeCacheSegment(current);
+ CcRosInternalFreeCacheSegment(current);
}
ExFreeToNPagedLookasideList(&BcbLookasideList, Bcb);
KeAcquireGuardedMutex(&ViewLock);
Modified: trunk/reactos/ntoskrnl/config/cmparse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmparse.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmparse.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmparse.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -999,13 +999,8 @@
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;
Modified: trunk/reactos/ntoskrnl/config/cmsysini.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmsysini.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmsysini.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmsysini.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -1194,6 +1194,7 @@
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 @@
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 @@
CmpGetRegistryPath(ConfigPath);
RtlInitUnicodeString(&TempName, ConfigPath);
RtlAppendStringToString((PSTRING)&FileName, (PSTRING)&TempName);
- FileStart = FileName.Length;
/* And build the registry root path */
RtlInitUnicodeString(&TempName, L"\\REGISTRY\\");
Modified: trunk/reactos/ntoskrnl/config/cmvalche.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmvalche.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmvalche.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmvalche.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -340,7 +340,6 @@
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 @@
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 */
Modified: trunk/reactos/ntoskrnl/config/i386/cmhardwr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/i386/cmhar…
==============================================================================
--- trunk/reactos/ntoskrnl/config/i386/cmhardwr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/i386/cmhardwr.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -232,7 +232,7 @@
{
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 @@
}
}
- /* Get the cache size while we're still localized */
- CacheSize = ((PKIPCR)KeGetPcr())->SecondLevelCacheSize;
-
/* Go back to user affinity */
KeRevertToUserAffinityThread();
Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -494,7 +494,6 @@
{
PSYSTEM_PROCESSOR_INFORMATION Spi
= (PSYSTEM_PROCESSOR_INFORMATION) Buffer;
- PKPRCB Prcb;
*ReqSize = sizeof(SYSTEM_PROCESSOR_INFORMATION);
@@ -503,7 +502,6 @@
{
return STATUS_INFO_LENGTH_MISMATCH;
}
- Prcb = KeGetCurrentPrcb();
Spi->ProcessorArchitecture = KeProcessorArchitecture;
Spi->ProcessorLevel = KeProcessorLevel;
Spi->ProcessorRevision = KeProcessorRevision;
@@ -931,7 +929,6 @@
LONG i;
ULONG TotalTime;
- LARGE_INTEGER CurrentTime;
PKPRCB Prcb;
*ReqSize = KeNumberProcessors * sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION);
@@ -942,7 +939,6 @@
return STATUS_INFO_LENGTH_MISMATCH;
}
- CurrentTime.QuadPart = KeQueryInterruptTime();
for (i = 0; i < KeNumberProcessors; i++)
{
/* Get the PRCB on this processor */
Modified: trunk/reactos/ntoskrnl/ex/xipdisp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/xipdisp.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/xipdisp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/xipdisp.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -79,6 +79,7 @@
/* FIXME: TODO */
DPRINT1("ReactOS does not yet support eXecute In Place boot
technology\n");
+ DPRINT("%s MB requested (XIP = %s)\n", XipMegs, XipBoot);
}
/* EOF */
Modified: trunk/reactos/ntoskrnl/inbv/inbv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/inbv/inbv.c?rev=4…
==============================================================================
--- trunk/reactos/ntoskrnl/inbv/inbv.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/inbv/inbv.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -552,7 +552,7 @@
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 @@
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 @@
}
/* Server product, display appropriate status bar color */
- Bar = InbvGetResourceAddress(IDB_BAR_SERVER);
+ InbvGetResourceAddress(IDB_BAR_SERVER);
}
/* Make sure we had a logo */
Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -715,7 +715,6 @@
PLDR_DATA_TABLE_ENTRY *ModuleObject)
{
NTSTATUS Status;
- PLDR_DATA_TABLE_ENTRY NewEntry;
UNICODE_STRING BaseName, BaseDirectory;
PLOAD_IMPORTS LoadedImports = (PVOID)-2;
PCHAR MissingApiName, Buffer;
@@ -762,8 +761,6 @@
BaseDirectory = *FileName;
BaseDirectory.Length -= BaseName.Length;
BaseDirectory.MaximumLength = BaseDirectory.Length;
-
- NewEntry = LdrEntry;
/* Resolve imports */
MissingApiName = Buffer;
Modified: trunk/reactos/ntoskrnl/io/iomgr/rawfs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/rawfs.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/rawfs.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/rawfs.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -604,13 +604,11 @@
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 */
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnproot…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -799,10 +799,8 @@
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)
Modified: trunk/reactos/ntoskrnl/kdbg/i386/i386-dis.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/i386/i386-di…
==============================================================================
--- trunk/reactos/ntoskrnl/kdbg/i386/i386-dis.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/kdbg/i386/i386-dis.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -3746,7 +3746,6 @@
int sizeflag;
{
bfd_signed_vma op;
- bfd_signed_vma mask = -1;
switch (bytemode)
{
@@ -3755,7 +3754,6 @@
op = *codep++;
if ((op & 0x80) != 0)
op -= 0x100;
- mask = 0xffffffff;
break;
case v_mode:
USED_REX (REX_MODE64);
@@ -3764,11 +3762,9 @@
else if (sizeflag & DFLAG)
{
op = get32s ();
- mask = 0xffffffff;
}
else
{
- mask = 0xffffffff;
op = get16 ();
if ((op & 0x8000) != 0)
op -= 0x10000;
@@ -3777,7 +3773,6 @@
break;
case w_mode:
op = get16 ();
- mask = 0xffffffff;
if ((op & 0x8000) != 0)
op -= 0x10000;
break;
Modified: trunk/reactos/ntoskrnl/kdbg/kdb_cli.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb_cli.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -790,7 +790,6 @@
ULONG Argc,
PCHAR Argv[])
{
- ULONG Count;
ULONG ul;
ULONGLONG Result = 0;
ULONG_PTR Frame = KdbCurrentTrapFrame->Tf.Ebp;
@@ -806,7 +805,6 @@
ul = strtoul(Argv[Argc-1], NULL, 0);
if (ul > 0)
{
- Count = ul;
Argc -= 2;
}
}
@@ -815,7 +813,6 @@
ul = strtoul(Argv[Argc-1] + 1, NULL, 0);
if (ul > 0)
{
- Count = ul;
Argc--;
}
}
Modified: trunk/reactos/ntoskrnl/ke/eventobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/eventobj.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/eventobj.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/eventobj.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -161,7 +161,6 @@
{
KIRQL OldIrql;
LONG PreviousState;
- PKWAIT_BLOCK WaitBlock;
PKTHREAD Thread;
ASSERT_EVENT(Event);
ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL);
@@ -170,7 +169,7 @@
* 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 @@
/* 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 @@
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 */
Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -739,6 +739,7 @@
NpxSaveArea = KiGetThreadNpxArea(NpxThread);
/* Save FPU state */
+ DPRINT("FIXME: Save FPU state: %p\n", NpxSaveArea);
//Ke386SaveFpuState(NpxSaveArea);
/* Update NPX state */
Modified: trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/i386/init…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -158,7 +158,6 @@
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 @@
// We PDE-aligned the nonpaged system start VA, so haul some extra PTEs!
//
PointerPte = MiAddressToPte(MmNonPagedSystemStart);
- OldCount = MmNumberOfSystemPtes;
MmNumberOfSystemPtes = MiAddressToPte(MmNonPagedPoolExpansionStart) -
PointerPte;
MmNumberOfSystemPtes--;
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -578,13 +578,11 @@
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 @@
ASSERT(LockPages != 0);
//
- // Get the thread and process
- //
- Thread = PsGetCurrentThread();
+ // Get theprocess
+ //
if (Address <= MM_HIGHEST_USER_ADDRESS)
{
//
@@ -962,10 +959,6 @@
PageFrameIndex = PFN_FROM_PTE(PointerPte);
if (PageFrameIndex <= MmHighestPhysicalPage)
{
- //
- // Get the PFN entry
- //
- Pfn1 = MiGetPfnEntry(PageFrameIndex);
ASSERT((CurrentProcess == NULL) || (UsePfnLock == FALSE));
//
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pool.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pool.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -686,6 +686,10 @@
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 @@
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
//
Modified: trunk/reactos/ntoskrnl/mm/ARM3/procsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/procsup.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -389,7 +389,6 @@
{
PKTHREAD Thread = KeGetCurrentThread();
PMMPTE LimitPte, NewLimitPte, LastPte;
- PFN_NUMBER StackPages;
KIRQL OldIrql;
MMPTE TempPte, InvalidPte;
PFN_NUMBER PageFrameIndex;
@@ -430,7 +429,6 @@
// Calculate the number of new pages
//
LimitPte--;
- StackPages = (LimitPte - NewLimitPte + 1);
/* Setup the temporary invalid PTE */
MI_MAKE_SOFTWARE_PTE(&InvalidPte, MM_NOACCESS);
Modified: trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -559,7 +559,20 @@
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 @@
}
#else
/* Get the import table */
- i = ImportSize;
ImportDescriptor = RtlImageDirectoryEntryToData(LdrEntry->DllBase,
TRUE,
IMAGE_DIRECTORY_ENTRY_IMPORT,
Modified: trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/virtual.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -81,6 +81,7 @@
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
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -180,6 +180,9 @@
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
//
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -653,8 +653,6 @@
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 @@
}
Attributes = ProtectToPTE(flProtect);
- if (Attributes & 0x80000000)
- {
- NoExecute = TRUE;
- }
Attributes &= 0xfff;
if (Address >= MmSystemRangeStart)
{
@@ -826,7 +820,6 @@
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 @@
Attributes = ProtectToPTE(flProtect);
- if (Attributes & 0x80000000)
- {
- NoExecute = TRUE;
- }
Attributes &= 0xfff;
if (Address >= MmSystemRangeStart)
{
Modified: trunk/reactos/ntoskrnl/mm/ppool.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ppool.c?rev=48…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ppool.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ppool.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -719,10 +719,7 @@
{
PR_USED NewBlock;
PR_FREE BestBlock,
- NextBlock,
- PreviousBlock,
- BestPreviousBlock,
- CurrentBlock;
+ CurrentBlock;
void* BestAlignedAddr;
int que,
queBytes = NumberOfBytes;
@@ -785,8 +782,6 @@
*/
BestBlock = NULL;
Alignment = pool->Alignments[align];
- PreviousBlock = NULL;
- BestPreviousBlock = NULL,
CurrentBlock = pool->FirstFree;
BestAlignedAddr = NULL;
@@ -802,7 +797,6 @@
if ( Addr == AlignedAddr )
{
BestAlignedAddr = AlignedAddr;
- BestPreviousBlock = PreviousBlock;
BestBlock = CurrentBlock;
break;
}
@@ -820,12 +814,10 @@
|| BestBlock->Size > CurrentBlock->Size )
{
BestAlignedAddr = AlignedAddr;
- BestPreviousBlock = PreviousBlock;
BestBlock = CurrentBlock;
}
}
- PreviousBlock = CurrentBlock;
CurrentBlock = CurrentBlock->NextFree;
}
@@ -876,7 +868,6 @@
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 @@
/*
* Create the new free block.
*/
- NextBlock = RFreeSplit ( pool, BestBlock, BlockSize );
+ RFreeSplit ( pool, BestBlock, BlockSize );
//ASSERT_SIZE ( NextBlock->Size );
}
/*
@@ -919,7 +910,9 @@
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 @@
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
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -2963,7 +2963,6 @@
{
ULONG i;
ULONG LastSegment;
- BOOLEAN Initialized;
PMM_SECTION_SEGMENT EffectiveSegment;
if (Flags & EXEFMT_LOAD_ASSUME_SEGMENTS_PAGE_ALIGNED)
@@ -2972,7 +2971,6 @@
return TRUE;
}
- Initialized = FALSE;
LastSegment = 0;
EffectiveSegment = &ImageSectionObject->Segments[LastSegment];
@@ -3711,7 +3709,6 @@
PROS_SECTION_OBJECT Section;
PEPROCESS Process;
KPROCESSOR_MODE PreviousMode;
- PMMSUPPORT AddressSpace;
NTSTATUS Status;
ULONG tmpProtect;
ACCESS_MASK DesiredAccess;
@@ -3787,8 +3784,6 @@
return(Status);
}
- AddressSpace = &Process->Vm;
-
/* Convert NT Protection Attr to Access Mask */
if (Protect == PAGE_READONLY)
{
@@ -4033,7 +4028,7 @@
}
MmUnlockSectionSegment(Segment);
ObDereferenceObject(Section);
- return(STATUS_SUCCESS);
+ return(Status);
}
/*
Modified: trunk/reactos/ntoskrnl/ob/obhandle.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obhandle.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/obhandle.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ob/obhandle.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -462,6 +462,7 @@
/* 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 @@
if (!ObCheckObjectAccess(Object,
AccessState,
TRUE,
- AccessMode,
+ ProbeMode,
&Status))
{
/* Access was denied, so fail */
Modified: trunk/reactos/ntoskrnl/ob/oblife.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/oblife.c?rev=4…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/oblife.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ob/oblife.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -107,6 +107,15 @@
/* 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
+
}
}
Modified: trunk/reactos/ntoskrnl/po/power.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/power.c?rev=48…
==============================================================================
--- trunk/reactos/ntoskrnl/po/power.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/po/power.c [iso-8859-1] Sat Sep 4 08:17:17 2010
@@ -370,7 +370,6 @@
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 @@
*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.