From 5a7730db99a5d967909521c9bd699e0e33d60bba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 11 Dec 2012 01:45:49 +0000 Subject: [PATCH] [CONSRV] However here, we must keep the incrementation at the end of the loop, because of a possible corner case (a loop-break which takes place when we reach the last element of the list, but NextEntry already points to its head because of the cyclicity of the list) with the following 'if'-test made just after the loop. svn path=/branches/ros-csrss/; revision=57867 --- subsystems/win32/csrsrv/procsup.c | 2 +- subsystems/win32/csrsrv/thredsup.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/subsystems/win32/csrsrv/procsup.c b/subsystems/win32/csrsrv/procsup.c index c79fdee0a48..97dd0cb8f98 100644 --- a/subsystems/win32/csrsrv/procsup.c +++ b/subsystems/win32/csrsrv/procsup.c @@ -1118,7 +1118,7 @@ CsrLockProcessByClientId(IN HANDLE Pid, CsrLockedReferenceProcess(CurrentProcess); *CsrProcess = CurrentProcess; } - + /* Return the result */ return Status; } diff --git a/subsystems/win32/csrsrv/thredsup.c b/subsystems/win32/csrsrv/thredsup.c index 77c02cf057b..61a572ef4bb 100644 --- a/subsystems/win32/csrsrv/thredsup.c +++ b/subsystems/win32/csrsrv/thredsup.c @@ -970,9 +970,6 @@ CsrLockThreadByClientId(IN HANDLE Tid, /* Get the Process */ CurrentThread = CONTAINING_RECORD(NextEntry, CSR_THREAD, HashLinks); - /* Move to the next entry */ - NextEntry = NextEntry->Flink; - /* Check for PID Match */ if ((CurrentThread->ClientId.UniqueThread == Tid) && !(CurrentThread->Flags & CsrThreadTerminated)) @@ -980,6 +977,9 @@ CsrLockThreadByClientId(IN HANDLE Tid, /* Get out of here */ break; } + + /* Move to the next entry */ + NextEntry = NextEntry->Flink; } /* Nothing found if we got back to the list */ -- 2.17.1