mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +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;
|
current_entry = CacheSegmentLRUListHead.Flink;
|
||||||
while (current_entry != &CacheSegmentLRUListHead && Target > 0)
|
while (current_entry != &CacheSegmentLRUListHead && Target > 0)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
|
||||||
|
|
||||||
Status = STATUS_SUCCESS;
|
|
||||||
current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
|
current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
|
||||||
CacheSegmentLRUListEntry);
|
CacheSegmentLRUListEntry);
|
||||||
current_entry = current_entry->Flink;
|
current_entry = current_entry->Flink;
|
||||||
|
@ -332,7 +329,7 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed)
|
||||||
{
|
{
|
||||||
PFN_NUMBER Page;
|
PFN_NUMBER Page;
|
||||||
Page = (PFN_NUMBER)(MmGetPhysicalAddress((char*)current->BaseAddress + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT);
|
Page = (PFN_NUMBER)(MmGetPhysicalAddress((char*)current->BaseAddress + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT);
|
||||||
Status = MmPageOutPhysicalAddress(Page);
|
MmPageOutPhysicalAddress(Page);
|
||||||
}
|
}
|
||||||
KeAcquireGuardedMutex(&ViewLock);
|
KeAcquireGuardedMutex(&ViewLock);
|
||||||
KeAcquireSpinLock(¤t->Bcb->BcbLock, &oldIrql);
|
KeAcquireSpinLock(¤t->Bcb->BcbLock, &oldIrql);
|
||||||
|
@ -1022,7 +1019,6 @@ CcRosDeleteFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
|
||||||
{
|
{
|
||||||
PLIST_ENTRY current_entry;
|
PLIST_ENTRY current_entry;
|
||||||
PCACHE_SEGMENT current;
|
PCACHE_SEGMENT current;
|
||||||
NTSTATUS Status;
|
|
||||||
LIST_ENTRY FreeList;
|
LIST_ENTRY FreeList;
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
|
|
||||||
|
@ -1077,7 +1073,7 @@ CcRosDeleteFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
|
||||||
{
|
{
|
||||||
current_entry = RemoveTailList(&FreeList);
|
current_entry = RemoveTailList(&FreeList);
|
||||||
current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry);
|
current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry);
|
||||||
Status = CcRosInternalFreeCacheSegment(current);
|
CcRosInternalFreeCacheSegment(current);
|
||||||
}
|
}
|
||||||
ExFreeToNPagedLookasideList(&BcbLookasideList, Bcb);
|
ExFreeToNPagedLookasideList(&BcbLookasideList, Bcb);
|
||||||
KeAcquireGuardedMutex(&ViewLock);
|
KeAcquireGuardedMutex(&ViewLock);
|
||||||
|
|
|
@ -999,14 +999,9 @@ CmpBuildHashStackAndLookupCache(IN PCM_KEY_BODY ParseObject,
|
||||||
OUT PULONG OuterStackArray,
|
OUT PULONG OuterStackArray,
|
||||||
OUT PULONG *LockedKcbs)
|
OUT PULONG *LockedKcbs)
|
||||||
{
|
{
|
||||||
ULONG HashKeyCopy;
|
|
||||||
|
|
||||||
/* We don't lock anything for now */
|
/* We don't lock anything for now */
|
||||||
*LockedKcbs = NULL;
|
*LockedKcbs = NULL;
|
||||||
|
|
||||||
/* Make a copy of the hash key */
|
|
||||||
HashKeyCopy = (*Kcb)->ConvKey;
|
|
||||||
|
|
||||||
/* Calculate hash values */
|
/* Calculate hash values */
|
||||||
*TotalRemainingSubkeys = 0xBAADF00D;
|
*TotalRemainingSubkeys = 0xBAADF00D;
|
||||||
|
|
||||||
|
|
|
@ -1194,6 +1194,7 @@ CmpLoadHiveThread(IN PVOID StartContext)
|
||||||
if (CmHive->Hive.Cluster != ClusterSize) ASSERT(FALSE);
|
if (CmHive->Hive.Cluster != ClusterSize) ASSERT(FALSE);
|
||||||
|
|
||||||
/* Set the file size */
|
/* Set the file size */
|
||||||
|
DPRINT("FIXME: Should set file size: %lx\n", Length);
|
||||||
//if (!CmpFileSetSize((PHHIVE)CmHive, HFILE_TYPE_PRIMARY, Length, Length))
|
//if (!CmpFileSetSize((PHHIVE)CmHive, HFILE_TYPE_PRIMARY, Length, Length))
|
||||||
{
|
{
|
||||||
/* This shouldn't fail */
|
/* This shouldn't fail */
|
||||||
|
@ -1232,7 +1233,7 @@ CmpInitializeHiveList(IN USHORT Flag)
|
||||||
UNICODE_STRING TempName, FileName, RegName;
|
UNICODE_STRING TempName, FileName, RegName;
|
||||||
HANDLE Thread;
|
HANDLE Thread;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG FileStart, RegStart, i;
|
ULONG RegStart, i;
|
||||||
PSECURITY_DESCRIPTOR SecurityDescriptor;
|
PSECURITY_DESCRIPTOR SecurityDescriptor;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
@ -1247,7 +1248,6 @@ CmpInitializeHiveList(IN USHORT Flag)
|
||||||
CmpGetRegistryPath(ConfigPath);
|
CmpGetRegistryPath(ConfigPath);
|
||||||
RtlInitUnicodeString(&TempName, ConfigPath);
|
RtlInitUnicodeString(&TempName, ConfigPath);
|
||||||
RtlAppendStringToString((PSTRING)&FileName, (PSTRING)&TempName);
|
RtlAppendStringToString((PSTRING)&FileName, (PSTRING)&TempName);
|
||||||
FileStart = FileName.Length;
|
|
||||||
|
|
||||||
/* And build the registry root path */
|
/* And build the registry root path */
|
||||||
RtlInitUnicodeString(&TempName, L"\\REGISTRY\\");
|
RtlInitUnicodeString(&TempName, L"\\REGISTRY\\");
|
||||||
|
|
|
@ -340,7 +340,6 @@ CmpQueryKeyValueData(IN PCM_KEY_CONTROL_BLOCK Kcb,
|
||||||
OUT PULONG ResultLength,
|
OUT PULONG ResultLength,
|
||||||
OUT PNTSTATUS Status)
|
OUT PNTSTATUS Status)
|
||||||
{
|
{
|
||||||
PHHIVE Hive;
|
|
||||||
PKEY_VALUE_INFORMATION Info = (PKEY_VALUE_INFORMATION)KeyValueInformation;
|
PKEY_VALUE_INFORMATION Info = (PKEY_VALUE_INFORMATION)KeyValueInformation;
|
||||||
PCELL_DATA CellData;
|
PCELL_DATA CellData;
|
||||||
USHORT NameSize;
|
USHORT NameSize;
|
||||||
|
@ -350,8 +349,7 @@ CmpQueryKeyValueData(IN PCM_KEY_CONTROL_BLOCK Kcb,
|
||||||
HCELL_INDEX CellToRelease = HCELL_NIL;
|
HCELL_INDEX CellToRelease = HCELL_NIL;
|
||||||
VALUE_SEARCH_RETURN_TYPE Result = SearchSuccess;
|
VALUE_SEARCH_RETURN_TYPE Result = SearchSuccess;
|
||||||
|
|
||||||
/* Get the hive and cell data */
|
/* Get the value data */
|
||||||
Hive = Kcb->KeyHive;
|
|
||||||
CellData = (PCELL_DATA)ValueKey;
|
CellData = (PCELL_DATA)ValueKey;
|
||||||
|
|
||||||
/* Check if the value is compressed */
|
/* Check if the value is compressed */
|
||||||
|
|
|
@ -232,7 +232,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc
|
||||||
{
|
{
|
||||||
UNICODE_STRING KeyName, ValueName, Data, SectionName;
|
UNICODE_STRING KeyName, ValueName, Data, SectionName;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
ULONG HavePae, CacheSize, Length, TotalLength = 0, i, Disposition;
|
ULONG HavePae, Length, TotalLength = 0, i, Disposition;
|
||||||
SIZE_T ViewSize;
|
SIZE_T ViewSize;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
HANDLE KeyHandle, BiosHandle, SystemHandle, FpuHandle, SectionHandle;
|
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 */
|
/* Go back to user affinity */
|
||||||
KeRevertToUserAffinityThread();
|
KeRevertToUserAffinityThread();
|
||||||
|
|
||||||
|
|
|
@ -494,7 +494,6 @@ QSI_DEF(SystemProcessorInformation)
|
||||||
{
|
{
|
||||||
PSYSTEM_PROCESSOR_INFORMATION Spi
|
PSYSTEM_PROCESSOR_INFORMATION Spi
|
||||||
= (PSYSTEM_PROCESSOR_INFORMATION) Buffer;
|
= (PSYSTEM_PROCESSOR_INFORMATION) Buffer;
|
||||||
PKPRCB Prcb;
|
|
||||||
|
|
||||||
*ReqSize = sizeof(SYSTEM_PROCESSOR_INFORMATION);
|
*ReqSize = sizeof(SYSTEM_PROCESSOR_INFORMATION);
|
||||||
|
|
||||||
|
@ -503,7 +502,6 @@ QSI_DEF(SystemProcessorInformation)
|
||||||
{
|
{
|
||||||
return STATUS_INFO_LENGTH_MISMATCH;
|
return STATUS_INFO_LENGTH_MISMATCH;
|
||||||
}
|
}
|
||||||
Prcb = KeGetCurrentPrcb();
|
|
||||||
Spi->ProcessorArchitecture = KeProcessorArchitecture;
|
Spi->ProcessorArchitecture = KeProcessorArchitecture;
|
||||||
Spi->ProcessorLevel = KeProcessorLevel;
|
Spi->ProcessorLevel = KeProcessorLevel;
|
||||||
Spi->ProcessorRevision = KeProcessorRevision;
|
Spi->ProcessorRevision = KeProcessorRevision;
|
||||||
|
@ -931,7 +929,6 @@ QSI_DEF(SystemProcessorPerformanceInformation)
|
||||||
|
|
||||||
LONG i;
|
LONG i;
|
||||||
ULONG TotalTime;
|
ULONG TotalTime;
|
||||||
LARGE_INTEGER CurrentTime;
|
|
||||||
PKPRCB Prcb;
|
PKPRCB Prcb;
|
||||||
|
|
||||||
*ReqSize = KeNumberProcessors * sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION);
|
*ReqSize = KeNumberProcessors * sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION);
|
||||||
|
@ -942,7 +939,6 @@ QSI_DEF(SystemProcessorPerformanceInformation)
|
||||||
return STATUS_INFO_LENGTH_MISMATCH;
|
return STATUS_INFO_LENGTH_MISMATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentTime.QuadPart = KeQueryInterruptTime();
|
|
||||||
for (i = 0; i < KeNumberProcessors; i++)
|
for (i = 0; i < KeNumberProcessors; i++)
|
||||||
{
|
{
|
||||||
/* Get the PRCB on this processor */
|
/* Get the PRCB on this processor */
|
||||||
|
|
|
@ -79,6 +79,7 @@ XIPInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
|
|
||||||
/* FIXME: TODO */
|
/* FIXME: TODO */
|
||||||
DPRINT1("ReactOS does not yet support eXecute In Place boot technology\n");
|
DPRINT1("ReactOS does not yet support eXecute In Place boot technology\n");
|
||||||
|
DPRINT("%s MB requested (XIP = %s)\n", XipMegs, XipBoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -552,7 +552,7 @@ VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
DisplayBootBitmap(IN BOOLEAN SosMode)
|
DisplayBootBitmap(IN BOOLEAN SosMode)
|
||||||
{
|
{
|
||||||
PVOID Header, Band, Bar, Text, Screen;
|
PVOID Header, Band, Text, Screen;
|
||||||
ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;
|
ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;
|
||||||
UCHAR Buffer[64];
|
UCHAR Buffer[64];
|
||||||
|
|
||||||
|
@ -615,7 +615,7 @@ DisplayBootBitmap(IN BOOLEAN SosMode)
|
||||||
if (SharedUserData->NtProductType == NtProductWinNt)
|
if (SharedUserData->NtProductType == NtProductWinNt)
|
||||||
{
|
{
|
||||||
/* Workstation product, display appropriate status bar color */
|
/* Workstation product, display appropriate status bar color */
|
||||||
Bar = InbvGetResourceAddress(IDB_BAR_PRO);
|
InbvGetResourceAddress(IDB_BAR_PRO);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -637,7 +637,7 @@ DisplayBootBitmap(IN BOOLEAN SosMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Server product, display appropriate status bar color */
|
/* Server product, display appropriate status bar color */
|
||||||
Bar = InbvGetResourceAddress(IDB_BAR_SERVER);
|
InbvGetResourceAddress(IDB_BAR_SERVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure we had a logo */
|
/* Make sure we had a logo */
|
||||||
|
|
|
@ -715,7 +715,6 @@ LdrProcessDriverModule(PLDR_DATA_TABLE_ENTRY LdrEntry,
|
||||||
PLDR_DATA_TABLE_ENTRY *ModuleObject)
|
PLDR_DATA_TABLE_ENTRY *ModuleObject)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PLDR_DATA_TABLE_ENTRY NewEntry;
|
|
||||||
UNICODE_STRING BaseName, BaseDirectory;
|
UNICODE_STRING BaseName, BaseDirectory;
|
||||||
PLOAD_IMPORTS LoadedImports = (PVOID)-2;
|
PLOAD_IMPORTS LoadedImports = (PVOID)-2;
|
||||||
PCHAR MissingApiName, Buffer;
|
PCHAR MissingApiName, Buffer;
|
||||||
|
@ -763,8 +762,6 @@ LdrProcessDriverModule(PLDR_DATA_TABLE_ENTRY LdrEntry,
|
||||||
BaseDirectory.Length -= BaseName.Length;
|
BaseDirectory.Length -= BaseName.Length;
|
||||||
BaseDirectory.MaximumLength = BaseDirectory.Length;
|
BaseDirectory.MaximumLength = BaseDirectory.Length;
|
||||||
|
|
||||||
NewEntry = LdrEntry;
|
|
||||||
|
|
||||||
/* Resolve imports */
|
/* Resolve imports */
|
||||||
MissingApiName = Buffer;
|
MissingApiName = Buffer;
|
||||||
Status = MiResolveImageReferences(DriverBase,
|
Status = MiResolveImageReferences(DriverBase,
|
||||||
|
|
|
@ -604,13 +604,11 @@ RawSetInformation(IN PVCB Vcb,
|
||||||
IN PIO_STACK_LOCATION IoStackLocation)
|
IN PIO_STACK_LOCATION IoStackLocation)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_INVALID_DEVICE_REQUEST;
|
NTSTATUS Status = STATUS_INVALID_DEVICE_REQUEST;
|
||||||
PULONG Length;
|
|
||||||
PFILE_POSITION_INFORMATION Buffer;
|
PFILE_POSITION_INFORMATION Buffer;
|
||||||
PDEVICE_OBJECT DeviceObject;
|
PDEVICE_OBJECT DeviceObject;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Get information from the IRP */
|
/* Get information from the IRP */
|
||||||
Length = &IoStackLocation->Parameters.QueryFile.Length;
|
|
||||||
Buffer = Irp->AssociatedIrp.SystemBuffer;
|
Buffer = Irp->AssociatedIrp.SystemBuffer;
|
||||||
|
|
||||||
/* We only handle this request */
|
/* We only handle this request */
|
||||||
|
|
|
@ -799,10 +799,8 @@ PdoQueryCapabilities(
|
||||||
IN PIRP Irp,
|
IN PIRP Irp,
|
||||||
IN PIO_STACK_LOCATION IrpSp)
|
IN PIO_STACK_LOCATION IrpSp)
|
||||||
{
|
{
|
||||||
PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension;
|
|
||||||
PDEVICE_CAPABILITIES DeviceCapabilities;
|
PDEVICE_CAPABILITIES DeviceCapabilities;
|
||||||
|
|
||||||
DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
|
||||||
DeviceCapabilities = IrpSp->Parameters.DeviceCapabilities.Capabilities;
|
DeviceCapabilities = IrpSp->Parameters.DeviceCapabilities.Capabilities;
|
||||||
|
|
||||||
if (DeviceCapabilities->Version != 1)
|
if (DeviceCapabilities->Version != 1)
|
||||||
|
|
|
@ -3746,7 +3746,6 @@ OP_sI (bytemode, sizeflag)
|
||||||
int sizeflag;
|
int sizeflag;
|
||||||
{
|
{
|
||||||
bfd_signed_vma op;
|
bfd_signed_vma op;
|
||||||
bfd_signed_vma mask = -1;
|
|
||||||
|
|
||||||
switch (bytemode)
|
switch (bytemode)
|
||||||
{
|
{
|
||||||
|
@ -3755,7 +3754,6 @@ OP_sI (bytemode, sizeflag)
|
||||||
op = *codep++;
|
op = *codep++;
|
||||||
if ((op & 0x80) != 0)
|
if ((op & 0x80) != 0)
|
||||||
op -= 0x100;
|
op -= 0x100;
|
||||||
mask = 0xffffffff;
|
|
||||||
break;
|
break;
|
||||||
case v_mode:
|
case v_mode:
|
||||||
USED_REX (REX_MODE64);
|
USED_REX (REX_MODE64);
|
||||||
|
@ -3764,11 +3762,9 @@ OP_sI (bytemode, sizeflag)
|
||||||
else if (sizeflag & DFLAG)
|
else if (sizeflag & DFLAG)
|
||||||
{
|
{
|
||||||
op = get32s ();
|
op = get32s ();
|
||||||
mask = 0xffffffff;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mask = 0xffffffff;
|
|
||||||
op = get16 ();
|
op = get16 ();
|
||||||
if ((op & 0x8000) != 0)
|
if ((op & 0x8000) != 0)
|
||||||
op -= 0x10000;
|
op -= 0x10000;
|
||||||
|
@ -3777,7 +3773,6 @@ OP_sI (bytemode, sizeflag)
|
||||||
break;
|
break;
|
||||||
case w_mode:
|
case w_mode:
|
||||||
op = get16 ();
|
op = get16 ();
|
||||||
mask = 0xffffffff;
|
|
||||||
if ((op & 0x8000) != 0)
|
if ((op & 0x8000) != 0)
|
||||||
op -= 0x10000;
|
op -= 0x10000;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -790,7 +790,6 @@ KdbpCmdBackTrace(
|
||||||
ULONG Argc,
|
ULONG Argc,
|
||||||
PCHAR Argv[])
|
PCHAR Argv[])
|
||||||
{
|
{
|
||||||
ULONG Count;
|
|
||||||
ULONG ul;
|
ULONG ul;
|
||||||
ULONGLONG Result = 0;
|
ULONGLONG Result = 0;
|
||||||
ULONG_PTR Frame = KdbCurrentTrapFrame->Tf.Ebp;
|
ULONG_PTR Frame = KdbCurrentTrapFrame->Tf.Ebp;
|
||||||
|
@ -806,7 +805,6 @@ KdbpCmdBackTrace(
|
||||||
ul = strtoul(Argv[Argc-1], NULL, 0);
|
ul = strtoul(Argv[Argc-1], NULL, 0);
|
||||||
if (ul > 0)
|
if (ul > 0)
|
||||||
{
|
{
|
||||||
Count = ul;
|
|
||||||
Argc -= 2;
|
Argc -= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -815,7 +813,6 @@ KdbpCmdBackTrace(
|
||||||
ul = strtoul(Argv[Argc-1] + 1, NULL, 0);
|
ul = strtoul(Argv[Argc-1] + 1, NULL, 0);
|
||||||
if (ul > 0)
|
if (ul > 0)
|
||||||
{
|
{
|
||||||
Count = ul;
|
|
||||||
Argc--;
|
Argc--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,6 @@ KeSetEvent(IN PKEVENT Event,
|
||||||
{
|
{
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
LONG PreviousState;
|
LONG PreviousState;
|
||||||
PKWAIT_BLOCK WaitBlock;
|
|
||||||
PKTHREAD Thread;
|
PKTHREAD Thread;
|
||||||
ASSERT_EVENT(Event);
|
ASSERT_EVENT(Event);
|
||||||
ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL);
|
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.
|
* Check if this is an signaled notification event without an upcoming wait.
|
||||||
* In this case, we can immediately return TRUE, without locking.
|
* In this case, we can immediately return TRUE, without locking.
|
||||||
*/
|
*/
|
||||||
if ((Event->Header.Type == NotificationEvent) &&
|
if ((Event->Header.Type == EventNotificationObject) &&
|
||||||
(Event->Header.SignalState == 1) &&
|
(Event->Header.SignalState == 1) &&
|
||||||
!(Wait))
|
!(Wait))
|
||||||
{
|
{
|
||||||
|
@ -190,13 +189,8 @@ KeSetEvent(IN PKEVENT Event,
|
||||||
/* Check if the event just became signaled now, and it has waiters */
|
/* Check if the event just became signaled now, and it has waiters */
|
||||||
if (!(PreviousState) && !(IsListEmpty(&Event->Header.WaitListHead)))
|
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 */
|
/* Check the type of event */
|
||||||
if (Event->Header.Type == NotificationEvent)
|
if (Event->Header.Type == EventNotificationObject)
|
||||||
{
|
{
|
||||||
/* Unwait the thread */
|
/* Unwait the thread */
|
||||||
KxUnwaitThread(&Event->Header, Increment);
|
KxUnwaitThread(&Event->Header, Increment);
|
||||||
|
@ -237,7 +231,7 @@ KeSetEventBoostPriority(IN PKEVENT Event,
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
PKWAIT_BLOCK WaitBlock;
|
PKWAIT_BLOCK WaitBlock;
|
||||||
PKTHREAD Thread = KeGetCurrentThread(), WaitThread;
|
PKTHREAD Thread = KeGetCurrentThread(), WaitThread;
|
||||||
ASSERT(Event->Header.Type == SynchronizationEvent);
|
ASSERT(Event->Header.Type == EventSynchronizationObject);
|
||||||
ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL);
|
ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL);
|
||||||
|
|
||||||
/* Acquire Dispatcher Database Lock */
|
/* Acquire Dispatcher Database Lock */
|
||||||
|
|
|
@ -739,6 +739,7 @@ KiTrap07Handler(IN PKTRAP_FRAME TrapFrame)
|
||||||
NpxSaveArea = KiGetThreadNpxArea(NpxThread);
|
NpxSaveArea = KiGetThreadNpxArea(NpxThread);
|
||||||
|
|
||||||
/* Save FPU state */
|
/* Save FPU state */
|
||||||
|
DPRINT("FIXME: Save FPU state: %p\n", NpxSaveArea);
|
||||||
//Ke386SaveFpuState(NpxSaveArea);
|
//Ke386SaveFpuState(NpxSaveArea);
|
||||||
|
|
||||||
/* Update NPX state */
|
/* Update NPX state */
|
||||||
|
|
|
@ -158,7 +158,6 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
PMMPTE StartPde, EndPde, PointerPte, LastPte;
|
PMMPTE StartPde, EndPde, PointerPte, LastPte;
|
||||||
MMPTE TempPde, TempPte;
|
MMPTE TempPde, TempPte;
|
||||||
PVOID NonPagedPoolExpansionVa;
|
PVOID NonPagedPoolExpansionVa;
|
||||||
ULONG OldCount;
|
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
|
|
||||||
/* Check for kernel stack size that's too big */
|
/* 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!
|
// We PDE-aligned the nonpaged system start VA, so haul some extra PTEs!
|
||||||
//
|
//
|
||||||
PointerPte = MiAddressToPte(MmNonPagedSystemStart);
|
PointerPte = MiAddressToPte(MmNonPagedSystemStart);
|
||||||
OldCount = MmNumberOfSystemPtes;
|
|
||||||
MmNumberOfSystemPtes = MiAddressToPte(MmNonPagedPoolExpansionStart) -
|
MmNumberOfSystemPtes = MiAddressToPte(MmNonPagedPoolExpansionStart) -
|
||||||
PointerPte;
|
PointerPte;
|
||||||
MmNumberOfSystemPtes--;
|
MmNumberOfSystemPtes--;
|
||||||
|
|
|
@ -578,13 +578,11 @@ MmProbeAndLockPages(IN PMDL Mdl,
|
||||||
ULONG LockPages, TotalPages;
|
ULONG LockPages, TotalPages;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
PEPROCESS CurrentProcess;
|
PEPROCESS CurrentProcess;
|
||||||
PETHREAD Thread;
|
|
||||||
PMMSUPPORT AddressSpace;
|
PMMSUPPORT AddressSpace;
|
||||||
NTSTATUS ProbeStatus;
|
NTSTATUS ProbeStatus;
|
||||||
PMMPTE PointerPte, LastPte;
|
PMMPTE PointerPte, LastPte;
|
||||||
PMMPDE PointerPde;
|
PMMPDE PointerPde;
|
||||||
PFN_NUMBER PageFrameIndex;
|
PFN_NUMBER PageFrameIndex;
|
||||||
PMMPFN Pfn1;
|
|
||||||
BOOLEAN UsePfnLock;
|
BOOLEAN UsePfnLock;
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
DPRINT("Probing MDL: %p\n", Mdl);
|
DPRINT("Probing MDL: %p\n", Mdl);
|
||||||
|
@ -616,9 +614,8 @@ MmProbeAndLockPages(IN PMDL Mdl,
|
||||||
ASSERT(LockPages != 0);
|
ASSERT(LockPages != 0);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the thread and process
|
// Get theprocess
|
||||||
//
|
//
|
||||||
Thread = PsGetCurrentThread();
|
|
||||||
if (Address <= MM_HIGHEST_USER_ADDRESS)
|
if (Address <= MM_HIGHEST_USER_ADDRESS)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
@ -962,10 +959,6 @@ MmProbeAndLockPages(IN PMDL Mdl,
|
||||||
PageFrameIndex = PFN_FROM_PTE(PointerPte);
|
PageFrameIndex = PFN_FROM_PTE(PointerPte);
|
||||||
if (PageFrameIndex <= MmHighestPhysicalPage)
|
if (PageFrameIndex <= MmHighestPhysicalPage)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
// Get the PFN entry
|
|
||||||
//
|
|
||||||
Pfn1 = MiGetPfnEntry(PageFrameIndex);
|
|
||||||
ASSERT((CurrentProcess == NULL) || (UsePfnLock == FALSE));
|
ASSERT((CurrentProcess == NULL) || (UsePfnLock == FALSE));
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -686,6 +686,10 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||||
ASSERT(Pfn1->u3.e1.StartOfAllocation == 0);
|
ASSERT(Pfn1->u3.e1.StartOfAllocation == 0);
|
||||||
Pfn1->u3.e1.StartOfAllocation = 1;
|
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
|
// 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 = MiGetPfnEntry(StartPte->u.Hard.PageFrameNumber);
|
||||||
Pfn1->u3.e1.StartOfAllocation = 1;
|
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
|
// Release the PFN and nonpaged pool lock
|
||||||
//
|
//
|
||||||
|
|
|
@ -389,7 +389,6 @@ MmGrowKernelStackEx(IN PVOID StackPointer,
|
||||||
{
|
{
|
||||||
PKTHREAD Thread = KeGetCurrentThread();
|
PKTHREAD Thread = KeGetCurrentThread();
|
||||||
PMMPTE LimitPte, NewLimitPte, LastPte;
|
PMMPTE LimitPte, NewLimitPte, LastPte;
|
||||||
PFN_NUMBER StackPages;
|
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
MMPTE TempPte, InvalidPte;
|
MMPTE TempPte, InvalidPte;
|
||||||
PFN_NUMBER PageFrameIndex;
|
PFN_NUMBER PageFrameIndex;
|
||||||
|
@ -430,7 +429,6 @@ MmGrowKernelStackEx(IN PVOID StackPointer,
|
||||||
// Calculate the number of new pages
|
// Calculate the number of new pages
|
||||||
//
|
//
|
||||||
LimitPte--;
|
LimitPte--;
|
||||||
StackPages = (LimitPte - NewLimitPte + 1);
|
|
||||||
|
|
||||||
/* Setup the temporary invalid PTE */
|
/* Setup the temporary invalid PTE */
|
||||||
MI_MAKE_SOFTWARE_PTE(&InvalidPte, MM_NOACCESS);
|
MI_MAKE_SOFTWARE_PTE(&InvalidPte, MM_NOACCESS);
|
||||||
|
|
|
@ -559,7 +559,20 @@ MiUpdateThunks(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
ULONG_PTR OldBaseTop, Delta;
|
ULONG_PTR OldBaseTop, Delta;
|
||||||
PLDR_DATA_TABLE_ENTRY LdrEntry;
|
PLDR_DATA_TABLE_ENTRY LdrEntry;
|
||||||
PLIST_ENTRY NextEntry;
|
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;
|
PULONG_PTR ImageThunk;
|
||||||
PIMAGE_IMPORT_DESCRIPTOR ImportDescriptor;
|
PIMAGE_IMPORT_DESCRIPTOR ImportDescriptor;
|
||||||
|
|
||||||
|
@ -599,7 +612,6 @@ MiUpdateThunks(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* Get the import table */
|
/* Get the import table */
|
||||||
i = ImportSize;
|
|
||||||
ImportDescriptor = RtlImageDirectoryEntryToData(LdrEntry->DllBase,
|
ImportDescriptor = RtlImageDirectoryEntryToData(LdrEntry->DllBase,
|
||||||
TRUE,
|
TRUE,
|
||||||
IMAGE_DIRECTORY_ENTRY_IMPORT,
|
IMAGE_DIRECTORY_ENTRY_IMPORT,
|
||||||
|
|
|
@ -81,6 +81,7 @@ MiDeleteSystemPageableVm(IN PMMPTE PointerPte,
|
||||||
MiDecrementShareCount(Pfn1, PageFrameIndex);
|
MiDecrementShareCount(Pfn1, PageFrameIndex);
|
||||||
|
|
||||||
/* Decrement the page table too */
|
/* 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
|
#if 0 // ARM3: Dont't trust this yet
|
||||||
MiDecrementShareCount(Pfn2, PageTableIndex);
|
MiDecrementShareCount(Pfn2, PageTableIndex);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -180,6 +180,9 @@ MiAllocatePagesForMdl(IN PHYSICAL_ADDRESS LowAddress,
|
||||||
if (BYTE_OFFSET(SkipBytes.LowPart)) return NULL;
|
if (BYTE_OFFSET(SkipBytes.LowPart)) return NULL;
|
||||||
SkipPages = (PFN_NUMBER)(SkipBytes.QuadPart >> PAGE_SHIFT);
|
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
|
// Now compute the number of pages the MDL will cover
|
||||||
//
|
//
|
||||||
|
|
|
@ -653,8 +653,6 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process,
|
||||||
ULONG oldPdeOffset, PdeOffset;
|
ULONG oldPdeOffset, PdeOffset;
|
||||||
PULONG Pt = NULL;
|
PULONG Pt = NULL;
|
||||||
ULONG Pte;
|
ULONG Pte;
|
||||||
BOOLEAN NoExecute = FALSE;
|
|
||||||
|
|
||||||
DPRINT("MmCreateVirtualMappingUnsafe(%x, %x, %x, %x (%x), %d)\n",
|
DPRINT("MmCreateVirtualMappingUnsafe(%x, %x, %x, %x (%x), %d)\n",
|
||||||
Process, Address, flProtect, Pages, *Pages, PageCount);
|
Process, Address, flProtect, Pages, *Pages, PageCount);
|
||||||
|
|
||||||
|
@ -689,10 +687,6 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process,
|
||||||
}
|
}
|
||||||
|
|
||||||
Attributes = ProtectToPTE(flProtect);
|
Attributes = ProtectToPTE(flProtect);
|
||||||
if (Attributes & 0x80000000)
|
|
||||||
{
|
|
||||||
NoExecute = TRUE;
|
|
||||||
}
|
|
||||||
Attributes &= 0xfff;
|
Attributes &= 0xfff;
|
||||||
if (Address >= MmSystemRangeStart)
|
if (Address >= MmSystemRangeStart)
|
||||||
{
|
{
|
||||||
|
@ -826,7 +820,6 @@ NTAPI
|
||||||
MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect)
|
MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect)
|
||||||
{
|
{
|
||||||
ULONG Attributes = 0;
|
ULONG Attributes = 0;
|
||||||
BOOLEAN NoExecute = FALSE;
|
|
||||||
PULONG Pt;
|
PULONG Pt;
|
||||||
|
|
||||||
DPRINT("MmSetPageProtect(Process %x Address %x flProtect %x)\n",
|
DPRINT("MmSetPageProtect(Process %x Address %x flProtect %x)\n",
|
||||||
|
@ -834,10 +827,6 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect)
|
||||||
|
|
||||||
Attributes = ProtectToPTE(flProtect);
|
Attributes = ProtectToPTE(flProtect);
|
||||||
|
|
||||||
if (Attributes & 0x80000000)
|
|
||||||
{
|
|
||||||
NoExecute = TRUE;
|
|
||||||
}
|
|
||||||
Attributes &= 0xfff;
|
Attributes &= 0xfff;
|
||||||
if (Address >= MmSystemRangeStart)
|
if (Address >= MmSystemRangeStart)
|
||||||
{
|
{
|
||||||
|
|
|
@ -719,10 +719,7 @@ RPoolAlloc ( PR_POOL pool, rulong NumberOfBytes, rulong Tag, rulong align )
|
||||||
{
|
{
|
||||||
PR_USED NewBlock;
|
PR_USED NewBlock;
|
||||||
PR_FREE BestBlock,
|
PR_FREE BestBlock,
|
||||||
NextBlock,
|
CurrentBlock;
|
||||||
PreviousBlock,
|
|
||||||
BestPreviousBlock,
|
|
||||||
CurrentBlock;
|
|
||||||
void* BestAlignedAddr;
|
void* BestAlignedAddr;
|
||||||
int que,
|
int que,
|
||||||
queBytes = NumberOfBytes;
|
queBytes = NumberOfBytes;
|
||||||
|
@ -785,8 +782,6 @@ try_again:
|
||||||
*/
|
*/
|
||||||
BestBlock = NULL;
|
BestBlock = NULL;
|
||||||
Alignment = pool->Alignments[align];
|
Alignment = pool->Alignments[align];
|
||||||
PreviousBlock = NULL;
|
|
||||||
BestPreviousBlock = NULL,
|
|
||||||
CurrentBlock = pool->FirstFree;
|
CurrentBlock = pool->FirstFree;
|
||||||
BestAlignedAddr = NULL;
|
BestAlignedAddr = NULL;
|
||||||
|
|
||||||
|
@ -802,7 +797,6 @@ try_again:
|
||||||
if ( Addr == AlignedAddr )
|
if ( Addr == AlignedAddr )
|
||||||
{
|
{
|
||||||
BestAlignedAddr = AlignedAddr;
|
BestAlignedAddr = AlignedAddr;
|
||||||
BestPreviousBlock = PreviousBlock;
|
|
||||||
BestBlock = CurrentBlock;
|
BestBlock = CurrentBlock;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -820,12 +814,10 @@ try_again:
|
||||||
|| BestBlock->Size > CurrentBlock->Size )
|
|| BestBlock->Size > CurrentBlock->Size )
|
||||||
{
|
{
|
||||||
BestAlignedAddr = AlignedAddr;
|
BestAlignedAddr = AlignedAddr;
|
||||||
BestPreviousBlock = PreviousBlock;
|
|
||||||
BestBlock = CurrentBlock;
|
BestBlock = CurrentBlock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PreviousBlock = CurrentBlock;
|
|
||||||
CurrentBlock = CurrentBlock->NextFree;
|
CurrentBlock = CurrentBlock->NextFree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -876,7 +868,6 @@ try_again:
|
||||||
NewFreeBlock, NewFreeBlock->Size, BestBlock->Size, BestBlock->NextFree );*/
|
NewFreeBlock, NewFreeBlock->Size, BestBlock->Size, BestBlock->NextFree );*/
|
||||||
|
|
||||||
/* we want the following code to use our size-aligned block */
|
/* we want the following code to use our size-aligned block */
|
||||||
BestPreviousBlock = BestBlock;
|
|
||||||
BestBlock = NewFreeBlock;
|
BestBlock = NewFreeBlock;
|
||||||
|
|
||||||
//VerifyPagedPool();
|
//VerifyPagedPool();
|
||||||
|
@ -893,7 +884,7 @@ try_again:
|
||||||
/*
|
/*
|
||||||
* Create the new free block.
|
* Create the new free block.
|
||||||
*/
|
*/
|
||||||
NextBlock = RFreeSplit ( pool, BestBlock, BlockSize );
|
RFreeSplit ( pool, BestBlock, BlockSize );
|
||||||
//ASSERT_SIZE ( NextBlock->Size );
|
//ASSERT_SIZE ( NextBlock->Size );
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -919,7 +910,9 @@ static void
|
||||||
RPoolFree ( PR_POOL pool, void* Addr )
|
RPoolFree ( PR_POOL pool, void* Addr )
|
||||||
{
|
{
|
||||||
PR_USED UsedBlock;
|
PR_USED UsedBlock;
|
||||||
|
#ifndef R_RZ
|
||||||
rulong UsedSize;
|
rulong UsedSize;
|
||||||
|
#endif
|
||||||
PR_FREE FreeBlock;
|
PR_FREE FreeBlock;
|
||||||
rulong UserSize;
|
rulong UserSize;
|
||||||
int que;
|
int que;
|
||||||
|
@ -936,11 +929,11 @@ RPoolFree ( PR_POOL pool, void* Addr )
|
||||||
R_ASSERT_PTR(pool,Addr);
|
R_ASSERT_PTR(pool,Addr);
|
||||||
|
|
||||||
UsedBlock = RBodyToHdr(Addr);
|
UsedBlock = RBodyToHdr(Addr);
|
||||||
UsedSize = UsedBlock->Size;
|
|
||||||
FreeBlock = (PR_FREE)UsedBlock;
|
FreeBlock = (PR_FREE)UsedBlock;
|
||||||
#if R_RZ
|
#if R_RZ
|
||||||
UserSize = UsedBlock->UserSize;
|
UserSize = UsedBlock->UserSize;
|
||||||
#else
|
#else
|
||||||
|
UsedSize = UsedBlock->Size;
|
||||||
UserSize = UsedSize - sizeof(R_USED) - 2*R_RZ;
|
UserSize = UsedSize - sizeof(R_USED) - 2*R_RZ;
|
||||||
#endif//R_RZ
|
#endif//R_RZ
|
||||||
|
|
||||||
|
|
|
@ -2963,7 +2963,6 @@ MmspPageAlignSegments
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
ULONG LastSegment;
|
ULONG LastSegment;
|
||||||
BOOLEAN Initialized;
|
|
||||||
PMM_SECTION_SEGMENT EffectiveSegment;
|
PMM_SECTION_SEGMENT EffectiveSegment;
|
||||||
|
|
||||||
if (Flags & EXEFMT_LOAD_ASSUME_SEGMENTS_PAGE_ALIGNED)
|
if (Flags & EXEFMT_LOAD_ASSUME_SEGMENTS_PAGE_ALIGNED)
|
||||||
|
@ -2972,7 +2971,6 @@ MmspPageAlignSegments
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Initialized = FALSE;
|
|
||||||
LastSegment = 0;
|
LastSegment = 0;
|
||||||
EffectiveSegment = &ImageSectionObject->Segments[LastSegment];
|
EffectiveSegment = &ImageSectionObject->Segments[LastSegment];
|
||||||
|
|
||||||
|
@ -3711,7 +3709,6 @@ NtMapViewOfSection(IN HANDLE SectionHandle,
|
||||||
PROS_SECTION_OBJECT Section;
|
PROS_SECTION_OBJECT Section;
|
||||||
PEPROCESS Process;
|
PEPROCESS Process;
|
||||||
KPROCESSOR_MODE PreviousMode;
|
KPROCESSOR_MODE PreviousMode;
|
||||||
PMMSUPPORT AddressSpace;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG tmpProtect;
|
ULONG tmpProtect;
|
||||||
ACCESS_MASK DesiredAccess;
|
ACCESS_MASK DesiredAccess;
|
||||||
|
@ -3787,8 +3784,6 @@ NtMapViewOfSection(IN HANDLE SectionHandle,
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
AddressSpace = &Process->Vm;
|
|
||||||
|
|
||||||
/* Convert NT Protection Attr to Access Mask */
|
/* Convert NT Protection Attr to Access Mask */
|
||||||
if (Protect == PAGE_READONLY)
|
if (Protect == PAGE_READONLY)
|
||||||
{
|
{
|
||||||
|
@ -4033,7 +4028,7 @@ MmUnmapViewOfSegment(PMMSUPPORT AddressSpace,
|
||||||
}
|
}
|
||||||
MmUnlockSectionSegment(Segment);
|
MmUnlockSectionSegment(Segment);
|
||||||
ObDereferenceObject(Section);
|
ObDereferenceObject(Section);
|
||||||
return(STATUS_SUCCESS);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -462,6 +462,7 @@ ObpChargeQuotaForObject(IN POBJECT_HEADER ObjectHeader,
|
||||||
|
|
||||||
/* Charge the quota */
|
/* Charge the quota */
|
||||||
ObjectHeader->QuotaBlockCharged = (PVOID)1;
|
ObjectHeader->QuotaBlockCharged = (PVOID)1;
|
||||||
|
DPRINT("FIXME: Should charge: %lx %lx\n", PagedPoolCharge, NonPagedPoolCharge);
|
||||||
#if 0
|
#if 0
|
||||||
PsChargeSharedPoolQuota(PsGetCurrentProcess(),
|
PsChargeSharedPoolQuota(PsGetCurrentProcess(),
|
||||||
PagedPoolCharge,
|
PagedPoolCharge,
|
||||||
|
@ -898,7 +899,7 @@ ObpIncrementHandleCount(IN PVOID Object,
|
||||||
if (!ObCheckObjectAccess(Object,
|
if (!ObCheckObjectAccess(Object,
|
||||||
AccessState,
|
AccessState,
|
||||||
TRUE,
|
TRUE,
|
||||||
AccessMode,
|
ProbeMode,
|
||||||
&Status))
|
&Status))
|
||||||
{
|
{
|
||||||
/* Access was denied, so fail */
|
/* Access was denied, so fail */
|
||||||
|
|
|
@ -107,6 +107,15 @@ ObpDeallocateObject(IN PVOID Object)
|
||||||
/* Add the SD charge too */
|
/* Add the SD charge too */
|
||||||
if (Header->Flags & OB_FLAG_SECURITY) PagedPoolCharge += 2048;
|
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;
|
PIO_STACK_LOCATION Stack;
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
PREQUEST_POWER_ITEM RequestPowerItem;
|
PREQUEST_POWER_ITEM RequestPowerItem;
|
||||||
NTSTATUS Status;
|
|
||||||
|
|
||||||
if (MinorFunction != IRP_MN_QUERY_POWER
|
if (MinorFunction != IRP_MN_QUERY_POWER
|
||||||
&& MinorFunction != IRP_MN_SET_POWER
|
&& MinorFunction != IRP_MN_SET_POWER
|
||||||
|
@ -419,7 +418,7 @@ PoRequestPowerIrp(IN PDEVICE_OBJECT DeviceObject,
|
||||||
*pIrp = Irp;
|
*pIrp = Irp;
|
||||||
|
|
||||||
IoSetCompletionRoutine(Irp, PopRequestPowerIrpCompletion, RequestPowerItem, TRUE, TRUE, TRUE);
|
IoSetCompletionRoutine(Irp, PopRequestPowerIrpCompletion, RequestPowerItem, TRUE, TRUE, TRUE);
|
||||||
Status = IoCallDriver(TopDeviceObject, Irp);
|
IoCallDriver(TopDeviceObject, Irp);
|
||||||
|
|
||||||
/* Always return STATUS_PENDING. The completion routine
|
/* Always return STATUS_PENDING. The completion routine
|
||||||
* will call CompletionFunction and complete the Irp.
|
* will call CompletionFunction and complete the Irp.
|
||||||
|
|
Loading…
Reference in a new issue