mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[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. svn path=/trunk/; revision=48692
This commit is contained in:
parent
93ae36ab99
commit
edfb344c53
28 changed files with 59 additions and 97 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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\\");
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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--;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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--;
|
||||
|
|
|
@ -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));
|
||||
|
||||
//
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue