From 59ac9cae8948d33d359b6526722f2b34cb5c20cc Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sun, 19 Feb 2012 07:22:37 +0000 Subject: [PATCH] [CSRSRV]: Fix scenario when a new thread is being created from within CSRSRV and it could not register itself due to the new server-to-server support. Fixes CTRL-C and using the "X" button in a console window to close it, which had regressed since the server-to-server commit. svn path=/trunk/; revision=55700 --- reactos/subsystems/csr/csrsrv/api.c | 2 +- reactos/subsystems/win32/csrss/csrsrv/api/process.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/subsystems/csr/csrsrv/api.c b/reactos/subsystems/csr/csrsrv/api.c index 38fd18fa955..db495091520 100644 --- a/reactos/subsystems/csr/csrsrv/api.c +++ b/reactos/subsystems/csr/csrsrv/api.c @@ -1227,7 +1227,7 @@ CsrCallServerFromServer(PCSR_API_MESSAGE ReceiveMsg, _SEH2_TRY { /* Call the API and get the result */ - Status = (ServerDll->DispatchTable[ApiId])(ReceiveMsg, &Reply); + Status = ServerDll->DispatchTable[ApiId](ReceiveMsg, &Reply); /* Return the result, no matter what it is */ ReplyMsg->Status = Status; diff --git a/reactos/subsystems/win32/csrss/csrsrv/api/process.c b/reactos/subsystems/win32/csrss/csrsrv/api/process.c index f8bdd0f54c4..7576a4b0a45 100644 --- a/reactos/subsystems/win32/csrss/csrsrv/api/process.c +++ b/reactos/subsystems/win32/csrss/csrsrv/api/process.c @@ -173,6 +173,7 @@ CSR_API(CsrSrvCreateThread) PCSR_PROCESS CsrProcess; CurrentThread = NtCurrentTeb()->CsrClientThread; + if (!CurrentThread) return STATUS_SUCCESS; // server-to-server CsrProcess = CurrentThread->Process; if (CsrProcess->ClientId.UniqueProcess != Request->Data.CreateThreadRequest.ClientId.UniqueProcess)