41 InvalidateDIBitsRequest->OutputHandle,
57 &InvalidateDIBitsRequest->Region);
62 &InvalidateDIBitsRequest->Region);
93 SetPaletteRequest->OutputHandle,
107 &SetPaletteRequest->PaletteHandle,
108 sizeof(SetPaletteRequest->PaletteHandle));
112 SetPaletteRequest->PaletteHandle,
113 SetPaletteRequest->Usage);
131 CursorInfoRequest->OutputHandle,
140 &CursorInfoRequest->Info);
158 CursorInfoRequest->OutputHandle,
167 &CursorInfoRequest->Info);
185 SetCursorPositionRequest->OutputHandle,
194 &SetCursorPositionRequest->Position);
217 GraphicsInfo.
Info = CreateScreenBufferRequest->GraphicsBufferInfo;
266 (
PVOID*)&CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMapInfo,
267 CreateScreenBufferRequest->GraphicsBufferInfo.dwBitMapInfoLength,
282 CreateScreenBufferRequest->InheritHandle =
FALSE;
286 DPRINT1(
"Invalid ScreenBuffer type %lu\n", CreateScreenBufferRequest->ScreenBufferType);
293 CreateScreenBufferRequest->ScreenBufferType,
302 &CreateScreenBufferRequest->OutputHandle,
304 CreateScreenBufferRequest->DesiredAccess,
305 CreateScreenBufferRequest->InheritHandle,
306 CreateScreenBufferRequest->ShareMode);
324 CreateScreenBufferRequest->hMutex =
Buffer->ClientMutex;
326 CreateScreenBufferRequest->lpBitMap =
Buffer->ClientBitMap;
343 SetScreenBufferRequest->OutputHandle,
377 DPRINT(
"WriteConsoleThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
395 WaitApiMessage->Status =
Status;
418 ULONG NrCharactersWritten = 0;
447 DPRINT(
"Calling ConDrvWriteConsole\n");
452 WriteConsoleRequest->
NumBytes / CharSize,
453 &NrCharactersWritten);
454 DPRINT(
"ConDrvWriteConsole returned (%d ; Status = 0x%08x)\n",
455 NrCharactersWritten,
Status);
481 WriteConsoleRequest->
NumBytes = NrCharactersWritten * CharSize;
523 CharInfo = &ReadOutputRequest->StaticBuffer;
528 (
PVOID*)&ReadOutputRequest->CharInfo,
535 CharInfo = ReadOutputRequest->CharInfo;
539 ReadOutputRequest->OutputHandle,
548 ReadOutputRequest->Unicode,
550 &ReadOutputRequest->ReadRegion);
577 WriteOutputRequest->OutputHandle,
589 if (!WriteOutputRequest->UseVirtualMemory)
604 CharInfo = &WriteOutputRequest->StaticBuffer;
609 (
PVOID*)&WriteOutputRequest->CharInfo,
617 CharInfo = WriteOutputRequest->CharInfo;
628 if (CharInfo ==
NULL)
635 WriteOutputRequest->CharInfo,
649 WriteOutputRequest->Unicode,
651 &WriteOutputRequest->WriteRegion);
654 if (WriteOutputRequest->UseVirtualMemory && CharInfo)
668 DPRINT(
"SrvWriteConsole\n");
676 if (WriteConsoleRequest->UsingStaticBuffer &&
677 WriteConsoleRequest->NumBytes <=
sizeof(WriteConsoleRequest->StaticBuffer))
688 (
PVOID)&WriteConsoleRequest->Buffer,
689 WriteConsoleRequest->NumBytes,
721 switch (ReadOutputCodeRequest->CodeType)
745 if (ReadOutputCodeRequest->NumCodes * CodeSize <=
sizeof(ReadOutputCodeRequest->CodeStaticBuffer))
752 pCode = ReadOutputCodeRequest->CodeStaticBuffer;
757 (
PVOID*)&ReadOutputCodeRequest->pCode,
758 ReadOutputCodeRequest->NumCodes,
764 pCode = ReadOutputCodeRequest->pCode;
768 ReadOutputCodeRequest->OutputHandle,
772 ReadOutputCodeRequest->NumCodes = 0;
780 ReadOutputCodeRequest->CodeType,
782 ReadOutputCodeRequest->NumCodes,
783 &ReadOutputCodeRequest->Coord,
785 &ReadOutputCodeRequest->NumCodes);
809 switch (WriteOutputCodeRequest->CodeType)
833 if (WriteOutputCodeRequest->NumCodes * CodeSize <=
sizeof(WriteOutputCodeRequest->CodeStaticBuffer))
840 pCode = WriteOutputCodeRequest->CodeStaticBuffer;
845 (
PVOID*)&WriteOutputCodeRequest->pCode,
846 WriteOutputCodeRequest->NumCodes,
852 pCode = WriteOutputCodeRequest->pCode;
856 WriteOutputCodeRequest->OutputHandle,
860 WriteOutputCodeRequest->NumCodes = 0;
868 WriteOutputCodeRequest->CodeType,
870 WriteOutputCodeRequest->NumCodes,
871 &WriteOutputCodeRequest->Coord,
873 &WriteOutputCodeRequest->NumCodes);
893 CODE_TYPE CodeType = FillOutputRequest->CodeType;
903 FillOutputRequest->OutputHandle,
907 FillOutputRequest->NumCodes = 0;
916 FillOutputRequest->Code,
917 FillOutputRequest->NumCodes,
918 &FillOutputRequest->WriteCoord,
919 &FillOutputRequest->NumCodes);
942 ScreenBufferInfoRequest->OutputHandle,
951 &ScreenBufferInfoRequest->ScreenBufferSize,
952 &ScreenBufferInfoRequest->CursorPosition,
953 &ScreenBufferInfoRequest->ViewOrigin,
954 &ScreenBufferInfoRequest->ViewSize,
955 &ScreenBufferInfoRequest->MaximumViewSize,
956 &ScreenBufferInfoRequest->Attributes);
974 SetTextAttribRequest->OutputHandle,
983 SetTextAttribRequest->Attributes);
1001 SetScreenBufferSizeRequest->OutputHandle,
1010 &SetScreenBufferSizeRequest->Size);
1033 ScrollScreenBufferRequest->OutputHandle,
1042 ScrollScreenBufferRequest->Unicode,
1043 &ScrollScreenBufferRequest->ScrollRectangle,
1044 ScrollScreenBufferRequest->UseClipRectangle,
1045 &ScrollScreenBufferRequest->ClipRectangle,
1046 &ScrollScreenBufferRequest->DestinationOrigin,
1047 ScrollScreenBufferRequest->Fill);
1066 DPRINT(
"SrvSetConsoleWindowInfo(0x%08x, %d, {L%d, T%d, R%d, B%d}) called\n",
1067 SetWindowInfoRequest->OutputHandle, SetWindowInfoRequest->Absolute,
1068 SetWindowInfoRequest->WindowRect.Left ,
1069 SetWindowInfoRequest->WindowRect.Top ,
1070 SetWindowInfoRequest->WindowRect.Right,
1071 SetWindowInfoRequest->WindowRect.Bottom);
1075 SetWindowInfoRequest->OutputHandle,
1084 SetWindowInfoRequest->Absolute,
1085 &SetWindowInfoRequest->WindowRect);
UINT CALLBACK ClientThread(_Inout_ PVOID Parameter)
char TextBuffer[BUFFERLEN]
NTSTATUS NTAPI ConDrvGetConsoleCursorInfo(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, OUT PCONSOLE_CURSOR_INFO CursorInfo)
NTSTATUS NTAPI ConDrvSetConsoleCursorPosition(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN PCOORD Position)
VOID NTAPI ConDrvDeleteScreenBuffer(PCONSOLE_SCREEN_BUFFER Buffer)
NTSTATUS NTAPI ConDrvSetConsoleCursorInfo(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN PCONSOLE_CURSOR_INFO CursorInfo)
NTSTATUS NTAPI ConDrvSetConsolePalette(IN PCONSOLE Console, IN PCONSOLE_SCREEN_BUFFER Buffer, IN HPALETTE PaletteHandle, IN UINT PaletteUsage)
NTSTATUS NTAPI ConDrvSetConsoleActiveScreenBuffer(IN PCONSOLE Console, IN PCONSOLE_SCREEN_BUFFER Buffer)
NTSTATUS ConDrvCreateScreenBuffer(OUT PCONSOLE_SCREEN_BUFFER *Buffer, IN PCONSOLE Console, IN HANDLE ProcessHandle OPTIONAL, IN ULONG BufferType, IN PVOID ScreenBufferInfo)
NTSTATUS NTAPI ConDrvInvalidateBitMapRect(IN PCONSOLE Console, IN PCONSOLE_SCREEN_BUFFER Buffer, IN PSMALL_RECT Region)
struct _CONSRV_CONSOLE * PCONSRV_CONSOLE
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
enum _CODE_TYPE CODE_TYPE
NTSTATUS NTAPI ConDrvReadConsoleOutput(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN BOOLEAN Unicode, OUT PCHAR_INFO CharInfo, IN OUT PSMALL_RECT ReadRegion)
NTSTATUS NTAPI ConDrvGetConsoleScreenBufferInfo(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, OUT PCOORD ScreenBufferSize, OUT PCOORD CursorPosition, OUT PCOORD ViewOrigin, OUT PCOORD ViewSize, OUT PCOORD MaximumViewSize, OUT PWORD Attributes)
NTSTATUS NTAPI ConDrvSetConsoleWindowInfo(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN BOOLEAN Absolute, IN PSMALL_RECT WindowRect)
NTSTATUS NTAPI ConDrvWriteConsoleOutput(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN BOOLEAN Unicode, IN PCHAR_INFO CharInfo, IN OUT PSMALL_RECT WriteRegion)
NTSTATUS NTAPI ConDrvSetConsoleTextAttribute(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN WORD Attributes)
static NTSTATUS DoWriteConsole(IN PCSR_API_MESSAGE ApiMessage, IN PCSR_THREAD ClientThread, IN BOOLEAN CreateWaitBlock OPTIONAL)
NTSTATUS NTAPI ConDrvScrollConsoleScreenBuffer(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN BOOLEAN Unicode, IN PSMALL_RECT ScrollRectangle, IN BOOLEAN UseClipRectangle, IN PSMALL_RECT ClipRectangle OPTIONAL, IN PCOORD DestinationOrigin, IN CHAR_INFO FillChar)
NTSTATUS NTAPI ConDrvWriteConsoleOutputString(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN CODE_TYPE CodeType, IN PVOID StringBuffer, IN ULONG NumCodesToWrite, IN PCOORD WriteCoord, OUT PULONG NumCodesWritten OPTIONAL)
NTSTATUS NTAPI ConDrvWriteConsole(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER ScreenBuffer, IN BOOLEAN Unicode, IN PVOID StringBuffer, IN ULONG NumCharsToWrite, OUT PULONG NumCharsWritten OPTIONAL)
NTSTATUS NTAPI ConDrvWriteConsoleOutputVDM(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN PCHAR_CELL CharInfo, IN COORD CharInfoSize, IN PSMALL_RECT WriteRegion)
NTSTATUS NTAPI ConDrvFillConsoleOutput(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN CODE_TYPE CodeType, IN CODE_ELEMENT Code, IN ULONG NumCodesToWrite, IN PCOORD WriteCoord, OUT PULONG NumCodesWritten OPTIONAL)
NTSTATUS NTAPI ConDrvSetConsoleScreenBufferSize(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN PCOORD Size)
NTSTATUS NTAPI ConDrvReadConsoleOutputString(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN CODE_TYPE CodeType, OUT PVOID StringBuffer, IN ULONG NumCodesToRead, IN PCOORD ReadCoord, OUT PULONG NumCodesRead OPTIONAL)
static BOOLEAN NTAPI WriteConsoleThread(IN PLIST_ENTRY WaitList, IN PCSR_THREAD WaitThread, IN PCSR_API_MESSAGE WaitApiMessage, IN PVOID WaitContext, IN PVOID WaitArgument1, IN PVOID WaitArgument2, IN ULONG WaitFlags)
#define ConSrvGetTextModeBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
#define ConSrvGetScreenBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
#define ConsoleGetPerProcessData(Process)
BOOLEAN NTAPI CsrValidateMessageBuffer(IN PCSR_API_MESSAGE ApiMessage, IN PVOID *Buffer, IN ULONG ElementCount, IN ULONG ElementSize)
#define CsrGetClientThread()
BOOLEAN NTAPI CsrCreateWait(IN PLIST_ENTRY WaitList, IN CSR_WAIT_FUNCTION WaitFunction, IN PCSR_THREAD CsrWaitThread, IN OUT PCSR_API_MESSAGE WaitApiMessage, IN PVOID WaitContext)
#define NT_SUCCESS(StatCode)
#define INVALID_HANDLE_VALUE
#define ConioRectWidth(Rect)
#define ConioRectHeight(Rect)
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
@ ConsoleMakePalettePublic
NTSTATUS APIENTRY NtUserConsoleControl(IN CONSOLECONTROL ConsoleCtrl, IN PVOID ConsoleCtrlInfo, IN ULONG ConsoleCtrlInfoLength)
#define RTL_FIELD_SIZE(type, field)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
CONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo
NTSTATUS NTAPI NtReadVirtualMemory(IN HANDLE ProcessHandle, IN PVOID BaseAddress, OUT PVOID Buffer, IN SIZE_T NumberOfBytesToRead, OUT PSIZE_T NumberOfBytesRead OPTIONAL)
#define STATUS_THREAD_IS_TERMINATING
static USHORT CursorPosition
PULONG MinorVersion OPTIONAL
BOOLEAN UsingStaticBuffer
CONSOLE_GRAPHICS_BUFFER_INFO Info
static HPALETTE PaletteHandle
#define STATUS_INVALID_PARAMETER
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
#define DEFAULT_SCREEN_ATTRIB
#define CSR_DEFAULT_CURSOR_SIZE
#define DEFAULT_POPUP_ATTRIB
#define CON_API(Name, TYPE, RequestName)
NTSTATUS ConSrvInsertObject(IN PCONSOLE_PROCESS_DATA ProcessData, OUT PHANDLE Handle, IN PCONSOLE_IO_OBJECT Object, IN ULONG Access, IN BOOLEAN Inheritable, IN ULONG ShareMode)
#define ConsoleAllocHeap(Flags, Size)
#define ConsoleFreeHeap(HeapBase)
struct _TEXTMODE_SCREEN_BUFFER * PTEXTMODE_SCREEN_BUFFER
struct _GRAPHICS_SCREEN_BUFFER * PGRAPHICS_SCREEN_BUFFER
struct _CHAR_INFO CHAR_INFO
#define CONSOLE_TEXTMODE_BUFFER
#define CONSOLE_GRAPHICS_BUFFER