https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c5b87ac6ac9abcf19b997…
commit c5b87ac6ac9abcf19b99748d5f52584f92c3f593
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed Apr 21 19:47:36 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed May 5 17:24:13 2021 +0200
[CSRSRV] Display some other DPRINTs only when CSRSRV is compiled in debugging mode.
Addendum to 835f3ef1.
---
subsystems/win32/csrsrv/api.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/subsystems/win32/csrsrv/api.c b/subsystems/win32/csrsrv/api.c
index 6ff8694537a..39229a1b384 100644
--- a/subsystems/win32/csrsrv/api.c
+++ b/subsystems/win32/csrsrv/api.c
@@ -64,7 +64,11 @@ CsrCallServerFromServer(IN PCSR_API_MESSAGE ReceiveMsg,
(!(ServerDll = CsrLoadedServerDll[ServerId])))
{
/* We are beyond the Maximum Server ID */
- DPRINT1("CSRSS: %lx is invalid ServerDllIndex (%08x)\n", ServerId,
ServerDll);
+#ifdef CSR_DBG
+ DPRINT1("CSRSS: %lx is invalid ServerDllIndex (%08x)\n",
+ ServerId, ServerDll);
+ if (NtCurrentPeb()->BeingDebugged) DbgBreakPoint();
+#endif
ReplyMsg->Status = STATUS_ILLEGAL_FUNCTION;
return STATUS_ILLEGAL_FUNCTION;
}
@@ -547,7 +551,6 @@ CsrApiRequestThread(IN PVOID Parameter)
ServerId, ServerDll);
if (NtCurrentPeb()->BeingDebugged) DbgBreakPoint();
#endif
-
ReplyMsg = NULL;
ReplyPort = CsrApiPort;
continue;
@@ -560,10 +563,11 @@ CsrApiRequestThread(IN PVOID Parameter)
if (ApiId >= ServerDll->HighestApiSupported)
{
/* We are beyond the Maximum API ID, or it doesn't exist */
+#ifdef CSR_DBG
DPRINT1("CSRSS: %lx is invalid ApiTableIndex for %Z\n",
CSR_API_NUMBER_TO_API_ID(ReceiveMsg.ApiNumber),
&ServerDll->Name);
-
+#endif
ReplyPort = CsrApiPort;
ReplyMsg = NULL;
continue;
@@ -751,7 +755,6 @@ CsrApiRequestThread(IN PVOID Parameter)
ServerId, ServerDll);
if (NtCurrentPeb()->BeingDebugged) DbgBreakPoint();
#endif
-
ReplyPort = CsrApiPort;
ReplyMsg = &ReceiveMsg;
ReplyMsg->Status = STATUS_ILLEGAL_FUNCTION;
@@ -765,11 +768,12 @@ CsrApiRequestThread(IN PVOID Parameter)
/* Make sure that the ID is within limits, and the entry exists */
if (ApiId >= ServerDll->HighestApiSupported)
{
+#ifdef CSR_DBG
/* We are beyond the Maximum API ID, or it doesn't exist */
DPRINT1("CSRSS: %lx is invalid ApiTableIndex for %Z\n",
CSR_API_NUMBER_TO_API_ID(ReceiveMsg.ApiNumber),
&ServerDll->Name);
-
+#endif
ReplyPort = CsrApiPort;
ReplyMsg = &ReceiveMsg;
ReplyMsg->Status = STATUS_ILLEGAL_FUNCTION;