33 SrvWriteConsoleOutput,
34 SrvReadConsoleOutputString,
35 SrvWriteConsoleOutputString,
38 SrvGetConsoleNumberOfFonts,
39 SrvGetConsoleNumberOfInputEvents,
40 SrvGetConsoleScreenBufferInfo,
41 SrvGetConsoleCursorInfo,
42 SrvGetConsoleMouseInfo,
43 SrvGetConsoleFontInfo,
44 SrvGetConsoleFontSize,
45 SrvGetConsoleCurrentFont,
47 SrvSetConsoleActiveScreenBuffer,
48 SrvFlushConsoleInputBuffer,
49 SrvGetLargestConsoleWindowSize,
50 SrvSetConsoleScreenBufferSize,
51 SrvSetConsoleCursorPosition,
52 SrvSetConsoleCursorInfo,
53 SrvSetConsoleWindowInfo,
54 SrvScrollConsoleScreenBuffer,
55 SrvSetConsoleTextAttribute,
61 SrvGetHandleInformation,
62 SrvSetHandleInformation,
64 SrvVerifyConsoleIoHandle,
69 SrvCreateConsoleScreenBuffer,
70 SrvInvalidateBitMapRect,
71 SrvVDMConsoleOperation,
74 SrvConsoleMenuControl,
76 SrvSetConsoleDisplayMode,
77 SrvRegisterConsoleVDM,
78 SrvGetConsoleHardwareState,
79 SrvSetConsoleHardwareState,
80 SrvGetConsoleDisplayMode,
83 SrvGetConsoleAliasesLength,
84 SrvGetConsoleAliasExesLength,
86 SrvGetConsoleAliasExes,
87 SrvExpungeConsoleCommandHistory,
88 SrvSetConsoleNumberOfCommands,
89 SrvGetConsoleCommandHistoryLength,
90 SrvGetConsoleCommandHistory,
91 SrvSetConsoleCommandHistoryMode,
94 SrvSetConsoleKeyShortcuts,
95 SrvSetConsoleMenuClose,
96 SrvConsoleNotifyLastClose,
97 SrvGenerateConsoleCtrlEvent,
98 SrvGetConsoleKeyboardLayoutName,
100 SrvGetConsoleCharType,
101 SrvSetConsoleLocalEUDC,
102 SrvSetConsoleCursorMode,
103 SrvGetConsoleCursorMode,
104 SrvRegisterConsoleOS2,
105 SrvSetConsoleOS2OemFormat,
106 SrvGetConsoleNlsMode,
107 SrvSetConsoleNlsMode,
108 SrvRegisterConsoleIME,
109 SrvUnregisterConsoleIME,
113 SrvGetConsoleSelectionInfo,
114 SrvGetConsoleProcessList,
116 SrvGetConsoleHistory,
117 SrvSetConsoleHistory,
230 "WriteConsoleOutput",
231 "ReadConsoleOutputString",
232 "WriteConsoleOutputString",
235 "GetConsoleNumberOfFonts",
236 "GetConsoleNumberOfInputEvents",
237 "GetConsoleScreenBufferInfo",
238 "GetConsoleCursorInfo",
239 "GetConsoleMouseInfo",
240 "GetConsoleFontInfo",
241 "GetConsoleFontSize",
242 "GetConsoleCurrentFont",
244 "SetConsoleActiveScreenBuffer",
245 "FlushConsoleInputBuffer",
246 "GetLargestConsoleWindowSize",
247 "SetConsoleScreenBufferSize",
248 "SetConsoleCursorPosition",
249 "SetConsoleCursorInfo",
250 "SetConsoleWindowInfo",
251 "ScrollConsoleScreenBuffer",
252 "SetConsoleTextAttribute",
258 "GetHandleInformation",
259 "SetHandleInformation",
261 "VerifyConsoleIoHandle",
266 "CreateConsoleScreenBuffer",
267 "InvalidateBitMapRect",
268 "VDMConsoleOperation",
271 "ConsoleMenuControl",
273 "SetConsoleDisplayMode",
274 "RegisterConsoleVDM",
275 "GetConsoleHardwareState",
276 "SetConsoleHardwareState",
277 "GetConsoleDisplayMode",
280 "GetConsoleAliasesLength",
281 "GetConsoleAliasExesLength",
283 "GetConsoleAliasExes",
284 "ExpungeConsoleCommandHistory",
285 "SetConsoleNumberOfCommands",
286 "GetConsoleCommandHistoryLength",
287 "GetConsoleCommandHistory",
288 "SetConsoleCommandHistoryMode",
291 "SetConsoleKeyShortcuts",
292 "SetConsoleMenuClose",
293 "ConsoleNotifyLastClose",
294 "GenerateConsoleCtrlEvent",
295 "GetConsoleKeyboardLayoutName",
297 "GetConsoleCharType",
298 "SetConsoleLocalEUDC",
299 "SetConsoleCursorMode",
300 "GetConsoleCursorMode",
301 "RegisterConsoleOS2",
302 "SetConsoleOS2OemFormat",
305 "RegisterConsoleIME",
306 "UnregisterConsoleIME",
310 "GetConsoleSelectionInfo",
311 "GetConsoleProcessList",
349 RtlZeroMemory(TargetProcessData,
sizeof(*TargetProcessData));
350 TargetProcessData->
Process = TargetProcess;
388 DPRINT1(
"Inheriting handles table failed\n");
413 if ( ConnectionInfo ==
NULL ||
414 ConnectionInfoLength ==
NULL ||
415 *ConnectionInfoLength !=
sizeof(*ConnectInfo) )
417 DPRINT1(
"CONSRV: Connection failed - ConnectionInfo = 0x%p ; ConnectionInfoLength = 0x%p (%lu), expected %lu\n",
419 ConnectionInfoLength,
420 ConnectionInfoLength ? *ConnectionInfoLength : (
ULONG)-1,
421 sizeof(*ConnectInfo));
430 DPRINT(
"ConnectInfo->IsConsoleApp = %s\n", ConnectInfo->
IsConsoleApp ?
"True" :
"False");
438 DPRINT(
"ConSrvConnect - Allocate a new console\n");
503 DPRINT1(
"Console allocation failed\n");
509 DPRINT(
"ConSrvConnect - Reuse current (parent's) console\n");
521 DPRINT1(
"Console inheritance failed\n");
545 DPRINT(
"ConSrvDisconnect - calling ConSrvRemoveConsole\n");
575 LoadedServerDll->NameTable = ConsoleServerApiNameTable;
#define CONSRV_FIRST_API_NUMBER
struct _CONSRV_API_CONNECTINFO * PCONSRV_API_CONNECTINFO
#define ConsoleGetPerProcessData(Process)
ULONG NTAPI ConsoleClientShutdown(IN PCSR_PROCESS CsrProcess, IN ULONG Flags, IN BOOLEAN FirstPhase)
struct _CONSOLE_PROCESS_DATA CONSOLE_PROCESS_DATA
NTSTATUS(NTAPI * PCSR_API_ROUTINE)(IN OUT PCSR_API_MESSAGE ApiMessage, IN OUT PCSR_REPLY_CODE ReplyCode OPTIONAL)
#define CSR_SERVER_DLL_INIT(n)
#define NT_SUCCESS(StatCode)
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSTATUS NTAPI NtReadVirtualMemory(IN HANDLE ProcessHandle, IN PVOID BaseAddress, OUT PVOID Buffer, IN SIZE_T NumberOfBytesToRead, OUT PSIZE_T NumberOfBytesRead OPTIONAL)
PCONSOLE_START_INFO ConsoleStartInfo
LPTHREAD_START_ROUTINE CtrlRoutine
struct _CONSOLE_IO_HANDLE * HandleTable
RTL_CRITICAL_SECTION HandleTableLock
LPTHREAD_START_ROUTINE PropRoutine
WCHAR ConsoleTitle[MAX_PATH+1]
LPTHREAD_START_ROUTINE PropRoutine
CONSOLE_START_INFO ConsoleStartInfo
LPTHREAD_START_ROUTINE CtrlRoutine
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
BOOLEAN NTAPI ConSrvValidateConsole(OUT PCONSRV_CONSOLE *Console, IN HANDLE ConsoleHandle, IN CONSOLE_STATE ExpectedState, IN BOOLEAN LockConsole)
VOID NTAPI ConSrvInitConsoleSupport(VOID)
NTSTATUS ConSrvAllocateConsole(IN OUT PCONSOLE_PROCESS_DATA ProcessData, OUT PHANDLE pInputHandle, OUT PHANDLE pOutputHandle, OUT PHANDLE pErrorHandle, IN OUT PCONSOLE_INIT_INFO ConsoleInitInfo)
NTSTATUS ConSrvRemoveConsole(IN OUT PCONSOLE_PROCESS_DATA ProcessData)
NTSTATUS ConSrvInheritConsole(IN OUT PCONSOLE_PROCESS_DATA ProcessData, IN HANDLE ConsoleHandle, IN BOOLEAN CreateNewHandleTable, OUT PHANDLE pInputHandle, OUT PHANDLE pOutputHandle, OUT PHANDLE pErrorHandle, IN OUT PCONSOLE_START_INFO ConsoleStartInfo)
NTSTATUS ConSrvInheritHandlesTable(IN PCONSOLE_PROCESS_DATA SourceProcessData, IN PCONSOLE_PROCESS_DATA TargetProcessData)
#define ConsoleAllocHeap(Flags, Size)
#define ConsoleFreeHeap(HeapBase)
NTSTATUS NTAPI ConSrvNewProcess(PCSR_PROCESS SourceProcess, PCSR_PROCESS TargetProcess)
BOOLEAN ConsoleServerApiServerValidTable[ConsolepMaxApiNumber - CONSRV_FIRST_API_NUMBER]
HINSTANCE ConSrvDllInstance
VOID NTAPI ConSrvDisconnect(IN PCSR_PROCESS CsrProcess)
NTSTATUS NTAPI ConSrvConnect(IN PCSR_PROCESS CsrProcess, IN OUT PVOID ConnectionInfo, IN OUT PULONG ConnectionInfoLength)
PCSR_API_ROUTINE ConsoleServerApiDispatchTable[ConsolepMaxApiNumber - CONSRV_FIRST_API_NUMBER]
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)