19#define ConSrvGetInputBuffer(ProcessData, Handle, Ptr, Access, LockConsole) \
20 ConSrvGetObject((ProcessData), (Handle), (PCONSOLE_IO_OBJECT*)(Ptr), NULL, \
21 (Access), (LockConsole), INPUT_BUFFER)
23#define ConSrvGetInputBufferAndHandleEntry(ProcessData, Handle, Ptr, Entry, Access, LockConsole) \
24 ConSrvGetObject((ProcessData), (Handle), (PCONSOLE_IO_OBJECT*)(Ptr), (Entry), \
25 (Access), (LockConsole), INPUT_BUFFER)
27#define ConSrvReleaseInputBuffer(Buff, IsConsoleLocked) \
28 ConSrvReleaseObject(&(Buff)->Header, (IsConsoleLocked))
37#define ConsoleInputUnicodeToAnsiChar(Console, dChar, sWChar) \
39 ASSERT((ULONG_PTR)(dChar) != (ULONG_PTR)(sWChar)); \
40 WideCharToMultiByte((Console)->InputCodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL); \
43#define ConsoleInputAnsiToUnicodeChar(Console, dWChar, sChar) \
45 ASSERT((ULONG_PTR)(dWChar) != (ULONG_PTR)(sChar)); \
46 MultiByteToWideChar((Console)->InputCodePage, 0, (sChar), 1, (dWChar), 1); \
89 ULONG NumEventsToWrite)
97 for (NumEvents = NumEventsToWrite; NumEvents > 0; --NumEvents)
142 return NumEventsToWrite;
169 ULONG NumEventsToWrite,
175 if (NumEventsWritten) *NumEventsWritten = 0;
204 ULONG NumEventsWritten;
214 Down && (VirtualKeyCode ==
VK_PAUSE || VirtualKeyCode ==
'C') &&
217 DPRINT1(
"Console_Api Ctrl-C\n");
256 InputInfo->CallingThread,
290 DPRINT(
"ReadCharsThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
326 WaitApiMessage->Status =
Status;
355 ULONG NrCharactersRead = 0;
397 DPRINT(
"Calling ConDrvReadConsole(%wZ)\n", &ExeName);
404 ReadConsoleRequest->
NumBytes / CharSize,
406 DPRINT(
"ConDrvReadConsole returned (%d ; Status = 0x%08x)\n",
407 NrCharactersRead,
Status);
425 ReadConsoleRequest->
NumBytes = NrCharactersRead * CharSize;
454 DPRINT(
"ReadInputBufferThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
490 WaitApiMessage->Status =
Status;
568 for (
i = 0;
i < NumEventsRead; ++
i)
592 DPRINT(
"SrvReadConsole\n");
600 if (ReadConsoleRequest->CaptureBufferSize <=
sizeof(ReadConsoleRequest->StaticBuffer))
611 (
PVOID*)&ReadConsoleRequest->Buffer,
612 ReadConsoleRequest->CaptureBufferSize,
619 if (ReadConsoleRequest->InitialNumBytes > ReadConsoleRequest->NumBytes)
625 ReadConsoleRequest->InputHandle,
657 DPRINT(
"SrvGetConsoleInput\n");
670 if (GetInputRequest->NumRecords <=
sizeof(GetInputRequest->RecordStaticBuffer)/
sizeof(
INPUT_RECORD))
681 (
PVOID*)&GetInputRequest->RecordBufPtr,
682 GetInputRequest->NumRecords,
690 GetInputRequest->InputHandle,
729 ULONG NumEventsWritten;
738 if (WriteInputRequest->NumRecords <=
sizeof(WriteInputRequest->RecordStaticBuffer)/
sizeof(
INPUT_RECORD))
745 InputRecord = WriteInputRequest->RecordStaticBuffer;
750 (
PVOID*)&WriteInputRequest->RecordBufPtr,
751 WriteInputRequest->NumRecords,
757 InputRecord = WriteInputRequest->RecordBufPtr;
761 WriteInputRequest->InputHandle,
765 WriteInputRequest->NumRecords = 0;
772 if (!WriteInputRequest->Unicode)
775 for (
i = 0;
i < WriteInputRequest->NumRecords; ++
i)
782 NumEventsWritten = 0;
786 WriteInputRequest->NumRecords,
788 WriteInputRequest->AppendToEnd);
797 WriteInputRequest->NumRecords = NumEventsWritten;
814 FlushInputBufferRequest->InputHandle,
839 GetNumInputEventsRequest->InputHandle,
848 &GetNumInputEventsRequest->NumberOfEvents);
struct _CONSRV_CONSOLE * PCONSRV_CONSOLE
#define PAUSED_FROM_KEYBOARD
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
BOOLEAN NTAPI CsrValidateMessageBuffer(IN PCSR_API_MESSAGE ApiMessage, IN PVOID *Buffer, IN ULONG ElementCount, IN ULONG ElementSize)
#define CsrGetClientThread()
VOID NTAPI CsrDereferenceWait(IN PLIST_ENTRY WaitList)
BOOLEAN(NTAPI * CSR_WAIT_FUNCTION)(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)
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)
BOOLEAN NTAPI CsrNotifyWait(IN PLIST_ENTRY WaitList, IN BOOLEAN NotifyAll, IN PVOID WaitArgument1, IN PVOID WaitArgument2)
#define NT_SUCCESS(StatCode)
#define IsListEmpty(ListHead)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define STATUS_THREAD_IS_TERMINATING
PULONG MinorVersion OPTIONAL
union _KEY_EVENT_RECORD::@3284 uChar
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_INVALID_PARAMETER
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
#define CON_API(Name, TYPE, RequestName)
VOID ConioUnpause(PCONSRV_CONSOLE Console, UCHAR Flags)
NTSTATUS NTAPI ConSrvConsoleProcessCtrlEvent(IN PCONSRV_CONSOLE Console, IN ULONG ProcessGroupId, IN ULONG CtrlEvent)
VOID ConioPause(PCONSRV_CONSOLE Console, UCHAR Flags)
#define ConsoleAllocHeap(Flags, Size)
#define ConsoleFreeHeap(HeapBase)
#define GetConsoleInputBufferMode(Console)
#define LEFT_CTRL_PRESSED
#define RIGHT_CTRL_PRESSED
struct _INPUT_RECORD INPUT_RECORD
#define RIGHT_ALT_PRESSED
#define CONSOLE_READ_NOREMOVE
struct _CONSOLE_READCONSOLE_CONTROL CONSOLE_READCONSOLE_CONTROL
#define ENABLE_LINE_INPUT
#define ENABLE_PROCESSED_INPUT
#define CONSOLE_READ_NOWAIT
_Inout_opt_ PVOID Parameter