https://git.reactos.org/?p=reactos.git;a=commitdiff;h=06a0451415221a84c5f17…
commit 06a0451415221a84c5f17443ab7edb8cf132b4d0
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Fri Nov 11 21:18:28 2022 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Nov 14 00:10:32 2022 +0100
[SMSS][CSRSRV] Undefine CreateProcess symbol. Name the union inside SB_API_MSG.
Undefine CreateProcess because it can be #define'd (to CreateProcessA/W)
if winbase.h is included prior (as it is in SMSS).
---
base/system/smss/smsbapi.c | 2 +-
base/system/smss/smsubsys.c | 4 ++--
sdk/include/reactos/subsys/sm/smmsg.h | 6 +++++-
subsystems/csr/csrsrv/session.c | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/base/system/smss/smsbapi.c b/base/system/smss/smsbapi.c
index 60a081a548c..e1b21f7bdb3 100644
--- a/base/system/smss/smsbapi.c
+++ b/base/system/smss/smsbapi.c
@@ -47,7 +47,7 @@ SmpSbCreateSession(IN PVOID Reserved,
PSB_CREATE_SESSION_MSG CreateSessionMsg;
/* Write out the create session message including its initial process */
- CreateSessionMsg = &SbApiMsg.CreateSession;
+ CreateSessionMsg = &SbApiMsg.u.CreateSession;
CreateSessionMsg->ProcessInfo = *ProcessInformation;
CreateSessionMsg->MuSessionId = MuSessionId;
if (DbgClientId)
diff --git a/base/system/smss/smsubsys.c b/base/system/smss/smsubsys.c
index a504a185900..ecae4cb1db0 100644
--- a/base/system/smss/smsubsys.c
+++ b/base/system/smss/smsubsys.c
@@ -149,8 +149,8 @@ SmpLoadSubSystem(IN PUNICODE_STRING FileName,
RTL_USER_PROCESS_INFORMATION ProcessInformation;
LARGE_INTEGER Timeout;
PVOID State;
- PSB_CREATE_PROCESS_MSG CreateProcess = &SbApiMsg.CreateProcess;
- PSB_CREATE_SESSION_MSG CreateSession = &SbApiMsg.CreateSession;
+ PSB_CREATE_PROCESS_MSG CreateProcess = &SbApiMsg.u.CreateProcess;
+ PSB_CREATE_SESSION_MSG CreateSession = &SbApiMsg.u.CreateSession;
/* Make sure this is a found subsystem */
if (Flags & SMP_INVALID_PATH)
diff --git a/sdk/include/reactos/subsys/sm/smmsg.h
b/sdk/include/reactos/subsys/sm/smmsg.h
index e72f0917fb2..ada3ae670bc 100644
--- a/sdk/include/reactos/subsys/sm/smmsg.h
+++ b/sdk/include/reactos/subsys/sm/smmsg.h
@@ -211,6 +211,10 @@ C_ASSERT(sizeof(SB_CREATE_PROCESS_MSG) == 0x18);
C_ASSERT(sizeof(SB_CREATE_PROCESS_MSG) == 0x28);
#endif
+#ifdef CreateProcess
+#undef CreateProcess
+#endif
+
//
// When the server connects to a client, this structure is exchanged
//
@@ -239,7 +243,7 @@ typedef struct _SB_API_MSG
SB_TERMINATE_SESSION_MSG TerminateSession;
SB_FOREIGN_SESSION_COMPLETE_MSG ForeignSessionComplete;
SB_CREATE_PROCESS_MSG CreateProcess;
- };
+ } u;
};
};
} SB_API_MSG, *PSB_API_MSG;
diff --git a/subsystems/csr/csrsrv/session.c b/subsystems/csr/csrsrv/session.c
index 381bb16df6f..75aff353638 100644
--- a/subsystems/csr/csrsrv/session.c
+++ b/subsystems/csr/csrsrv/session.c
@@ -207,7 +207,7 @@ BOOLEAN
NTAPI
CsrSbCreateSession(IN PSB_API_MSG ApiMessage)
{
- PSB_CREATE_SESSION_MSG CreateSession = &ApiMessage->CreateSession;
+ PSB_CREATE_SESSION_MSG CreateSession = &ApiMessage->u.CreateSession;
HANDLE hProcess, hThread;
PCSR_PROCESS CsrProcess;
PCSR_THREAD CsrThread;