[ros-kernel] System Handle Information Pre Patch ex/sysinfo.c.

Hartmut Birr Hartmut.Birr at gmx.de
Thu Apr 29 22:58:05 CEST 2004


Hi,

> -----Original Message-----
> From: ros-kernel-bounces at reactos.com 
> [mailto:ros-kernel-bounces at reactos.com] On Behalf Of James Tabor
> Sent: Thursday, April 29, 2004 8:54 PM
> To: ReactOS Kernel List
> Subject: [ros-kernel] System Handle Information Pre Patch 
> ex/sysinfo.c.
> 
> 
> 	do
> 	{
>            int curSize, Count;
> 	  PSYSTEM_HANDLE_INFORMATION ShiCur;
> 	  ShiCur = (PSYSTEM_HANDLE_INFORMATION)pCur;
> 	  ULONG HandleCount = ObGetObjectHandleCount(Process);

This returns the number of the handles whiche reference the process. This is
not the number of handles, which the process has allocated in its handle
table. 

> 
> 	  curSize = sizeof(SYSTEM_HANDLE_INFORMATION);
> 
>            for (Count = 0; HandleCount > 0 ; HandleCount--)
> 	     {
> 	      HANDLE h;
> 	      PHANDLE_REP Rep;
>                POBJECT_HEADER ObjectHeader;
>                PVOID ObjectBody;
> 
> 	      h = (HANDLE)((Count + 1) << 2);
> 
>                ShiCur->Handle = (USHORT) ((Count +1) << 2);
>                ShiCur->ProcessId = Process->UniqueProcessId;

I would prefer, that the code which walks through the handles of a processs,
is located somewhere in ntoskrnl\ob. 


- Hartmut




More information about the Ros-kernel mailing list