reactos/sdk/include
Hermès Bélusca-Maïto 2dddbd5c54
[SMSS] Fix three SmpLoadSubSystem bugs related to the SB_CREATE_SESSION callback.
This fixes starting the Windows 2000 POSIX subsystem in ReactOS.

- The CreateSession pointer was initialized against the SbApiMsg variable, but
  it was the other SbApiMsg2 that was being initialized and sent through LPC.

- Do not overwrite the MuSessionId (Terminal Services session ID) variable with
  the generated environment subsystem session ID from SmpAllocateSessionId().

- Actually initialize the SbApiMsg ApiNumber for the CreateSession LPC call.

(dll\win32\kernel32\client\proc.c:3690) Retrying with: POSIX /P C:\ReactOS\system32\posix\ls.exe /C ls
Breakpoint 1 hit
csrsrv!CsrSbApiRequestThread+0x64:
001b:1000ac34 837dfc00        cmp     dword ptr [ebp-4],0
kd> ??ReceiveMsg
struct _SB_API_MSG
   +0x000 h                : _PORT_MESSAGE
   +0x018 ConnectionInfo   : _SB_CONNECTION_INFO
   +0x018 ApiNumber        : 0xcccccccc (No matching name)
   +0x01c ReturnValue      : 0n0
   +0x020 u                : <unnamed-tag>
kd> p
...
(base\system\smss\smsubsys.c:393) SMSS: SmpLoadSubSystem - NtRequestWaitReplyPort Failed with  Status c0000002 for sessionid 2
...
<Retrying>
...
(base\system\smss\smsubsys.c:393) SMSS: SmpLoadSubSystem - NtRequestWaitReplyPort Failed with  Status c0000002 for sessionid 3

All those bugs could have been avoided *IF*, rather than (badly) duplicating
its code, the existing SmpSbCreateSession() function had been used instead.

- "Not sure these field mean what I think they do -- but clear them" ... ◔_◔
  Those fields are related to the debug client interface (DbgUi) and session
  in case the subsystem being started is going to be debugged. These have
  nothing to do with the MuSessionId. Clarify this in the SB_CREATE_SESSION_MSG
  structure and in the SmpSbCreateSession() function.
2022-11-14 00:10:35 +01:00
..
asm [NTOS] Add MxCsr handling to trap handlers 2022-08-22 11:22:08 +02:00
c++ [GITHUB] Add MSVC ARM64 builder 2022-05-25 21:10:17 +03:00
crt [CRT] Fix amd64 floating point control functions 2022-08-22 11:22:08 +02:00
ddk [INCLUDE] immdev.h: Adapt INPUTCONTEXTDX to C++ 2022-10-15 08:13:22 +09:00
dxsdk [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
GL [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
host [SDK] Fix definition of IMAGE_NT_HEADERS64 in host tools 2021-04-28 13:10:23 +02:00
ndk [NTOS][NTDLL][NDK] Nt/ZwCreatePagingFile: Fix parameter names + use SAL; fix NTDLL spec file. 2022-11-03 02:55:50 +01:00
psdk [PSDK] SECURITY_ATTRIBUTES: Remove size_is(nLength) (#4832) 2022-11-01 03:14:09 +01:00
reactos [SMSS] Fix three SmpLoadSubSystem bugs related to the SB_CREATE_SESSION callback. 2022-11-14 00:10:35 +01:00
wdf/kmdf/1.17 [KMDF] Make KMDF headers compatible with our SDK and compilers 2020-11-03 00:06:25 +03:00
xdk [REACTOS] Finally get some ARM64 applications building (#4517) 2022-05-25 17:06:32 +03:00