[ros-kernel] CSRSS problems

Ge van Geldorp gvg at reactos.com
Sun Jun 27 18:02:58 CEST 2004


> From: Hartmut Birr
> 
> I think I've found the problem. A valid ProcessData pointer 
> can never exist in Thread_Api. A valid ProcessData pointer 
> can only exist in Thread_Api2, if CsrCreateProcess was 
> called. The ProcessData structure must be created in 
> Thread_Api. You described the second problem below. Csrss 
> needs a connection to itself. We must change the 
> initialisation order in CsrServerInitialization. Win32csr can 
> be loaded only if the server port is initialized.

It's been a while since I worked on this, but at the time there was a
problem with initialization. CSRSS loads (through win32csr.dll)
kernel32.dll, which in turn does a call from its DllMain to
CsrClientConnectToServer() in lib/ntdll/csr/lpc.c. If the call to
CsrClientConnectToServer fails, kernel32.dll fails to load.
When win32csr.dll is loaded by CSRSS, the LPC listener port is not setup
yet. So, the CsrClientConnectToServer fails, kernel32.dll fails to load,
win32csr.dll fails to load... There currently is a hack in
lib/ntdll/csr/lpc.c, using a static IsCsrss variable. This is normally
set to FALSE, but csrss makes a call to IsCsrss() before loading
win32csr.dll, which sets it to TRUE. When CsrClientConnectToServer is
then called later on, it just returns success without trying to connect
to csrss.

Ge van Geldorp.



More information about the Ros-kernel mailing list