mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 04:35:53 +00:00
[NTOSKRNL]
Some misc fixes to make kernel compile warning-free with /W3. Also fix a bug that completely broke the ProcessWx86Information case for NtQueryInformationProcess by missing to reference/dereference and acquiring the specified process' EPROCESS. svn path=/trunk/; revision=55815
This commit is contained in:
parent
26a8d7fa89
commit
4cb002ee80
7 changed files with 34 additions and 18 deletions
|
@ -737,7 +737,9 @@ IoGetDeviceInterfaces(IN CONST GUID *InterfaceClassGuid,
|
||||||
{
|
{
|
||||||
PWSTR NewBuffer;
|
PWSTR NewBuffer;
|
||||||
ReturnBuffer.MaximumLength = (USHORT)max(ReturnBuffer.MaximumLength * 2,
|
ReturnBuffer.MaximumLength = (USHORT)max(ReturnBuffer.MaximumLength * 2,
|
||||||
ReturnBuffer.Length + KeyName.Length + 2 * sizeof(WCHAR));
|
(USHORT)(ReturnBuffer.Length +
|
||||||
|
KeyName.Length +
|
||||||
|
2 * sizeof(WCHAR)));
|
||||||
NewBuffer = ExAllocatePool(PagedPool, ReturnBuffer.MaximumLength);
|
NewBuffer = ExAllocatePool(PagedPool, ReturnBuffer.MaximumLength);
|
||||||
if (!NewBuffer)
|
if (!NewBuffer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1409,8 +1409,8 @@ IoVolumeDeviceToDosName(IN PVOID VolumeDeviceObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set output string */
|
/* Set output string */
|
||||||
DosName->Length = VolumePathPtr->MultiSzLength;
|
DosName->Length = (USHORT)VolumePathPtr->MultiSzLength;
|
||||||
DosName->MaximumLength = VolumePathPtr->MultiSzLength + sizeof(UNICODE_NULL);
|
DosName->MaximumLength = (USHORT)VolumePathPtr->MultiSzLength + sizeof(UNICODE_NULL);
|
||||||
/* Our MOUNTMGR_VOLUME_PATHS will be used as output buffer */
|
/* Our MOUNTMGR_VOLUME_PATHS will be used as output buffer */
|
||||||
DosName->Buffer = (PWSTR)VolumePathPtr;
|
DosName->Buffer = (PWSTR)VolumePathPtr;
|
||||||
/* Move name at the begin, RtlMoveMemory is OK with overlapping */
|
/* Move name at the begin, RtlMoveMemory is OK with overlapping */
|
||||||
|
|
|
@ -199,7 +199,7 @@ IopInstallCriticalDevice(PDEVICE_NODE DeviceNode)
|
||||||
|
|
||||||
while (*IdBuffer)
|
while (*IdBuffer)
|
||||||
{
|
{
|
||||||
ULONG StringLength = (ULONG)wcslen(IdBuffer) + 1, Index;
|
USHORT StringLength = (USHORT)wcslen(IdBuffer) + 1, Index;
|
||||||
|
|
||||||
IopFixupDeviceId(IdBuffer);
|
IopFixupDeviceId(IdBuffer);
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ IopInstallCriticalDevice(PDEVICE_NODE DeviceNode)
|
||||||
ChildIdNameU.Buffer = IdBuffer;
|
ChildIdNameU.Buffer = IdBuffer;
|
||||||
ChildIdNameU.MaximumLength = ChildIdNameU.Length = (StringLength - 1) * sizeof(WCHAR);
|
ChildIdNameU.MaximumLength = ChildIdNameU.Length = (StringLength - 1) * sizeof(WCHAR);
|
||||||
RegKeyNameU.Buffer = BasicInfo->Name;
|
RegKeyNameU.Buffer = BasicInfo->Name;
|
||||||
RegKeyNameU.MaximumLength = RegKeyNameU.Length = BasicInfo->NameLength;
|
RegKeyNameU.MaximumLength = RegKeyNameU.Length = (USHORT)BasicInfo->NameLength;
|
||||||
|
|
||||||
if (RtlEqualUnicodeString(&ChildIdNameU, &RegKeyNameU, TRUE))
|
if (RtlEqualUnicodeString(&ChildIdNameU, &RegKeyNameU, TRUE))
|
||||||
{
|
{
|
||||||
|
|
|
@ -138,7 +138,7 @@ ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
MiTrimMemoryConsumer(ULONG Consumer, ULONG InitialTarget)
|
MiTrimMemoryConsumer(ULONG Consumer, ULONG InitialTarget)
|
||||||
{
|
{
|
||||||
LONG Target = InitialTarget;
|
ULONG Target = InitialTarget;
|
||||||
ULONG NrFreedPages = 0;
|
ULONG NrFreedPages = 0;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,7 @@ MiSynchronizeSystemPde(PMMPDE PointerPde)
|
||||||
KeMemoryBarrierWithoutFence();
|
KeMemoryBarrierWithoutFence();
|
||||||
|
|
||||||
/* Return, if we had success */
|
/* Return, if we had success */
|
||||||
return (BOOLEAN)SystemPde.u.Hard.Valid;
|
return SystemPde.u.Hard.Valid != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
@ -549,7 +549,7 @@ Mmi386MakeKernelPageTableGlobal(PVOID Address)
|
||||||
{
|
{
|
||||||
if(!MiSynchronizeSystemPde(PointerPde))
|
if(!MiSynchronizeSystemPde(PointerPde))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
return PointerPte->u.Hard.Valid;
|
return (BOOLEAN)PointerPte->u.Hard.Valid;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -262,7 +262,7 @@ MiDbgDumpAddressSpace(VOID)
|
||||||
DPRINT1(" 0x%p - 0x%p\t%s\n",
|
DPRINT1(" 0x%p - 0x%p\t%s\n",
|
||||||
MmNonPagedPoolStart,
|
MmNonPagedPoolStart,
|
||||||
(ULONG_PTR)MmNonPagedPoolStart + MmSizeOfNonPagedPoolInBytes,
|
(ULONG_PTR)MmNonPagedPoolStart + MmSizeOfNonPagedPoolInBytes,
|
||||||
"ARM³ Non Paged Pool");
|
"ARM3 Non Paged Pool");
|
||||||
DPRINT1(" 0x%p - 0x%p\t%s\n",
|
DPRINT1(" 0x%p - 0x%p\t%s\n",
|
||||||
MiSystemViewStart,
|
MiSystemViewStart,
|
||||||
(ULONG_PTR)MiSystemViewStart + MmSystemViewSize,
|
(ULONG_PTR)MiSystemViewStart + MmSystemViewSize,
|
||||||
|
@ -283,7 +283,7 @@ MiDbgDumpAddressSpace(VOID)
|
||||||
DPRINT1(" 0x%p - 0x%p\t%s\n",
|
DPRINT1(" 0x%p - 0x%p\t%s\n",
|
||||||
MmPagedPoolStart,
|
MmPagedPoolStart,
|
||||||
(ULONG_PTR)MmPagedPoolStart + MmSizeOfPagedPoolInBytes,
|
(ULONG_PTR)MmPagedPoolStart + MmSizeOfPagedPoolInBytes,
|
||||||
"ARM³ Paged Pool");
|
"ARM3 Paged Pool");
|
||||||
DPRINT1(" 0x%p - 0x%p\t%s\n",
|
DPRINT1(" 0x%p - 0x%p\t%s\n",
|
||||||
MmNonPagedSystemStart, MmNonPagedPoolExpansionStart,
|
MmNonPagedSystemStart, MmNonPagedPoolExpansionStart,
|
||||||
"System PTE Space");
|
"System PTE Space");
|
||||||
|
|
|
@ -855,7 +855,7 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle,
|
||||||
/* Protect write in SEH */
|
/* Protect write in SEH */
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
/* Return the count of handles */
|
/* Return debug port's handle */
|
||||||
*(PHANDLE)ProcessInformation = DebugPort;
|
*(PHANDLE)ProcessInformation = DebugPort;
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
@ -887,7 +887,7 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle,
|
||||||
/* Protect write in SEH */
|
/* Protect write in SEH */
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
/* Return the count of handles */
|
/* Return FALSE -- we don't support this */
|
||||||
*(PULONG)ProcessInformation = FALSE;
|
*(PULONG)ProcessInformation = FALSE;
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
@ -908,8 +908,14 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Indicate success */
|
/* Reference the process */
|
||||||
Status = STATUS_SUCCESS;
|
Status = ObReferenceObjectByHandle(ProcessHandle,
|
||||||
|
PROCESS_QUERY_INFORMATION,
|
||||||
|
PsProcessType,
|
||||||
|
PreviousMode,
|
||||||
|
(PVOID*)&Process,
|
||||||
|
NULL);
|
||||||
|
if (!NT_SUCCESS(Status)) break;
|
||||||
|
|
||||||
/* Protect write in SEH */
|
/* Protect write in SEH */
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
|
@ -923,6 +929,9 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle,
|
||||||
Status = _SEH2_GetExceptionCode();
|
Status = _SEH2_GetExceptionCode();
|
||||||
}
|
}
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
|
|
||||||
|
/* Dereference the process */
|
||||||
|
ObDereferenceObject(Process);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ProcessWow64Information:
|
case ProcessWow64Information:
|
||||||
|
@ -1067,8 +1076,11 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
||||||
PVOID ExceptionPort;
|
PVOID ExceptionPort;
|
||||||
ULONG Break;
|
ULONG Break;
|
||||||
KAFFINITY ValidAffinity, Affinity = 0;
|
KAFFINITY ValidAffinity, Affinity = 0;
|
||||||
ULONG DefaultHardErrorMode = 0, BasePriority = 0, MemoryPriority = 0;
|
KPRIORITY BasePriority = 0;
|
||||||
ULONG DisableBoost = 0, DebugFlags = 0, EnableFixup = 0, Boost = 0;
|
UCHAR MemoryPriority = 0;
|
||||||
|
BOOLEAN DisableBoost = 0;
|
||||||
|
ULONG DefaultHardErrorMode = 0;
|
||||||
|
ULONG DebugFlags = 0, EnableFixup = 0, Boost = 0;
|
||||||
ULONG NoExecute = 0, VdmPower = 0;
|
ULONG NoExecute = 0, VdmPower = 0;
|
||||||
BOOLEAN HasPrivilege;
|
BOOLEAN HasPrivilege;
|
||||||
PLIST_ENTRY Next;
|
PLIST_ENTRY Next;
|
||||||
|
@ -1448,7 +1460,7 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
||||||
/* Enter SEH for direct buffer read */
|
/* Enter SEH for direct buffer read */
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
BasePriority = *(PULONG)ProcessInformation;
|
BasePriority = *(KPRIORITY*)ProcessInformation;
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
|
@ -1674,7 +1686,7 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
||||||
/* Enter SEH for direct buffer read */
|
/* Enter SEH for direct buffer read */
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
DisableBoost = *(PULONG)ProcessInformation;
|
DisableBoost = *(PBOOLEAN)ProcessInformation;
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
|
@ -1814,6 +1826,8 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
||||||
/* Only supported on x86 */
|
/* Only supported on x86 */
|
||||||
#if defined (_X86_)
|
#if defined (_X86_)
|
||||||
Ke386SetIOPL();
|
Ke386SetIOPL();
|
||||||
|
#else
|
||||||
|
Status = STATUS_NOT_IMPLEMENTED;
|
||||||
#endif
|
#endif
|
||||||
/* Done */
|
/* Done */
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue