[ros-dev] Re: [ros-svn] [ea] 18050: Required for binary compatibility with MS KERNEL32.DLL.

Alex Ionescu ionucu at videotron.ca
Mon Sep 26 00:06:22 CEST 2005


Emanuele Aliberti wrote:

> Hi Mike!
>
> KJKHyperion wrote:
>
>> ea at 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 at 8
SrvGetConsoleInput at 8 ; SrvGetConsoleInput(x,x)
SrvWriteConsoleInput at 8 ; SrvWriteConsoleInput(x,x)
SrvReadConsoleOutput at 8 ; SrvReadConsoleOutput(x,x)
SrvWriteConsoleOutput at 8 ; SrvWriteConsoleOutput(x,x)
SrvReadConsoleOutputString at 8 ; SrvReadConsoleOutputString(x,x)
SrvWriteConsoleOutputString at 8 ; SrvWriteConsoleOutputString(x,x)
SrvFillConsoleOutput at 8 ; SrvFillConsoleOutput(x,x)
SrvGetConsoleMode at 8 ; SrvGetConsoleMode(x,x)
SrvGetConsoleNumberOfFonts at 8 ; SrvGetConsoleNumberOfFonts(x,x)
SrvGetConsoleNumberOfInputEvents at 8 ; SrvGetConsoleNumberOfInputEvents(x,x)
SrvGetConsoleScreenBufferInfo at 8 ; SrvGetConsoleScreenBufferInfo(x,x)
SrvGetConsoleCursorInfo at 8 ; SrvGetConsoleCursorInfo(x,x)
SrvGetConsoleMouseInfo at 8 ; SrvGetConsoleMouseInfo(x,x)
SrvGetConsoleFontInfo at 8 ; SrvGetConsoleFontInfo(x,x)
SrvGetConsoleFontSize at 8 ; SrvGetConsoleFontSize(x,x)
SrvGetConsoleCurrentFont at 8 ; SrvGetConsoleCurrentFont(x,x)
SrvSetConsoleMode at 8 ; SrvSetConsoleMode(x,x)
SrvSetConsoleActiveScreenBuffer at 8 ; SrvSetConsoleActiveScreenBuffer(x,x)
SrvFlushConsoleInputBuffer at 8 ; SrvFlushConsoleInputBuffer(x,x)
SrvGetLargestConsoleWindowSize at 8 ; SrvGetLargestConsoleWindowSize(x,x)
SrvSetConsoleScreenBufferSize at 8 ; SrvSetConsoleScreenBufferSize(x,x)
SrvSetConsoleCursorPosition at 8 ; SrvSetConsoleCursorPosition(x,x)
SrvSetConsoleCursorInfo at 8 ; SrvSetConsoleCursorInfo(x,x)
SrvSetConsoleWindowInfo at 8 ; SrvSetConsoleWindowInfo(x,x)
SrvScrollConsoleScreenBuffer at 8 ; SrvScrollConsoleScreenBuffer(x,x)
SrvSetConsoleTextAttribute at 8 ; SrvSetConsoleTextAttribute(x,x)
SrvSetConsoleFont at 8 ; SrvSetConsoleFont(x,x)
SrvSetConsoleIcon at 8 ; SrvSetConsoleIcon(x,x)
SrvReadConsole at 8 ; SrvReadConsole(x,x)
SrvWriteConsole at 8 ; SrvWriteConsole(x,x)
SrvDuplicateHandle at 8 ; SrvDuplicateHandle(x,x)
SrvGetHandleInformation at 8 ; SrvGetHandleInformation(x,x)
SrvSetHandleInformation at 8 ; SrvSetHandleInformation(x,x)
SrvCloseHandle at 8 ; SrvCloseHandle(x,x)
SrvVerifyConsoleIoHandle at 8 ; SrvVerifyConsoleIoHandle(x,x)
SrvAllocConsole at 8 ; SrvAllocConsole(x,x)
SrvFreeConsole at 8 ; SrvFreeConsole(x,x)
SrvGetConsoleTitle at 8 ; SrvGetConsoleTitle(x,x)
SrvSetConsoleTitle at 8 ; SrvSetConsoleTitle(x,x)
SrvCreateConsoleScreenBuffer at 8 ; SrvCreateConsoleScreenBuffer(x,x)
SrvInvalidateBitMapRect at 8 ; SrvInvalidateBitMapRect(x,x)
SrvVDMConsoleOperation at 8 ; SrvVDMConsoleOperation(x,x)
SrvSetConsoleCursor at 8 ; SrvSetConsoleCursor(x,x)
SrvShowConsoleCursor at 8 ; SrvShowConsoleCursor(x,x)
SrvConsoleMenuControl at 8 ; SrvConsoleMenuControl(x,x)
SrvSetConsolePalette at 8 ; SrvSetConsolePalette(x,x)
SrvSetConsoleDisplayMode at 8 ; SrvSetConsoleDisplayMode(x,x)
SrvRegisterConsoleVDM at 8 ; SrvRegisterConsoleVDM(x,x)
SrvGetConsoleHardwareState at 8 ; SrvGetConsoleHardwareState(x,x)
SrvSetConsoleHardwareState at 8 ; SrvSetConsoleHardwareState(x,x)
SrvGetConsoleDisplayMode at 8 ; SrvGetConsoleDisplayMode(x,x)
SrvAddConsoleAlias at 8 ; SrvAddConsoleAlias(x,x)
SrvGetConsoleAlias at 8 ; SrvGetConsoleAlias(x,x)
SrvGetConsoleAliasesLength at 8 ; SrvGetConsoleAliasesLength(x,x)
SrvGetConsoleAliasExesLength at 8 ; SrvGetConsoleAliasExesLength(x,x)
SrvGetConsoleAliases at 8 ; SrvGetConsoleAliases(x,x)
SrvGetConsoleAliasExes at 8 ; SrvGetConsoleAliasExes(x,x)
SrvExpungeConsoleCommandHistory at 8 ; SrvExpungeConsoleCommandHistory(x,x)
SrvSetConsoleNumberOfCommands at 8 ; SrvSetConsoleNumberOfCommands(x,x)
SrvGetConsoleCommandHistoryLength at 8 ; SrvGetConsoleCommandHistoryLength(x,x)
SrvGetConsoleCommandHistory at 8 ; SrvGetConsoleCommandHistory(x,x)
SrvSetConsoleCommandHistoryMode at 8 ; SrvSetConsoleCommandHistoryMode(x,x)
SrvGetConsoleCP at 8 ; SrvGetConsoleCP(x,x)
SrvSetConsoleCP at 8 ; SrvSetConsoleCP(x,x)
SrvSetConsoleKeyShortcuts at 8 ; SrvSetConsoleKeyShortcuts(x,x)
SrvSetConsoleMenuClose at 8 ; SrvSetConsoleMenuClose(x,x)
SrvConsoleNotifyLastClose at 8 ; SrvConsoleNotifyLastClose(x,x)
SrvGenerateConsoleCtrlEvent at 8 ; SrvGenerateConsoleCtrlEvent(x,x)
SrvGetConsoleKeyboardLayoutName at 8 ; SrvGetConsoleKeyboardLayoutName(x,x)
SrvGetConsoleWindow at 8 ; SrvGetConsoleWindow(x,x)
SrvGetConsoleCharType at 8 ; SrvGetConsoleCharType(x,x)
SrvSetConsoleLocalEUDC at 8 ; SrvSetConsoleLocalEUDC(x,x)
SrvSetConsoleCursorMode at 8 ; SrvSetConsoleCursorMode(x,x)
SrvGetConsoleCursorMode at 8 ; SrvGetConsoleCursorMode(x,x)
SrvRegisterConsoleOS2 at 8 ; SrvRegisterConsoleOS2(x,x)
SrvSetConsoleOS2OemFormat at 8 ; SrvSetConsoleOS2OemFormat(x,x)
SrvGetConsoleNlsMode at 8 ; SrvGetConsoleNlsMode(x,x)
SrvSetConsoleNlsMode at 8 ; SrvSetConsoleNlsMode(x,x)
SrvRegisterConsoleIME at 8 ; SrvRegisterConsoleIME(x,x)
SrvUnregisterConsoleIME at 8 ; SrvUnregisterConsoleIME(x,x)
SrvGetConsoleLangId at 8 ; SrvGetConsoleLangId(x,x)
SrvAttachConsole at 8 ; SrvAttachConsole(x,x)
SrvGetConsoleSelectionInfo at 8 ; SrvGetConsoleSelectionInfo(x,x)
SrvGetConsoleProcessList at 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


More information about the Ros-dev mailing list