2013-04-07 23:18:59 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Console Server DLL
|
2015-10-05 12:21:25 +00:00
|
|
|
* FILE: win32ss/user/winsrv/consrv/api.h
|
2013-04-07 23:18:59 +00:00
|
|
|
* PURPOSE: Public server APIs definitions
|
|
|
|
* PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-04-12 10:45:31 +00:00
|
|
|
/*
|
|
|
|
* Helper macros to define the CSR_API_ROUTINE-s defined in CONSRV,
|
|
|
|
* factoring out the common prologue and epilogue code, and including
|
|
|
|
* the necessary local variables.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define CON_API_NOCONSOLE_IMPL(Name, TYPE, RequestName) \
|
|
|
|
NTSTATUS \
|
|
|
|
Name##Impl( \
|
|
|
|
IN PCONSOLE_PROCESS_DATA ProcessData, \
|
|
|
|
IN OUT PCSR_API_MESSAGE ApiMessage, \
|
|
|
|
IN TYPE* RequestName, /* Request */ \
|
|
|
|
IN OUT PCSR_REPLY_CODE ReplyCode OPTIONAL)
|
|
|
|
|
|
|
|
// NTSTATUS NTAPI
|
|
|
|
// Name(
|
|
|
|
// IN OUT PCSR_API_MESSAGE ApiMessage,
|
|
|
|
// IN OUT PCSR_REPLY_CODE ReplyCode OPTIONAL)
|
|
|
|
#define CON_API_NOCONSOLE_ENTRY(Name, TYPE, RequestName) \
|
|
|
|
CON_API_NOCONSOLE_IMPL(Name, TYPE, RequestName); \
|
|
|
|
CSR_API(Name) \
|
|
|
|
{ \
|
|
|
|
TYPE* RequestName = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.RequestName; \
|
|
|
|
PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); \
|
|
|
|
\
|
|
|
|
return Name##Impl(ProcessData, ApiMessage, RequestName, ReplyCode); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CON_API_NOCONSOLE(Name, TYPE, RequestName) \
|
|
|
|
CON_API_NOCONSOLE_ENTRY(Name, TYPE, RequestName); \
|
|
|
|
CON_API_NOCONSOLE_IMPL(Name, TYPE, RequestName)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define CON_API_IMPL(Name, TYPE, RequestName) \
|
|
|
|
NTSTATUS \
|
|
|
|
Name##Impl( \
|
|
|
|
IN PCONSOLE_PROCESS_DATA ProcessData, \
|
|
|
|
IN PCONSRV_CONSOLE Console, \
|
|
|
|
IN OUT PCSR_API_MESSAGE ApiMessage, \
|
|
|
|
IN TYPE* RequestName, /* Request */ \
|
|
|
|
IN OUT PCSR_REPLY_CODE ReplyCode OPTIONAL)
|
|
|
|
|
|
|
|
// NTSTATUS NTAPI
|
|
|
|
// Name(
|
|
|
|
// IN OUT PCSR_API_MESSAGE ApiMessage,
|
|
|
|
// IN OUT PCSR_REPLY_CODE ReplyCode OPTIONAL)
|
|
|
|
#define CON_API_ENTRY(Name, TYPE, RequestName) \
|
|
|
|
CON_API_IMPL(Name, TYPE, RequestName); \
|
|
|
|
CSR_API(Name) \
|
|
|
|
{ \
|
|
|
|
NTSTATUS Status; \
|
|
|
|
TYPE* RequestName = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.RequestName; \
|
|
|
|
PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); \
|
|
|
|
PCONSRV_CONSOLE Console; \
|
|
|
|
\
|
|
|
|
Status = ConSrvGetConsole(ProcessData, \
|
|
|
|
/* RequestName->ConsoleHandle, */ \
|
|
|
|
&Console, TRUE); \
|
|
|
|
if (!NT_SUCCESS(Status)) \
|
|
|
|
return Status; \
|
|
|
|
\
|
|
|
|
Status = Name##Impl(ProcessData, Console, \
|
|
|
|
ApiMessage, RequestName, ReplyCode); \
|
|
|
|
\
|
|
|
|
ConSrvReleaseConsole(Console, TRUE); \
|
|
|
|
return Status; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CON_API(Name, TYPE, RequestName) \
|
|
|
|
CON_API_ENTRY(Name, TYPE, RequestName); \
|
|
|
|
CON_API_IMPL(Name, TYPE, RequestName)
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* List of CSR_API_ROUTINE-s defined in this module.
|
|
|
|
*/
|
|
|
|
|
2013-04-07 23:18:59 +00:00
|
|
|
/* alias.c */
|
|
|
|
CSR_API(SrvAddConsoleAlias);
|
|
|
|
CSR_API(SrvGetConsoleAlias);
|
|
|
|
CSR_API(SrvGetConsoleAliases);
|
|
|
|
CSR_API(SrvGetConsoleAliasesLength);
|
|
|
|
CSR_API(SrvGetConsoleAliasExes);
|
|
|
|
CSR_API(SrvGetConsoleAliasExesLength);
|
|
|
|
|
|
|
|
/* coninput.c */
|
2013-04-07 23:39:39 +00:00
|
|
|
CSR_API(SrvReadConsole);
|
2013-04-07 23:18:59 +00:00
|
|
|
CSR_API(SrvGetConsoleInput);
|
|
|
|
CSR_API(SrvWriteConsoleInput);
|
|
|
|
CSR_API(SrvFlushConsoleInputBuffer);
|
|
|
|
CSR_API(SrvGetConsoleNumberOfInputEvents);
|
|
|
|
|
|
|
|
/* conoutput.c */
|
2013-05-29 00:29:07 +00:00
|
|
|
CSR_API(SrvInvalidateBitMapRect);
|
2013-08-12 16:12:58 +00:00
|
|
|
CSR_API(SrvSetConsolePalette);
|
2013-04-07 23:18:59 +00:00
|
|
|
CSR_API(SrvReadConsoleOutput);
|
2013-04-07 23:39:39 +00:00
|
|
|
CSR_API(SrvWriteConsole);
|
2013-04-07 23:18:59 +00:00
|
|
|
CSR_API(SrvWriteConsoleOutput);
|
|
|
|
CSR_API(SrvReadConsoleOutputString);
|
|
|
|
CSR_API(SrvWriteConsoleOutputString);
|
|
|
|
CSR_API(SrvFillConsoleOutput);
|
|
|
|
CSR_API(SrvGetConsoleCursorInfo);
|
|
|
|
CSR_API(SrvSetConsoleCursorInfo);
|
2013-04-07 23:39:39 +00:00
|
|
|
CSR_API(SrvSetConsoleCursorPosition);
|
2013-04-07 23:18:59 +00:00
|
|
|
CSR_API(SrvSetConsoleTextAttribute);
|
|
|
|
CSR_API(SrvCreateConsoleScreenBuffer);
|
|
|
|
CSR_API(SrvGetConsoleScreenBufferInfo);
|
|
|
|
CSR_API(SrvSetConsoleActiveScreenBuffer);
|
|
|
|
CSR_API(SrvSetConsoleScreenBufferSize);
|
2013-08-30 17:53:45 +00:00
|
|
|
CSR_API(SrvScrollConsoleScreenBuffer);
|
|
|
|
CSR_API(SrvSetConsoleWindowInfo);
|
2013-04-07 23:18:59 +00:00
|
|
|
|
|
|
|
/* console.c */
|
|
|
|
CSR_API(SrvAllocConsole);
|
|
|
|
CSR_API(SrvAttachConsole);
|
|
|
|
CSR_API(SrvFreeConsole);
|
|
|
|
CSR_API(SrvGetConsoleMode);
|
2013-04-07 23:39:39 +00:00
|
|
|
CSR_API(SrvSetConsoleMode);
|
2013-04-07 23:18:59 +00:00
|
|
|
CSR_API(SrvGetConsoleTitle);
|
2013-04-07 23:39:39 +00:00
|
|
|
CSR_API(SrvSetConsoleTitle);
|
2013-08-30 17:53:45 +00:00
|
|
|
CSR_API(SrvGetConsoleCP);
|
|
|
|
CSR_API(SrvSetConsoleCP);
|
|
|
|
CSR_API(SrvGetConsoleProcessList);
|
|
|
|
CSR_API(SrvGenerateConsoleCtrlEvent);
|
|
|
|
CSR_API(SrvConsoleNotifyLastClose);
|
|
|
|
|
|
|
|
CSR_API(SrvGetConsoleMouseInfo);
|
|
|
|
CSR_API(SrvSetConsoleKeyShortcuts);
|
|
|
|
CSR_API(SrvGetConsoleKeyboardLayoutName);
|
|
|
|
CSR_API(SrvGetConsoleCharType);
|
|
|
|
CSR_API(SrvSetConsoleLocalEUDC);
|
|
|
|
CSR_API(SrvSetConsoleCursorMode);
|
|
|
|
CSR_API(SrvGetConsoleCursorMode);
|
|
|
|
CSR_API(SrvGetConsoleNlsMode);
|
|
|
|
CSR_API(SrvSetConsoleNlsMode);
|
|
|
|
CSR_API(SrvGetConsoleLangId);
|
|
|
|
|
|
|
|
/* frontendctl.c */
|
2013-04-07 23:18:59 +00:00
|
|
|
CSR_API(SrvGetConsoleHardwareState);
|
|
|
|
CSR_API(SrvSetConsoleHardwareState);
|
|
|
|
CSR_API(SrvGetConsoleDisplayMode);
|
|
|
|
CSR_API(SrvSetConsoleDisplayMode);
|
2013-04-09 15:21:14 +00:00
|
|
|
CSR_API(SrvGetLargestConsoleWindowSize);
|
2013-06-01 22:49:50 +00:00
|
|
|
CSR_API(SrvShowConsoleCursor);
|
|
|
|
CSR_API(SrvSetConsoleCursor);
|
2013-05-30 00:50:03 +00:00
|
|
|
CSR_API(SrvConsoleMenuControl);
|
|
|
|
CSR_API(SrvSetConsoleMenuClose);
|
2019-04-28 00:40:20 +00:00
|
|
|
|
|
|
|
/* Used by USERSRV!SrvGetThreadConsoleDesktop() */
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
GetThreadConsoleDesktop(
|
|
|
|
IN ULONG_PTR ThreadId,
|
|
|
|
OUT HDESK* ConsoleDesktop);
|
|
|
|
|
2013-04-07 23:18:59 +00:00
|
|
|
CSR_API(SrvGetConsoleWindow);
|
|
|
|
CSR_API(SrvSetConsoleIcon);
|
|
|
|
CSR_API(SrvGetConsoleSelectionInfo);
|
|
|
|
|
2013-08-30 17:53:45 +00:00
|
|
|
CSR_API(SrvGetConsoleNumberOfFonts);
|
|
|
|
CSR_API(SrvGetConsoleFontInfo);
|
|
|
|
CSR_API(SrvGetConsoleFontSize);
|
|
|
|
CSR_API(SrvGetConsoleCurrentFont);
|
|
|
|
CSR_API(SrvSetConsoleFont);
|
|
|
|
|
2013-04-07 23:18:59 +00:00
|
|
|
/* handle.c */
|
2013-04-07 23:39:39 +00:00
|
|
|
CSR_API(SrvOpenConsole);
|
2013-08-30 17:53:45 +00:00
|
|
|
CSR_API(SrvDuplicateHandle);
|
|
|
|
CSR_API(SrvGetHandleInformation);
|
|
|
|
CSR_API(SrvSetHandleInformation);
|
2013-04-07 23:18:59 +00:00
|
|
|
CSR_API(SrvCloseHandle);
|
|
|
|
CSR_API(SrvVerifyConsoleIoHandle);
|
|
|
|
|
2020-04-12 10:45:31 +00:00
|
|
|
/* history.c */
|
2013-04-07 23:18:59 +00:00
|
|
|
CSR_API(SrvGetConsoleCommandHistory);
|
2013-04-07 23:39:39 +00:00
|
|
|
CSR_API(SrvGetConsoleCommandHistoryLength);
|
2013-04-07 23:18:59 +00:00
|
|
|
CSR_API(SrvExpungeConsoleCommandHistory);
|
|
|
|
CSR_API(SrvSetConsoleNumberOfCommands);
|
|
|
|
CSR_API(SrvGetConsoleHistory);
|
|
|
|
CSR_API(SrvSetConsoleHistory);
|
2013-08-30 17:53:45 +00:00
|
|
|
CSR_API(SrvSetConsoleCommandHistoryMode);
|
|
|
|
|
|
|
|
/* subsysreg.c */
|
|
|
|
CSR_API(SrvRegisterConsoleVDM);
|
|
|
|
CSR_API(SrvVDMConsoleOperation);
|
|
|
|
CSR_API(SrvRegisterConsoleOS2);
|
|
|
|
CSR_API(SrvSetConsoleOS2OemFormat);
|
|
|
|
CSR_API(SrvRegisterConsoleIME);
|
|
|
|
CSR_API(SrvUnregisterConsoleIME);
|
2013-04-07 23:18:59 +00:00
|
|
|
|
|
|
|
/* EOF */
|