Added Spinlock in ObpGetHandleCountbyHandleTable.

svn path=/trunk/; revision=9306
This commit is contained in:
James Tabor 2004-05-04 20:18:52 +00:00
parent 4aeca8b2b1
commit 311d1ab004

View file

@ -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.55 2004/05/02 04:40:25 jimtabor Exp $
/* $Id: handle.c,v 1.56 2004/05/04 20:18:52 jimtabor Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -957,8 +957,12 @@ unsigned int i, Count=0;
PHANDLE_BLOCK blk;
POBJECT_HEADER Header;
PVOID ObjectBody;
KIRQL oldIrql;
PLIST_ENTRY current = HandleTable->ListHead.Flink;
KeAcquireSpinLock(&HandleTable->ListLock, &oldIrql);
while (current != &HandleTable->ListHead)
{
blk = CONTAINING_RECORD(current, HANDLE_BLOCK, entry);
@ -977,6 +981,7 @@ PLIST_ENTRY current = HandleTable->ListHead.Flink;
}
current = current->Flink;
}
KeReleaseSpinLock(&HandleTable->ListLock, oldIrql);
return (Count);
}