From 875b73611c2de3008a9a0044cd390e7fe4e93db9 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Thu, 1 Feb 2007 19:25:04 +0000 Subject: [PATCH] - Fix a bug in NtSetInformationThread which was causing 2nd-stage setup to freeze/crash. Fixes regression from 25631. svn path=/trunk/; revision=25669 --- reactos/ntoskrnl/ps/query.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/ps/query.c b/reactos/ntoskrnl/ps/query.c index fd347bff7e4..c95de551bd2 100644 --- a/reactos/ntoskrnl/ps/query.c +++ b/reactos/ntoskrnl/ps/query.c @@ -730,6 +730,7 @@ NtSetInformationThread(IN HANDLE ThreadHandle, PTEB Teb; ULONG TlsIndex = 0; PVOID *ExpansionSlots; + PETHREAD ProcThread; PAGED_CODE(); /* Verify Information Class validity */ @@ -1021,14 +1022,14 @@ NtSetInformationThread(IN HANDLE ThreadHandle, Process = Thread->ThreadsProcess; /* Loop the threads */ - Thread = PsGetNextProcessThread(Process, NULL); - while (Thread) + ProcThread = PsGetNextProcessThread(Process, NULL); + while (ProcThread) { /* Acquire rundown */ - if (ExAcquireRundownProtection(&Thread->RundownProtect)) + if (ExAcquireRundownProtection(&ProcThread->RundownProtect)) { /* Get the TEB */ - Teb = Thread->Tcb.Teb; + Teb = ProcThread->Tcb.Teb; if (Teb) { /* Check if we're in the expansion range */ @@ -1054,11 +1055,11 @@ NtSetInformationThread(IN HANDLE ThreadHandle, } /* Release rundown */ - ExReleaseRundownProtection(&Thread->RundownProtect); + ExReleaseRundownProtection(&ProcThread->RundownProtect); } /* Go to the next thread */ - Thread = PsGetNextProcessThread(Process, Thread); + ProcThread = PsGetNextProcessThread(Process, ProcThread); } /* All done */