https://git.reactos.org/?p=reactos.git;a=commitdiff;h=30613b92abdbd113751c9…
commit 30613b92abdbd113751c9dcd0a5a20434778f825
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Mon Mar 30 13:13:22 2020 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Mar 30 13:13:22 2020 +0200
[ACLUI] Properly enumerate cache+queue entries (#1937)
---
dll/win32/aclui/sidcache.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/dll/win32/aclui/sidcache.c b/dll/win32/aclui/sidcache.c
index 6fde2a4641d..e68cf9320b4 100644
--- a/dll/win32/aclui/sidcache.c
+++ b/dll/win32/aclui/sidcache.c
@@ -337,8 +337,9 @@ FindSidInCache(IN PSIDCACHEMGR scm,
/* NOTE: assumes the lists are locked! */
- CurrentEntry = &scm->CacheListHead;
- while (CurrentEntry != &scm->CacheListHead)
+ for (CurrentEntry = scm->CacheListHead.Flink;
+ CurrentEntry != &scm->CacheListHead;
+ CurrentEntry = CurrentEntry->Flink)
{
CacheEntry = CONTAINING_RECORD(CurrentEntry,
SIDCACHEENTRY,
@@ -383,8 +384,6 @@ FindSidInCache(IN PSIDCACHEMGR scm,
*ReqResult = ReqRes;
break;
}
-
- CurrentEntry = CurrentEntry->Flink;
}
return Ret;
@@ -699,8 +698,9 @@ QueueSidLookup(IN PSIDCACHEMGR scm,
}
else
{
- CurrentEntry = &scm->QueueListHead;
- while (CurrentEntry != &scm->QueueListHead)
+ for (CurrentEntry = scm->QueueListHead.Flink;
+ CurrentEntry != &scm->QueueListHead;
+ CurrentEntry = CurrentEntry->Flink)
{
QueueEntry = CONTAINING_RECORD(CurrentEntry,
SIDQUEUEENTRY,
@@ -712,8 +712,6 @@ QueueSidLookup(IN PSIDCACHEMGR scm,
FoundEntry = QueueEntry;
break;
}
-
- CurrentEntry = CurrentEntry->Flink;
}
}
@@ -805,8 +803,9 @@ DequeueSidLookup(IN HANDLE SidCacheMgr,
}
else
{
- CurrentEntry = &scm->QueueListHead;
- while (CurrentEntry != &scm->QueueListHead)
+ for (CurrentEntry = scm->QueueListHead.Flink;
+ CurrentEntry != &scm->QueueListHead;
+ CurrentEntry = CurrentEntry->Flink)
{
QueueEntry = CONTAINING_RECORD(CurrentEntry,
SIDQUEUEENTRY,
@@ -819,8 +818,6 @@ DequeueSidLookup(IN HANDLE SidCacheMgr,
QueueEntry);
break;
}
-
- CurrentEntry = CurrentEntry->Flink;
}
}