Difference between revisions of "Csrss.exe"

From ReactOS Wiki
Jump to: navigation, search
m (ChangeLog-0.2.3)
(Updated information and added some relevant info from Wikipedia with mods.)
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/?view=log
+
{{DISPLAYTITLE:csrss.exe}}
 +
{{stub}}
 +
[[Wikipedia:Client/Server Runtime Subsystem|Client/Server Runtime Subsystem]], or csrss.exe, is an essential component of the Windows NT&trade; family of operating systems. It provides the user mode side of the Win32 subsystem and is included in Windows 2000 and later, while Win32.sys is the kernel-mode portion of the Win32 Subsystem.<br /><br />
  
[[ChangeLog-0.0.16]]
+
Since Windows NT 4, most of the Win32 subsystem operations have been moved to kernel mode drivers. So CSRSS is mainly responsible for Win32 console handling and GUI shutdown.<br />
* Console handling moved to CSRSS
 
* Whole new win32 console support, with multiple virtual consoles and scrollback support
 
[[ChangeLog-0.0.17]]
 
* New console client support
 
[[ChangeLog-0.0.21]]
 
* Csrss: Console improvements [[Marty Dill]]
 
[[ChangeLog-0.1.0]]
 
* CSRSS: Implemented ReadConsoleOutputA() and WriteConsoleInputA() ([[Marty Dill]])
 
[[ChangeLog-0.1.1]]
 
* Csrss: More Console functions implemented, others improved ([[Hartmut Birr]])
 
[[ChangeLog-0.2.0]]
 
* Move desktop window proc from WIN32K to CSRSS ([[Gé van Geldorp]])
 
* Auto-detect whether to create a GUI or a TUI console ([[Gé van Geldorp]])
 
* Improved keyboard handling ([[Art Yerkes]])
 
[[ChangeLog-0.2.1]]
 
* Use ScrollWindowEx for scrolling text in console ([[Filip Navara]])
 
* Move call to PrivateCsrssManualGuiCheck to before the creation of window classes ([[Gé van Geldorp]])
 
* Fixed shift handling code that caused bug 193 ([[Art Yerkes]])
 
* Initialize/delete the lock of a screen buffer ([[Hartmut Birr]])
 
  
[[ChangeLog-0.2.2]]
+
== Technical details ==
*Made the cursor and F1-12 keys usable again ([[Hartmut Birr]])
+
CSRSS runs as a user-mode [[Wikipedia:Windows service|system service]]. When a user-mode process calls a function involving console windows, process/thread creation, or [[Wikipedia:Side-by-side assembly|side-by-side]] support, instead of issuing a [[Wikipedia:system call|system call]], the Win32 libraries (kernel32.dll, user32.dll, gdi32.dll) send an [[Wikipedia:Local Procedure Call|inter-process call]] to the CSRSS process which does most of the actual work without compromising the kernel.<ref>[https://wenku.baidu.com/view/a9966e2d55270722192ef7cb.html "Detailed implementation of a system service in Windows NT"]. ''Undocumented Windows NT.'' Retrieved 2017-06-11.</ref> Window manager and [[Wikipedia:Graphics Device Interface|GDI]] services are instead handled by a kernel mode driver (win32k.sys).<ref>Russinovich, Mark (2009). ''Windows Internals, 5th Edition'' Microsoft Press. p. 54.</ref><br /><br />
*Initialize/delete the lock of a screen buffer ([[Hartmut Birr]])
 
*Initialize/delete the lock of a console ([[Hartmut Birr]])
 
*Fixed the handling for ctrl and alt keys ([[Hartmut Birr]])
 
*Implemented double buffering for a console windows ([[Hartmut Birr]])
 
*Implemented SetConsoleIcon() ([[Thomas Weidenmueller]])
 
  
[[ChangeLog-0.2.3]]
+
CSRSS is called along with <tt>winlogon.exe</tt> at Windows startup. If either of the files is corrupted or otherwise inaccessible, the NT kernel will shut down the startup process with a [[Wikipedia:Blue Screen of Death|BSOD]] displaying error 0xc000021a. This is caused by a failure to move out of kernel mode and into user mode.<br /><br />
*GuiConsoleUpdateBitmap ignores the color attribute of the first character in line, instead it takes the attribute of the last character of the previous line ([[Ge van Geldorp]], Tonik)
+
 
*Clean up calls from win32k to csrss ([[Ge van Geldorp]])
+
Vista and Windows 7 both run two instances of csrss.exe.<ref>[https://technet.microsoft.com/en-us/library/2007.03.vistakernel.aspx "Inside the Windows Vista Kernel – Startup Processes"]. ''Inside the Windows Vista Kernel – Startup Processes.'' Microsoft. Retrieved 2010-10-01.</ref><br /><br />
 +
 
 +
Starting with Windows 7, instead of drawing console windows itself, CSRSS spawns <tt>conhost.exe</tt> subprocesses to draw console windows for command line programs with the permissions of that user.
 +
<br /><br />
 +
 
 +
{{Code history|subsystems/win32/csrss}}
 +
 
 +
== See also ==
 +
*[[Win32k.sys|Kernel Mode Subsystem Server]]
 +
 
 +
==Notes and references==
 +
<references/>
 +
 
 +
[[Category:Application]]

Revision as of 02:00, 13 June 2017

The page Csrss.exe is a short article on something that should have a lot more information written on it.
If you know anything else about it, you are STRONGLY encouraged to add the information in. If you are unsure of proper formatting or style, add it to the talk page or this page itself as you think best and others will help.


Client/Server Runtime Subsystem, or csrss.exe, is an essential component of the Windows NT™ family of operating systems. It provides the user mode side of the Win32 subsystem and is included in Windows 2000 and later, while Win32.sys is the kernel-mode portion of the Win32 Subsystem.

Since Windows NT 4, most of the Win32 subsystem operations have been moved to kernel mode drivers. So CSRSS is mainly responsible for Win32 console handling and GUI shutdown.

Technical details

CSRSS runs as a user-mode system service. When a user-mode process calls a function involving console windows, process/thread creation, or side-by-side support, instead of issuing a system call, the Win32 libraries (kernel32.dll, user32.dll, gdi32.dll) send an inter-process call to the CSRSS process which does most of the actual work without compromising the kernel.[1] Window manager and GDI services are instead handled by a kernel mode driver (win32k.sys).[2]

CSRSS is called along with winlogon.exe at Windows startup. If either of the files is corrupted or otherwise inaccessible, the NT kernel will shut down the startup process with a BSOD displaying error 0xc000021a. This is caused by a failure to move out of kernel mode and into user mode.

Vista and Windows 7 both run two instances of csrss.exe.[3]

Starting with Windows 7, instead of drawing console windows itself, CSRSS spawns conhost.exe subprocesses to draw console windows for command line programs with the permissions of that user.

Commit history (Source code can be found in: /reactos/subsystems/win32/csrss)

See also

Notes and references

  1. "Detailed implementation of a system service in Windows NT". Undocumented Windows NT. Retrieved 2017-06-11.
  2. Russinovich, Mark (2009). Windows Internals, 5th Edition Microsoft Press. p. 54.
  3. "Inside the Windows Vista Kernel – Startup Processes". Inside the Windows Vista Kernel – Startup Processes. Microsoft. Retrieved 2010-10-01.