#include "precomp.h"
Go to the source code of this file.
Defines | |
#define | HandleFromIndex(i) ((HANDLE)((i & 0xFFFF) | (ConsoleId++ << 16))) |
#define | IndexFromHandle(h) ((USHORT)((ULONG_PTR)h & 0xFFFF)) |
#define | ConsoleHandleTableLocked() (ConsoleHandleLock.OwningThread == NtCurrentTeb()->ClientId.UniqueThread) |
Functions | |
VOID | AddProcessToList (IN OUT PCONSOLE_INFORMATION Console, IN OUT PCONSOLE_PROCESS_HANDLE ProcessHandleRecord, IN HANDLE ProcessHandle) |
VOID | FreeInputHandle (IN PHANDLE_DATA HandleData) |
NTSTATUS | InitializeConsoleHandleTable (VOID) |
NTSTATUS | DereferenceConsoleHandle (IN HANDLE ConsoleHandle, OUT PCONSOLE_INFORMATION *Console) |
NTSTATUS | GrowConsoleHandleTable (VOID) |
NTSTATUS | AllocateConsoleHandle (OUT PHANDLE Handle) |
NTSTATUS | FreeConsoleHandle (IN HANDLE Handle) |
NTSTATUS | ValidateConsole (IN PCONSOLE_INFORMATION Console) |
NTSTATUS | InitializeIoHandleTable (IN OUT PCONSOLE_INFORMATION Console, OUT PCONSOLE_PER_PROCESS_DATA ProcessData, OUT PHANDLE StdIn, OUT PHANDLE StdOut, OUT PHANDLE StdErr) |
NTSTATUS | InheritIoHandleTable (IN PCONSOLE_INFORMATION Console, IN PCONSOLE_PER_PROCESS_DATA ProcessData, IN PCONSOLE_PER_PROCESS_DATA ParentProcessData) |
NTSTATUS | ConsoleAddProcessRoutine (IN PCSR_PROCESS ParentProcess, IN PCSR_PROCESS Process) |
NTSTATUS | AllocateConsole (IN HANDLE ConsoleHandle, IN LPWSTR Title, IN USHORT TitleLength, IN HANDLE ClientProcessHandle, OUT PHANDLE StdIn, OUT PHANDLE StdOut, OUT PHANDLE StdErr, OUT PCONSOLE_PER_PROCESS_DATA ProcessData, IN OUT PCONSOLE_INFO ConsoleInfo, IN BOOLEAN WindowVisible, IN DWORD dwConsoleThreadId) |
VOID | DestroyConsole (IN PCONSOLE_INFORMATION Console) |
VOID | FreeCon (IN PCONSOLE_INFORMATION Console) |
VOID | InsertScreenBuffer (IN PCONSOLE_INFORMATION Console, IN PSCREEN_INFORMATION ScreenInfo) |
VOID | RemoveScreenBuffer (IN PCONSOLE_INFORMATION Console, IN PSCREEN_INFORMATION ScreenInfo) |
NTSTATUS | GrowIoHandleTable (IN PCONSOLE_PER_PROCESS_DATA ProcessData) |
VOID | FreeProcessData (IN PCONSOLE_PER_PROCESS_DATA ProcessData) |
VOID | InitializeOutputHandle (PHANDLE_DATA HandleData, PSCREEN_INFORMATION ScreenBuffer) |
BOOLEAN | InitializeInputHandle (PHANDLE_DATA HandleData, PINPUT_INFORMATION InputBuffer) |
NTSTATUS | AllocateIoHandle (IN PCONSOLE_PER_PROCESS_DATA ProcessData, IN ULONG HandleType, OUT PHANDLE Handle) |
NTSTATUS | FreeIoHandle (IN PCONSOLE_PER_PROCESS_DATA ProcessData, IN HANDLE Handle) |
NTSTATUS | DereferenceIoHandleNoCheck (IN PCONSOLE_PER_PROCESS_DATA ProcessData, IN HANDLE Handle, OUT PHANDLE_DATA *HandleData) |
NTSTATUS | DereferenceIoHandle (IN PCONSOLE_PER_PROCESS_DATA ProcessData, IN HANDLE Handle, IN ULONG HandleType, IN ACCESS_MASK Access, OUT PHANDLE_DATA *HandleData) |
ULONG | SrvVerifyConsoleIoHandle (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus) |
NTSTATUS | ApiPreamble (IN HANDLE ConsoleHandle, OUT PCONSOLE_INFORMATION *Console) |
NTSTATUS | RevalidateConsole (IN HANDLE ConsoleHandle, OUT PCONSOLE_INFORMATION *Console) |
Variables | |
PCONSOLE_INFORMATION | InitialConsoleHandles [CONSOLE_INITIAL_CONSOLES] |
PCONSOLE_INFORMATION * | ConsoleHandles |
ULONG | NumberOfConsoleHandles |
CRITICAL_SECTION | ConsoleHandleLock |
ULONG | ConsoleId = 47 |
|
Definition at line 42 of file w32/ntcon/server/handle.c. Referenced by AllocateConsoleHandle(), DereferenceConsoleHandle(), FreeConsoleHandle(), and GrowConsoleHandleTable(). |
|
Definition at line 40 of file w32/ntcon/server/handle.c. Referenced by AllocateConsoleHandle(), and CreateHandle(). |
|
Definition at line 41 of file w32/ntcon/server/handle.c. Referenced by AllocateConsole(), DereferenceConsoleHandle(), DestroyConsole(), DestroyHandle(), FreeConsoleHandle(), GetHandleData(), SetHandleData(), and ValidateCHandle(). |
|
Definition at line 895 of file srvinit.c. References ASSERT, CONSOLE_HAS_FOCUS, CONSOLE_SHUTTING_DOWN, CONSOLE_TERMINATING, and SetProcessFocus(). Referenced by ConsoleAddProcessRoutine(), ConsoleClientConnectRoutine(), and SrvAllocConsole().
|
|
Definition at line 789 of file w32/ntcon/server/handle.c. References BOOL, CM_CREATE_CONSOLE_WINDOW, CONSOLE_CLIENTTHREADHANDLE, CONSOLE_NO_WINDOW, CONSOLE_TAG, ConsoleHandles, ConsoleHeapAlloc, ConsoleHeapFree, ConsoleOutputCP, CreateEUDC(), CreateInputBuffer(), DoCreateScreenBuffer(), dwConsoleThreadId, FALSE, _CONSOLE_INFORMATION::Flags, FreeInputBuffer(), FreeScreenBuffer(), HorizontalClientToWindow, IndexFromHandle, INITIALIZATION_FAILED, INITIALIZATION_SUCCEEDED, InitializeConsoleCommandData(), InitializeIoHandleTable(), MAKE_TAG, MapHandle(), NT_SUCCESS, NtClose(), NtCreateEvent(), NtDuplicateObject(), NTSTATUS(), NULL, OEMCP, PostThreadMessage(), RtlDeleteCriticalSection(), RtlInitializeCriticalSection(), Status, TITLE_TAG, TranslateConsoleTitle(), TRUE, UnProtectHandle(), and VerticalClientToWindow. Referenced by SetUpConsole().
|
|
Definition at line 269 of file w32/ntcon/server/handle.c. References ASSERT, CONSOLE_HANDLE_ALLOCATED, ConsoleHandles, ConsoleHandleTableLocked, FALSE, GrowConsoleHandleTable(), Handle, HandleFromIndex, NT_SUCCESS, NTSTATUS(), NULL, NumberOfConsoleHandles, and Status. Referenced by SetUpConsole().
|
|
Definition at line 1390 of file w32/ntcon/server/handle.c. References ASSERT, CONSOLE_FREE_HANDLE, FALSE, GrowIoHandleTable(), Handle, NT_SUCCESS, NTSTATUS(), and Status. Referenced by InitializeIoHandleTable(), SrvCreateConsoleScreenBuffer(), SrvDuplicateHandle(), and SrvOpenConsole().
|
|
|
Definition at line 705 of file w32/ntcon/server/handle.c. References AddProcessToList(), ASSERT, CONSOLE_FREE_HANDLE, CONSOLE_FROMPROCESSPERPROCESSDATA, CONSOLE_INITIAL_IO_HANDLES, CONSOLE_SETCONSOLEAPPFROMPROCESSDATA, CONSOLE_SHUTTING_DOWN, _CONSOLE_PER_PROCESS_DATA::ConsoleHandle, ConsoleHeapAlloc, ConsoleHeapFree, _CONSOLE_PROCESS_HANDLE::CtrlRoutine, FALSE, _CONSOLE_INFORMATION::Flags, _CONSOLE_PER_PROCESS_DATA::Foo, HANDLE_TAG, _CONSOLE_PER_PROCESS_DATA::HandleTable, _CONSOLE_PER_PROCESS_DATA::HandleTablePtr, _CONSOLE_PER_PROCESS_DATA::HandleTableSize, _HANDLE_DATA::HandleType, InheritIoHandleTable(), MAKE_TAG, NT_SUCCESS, NTSTATUS(), NULL, _CONSOLE_PROCESS_HANDLE::Process, _CONSOLE_PROCESS_HANDLE::ProcessHandle, _CONSOLE_PROCESS_HANDLE::PropRoutine, _CONSOLE_INFORMATION::RefCount, RevalidateConsole(), _CONSOLE_PER_PROCESS_DATA::RootProcess, Status, and UnlockConsole(). Referenced by ConServerDllInitialization().
|
|
Definition at line 175 of file w32/ntcon/server/handle.c. References ASSERT, CONSOLE_TERMINATING, ConsoleHandles, ConsoleHandleTableLocked, IndexFromHandle, NULL, and NumberOfConsoleHandles. Referenced by RevalidateConsole(), SetUpConsole(), and WriteConsoleWaitRoutine().
|
|
|
Definition at line 1501 of file w32/ntcon/server/handle.c. References CONSOLE_FREE_HANDLE, and Handle. Referenced by CookedRead(), CookedReadWaitRoutine(), DirectReadWaitRoutine(), FindActiveScreenBufferHandle(), FreeIoHandle(), InitializeIoHandleTable(), ProcessCommandListInput(), ProcessCommandNumberInput(), ProcessCopyFromCharInput(), ProcessCopyToCharInput(), RawReadWaitRoutine(), RemoveConsole(), SrvCloseHandle(), SrvCreateConsoleScreenBuffer(), SrvDuplicateHandle(), SrvGetHandleInformation(), SrvOpenConsole(), SrvSetHandleInformation(), and SrvVerifyConsoleIoHandle().
|
|
Definition at line 1051 of file w32/ntcon/server/handle.c. References ASSERT, CONSOLE_IN_DESTRUCTION, _CONSOLE_INFORMATION::ConsoleHandle, ConsoleHandles, ConsoleHeapFree, ConsoleLocked, FreeConsoleHandle(), IndexFromHandle, LockConsoleHandleTable, NULL, RtlDeleteCriticalSection(), and UnlockConsoleHandleTable. Referenced by AbortCreateConsole(), DestroyWindowsWindow(), ProcessCtrlEvents(), and RevalidateConsole().
|
|
Definition at line 1110 of file w32/ntcon/server/handle.c. References AbortCreateConsole(), CM_DESTROY_WINDOW, CONSOLE_TERMINATING, hWnd, NtSetEvent(), NULL, SendMessageTimeout(), and UnlockConsole(). Referenced by RemoveConsole().
|
|
Definition at line 331 of file w32/ntcon/server/handle.c. References ASSERT, ConsoleHandles, ConsoleHandleTableLocked, FALSE, Handle, IndexFromHandle, NULL, and NumberOfConsoleHandles. Referenced by DestroyConsole(), and SetUpConsole().
|
|
Definition at line 1378 of file w32/ntcon/server/handle.c. References ConsoleHeapFree, NULL, and RtlDeleteCriticalSection(). Referenced by FreeIoHandle(), and InheritIoHandleTable().
|
|
Definition at line 1455 of file w32/ntcon/server/handle.c. References ASSERT, CONSOLE_FREE_HANDLE, CONSOLE_INPUT_HANDLE, DereferenceIoHandleNoCheck(), FreeInputHandle(), Handle, _HANDLE_DATA::HandleType, NT_SUCCESS, NTSTATUS(), and Status. Referenced by CloseInputHandle(), CloseOutputHandle(), SrvCreateConsoleScreenBuffer(), SrvDuplicateHandle(), and SrvOpenConsole().
|
|
Definition at line 1280 of file w32/ntcon/server/handle.c. References CONSOLE_INITIAL_IO_HANDLES, and ConsoleHeapFree. Referenced by RemoveConsole().
|
|
Definition at line 223 of file w32/ntcon/server/handle.c. References ASSERT, CONSOLE_CONSOLE_HANDLE_INCREMENT, ConsoleHandles, ConsoleHandleTableLocked, ConsoleHeapAlloc, ConsoleHeapFree, HANDLE_TAG, InitialConsoleHandles, MAKE_TAG, NULL, NumberOfConsoleHandles, and PCONSOLE_INFORMATION. Referenced by AllocateConsoleHandle().
|
|
Definition at line 1234 of file w32/ntcon/server/handle.c. References ASSERT, CONSOLE_FREE_HANDLE, CONSOLE_INITIAL_IO_HANDLES, CONSOLE_IO_HANDLE_INCREMENT, ConsoleHeapAlloc, ConsoleHeapFree, HANDLE_DATA, HANDLE_TAG, _HANDLE_DATA::HandleType, MAKE_TAG, and NULL. Referenced by AllocateIoHandle().
|
|
Definition at line 561 of file w32/ntcon/server/handle.c. References ASSERT, CONSOLE_FREE_HANDLE, CONSOLE_INHERITABLE, CONSOLE_INITIAL_IO_HANDLES, CONSOLE_INPUT_HANDLE, CONSOLE_SHUTTING_DOWN, ConsoleDupShare(), ConsoleHeapAlloc, ConsoleHeapFree, FreeInputHandle(), HANDLE_DATA, HANDLE_TAG, INPUT_READ_HANDLE_DATA, MAKE_TAG, NT_SUCCESS, NTSTATUS(), NULL, RtlInitializeCriticalSection(), and Status. Referenced by ConsoleAddProcessRoutine().
|
|
Definition at line 57 of file w32/ntcon/server/handle.c. References ConsoleHandleLock, ConsoleHandles, InitialConsoleHandles, NELEM, NTSTATUS(), NumberOfConsoleHandles, RtlInitializeCriticalSectionAndSpinCount(), and Status. Referenced by ConServerDllInitialization().
|
|
Definition at line 1335 of file w32/ntcon/server/handle.c. References _HANDLE_DATA::Buffer, ConsoleHeapAlloc, ConsoleHeapFree, FALSE, HANDLE_TAG, _INPUT_READ_HANDLE_DATA::InputHandleFlags, _HANDLE_DATA::InputReadData, MAKE_TAG, NT_SUCCESS, NTSTATUS(), NULL, _INPUT_READ_HANDLE_DATA::ReadCount, _INPUT_READ_HANDLE_DATA::ReadCountLock, RtlInitializeCriticalSection(), Status, and TRUE. Referenced by InitializeIoHandleTable(), SrvDuplicateHandle(), and SrvOpenConsole().
|
|
Definition at line 400 of file w32/ntcon/server/handle.c. References AllocateIoHandle(), ASSERT, CONSOLE_FREE_HANDLE, CONSOLE_INHERITABLE, CONSOLE_INITIAL_IO_HANDLES, CONSOLE_INPUT_HANDLE, CONSOLE_OUTPUT_HANDLE, ConsoleAddShare(), ConsoleHeapFree, DereferenceIoHandleNoCheck(), Handle, _HANDLE_DATA::HandleType, INDEX_TO_HANDLE, InitializeInputHandle(), InitializeOutputHandle(), _HANDLE_DATA::InputBuffer, NT_SUCCESS, NTSTATUS(), and Status. Referenced by AllocateConsole().
|
|
Definition at line 1307 of file w32/ntcon/server/handle.c. References _HANDLE_DATA::Buffer. Referenced by InitializeIoHandleTable(), SrvCreateConsoleScreenBuffer(), SrvDuplicateHandle(), and SrvOpenConsole().
|
|
Definition at line 1155 of file w32/ntcon/server/handle.c. Referenced by SrvCreateConsoleScreenBuffer().
|
|
Definition at line 1187 of file w32/ntcon/server/handle.c. References ASSERT, _SCREEN_INFORMATION::Next, and NULL. Referenced by CloseOutputHandle().
|
|
Definition at line 1686 of file w32/ntcon/server/handle.c. References CONSOLE_IN_DESTRUCTION, CONSOLE_TERMINATING, DereferenceConsoleHandle(), DestroyConsole(), EXCEPTION_EXECUTE_HANDLER, LockConsole, LockConsoleHandleTable, NT_SUCCESS, NTSTATUS(), NULL, Status, UnlockConsole(), and UnlockConsoleHandleTable. Referenced by ApiPreamble(), ConsoleAddProcessRoutine(), ConsoleClientConnectRoutine(), ConsoleClientShutdown(), ConsoleSetActiveWindow(), ConsoleWindowProc(), GetThreadConsoleDesktop(), ProcessCreateConsoleWindow(), RemoveConsole(), SrvAllocConsole(), and UnlockConsole().
|
|
Definition at line 1582 of file w32/ntcon/server/handle.c. References ApiPreamble(), CONSOLE_PERPROCESSDATA, _CONSOLE_VERIFYIOHANDLE_MSG::ConsoleHandle, DereferenceIoHandleNoCheck(), _CONSOLE_VERIFYIOHANDLE_MSG::Handle, HANDLE_TO_INDEX, NT_SUCCESS, NTSTATUS(), Status, UnlockConsole(), and _CONSOLE_VERIFYIOHANDLE_MSG::Valid.
|
|
Definition at line 370 of file w32/ntcon/server/handle.c. References ConsoleHandles, NULL, and NumberOfConsoleHandles. Referenced by ConsoleWindowProc(), and UnlockConsole().
|
|
Definition at line 32 of file w32/ntcon/server/handle.c. Referenced by InitializeConsoleHandleTable(). |
|
Definition at line 29 of file w32/ntcon/server/handle.c. Referenced by AllocateConsole(), AllocateConsoleHandle(), dc(), DereferenceConsoleHandle(), DestroyConsole(), di(), dmem(), dt(), FreeConsoleHandle(), GrowConsoleHandleTable(), InitializeConsoleHandleTable(), and ValidateConsole(). |
|
Definition at line 34 of file w32/ntcon/server/handle.c. |
|
Definition at line 28 of file w32/ntcon/server/handle.c. Referenced by GrowConsoleHandleTable(), and InitializeConsoleHandleTable(). |
|
Definition at line 30 of file w32/ntcon/server/handle.c. Referenced by AllocateConsoleHandle(), dc(), DereferenceConsoleHandle(), di(), dmem(), dt(), FreeConsoleHandle(), GrowConsoleHandleTable(), InitializeConsoleHandleTable(), and ValidateConsole(). |