diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index 9c238b8802d..bb04e18b083 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -1,4 +1,4 @@ -/* $Id: sysinfo.c,v 1.37 2004/06/23 21:01:27 ion Exp $ +/* $Id: sysinfo.c,v 1.38 2004/07/16 19:49:15 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -497,7 +497,7 @@ QSI_DEF(SystemPerformanceInformation) QSI_DEF(SystemTimeOfDayInformation) { LARGE_INTEGER CurrentTime; - + PSYSTEM_TIMEOFDAY_INFORMATION Sti = (PSYSTEM_TIMEOFDAY_INFORMATION) Buffer; @@ -593,24 +593,24 @@ QSI_DEF(SystemProcessInformation) SpiCur->BasePriority = pr->Pcb.BasePriority; SpiCur->ProcessId = pr->UniqueProcessId; SpiCur->InheritedFromProcessId = (DWORD)(pr->InheritedFromUniqueProcessId); - SpiCur->HandleCount = ObpGetHandleCountbyHandleTable(&pr->HandleTable); + SpiCur->HandleCount = ObpGetHandleCountByHandleTable(&pr->HandleTable); SpiCur->VmCounters.PeakVirtualSize = pr->PeakVirtualSize; SpiCur->VmCounters.VirtualSize = pr->VirtualSize.QuadPart; SpiCur->VmCounters.PageFaultCount = pr->LastFaultCount; SpiCur->VmCounters.PeakWorkingSetSize = pr->Vm.PeakWorkingSetSize; // Is this right using ->Vm. here ? SpiCur->VmCounters.WorkingSetSize = pr->Vm.WorkingSetSize; // Is this right using ->Vm. here ? SpiCur->VmCounters.QuotaPeakPagedPoolUsage = - pr->QuotaPeakPoolUsage[0]; + pr->QuotaPeakPoolUsage[0]; SpiCur->VmCounters.QuotaPagedPoolUsage = - pr->QuotaPoolUsage[0]; + pr->QuotaPoolUsage[0]; SpiCur->VmCounters.QuotaPeakNonPagedPoolUsage = - pr->QuotaPeakPoolUsage[1]; - SpiCur->VmCounters.QuotaNonPagedPoolUsage = - pr->QuotaPoolUsage[1]; + pr->QuotaPeakPoolUsage[1]; + SpiCur->VmCounters.QuotaNonPagedPoolUsage = + pr->QuotaPoolUsage[1]; SpiCur->VmCounters.PagefileUsage = pr->PagefileUsage; // FIXME SpiCur->VmCounters.PeakPagefileUsage = pr->PeakPagefileUsage; - // KJK::Hyperion: I don't know what does this mean. VM_COUNTERS - // doesn't seem to contain any equivalent field + // KJK::Hyperion: I don't know what does this mean. VM_COUNTERS + // doesn't seem to contain any equivalent field //SpiCur->TotalPrivateBytes = pr->NumberOfPrivatePages; //FIXME: bytes != pages pr = PsGetNextProcess(pr); @@ -627,7 +627,7 @@ QSI_DEF(SystemProcessInformation) *ReqSize = ovlSize; if (pr != NULL) { - ObDereferenceObject(pr); + ObDereferenceObject(pr); } return (STATUS_SUCCESS); } diff --git a/reactos/ntoskrnl/ob/handle.c b/reactos/ntoskrnl/ob/handle.c index edd5a8a64a8..3bc6c843b23 100644 --- a/reactos/ntoskrnl/ob/handle.c +++ b/reactos/ntoskrnl/ob/handle.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: handle.c,v 1.56 2004/05/04 20:18:52 jimtabor Exp $ +/* $Id: handle.c,v 1.57 2004/07/16 19:54:05 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -950,39 +950,44 @@ ObInsertObject(IN PVOID Object, } -ULONG -ObpGetHandleCountbyHandleTable(PHANDLE_TABLE HandleTable) +ULONG +ObpGetHandleCountByHandleTable(PHANDLE_TABLE HandleTable) { -unsigned int i, Count=0; -PHANDLE_BLOCK blk; -POBJECT_HEADER Header; -PVOID ObjectBody; -KIRQL oldIrql; + PHANDLE_BLOCK blk; + POBJECT_HEADER Header; + PVOID ObjectBody; + KIRQL OldIrql; + PLIST_ENTRY current; + ULONG i; + ULONG Count=0; -PLIST_ENTRY current = HandleTable->ListHead.Flink; - - KeAcquireSpinLock(&HandleTable->ListLock, &oldIrql); + KeAcquireSpinLock(&HandleTable->ListLock, &OldIrql); + current = HandleTable->ListHead.Flink; while (current != &HandleTable->ListHead) - { - blk = CONTAINING_RECORD(current, HANDLE_BLOCK, entry); + { + blk = CONTAINING_RECORD(current, HANDLE_BLOCK, entry); - for ( i=0; ihandles[i].ObjectBody); - - if (ObjectBody != NULL) - { - Header = BODY_TO_HEADER(ObjectBody); - /* Make sure this is real. */ - if (Header->ObjectType != NULL) - Count++; - } - } - current = current->Flink; - } - KeReleaseSpinLock(&HandleTable->ListLock, oldIrql); - return (Count); + for (i = 0; i < HANDLE_BLOCK_ENTRIES; i++) + { + ObjectBody = OB_ENTRY_TO_POINTER(blk->handles[i].ObjectBody); + if (ObjectBody != NULL) + { + Header = BODY_TO_HEADER(ObjectBody); + + /* Make sure this is real. */ + if (Header->ObjectType != NULL) + Count++; + } + } + + current = current->Flink; + } + + KeReleaseSpinLock(&HandleTable->ListLock, + OldIrql); + + return Count; } /* EOF */