reactos/base/system
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
..
autochk [FFS] Remove the FFS/UFS driver 2021-07-30 17:14:57 +03:00
bootok Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
chkdsk [TRANSLATION] Improve Simplified Chinese (zh-CN) translation (#4513) 2022-05-20 15:38:24 +03:00
diskpart [DISKPART] Fix help for multi-word command crashing. (#4873) 2022-11-12 13:02:33 +01:00
dllhost [DLLHOST] Add dllhost to make the device driver extractor for my Lenovo T400 happy 2018-08-11 22:25:30 +02:00
expand [EXPAND] Sync with Wine Staging 3.3. CORE-14434 2018-04-01 13:12:40 +01:00
format [TRANSLATION] Review & update Simplified Chinese (zh-CN) translation (#3933) 2022-03-31 20:30:52 +03:00
logonui [LOGONUI] Make Logon UI compilable again (#4684) 2022-09-14 15:10:37 +03:00
lsass [LSASS] Initialize SAM before starting the security services 2019-08-10 14:36:10 +02:00
msiexec [WINESYNC] msiexec: Enable compilation with long types. 2022-03-20 19:28:44 +01:00
regsvr32 [TRANSLATION] Review & update Simplified Chinese (zh-CN) translation (#3933) 2022-03-31 20:30:52 +03:00
rundll32 [RUNDLL32] Try to resolve the manifest file manually 2022-10-19 19:39:29 +02:00
runonce [TRANSLATION] Improve Simplified Chinese (zh-CN) translation (#4513) 2022-05-20 15:38:24 +03:00
services [SERVICES] Assign a World identity authority for Everyone SID, not Null authority 2022-05-06 10:09:52 +02:00
smss [SMSS] Fix three SmpLoadSubSystem bugs related to the SB_CREATE_SESSION callback. 2022-11-14 00:10:35 +01:00
subst [TRANSLATION] Improve Simplified Chinese (zh-CN) translation (#4513) 2022-05-20 15:38:24 +03:00
userinit [USERINIT] Improve Japanese translation (ja-JP) 2022-10-10 14:58:22 +09:00
winlogon [TRANSLATION] Update Indonesian (id-ID) translation (#4585) 2022-10-06 22:44:46 +03:00
CMakeLists.txt [LOGONUI] Make Logon UI compilable again (#4684) 2022-09-14 15:10:37 +03:00