mirror of
https://github.com/reactos/reactos.git
synced 2024-08-20 18:35:32 +00:00
- Fix a bug with our tei_instance selection (we could end up with the same tei_instance value on different entities of the same type if an entity of our type in the middle of the list was deleted previously)
svn path=/branches/aicom-network-branch/; revision=45090
This commit is contained in:
parent
b7457ec3d8
commit
2522eb7b9b
|
@ -15,16 +15,27 @@
|
|||
VOID AddEntity(ULONG EntityType, PVOID Context, ULONG Flags)
|
||||
{
|
||||
KIRQL OldIrql;
|
||||
ULONG i, Count = 0;
|
||||
ULONG i, Instance = 0;
|
||||
BOOLEAN ChoseIndex = FALSE;
|
||||
|
||||
TcpipAcquireSpinLock(&EntityListLock, &OldIrql);
|
||||
|
||||
for (i = 0; i < EntityCount; i++)
|
||||
if (EntityList[i].tei_entity == EntityType)
|
||||
Count++;
|
||||
while (!ChoseIndex)
|
||||
{
|
||||
ChoseIndex = TRUE;
|
||||
for (i = 0; i < EntityCount; i++)
|
||||
{
|
||||
if (EntityList[i].tei_entity == EntityType &&
|
||||
EntityList[i].tei_instance == Instance)
|
||||
{
|
||||
Instance++;
|
||||
ChoseIndex = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EntityList[EntityCount].tei_entity = EntityType;
|
||||
EntityList[EntityCount].tei_instance = Count;
|
||||
EntityList[EntityCount].tei_instance = Instance;
|
||||
EntityList[EntityCount].context = Context;
|
||||
EntityList[EntityCount].flags = Flags;
|
||||
EntityCount++;
|
||||
|
|
Loading…
Reference in a new issue