[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).
This commit is contained in:
Hermès Bélusca-Maïto 2022-11-11 21:18:28 +01:00
parent 9c8a8cf2aa
commit 06a0451415
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
4 changed files with 9 additions and 5 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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;

View file

@ -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;