From f34ec165f616cd61eb19931d3c385bb09807a2ae Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sun, 19 Feb 2012 09:57:00 +0000 Subject: [PATCH] [CSRSRV]: Port CsrLockedReferenceThread from CSRSRV2. svn path=/trunk/; revision=55704 --- .../subsystems/win32/csrss/csrsrv/thredsup.c | 22 +++++++++++++++++++ reactos/subsystems/win32/csrss/include/api.h | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/reactos/subsystems/win32/csrss/csrsrv/thredsup.c b/reactos/subsystems/win32/csrss/csrsrv/thredsup.c index 6cc6f060e01..72e7138e759 100644 --- a/reactos/subsystems/win32/csrss/csrsrv/thredsup.c +++ b/reactos/subsystems/win32/csrss/csrsrv/thredsup.c @@ -122,6 +122,28 @@ CsrAllocateThread(IN PCSR_PROCESS CsrProcess) return CsrThread; } +/*++ + * @name CsrLockedReferenceThread + * + * The CsrLockedReferenceThread refences a CSR Thread while the + * Process Lock is already being held. + * + * @param CsrThread + * Pointer to the CSR Thread to be referenced. + * + * @return None. + * + * @remarks This routine will return with the Process Lock held. + * + *--*/ +VOID +NTAPI +CsrLockedReferenceThread(IN PCSR_THREAD CsrThread) +{ + /* Increment the reference count */ + ++CsrThread->ReferenceCount; +} + PCSR_THREAD NTAPI CsrLocateThreadByClientId(OUT PCSR_PROCESS *Process OPTIONAL, diff --git a/reactos/subsystems/win32/csrss/include/api.h b/reactos/subsystems/win32/csrss/include/api.h index 4a1639be84c..7d1322201f2 100644 --- a/reactos/subsystems/win32/csrss/include/api.h +++ b/reactos/subsystems/win32/csrss/include/api.h @@ -328,6 +328,10 @@ NTAPI CsrInsertThread(IN PCSR_PROCESS Process, IN PCSR_THREAD Thread); +VOID +NTAPI +CsrLockedReferenceThread(IN PCSR_THREAD CsrThread); + /* api/process.c */ typedef NTSTATUS (WINAPI *CSRSS_ENUM_PROCESS_PROC)(PCSR_PROCESS ProcessData, PVOID Context);