WINSRV Console API Routines

As a CSRSS Server DLL, the console server in WINSRV.DLL implements API routines which a CSRSS client can call through the NTDLL function CsrClientCallServer and which other DLLs in the CSRSS.EXE server process may be allowed to call through the CSRSRV function CsrCallServerFromServer. Although most CSRSS server DLLs allow most API routines to be called from the server process, the console server does not. For the following table, an API routine is invalid as a server call unless explicitly noted as valid.

Availability

The console server was discontinued in Windows 8 but although it persists in Windows 7 it has no API dispatch table, functionality having been removed to the separate CONHOST.EXE process.

Routines

The console server’s API routines each have the prototype

ULONG ApiRoutine (CSR_API_MSG *, CSR_REPLY_STATUS *);

The caller selects a routine by specifying an API number. The high word is a 0-based index for the console server as a CSRSS server DLL. Known clients and WINSRV itself (for the slightly different matter of accessing server-specific per-process data) assume that this index is 2. Whatever symbolic names Microsoft has for the API numbers as constants to use when calling the corresponding API routines are not known. The table below gives only the name of each API routine as known from public symbol files for WINSRV.DLL.

API Number API Routine Versions Remarks
0x00020200 SrvOpenConsole 3.10 to 6.0  
0x00020201 SrvGetConsoleInput 3.10 to 6.0  
0x00020202 SrvWriteConsoleInput 3.10 to 6.0  
0x00020203 SrvReadConsoleOutput 3.10 to 6.0  
0x00020204 SrvWriteConsoleOutput 3.10 to 6.0  
0x00020205 SrvReadConsoleOutputString 3.10 to 6.0  
0x00020206 SrvWriteConsoleOutputString 3.10 to 6.0  
0x00020207 SrvFillConsoleOutput 3.10 to 6.0  
0x00020208 SrvGetConsoleMode 3.10 to 6.0  
0x00020209 SrvGetConsoleNumberOfFonts 3.10 to 6.0  
0x0002020A SrvGetConsoleNumberOfInputEvents 3.10 to 6.0  
0x0002020B SrvGetConsoleScreenBufferInfo 3.10 to 6.0  
0x0002020C SrvGetConsoleCursorInfo 3.10 to 6.0  
0x0002020D SrvGetConsoleMouseInfo 3.10 to 6.0  
0x0002020E SrvGetConsoleFontInfo 3.10 to 6.0  
0x0002020F SrvGetConsoleFontSize 3.10 to 6.0  
0x00020210 SrvGetConsoleCurrentFont 3.10 to 6.0  
0x00020211 SrvSetConsoleMode 3.10 to 6.0  
0x00020212 SrvSetConsoleActiveScreenBuffer 3.10 to 6.0  
0x00020213 SrvFlushConsoleInputBuffer 3.10 to 6.0  
0x00020214 SrvGetLargestConsoleWindowSize 3.10 to 6.0  
0x00020215 SrvSetConsoleScreenBufferSize 3.10 to 6.0  
0x00020216 SrvSetConsoleCursorPosition 3.10 to 6.0  
0x00020217 SrvSetConsoleCursorInfo 3.10 to 6.0  
0x00020218 SrvSetConsoleWindowInfo 3.10 to 6.0  
0x00020219 SrvScrollConsoleScreenBuffer 3.10 to 6.0  
0x0020021A SrvSetConsoleTextAttribute 3.10 to 6.0  
0x0002021B SrvSetConsoleFont 3.10 to 6.0  
0x0002021C SrvSetConsoleIcon 4.0 to 6.0  
0x0002021C (3.10 to 3.51);
0x0002021D
SrvReadConsole 3.10 to 6.0  
0x0002021D (3.10 to 3.51);
0x0002021E
SrvWriteConsole 3.10 to 6.0  
0x0002021E (3.10 to 3.51);
0x0002021F
SrvDuplicateHandle 3.10 to 6.0  
0x00020220 SrvGetHandleInformation 5.0 to 6.0  
0x00020221 SrvSetHandleInformation 5.0 to 6.0  
0x0002021F (3.10 to 3.51);
0x00020220 (4.0);
0x00020222
SrvCloseHandle 3.10 to 6.0  
0x00020220 (3.10 to 3.51);
0x00020221 (4.0);
0x00020223
SrvVerifyConsoleIoHandle 3.10 to 6.0  
0x00020221 (3.10 to 3.51);
0x00020222 (4.0);
0x00020224
SrvAllocConsole 3.10 to 6.0  
0x00020222 (3.10 to 3.51);
0x00020223 (4.0);
0x00020225
SrvFreeConsole 3.10 to 6.0  
0x00020223 (3.10 to 3.51);
0x00020224 (4.0);
0x00020226
SrvGetConsoleTitle 3.10 to 6.0  
0x00020224 (3.10 to 3.51);
0x00020025 (4.0);
0x00020027
SrvSetConsoleTitle 3.10 to 6.0  
0x00020225 (3.10 to 3.51);
0x00020226 (4.0);
0x00020228
SrvCreateConsoleScreenBuffer 3.10 to 6.0  
0x00020226 (3.10 to 3.51);
0x00020227 (4.0);
0x00020229
SrvInvalidateBitMapRect 3.10 to 6.0  
0x00020227 (3.10 to 3.51);
0x00020228 (4.0);
0x0002022A
SrvVDMConsoleOperation 3.10 to 6.0  
0x00020228 (3.10 to 3.51);
0x00020229 (4.0);
0x0002022B
SrvSetConsoleCursor 3.10 to 6.0  
0x00020229 (3.10 to 3.51);
0x0002022A (4.0);
0x0002022C
SrvShowConsoleCursor 3.10 to 6.0  
0x0002022A (3.10 to 3.51);
0x0002022B (4.0);
0x0002022D
SrvConsoleMenuControl 3.10 to 6.0  
0x0002022B (3.10 to 3.51);
0x0002022C (4.0);
0x0002022E
SrvSetConsolePalette 3.10 to 6.0  
0x0002022C (3.10 to 3.51);
0x0002022D (4.0);
0x0002022F
SrvSetConsoleDisplayMode 3.10 to 6.0  
0x0002022D (3.10 to 3.51);
0x0002022E (4.0);
0x00020230
SrvRegisterConsoleVDM 3.10 to 6.0  
0x0002022E (3.10 to 3.51);
0x0002022F (4.0);
0x00020231
SrvGetConsoleHardwareState 3.10 to 6.0  
0x0002022F (3.10 to 3.51);
0x00020230 (4.0);
0x00020232
SrvSetConsoleHardwareState 3.10 to 6.0  
0x00020230 (3.10 to 3.51);
0x00020231 (4.0);
0x00020233
SrvGetConsoleDisplayMode 3.10 to 6.0 valid as server call in 3.51 to 6.0
0x00020231 (3.10 to 3.51);
0x00020232 (4.0);
0x00020234
SrvAddConsoleAlias 3.10 to 6.0  
0x00020232 (3.10 to 3.51);
0x00020233 (4.0);
0x00020235
SrvGetConsoleAlias 3.10 to 6.0  
0x00020233 (3.10 to 3.51);
0x00020234 (4.0);
0x00020236
SrvGetConsoleAliasesLength 3.10 to 6.0  
0x00020234 (3.10 to 3.51);
0x00020235 (4.0);
0x00020237
SrvGetConsoleAliasExesLength 3.10 to 6.0  
0x00020235 (3.10 to 3.51);
0x00020236 (4.0);
0x00020238
SrvGetConsoleAliases 3.10 to 6.0  
0x00020236 (3.10 to 3.51);
0x00020237 (4.0);
0x00020239
SrvGetConsoleAliasExes 3.10 to 6.0  
0x00020237 (3.10 to 3.51);
0x00020238 (4.0);
0x0002023A
SrvExpungeConsoleCommandHistory 3.10 to 6.0  
0x00020238 (3.10 to 3.51);
0x00020239 (4.0);
0x0002023B
SrvSetConsoleNumberOfCommands 3.10 to 6.0  
0x00020239 (3.10 to 3.51);
0x0002023A (4.0);
0x0002023C
SrvGetConsoleCommandHistoryLength 3.10 to 6.0  
0x0002023A (3.10 to 3.51);
0x0002023B (4.0);
0x0002023D
SrvGetConsoleCommandHistory 3.10 to 6.0  
0x0002023B (3.10 to 3.51);
0x00020023C (4.0);
0x00020023E (5.0 to 5.2)
SrvSetConsoleCommandHistoryMode 3.10 to 5.2  
0x0002023C (3.10 to 3.51);
0x0002023D (4.0);
0x0002023F (5.0 to 5.2);
0x0002023E
SrvGetConsoleCP 3.10 to 6.0  
0x0002023D (3.10 to 3.51);
0x0002023E (4.0);
0x00020240 (5.0 to 5.2);
0x0002023F
SrvSetConsoleCP 3.10 to 6.0  
0x0002023E (3.10 to 3.51);
0x0002023F (4.0);
0x00020241 (5.0 to 5.2);
0x00020240
SrvSetConsoleKeyShortcuts 3.10 to 6.0  
0x0002023F (3.10 to 3.51);
0x00020240 (4.0);
0x00020242 (5.0 to 5.2);
0x00020241
SrvSetConsoleMenuClose 3.10 to 6.0  
0x00020240 (3.10 to 3.51);
0x00020241 (4.0);
0x00020243 (5.0 to 5.2);
0x00020242
SrvConsoleNotifyLastClose 3.10 to 6.0  
0x00020241 (3.10 to 3.51);
0x00020242 (4.0);
0x00020244 (5.0 to 5.2);
0x00020243
SrvGenerateConsoleCtrlEvent 3.10 to 6.0  
0x00020242 (3.10) SrvConsoleSubst 3.10 only  
0x00020243 (4.0);
0x00020245 (5.0 to 5.2);
0x00020244
SrvGetConsoleKeyboardLayoutName 4.0 to 6.0  
0x00020246 (5.0 to 5.2);
0x00020245
SrvGetConsoleWindow 5.0 to 6.0   
0x00020247 (5.0 to 5.2);
0x00020246
SrvGetConsoleCharType 5.0 to 6.0  
0x00020248 (5.0 to 5.2);
0x00020247
SrvSetConsoleLocalEUDC 5.0 to 6.0  
0x00020249 (5.0 to 5.2);
0x00020248
SrvSetConsoleCursorMode 5.0 to 6.0  
0x0002024A (5.0 to 5.2);
0x00020249
SrvGetConsoleCursorMode 5.0 to 6.0  
0x0002024B (5.0 to 5.2);
0x0002024A
SrvRegisterConsoleOS2 5.0 to 6.0  
0x0002024C (5.0 to 5.2);
0x0002024B
SrvSetConsoleOS2OemFormat 5.0 to 6.0  
0x0002024D (5.0 to 5.2);
0x0002024C
SrvGetConsoleNlsMode 5.0 to 6.0  
0x0002024E (5.0 to 5.2);
0x0002024D
SrvSetConsoleNlsMode 5.0 to 6.0  
0x0002024F (5.0 to 5.2);
0x0002024E
SrvRegisterConsoleIME 5.0 to 6.0  
0x00020250 (5.0 to 5.2);
0x0002024F
SrvUnregisterConsoleIME 5.0 to 6.0  
0x00020250 SrvQueryConsoleIME 6.0 only  
0x00020251  SrvGetConsoleLangId 5.0 to 6.0  
0x00020252 SrvAttachConsole 5.1 to 6.0  
0x00020253 SrvGetConsoleSelectionInfo 5.1 to 6.0  
0x00020254 SrvGetConsoleProcessList 5.1 to 6.0  
0x00020255 SrvGetConsoleHistory 6.0 only  
0x00020256 SrvSetConsoleHistory 6.0 only  
0x00020257 SrvSetConsoleCurrentFont 6.0 only  
0x00020258 SrvSetScreenBufferInfo 6.0 only