[ros-kernel] CSRSS problems

Hartmut Birr Hartmut.Birr at gmx.de
Sun Jun 27 20:39:40 CEST 2004


Hi,

I can fix the problem that the LPC listener port isn't setup at the time
where win32csr.dll is loaded. It is possible to change the initialisation
order. But I run in an other problem. CsrClientConnectToServer is called
from DllMain while the process is attaching. Csrss creates a new thread for
the client. Attaching of the new thread is not possible, because the loader
lock is held while the process attaching is in progress. I can fix this
deadlock by calling CsrClientConnectToServer previous win32csr.dll is loaded
and add a check that CsrClientConnectToServer doesn't initialized the
connection again. But I think it is also a dirty fix like CsrIsCsrss(). Any
other ideas? 

- Hartmut


> -----Original Message-----
> From: ros-kernel-bounces at reactos.com 
> [mailto:ros-kernel-bounces at reactos.com] On Behalf Of Ge van Geldorp
> Sent: Sunday, June 27, 2004 5:03 PM
> To: 'ReactOS Kernel List'
> Subject: [ros-kernel] CSRSS problems
> 
> 
> 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