Emanuele Aliberti wrote:
Hi Mike!
KJKHyperion wrote:
ea@svn.reactos.com wrote:
Required for binary compatibility with MS KERNEL32.DLL.
NOTE Filip and I still don't understand why KERNEL32 calls twice CsrConnectToServer. A possible explanation is because the Win32 server is a dual server: gui+console.
yes. It connects to subsystems 1 and 2. In general, all CSR calls made by kernel32.dll are easily identifiable as calls to either subsystem from their code (the subsystem code is in the upper 16 bits).
1=base and 2=console, as Alex reported. There are two missing servers: 0=csr and 3=user. Maybe 3 is connected to by user32.dll or gdi32.dll and 0 is a default gate. Mumble...
0 is csrsrv.dll, and it's used by the other servers (ie, base and console connect to server 0 (but they use server-to-server calls which are much faster, see my ntdll/csr changes that you have)). 3 is winsrv.dll and it's what user32.dll connects to. winsrv handles all sorts of misc stuff (like exitwindowsex) and also has some connections with win32k.sys. After commiting csr I'll probably work on 3 inside winsrv, since it's easier to implement then basesrv.dll (which is huge, since it handles all SxS stuff too now).
The GUI subsystem's functions, if you were wondering, are:
SrvExitWindowsEx SrvEndTask SrvLogon SrvRegisterServicesProcess SrvActivateDebugger SrvGetThreadConsoleDesktop SrvDeviceEvent SrvRegisterLogonProcess SrvCreateSystemThreads SrvRecordShutdownReason
Hmm... where are these symbols from?
winsrv.dll.
Oh, and I made a slight mistake, i said that the Console Server was inside basesrv.dll, it's not. It's inside winsrv.dll, my apologies. Here are the functions, for information:
SrvOpenConsole@8 SrvGetConsoleInput@8 ; SrvGetConsoleInput(x,x) SrvWriteConsoleInput@8 ; SrvWriteConsoleInput(x,x) SrvReadConsoleOutput@8 ; SrvReadConsoleOutput(x,x) SrvWriteConsoleOutput@8 ; SrvWriteConsoleOutput(x,x) SrvReadConsoleOutputString@8 ; SrvReadConsoleOutputString(x,x) SrvWriteConsoleOutputString@8 ; SrvWriteConsoleOutputString(x,x) SrvFillConsoleOutput@8 ; SrvFillConsoleOutput(x,x) SrvGetConsoleMode@8 ; SrvGetConsoleMode(x,x) SrvGetConsoleNumberOfFonts@8 ; SrvGetConsoleNumberOfFonts(x,x) SrvGetConsoleNumberOfInputEvents@8 ; SrvGetConsoleNumberOfInputEvents(x,x) SrvGetConsoleScreenBufferInfo@8 ; SrvGetConsoleScreenBufferInfo(x,x) SrvGetConsoleCursorInfo@8 ; SrvGetConsoleCursorInfo(x,x) SrvGetConsoleMouseInfo@8 ; SrvGetConsoleMouseInfo(x,x) SrvGetConsoleFontInfo@8 ; SrvGetConsoleFontInfo(x,x) SrvGetConsoleFontSize@8 ; SrvGetConsoleFontSize(x,x) SrvGetConsoleCurrentFont@8 ; SrvGetConsoleCurrentFont(x,x) SrvSetConsoleMode@8 ; SrvSetConsoleMode(x,x) SrvSetConsoleActiveScreenBuffer@8 ; SrvSetConsoleActiveScreenBuffer(x,x) SrvFlushConsoleInputBuffer@8 ; SrvFlushConsoleInputBuffer(x,x) SrvGetLargestConsoleWindowSize@8 ; SrvGetLargestConsoleWindowSize(x,x) SrvSetConsoleScreenBufferSize@8 ; SrvSetConsoleScreenBufferSize(x,x) SrvSetConsoleCursorPosition@8 ; SrvSetConsoleCursorPosition(x,x) SrvSetConsoleCursorInfo@8 ; SrvSetConsoleCursorInfo(x,x) SrvSetConsoleWindowInfo@8 ; SrvSetConsoleWindowInfo(x,x) SrvScrollConsoleScreenBuffer@8 ; SrvScrollConsoleScreenBuffer(x,x) SrvSetConsoleTextAttribute@8 ; SrvSetConsoleTextAttribute(x,x) SrvSetConsoleFont@8 ; SrvSetConsoleFont(x,x) SrvSetConsoleIcon@8 ; SrvSetConsoleIcon(x,x) SrvReadConsole@8 ; SrvReadConsole(x,x) SrvWriteConsole@8 ; SrvWriteConsole(x,x) SrvDuplicateHandle@8 ; SrvDuplicateHandle(x,x) SrvGetHandleInformation@8 ; SrvGetHandleInformation(x,x) SrvSetHandleInformation@8 ; SrvSetHandleInformation(x,x) SrvCloseHandle@8 ; SrvCloseHandle(x,x) SrvVerifyConsoleIoHandle@8 ; SrvVerifyConsoleIoHandle(x,x) SrvAllocConsole@8 ; SrvAllocConsole(x,x) SrvFreeConsole@8 ; SrvFreeConsole(x,x) SrvGetConsoleTitle@8 ; SrvGetConsoleTitle(x,x) SrvSetConsoleTitle@8 ; SrvSetConsoleTitle(x,x) SrvCreateConsoleScreenBuffer@8 ; SrvCreateConsoleScreenBuffer(x,x) SrvInvalidateBitMapRect@8 ; SrvInvalidateBitMapRect(x,x) SrvVDMConsoleOperation@8 ; SrvVDMConsoleOperation(x,x) SrvSetConsoleCursor@8 ; SrvSetConsoleCursor(x,x) SrvShowConsoleCursor@8 ; SrvShowConsoleCursor(x,x) SrvConsoleMenuControl@8 ; SrvConsoleMenuControl(x,x) SrvSetConsolePalette@8 ; SrvSetConsolePalette(x,x) SrvSetConsoleDisplayMode@8 ; SrvSetConsoleDisplayMode(x,x) SrvRegisterConsoleVDM@8 ; SrvRegisterConsoleVDM(x,x) SrvGetConsoleHardwareState@8 ; SrvGetConsoleHardwareState(x,x) SrvSetConsoleHardwareState@8 ; SrvSetConsoleHardwareState(x,x) SrvGetConsoleDisplayMode@8 ; SrvGetConsoleDisplayMode(x,x) SrvAddConsoleAlias@8 ; SrvAddConsoleAlias(x,x) SrvGetConsoleAlias@8 ; SrvGetConsoleAlias(x,x) SrvGetConsoleAliasesLength@8 ; SrvGetConsoleAliasesLength(x,x) SrvGetConsoleAliasExesLength@8 ; SrvGetConsoleAliasExesLength(x,x) SrvGetConsoleAliases@8 ; SrvGetConsoleAliases(x,x) SrvGetConsoleAliasExes@8 ; SrvGetConsoleAliasExes(x,x) SrvExpungeConsoleCommandHistory@8 ; SrvExpungeConsoleCommandHistory(x,x) SrvSetConsoleNumberOfCommands@8 ; SrvSetConsoleNumberOfCommands(x,x) SrvGetConsoleCommandHistoryLength@8 ; SrvGetConsoleCommandHistoryLength(x,x) SrvGetConsoleCommandHistory@8 ; SrvGetConsoleCommandHistory(x,x) SrvSetConsoleCommandHistoryMode@8 ; SrvSetConsoleCommandHistoryMode(x,x) SrvGetConsoleCP@8 ; SrvGetConsoleCP(x,x) SrvSetConsoleCP@8 ; SrvSetConsoleCP(x,x) SrvSetConsoleKeyShortcuts@8 ; SrvSetConsoleKeyShortcuts(x,x) SrvSetConsoleMenuClose@8 ; SrvSetConsoleMenuClose(x,x) SrvConsoleNotifyLastClose@8 ; SrvConsoleNotifyLastClose(x,x) SrvGenerateConsoleCtrlEvent@8 ; SrvGenerateConsoleCtrlEvent(x,x) SrvGetConsoleKeyboardLayoutName@8 ; SrvGetConsoleKeyboardLayoutName(x,x) SrvGetConsoleWindow@8 ; SrvGetConsoleWindow(x,x) SrvGetConsoleCharType@8 ; SrvGetConsoleCharType(x,x) SrvSetConsoleLocalEUDC@8 ; SrvSetConsoleLocalEUDC(x,x) SrvSetConsoleCursorMode@8 ; SrvSetConsoleCursorMode(x,x) SrvGetConsoleCursorMode@8 ; SrvGetConsoleCursorMode(x,x) SrvRegisterConsoleOS2@8 ; SrvRegisterConsoleOS2(x,x) SrvSetConsoleOS2OemFormat@8 ; SrvSetConsoleOS2OemFormat(x,x) SrvGetConsoleNlsMode@8 ; SrvGetConsoleNlsMode(x,x) SrvSetConsoleNlsMode@8 ; SrvSetConsoleNlsMode(x,x) SrvRegisterConsoleIME@8 ; SrvRegisterConsoleIME(x,x) SrvUnregisterConsoleIME@8 ; SrvUnregisterConsoleIME(x,x) SrvGetConsoleLangId@8 ; SrvGetConsoleLangId(x,x) SrvAttachConsole@8 ; SrvAttachConsole(x,x) SrvGetConsoleSelectionInfo@8 ; SrvGetConsoleSelectionInfo(x,x) SrvGetConsoleProcessList@8 ; SrvGetConsoleProcessList(x,x)
@8 of course since they are all CSR APIs (IN PCSR_API_MESSAGE, OUT ULONG Result)
And, as KJK stated, the APIs for Server 3 are:
SrvExitWindowsEx SrvEndTask SrvLogon SrvRegisterServicesProcess SrvActivateDebugger SrvGetThreadConsoleDesktop SrvDeviceEvent SrvRegisterLogonProcess SrvCreateSystemThreads SrvRecordShutdownReason
(Note that winsrv handles WM_DEVICE event or changed APIs, with SrvDeviceEvent)
Oh, and before I forget, basesrv is also largely responsible for VDM.
Best regards, Alex Ionescu