ReactOS  0.4.14-dev-999-g61c8d34
conoutput.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Console Server DLL
4  * FILE: win32ss/user/winsrv/consrv/conoutput.c
5  * PURPOSE: General Console Output Functions
6  * PROGRAMMERS: Jeffrey Morlan
7  * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8  */
9 
10 /* INCLUDES *******************************************************************/
11 
12 #include "consrv.h"
13 
14 #define NDEBUG
15 #include <debug.h>
16 
17 /* PUBLIC SERVER APIS *********************************************************/
18 
19 /*
20  * FIXME: This function MUST be moved from condrv/conoutput.c because only
21  * consrv knows how to manipulate VDM screenbuffers.
22  */
26  IN PCHAR_CELL CharInfo/*Buffer*/,
27  IN COORD CharInfoSize,
28  IN PSMALL_RECT WriteRegion);
33 /* API_NUMBER: ConsolepInvalidateBitMapRect */
34 CSR_API(SrvInvalidateBitMapRect)
35 {
37  PCONSOLE_INVALIDATEDIBITS InvalidateDIBitsRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.InvalidateDIBitsRequest;
39 
40  DPRINT("SrvInvalidateBitMapRect\n");
41 
43  InvalidateDIBitsRequest->OutputHandle,
45  if (!NT_SUCCESS(Status)) return Status;
46 
47  /* In text-mode only, draw the VDM buffer if present */
48  if (GetType(Buffer) == TEXTMODE_BUFFER && Buffer->Header.Console->VDMBuffer)
49  {
51 
52  /*Status =*/ ConDrvWriteConsoleOutputVDM(Buffer->Header.Console,
53  TextBuffer,
54  Buffer->Header.Console->VDMBuffer,
55  Buffer->Header.Console->VDMBufferSize,
56  &InvalidateDIBitsRequest->Region);
57  }
58 
59  Status = ConDrvInvalidateBitMapRect(Buffer->Header.Console,
60  Buffer,
61  &InvalidateDIBitsRequest->Region);
62 
64  return Status;
65 }
66 
69  // IN PGRAPHICS_SCREEN_BUFFER Buffer,
71  IN HPALETTE PaletteHandle,
72  IN UINT PaletteUsage);
73 /* API_NUMBER: ConsolepSetPalette */
74 CSR_API(SrvSetConsolePalette)
75 {
77  PCONSOLE_SETPALETTE SetPaletteRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetPaletteRequest;
78  // PGRAPHICS_SCREEN_BUFFER Buffer;
80 
81  DPRINT("SrvSetConsolePalette\n");
82 
83  // NOTE: Tests show that this function is used only for graphics screen buffers
84  // and otherwise it returns FALSE + sets last error to invalid handle.
85  // I think it's ridiculous, because if you are in text mode, simulating
86  // a change of VGA palette via DAC registers (done by a call to SetConsolePalette)
87  // cannot be done... So I allow it in ReactOS !
88  /*
89  Status = ConSrvGetGraphicsBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
90  SetPaletteRequest->OutputHandle,
91  &Buffer, GENERIC_WRITE, TRUE);
92  */
94  SetPaletteRequest->OutputHandle,
96  if (!NT_SUCCESS(Status)) return Status;
97 
98  /*
99  * Make the palette handle public, so that it can be
100  * used by other threads calling GDI functions on it.
101  * Indeed, the palette handle comes from a console app
102  * calling ourselves, running in CSRSS.
103  */
105  &SetPaletteRequest->PaletteHandle,
106  sizeof(SetPaletteRequest->PaletteHandle));
107 
108  Status = ConDrvSetConsolePalette(Buffer->Header.Console,
109  Buffer,
110  SetPaletteRequest->PaletteHandle,
111  SetPaletteRequest->Usage);
112 
114  return Status;
115 }
116 
120  OUT PCONSOLE_CURSOR_INFO CursorInfo);
121 /* API_NUMBER: ConsolepGetCursorInfo */
122 CSR_API(SrvGetConsoleCursorInfo)
123 {
125  PCONSOLE_GETSETCURSORINFO CursorInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.CursorInfoRequest;
127 
128  DPRINT("SrvGetConsoleCursorInfo\n");
129 
131  CursorInfoRequest->OutputHandle,
133  if (!NT_SUCCESS(Status)) return Status;
134 
135  Status = ConDrvGetConsoleCursorInfo(Buffer->Header.Console,
136  Buffer,
137  &CursorInfoRequest->Info);
138 
140  return Status;
141 }
142 
146  IN PCONSOLE_CURSOR_INFO CursorInfo);
147 /* API_NUMBER: ConsolepSetCursorInfo */
148 CSR_API(SrvSetConsoleCursorInfo)
149 {
151  PCONSOLE_GETSETCURSORINFO CursorInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.CursorInfoRequest;
153 
154  DPRINT("SrvSetConsoleCursorInfo\n");
155 
157  CursorInfoRequest->OutputHandle,
159  if (!NT_SUCCESS(Status)) return Status;
160 
161  Status = ConDrvSetConsoleCursorInfo(Buffer->Header.Console,
162  Buffer,
163  &CursorInfoRequest->Info);
164 
166  return Status;
167 }
168 
172  IN PCOORD Position);
173 /* API_NUMBER: ConsolepSetCursorPosition */
174 CSR_API(SrvSetConsoleCursorPosition)
175 {
177  PCONSOLE_SETCURSORPOSITION SetCursorPositionRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetCursorPositionRequest;
179 
180  DPRINT("SrvSetConsoleCursorPosition\n");
181 
183  SetCursorPositionRequest->OutputHandle,
185  if (!NT_SUCCESS(Status)) return Status;
186 
187  Status = ConDrvSetConsoleCursorPosition(Buffer->Header.Console,
188  Buffer,
189  &SetCursorPositionRequest->Position);
190 
192  return Status;
193 }
194 
195 /* API_NUMBER: ConsolepCreateScreenBuffer */
196 CSR_API(SrvCreateConsoleScreenBuffer)
197 {
199  PCONSOLE_CREATESCREENBUFFER CreateScreenBufferRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.CreateScreenBufferRequest;
204 
206  TEXTMODE_BUFFER_INFO TextModeInfo = {{80, 25},
209  TRUE,
211  GRAPHICS_BUFFER_INFO GraphicsInfo;
212  GraphicsInfo.Info = CreateScreenBufferRequest->GraphicsBufferInfo; // HACK for MSVC
213 
214  DPRINT("SrvCreateConsoleScreenBuffer\n");
215 
216  Status = ConSrvGetConsole(ProcessData, &Console, TRUE);
217  if (!NT_SUCCESS(Status)) return Status;
218 
219  if (CreateScreenBufferRequest->ScreenBufferType == CONSOLE_TEXTMODE_BUFFER)
220  {
221  ScreenBufferInfo = &TextModeInfo;
222 
223  /*
224  if (Console->ActiveBuffer)
225  {
226  TextModeInfo.ScreenBufferSize = Console->ActiveBuffer->ScreenBufferSize;
227  if (TextModeInfo.ScreenBufferSize.X == 0) TextModeInfo.ScreenBufferSize.X = 80;
228  if (TextModeInfo.ScreenBufferSize.Y == 0) TextModeInfo.ScreenBufferSize.Y = 25;
229 
230  TextModeInfo.ScreenAttrib = Console->ActiveBuffer->ScreenBuffer.TextBuffer.ScreenDefaultAttrib;
231  TextModeInfo.PopupAttrib = Console->ActiveBuffer->ScreenBuffer.TextBuffer.PopupDefaultAttrib;
232 
233  TextModeInfo.IsCursorVisible = Console->ActiveBuffer->CursorInfo.bVisible;
234  TextModeInfo.CursorSize = Console->ActiveBuffer->CursorInfo.dwSize;
235  }
236  */
237 
238  /*
239  * This is Windows behaviour.
240  */
241 
242  /* Use the current console size. Normalize it if needed */
243  TextModeInfo.ScreenBufferSize = Console->ConsoleSize;
244  if (TextModeInfo.ScreenBufferSize.X == 0) TextModeInfo.ScreenBufferSize.X = 1;
245  if (TextModeInfo.ScreenBufferSize.Y == 0) TextModeInfo.ScreenBufferSize.Y = 1;
246 
247  /* If we have an active screen buffer, use its attributes as the new ones */
248  if (Console->ActiveBuffer && GetType(Console->ActiveBuffer) == TEXTMODE_BUFFER)
249  {
251 
252  TextModeInfo.ScreenAttrib = Buffer->ScreenDefaultAttrib;
253  TextModeInfo.PopupAttrib = Buffer->PopupDefaultAttrib;
254 
255  TextModeInfo.IsCursorVisible = Buffer->CursorInfo.bVisible;
256  TextModeInfo.CursorSize = Buffer->CursorInfo.dwSize;
257  }
258  }
259  else if (CreateScreenBufferRequest->ScreenBufferType == CONSOLE_GRAPHICS_BUFFER)
260  {
261  /* Get information from the graphics buffer information structure */
262  if (!CsrValidateMessageBuffer(ApiMessage,
263  (PVOID*)&CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMapInfo,
264  CreateScreenBufferRequest->GraphicsBufferInfo.dwBitMapInfoLength,
265  sizeof(BYTE)))
266  {
268  goto Quit;
269  }
270 
271  ScreenBufferInfo = &GraphicsInfo;
272 
273  /* Initialize shared variables */
274  // CreateScreenBufferRequest->GraphicsBufferInfo.hMutex
275  CreateScreenBufferRequest->hMutex = GraphicsInfo.Info.hMutex = INVALID_HANDLE_VALUE;
276  // CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMap
277  CreateScreenBufferRequest->lpBitMap = GraphicsInfo.Info.lpBitMap = NULL;
278 
279  /* A graphics screen buffer is never inheritable */
280  CreateScreenBufferRequest->InheritHandle = FALSE;
281  }
282 
284  (PCONSOLE)Console,
285  Process->ProcessHandle,
286  CreateScreenBufferRequest->ScreenBufferType,
288  if (!NT_SUCCESS(Status)) goto Quit;
289 
290  /* Insert the new handle inside the process handles table */
292 
293  Status = ConSrvInsertObject(ProcessData,
294  &CreateScreenBufferRequest->OutputHandle,
295  &Buff->Header,
296  CreateScreenBufferRequest->DesiredAccess,
297  CreateScreenBufferRequest->InheritHandle,
298  CreateScreenBufferRequest->ShareMode);
299 
301 
302  if (!NT_SUCCESS(Status)) goto Quit;
303 
304  if (CreateScreenBufferRequest->ScreenBufferType == CONSOLE_GRAPHICS_BUFFER)
305  {
307  /*
308  * Initialize the graphics buffer information structure
309  * and give it back to the client.
310  */
311  // CreateScreenBufferRequest->GraphicsBufferInfo.hMutex
312  CreateScreenBufferRequest->hMutex = Buffer->ClientMutex;
313  // CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMap
314  CreateScreenBufferRequest->lpBitMap = Buffer->ClientBitMap;
315  }
316 
317 Quit:
319  return Status;
320 }
321 
325 /* API_NUMBER: ConsolepSetActiveScreenBuffer */
326 CSR_API(SrvSetConsoleActiveScreenBuffer)
327 {
329  PCONSOLE_SETACTIVESCREENBUFFER SetScreenBufferRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetScreenBufferRequest;
331 
332  DPRINT("SrvSetConsoleActiveScreenBuffer\n");
333 
335  SetScreenBufferRequest->OutputHandle,
337  if (!NT_SUCCESS(Status)) return Status;
338 
340  Buffer);
341 
343  return Status;
344 }
345 
346 
347 /* CSR THREADS FOR WriteConsole ***********************************************/
348 
349 static NTSTATUS
352  IN BOOLEAN CreateWaitBlock OPTIONAL);
353 
354 // Wait function CSR_WAIT_FUNCTION
355 static BOOLEAN
356 NTAPI
358  IN PCSR_THREAD WaitThread,
359  IN PCSR_API_MESSAGE WaitApiMessage,
360  IN PVOID WaitContext,
361  IN PVOID WaitArgument1,
362  IN PVOID WaitArgument2,
363  IN ULONG WaitFlags)
364 {
366 
367  DPRINT("WriteConsoleThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
368 
369  /*
370  * If we are notified of the process termination via a call
371  * to CsrNotifyWaitBlock triggered by CsrDestroyProcess or
372  * CsrDestroyThread, just return.
373  */
374  if (WaitFlags & CsrProcessTerminating)
375  {
377  goto Quit;
378  }
379 
380  Status = DoWriteConsole(WaitApiMessage, WaitThread, FALSE);
381 
382 Quit:
383  if (Status != STATUS_PENDING)
384  {
385  WaitApiMessage->Status = Status;
386  }
387 
388  return (Status == STATUS_PENDING ? FALSE : TRUE);
389 }
390 
394  IN BOOLEAN Unicode,
396  IN ULONG NumCharsToWrite,
397  OUT PULONG NumCharsWritten OPTIONAL);
398 static NTSTATUS
401  IN BOOLEAN CreateWaitBlock OPTIONAL)
402 {
404  PCONSOLE_WRITECONSOLE WriteConsoleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.WriteConsoleRequest;
406 
407  PVOID Buffer;
408  ULONG NrCharactersWritten = 0;
409  ULONG CharSize = (WriteConsoleRequest->Unicode ? sizeof(WCHAR) : sizeof(CHAR));
410 
412  WriteConsoleRequest->OutputHandle,
414  if (!NT_SUCCESS(Status)) return Status;
415 
416  /*
417  * For optimization purposes, Windows (and hence ReactOS, too, for
418  * compatibility reasons) uses a static buffer if no more than eighty
419  * bytes are written. Otherwise a new buffer is used.
420  * The client-side expects that we know this behaviour.
421  */
422  if (WriteConsoleRequest->UsingStaticBuffer &&
423  WriteConsoleRequest->NumBytes <= sizeof(WriteConsoleRequest->StaticBuffer))
424  {
425  /*
426  * Adjust the internal pointer, because its old value points to
427  * the static buffer in the original ApiMessage structure.
428  */
429  // WriteConsoleRequest->Buffer = WriteConsoleRequest->StaticBuffer;
430  Buffer = WriteConsoleRequest->StaticBuffer;
431  }
432  else
433  {
434  Buffer = WriteConsoleRequest->Buffer;
435  }
436 
437  DPRINT("Calling ConDrvWriteConsole\n");
438  Status = ConDrvWriteConsole(ScreenBuffer->Header.Console,
439  ScreenBuffer,
440  WriteConsoleRequest->Unicode,
441  Buffer,
442  WriteConsoleRequest->NumBytes / CharSize, // NrCharactersToWrite
443  &NrCharactersWritten);
444  DPRINT("ConDrvWriteConsole returned (%d ; Status = 0x%08x)\n",
445  NrCharactersWritten, Status);
446 
447  if (Status == STATUS_PENDING)
448  {
449  if (CreateWaitBlock)
450  {
452 
453  if (!CsrCreateWait(&Console->WriteWaitQueue,
455  ClientThread,
456  ApiMessage,
457  NULL))
458  {
459  /* Fail */
461  goto Quit;
462  }
463  }
464 
465  /* Wait until we un-pause the console */
466  // Status = STATUS_PENDING;
467  }
468  else
469  {
470  /* We read all what we wanted. Set the number of bytes written. */
471  WriteConsoleRequest->NumBytes = NrCharactersWritten * CharSize;
472  }
473 
474 Quit:
476  return Status;
477 }
478 
479 
480 /* TEXT OUTPUT APIS ***********************************************************/
481 
485  IN BOOLEAN Unicode,
486  OUT PCHAR_INFO CharInfo/*Buffer*/,
487  IN OUT PSMALL_RECT ReadRegion);
488 /* API_NUMBER: ConsolepReadConsoleOutput */
489 CSR_API(SrvReadConsoleOutput)
490 {
492  PCONSOLE_READOUTPUT ReadOutputRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ReadOutputRequest;
494 
495  ULONG NumCells;
496  PCHAR_INFO CharInfo;
497 
498  DPRINT("SrvReadConsoleOutput\n");
499 
500  NumCells = (ReadOutputRequest->ReadRegion.Right - ReadOutputRequest->ReadRegion.Left + 1) *
501  (ReadOutputRequest->ReadRegion.Bottom - ReadOutputRequest->ReadRegion.Top + 1);
502 
503  /*
504  * For optimization purposes, Windows (and hence ReactOS, too, for
505  * compatibility reasons) uses a static buffer if no more than one
506  * cell is read. Otherwise a new buffer is used.
507  * The client-side expects that we know this behaviour.
508  */
509  if (NumCells <= 1)
510  {
511  /*
512  * Adjust the internal pointer, because its old value points to
513  * the static buffer in the original ApiMessage structure.
514  */
515  // ReadOutputRequest->CharInfo = &ReadOutputRequest->StaticBuffer;
516  CharInfo = &ReadOutputRequest->StaticBuffer;
517  }
518  else
519  {
520  if (!CsrValidateMessageBuffer(ApiMessage,
521  (PVOID*)&ReadOutputRequest->CharInfo,
522  NumCells,
523  sizeof(CHAR_INFO)))
524  {
526  }
527 
528  CharInfo = ReadOutputRequest->CharInfo;
529  }
530 
532  ReadOutputRequest->OutputHandle,
534  if (!NT_SUCCESS(Status)) return Status;
535 
536  Status = ConDrvReadConsoleOutput(Buffer->Header.Console,
537  Buffer,
538  ReadOutputRequest->Unicode,
539  CharInfo,
540  &ReadOutputRequest->ReadRegion);
541 
543  return Status;
544 }
545 
549  IN BOOLEAN Unicode,
550  IN PCHAR_INFO CharInfo/*Buffer*/,
551  IN OUT PSMALL_RECT WriteRegion);
552 /* API_NUMBER: ConsolepWriteConsoleOutput */
553 CSR_API(SrvWriteConsoleOutput)
554 {
556  PCONSOLE_WRITEOUTPUT WriteOutputRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.WriteOutputRequest;
559 
560  ULONG NumCells;
561  PCHAR_INFO CharInfo;
562 
563  DPRINT("SrvWriteConsoleOutput\n");
564 
565  NumCells = (WriteOutputRequest->WriteRegion.Right - WriteOutputRequest->WriteRegion.Left + 1) *
566  (WriteOutputRequest->WriteRegion.Bottom - WriteOutputRequest->WriteRegion.Top + 1);
567 
569  WriteOutputRequest->OutputHandle,
571  if (!NT_SUCCESS(Status)) return Status;
572 
573  /*
574  * Validate the message buffer if we do not use a process' heap buffer
575  * (CsrAllocateCaptureBuffer succeeded because we haven't allocated
576  * a too large (>= 64 kB, size of the CSR heap) data buffer).
577  */
578  if (!WriteOutputRequest->UseVirtualMemory)
579  {
580  /*
581  * For optimization purposes, Windows (and hence ReactOS, too, for
582  * compatibility reasons) uses a static buffer if no more than one
583  * cell is written. Otherwise a new buffer is used.
584  * The client-side expects that we know this behaviour.
585  */
586  if (NumCells <= 1)
587  {
588  /*
589  * Adjust the internal pointer, because its old value points to
590  * the static buffer in the original ApiMessage structure.
591  */
592  // WriteOutputRequest->CharInfo = &WriteOutputRequest->StaticBuffer;
593  CharInfo = &WriteOutputRequest->StaticBuffer;
594  }
595  else
596  {
597  if (!CsrValidateMessageBuffer(ApiMessage,
598  (PVOID*)&WriteOutputRequest->CharInfo,
599  NumCells,
600  sizeof(CHAR_INFO)))
601  {
603  goto Quit;
604  }
605 
606  CharInfo = WriteOutputRequest->CharInfo;
607  }
608  }
609  else
610  {
611  /*
612  * This was not the case: we use a heap buffer. Retrieve its contents.
613  */
614  ULONG Size = NumCells * sizeof(CHAR_INFO);
615 
617  if (CharInfo == NULL)
618  {
620  goto Quit;
621  }
622 
623  Status = NtReadVirtualMemory(Process->ProcessHandle,
624  WriteOutputRequest->CharInfo,
625  CharInfo,
626  Size,
627  NULL);
628  if (!NT_SUCCESS(Status))
629  {
630  ConsoleFreeHeap(CharInfo);
631  // Status = STATUS_NO_MEMORY;
632  goto Quit;
633  }
634  }
635 
636  Status = ConDrvWriteConsoleOutput(Buffer->Header.Console,
637  Buffer,
638  WriteOutputRequest->Unicode,
639  CharInfo,
640  &WriteOutputRequest->WriteRegion);
641 
642  /* Free the temporary buffer if we used the process' heap buffer */
643  if (WriteOutputRequest->UseVirtualMemory && CharInfo)
644  ConsoleFreeHeap(CharInfo);
645 
646 Quit:
648  return Status;
649 }
650 
651 /* API_NUMBER: ConsolepWriteConsole */
652 CSR_API(SrvWriteConsole)
653 {
655  PCONSOLE_WRITECONSOLE WriteConsoleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.WriteConsoleRequest;
656 
657  DPRINT("SrvWriteConsole\n");
658 
659  /*
660  * For optimization purposes, Windows (and hence ReactOS, too, for
661  * compatibility reasons) uses a static buffer if no more than eighty
662  * bytes are written. Otherwise a new buffer is used.
663  * The client-side expects that we know this behaviour.
664  */
665  if (WriteConsoleRequest->UsingStaticBuffer &&
666  WriteConsoleRequest->NumBytes <= sizeof(WriteConsoleRequest->StaticBuffer))
667  {
668  /*
669  * Adjust the internal pointer, because its old value points to
670  * the static buffer in the original ApiMessage structure.
671  */
672  // WriteConsoleRequest->Buffer = WriteConsoleRequest->StaticBuffer;
673  }
674  else
675  {
676  if (!CsrValidateMessageBuffer(ApiMessage,
677  (PVOID)&WriteConsoleRequest->Buffer,
678  WriteConsoleRequest->NumBytes,
679  sizeof(BYTE)))
680  {
682  }
683  }
684 
685  Status = DoWriteConsole(ApiMessage, CsrGetClientThread(), TRUE);
686 
687  if (Status == STATUS_PENDING) *ReplyCode = CsrReplyPending;
688 
689  return Status;
690 }
691 
695  IN CODE_TYPE CodeType,
697  IN ULONG NumCodesToRead,
698  IN PCOORD ReadCoord,
699  // OUT PCOORD EndCoord,
700  OUT PULONG NumCodesRead OPTIONAL);
701 /* API_NUMBER: ConsolepReadConsoleOutputString */
702 CSR_API(SrvReadConsoleOutputString)
703 {
705  PCONSOLE_READOUTPUTCODE ReadOutputCodeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ReadOutputCodeRequest;
707  ULONG CodeSize;
708 
709  PVOID pCode;
710 
711  DPRINT("SrvReadConsoleOutputString\n");
712 
713  switch (ReadOutputCodeRequest->CodeType)
714  {
715  case CODE_ASCII:
716  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, AsciiChar);
717  break;
718 
719  case CODE_UNICODE:
720  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, UnicodeChar);
721  break;
722 
723  case CODE_ATTRIBUTE:
724  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, Attribute);
725  break;
726 
727  default:
729  }
730 
731  /*
732  * For optimization purposes, Windows (and hence ReactOS, too, for
733  * compatibility reasons) uses a static buffer if no more than eighty
734  * bytes are read. Otherwise a new buffer is used.
735  * The client-side expects that we know this behaviour.
736  */
737  if (ReadOutputCodeRequest->NumCodes * CodeSize <= sizeof(ReadOutputCodeRequest->CodeStaticBuffer))
738  {
739  /*
740  * Adjust the internal pointer, because its old value points to
741  * the static buffer in the original ApiMessage structure.
742  */
743  // ReadOutputCodeRequest->pCode = ReadOutputCodeRequest->CodeStaticBuffer;
744  pCode = ReadOutputCodeRequest->CodeStaticBuffer;
745  }
746  else
747  {
748  if (!CsrValidateMessageBuffer(ApiMessage,
749  (PVOID*)&ReadOutputCodeRequest->pCode,
750  ReadOutputCodeRequest->NumCodes,
751  CodeSize))
752  {
754  }
755 
756  pCode = ReadOutputCodeRequest->pCode;
757  }
758 
760  ReadOutputCodeRequest->OutputHandle,
762  if (!NT_SUCCESS(Status))
763  {
764  ReadOutputCodeRequest->NumCodes = 0;
765  return Status;
766  }
767 
768  Status = ConDrvReadConsoleOutputString(Buffer->Header.Console,
769  Buffer,
770  ReadOutputCodeRequest->CodeType,
771  pCode,
772  ReadOutputCodeRequest->NumCodes,
773  &ReadOutputCodeRequest->Coord,
774  // &ReadOutputCodeRequest->EndCoord,
775  &ReadOutputCodeRequest->NumCodes);
776 
778  return Status;
779 }
780 
784  IN CODE_TYPE CodeType,
786  IN ULONG NumCodesToWrite,
787  IN PCOORD WriteCoord,
788  // OUT PCOORD EndCoord,
789  OUT PULONG NumCodesWritten OPTIONAL);
790 /* API_NUMBER: ConsolepWriteConsoleOutputString */
791 CSR_API(SrvWriteConsoleOutputString)
792 {
794  PCONSOLE_WRITEOUTPUTCODE WriteOutputCodeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.WriteOutputCodeRequest;
796  ULONG CodeSize;
797 
798  PVOID pCode;
799 
800  DPRINT("SrvWriteConsoleOutputString\n");
801 
802  switch (WriteOutputCodeRequest->CodeType)
803  {
804  case CODE_ASCII:
805  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, AsciiChar);
806  break;
807 
808  case CODE_UNICODE:
809  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, UnicodeChar);
810  break;
811 
812  case CODE_ATTRIBUTE:
813  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, Attribute);
814  break;
815 
816  default:
818  }
819 
820  /*
821  * For optimization purposes, Windows (and hence ReactOS, too, for
822  * compatibility reasons) uses a static buffer if no more than eighty
823  * bytes are written. Otherwise a new buffer is used.
824  * The client-side expects that we know this behaviour.
825  */
826  if (WriteOutputCodeRequest->NumCodes * CodeSize <= sizeof(WriteOutputCodeRequest->CodeStaticBuffer))
827  {
828  /*
829  * Adjust the internal pointer, because its old value points to
830  * the static buffer in the original ApiMessage structure.
831  */
832  // WriteOutputCodeRequest->pCode = WriteOutputCodeRequest->CodeStaticBuffer;
833  pCode = WriteOutputCodeRequest->CodeStaticBuffer;
834  }
835  else
836  {
837  if (!CsrValidateMessageBuffer(ApiMessage,
838  (PVOID*)&WriteOutputCodeRequest->pCode,
839  WriteOutputCodeRequest->NumCodes,
840  CodeSize))
841  {
843  }
844 
845  pCode = WriteOutputCodeRequest->pCode;
846  }
847 
849  WriteOutputCodeRequest->OutputHandle,
851  if (!NT_SUCCESS(Status))
852  {
853  WriteOutputCodeRequest->NumCodes = 0;
854  return Status;
855  }
856 
857  Status = ConDrvWriteConsoleOutputString(Buffer->Header.Console,
858  Buffer,
859  WriteOutputCodeRequest->CodeType,
860  pCode,
861  WriteOutputCodeRequest->NumCodes,
862  &WriteOutputCodeRequest->Coord,
863  // &WriteOutputCodeRequest->EndCoord,
864  &WriteOutputCodeRequest->NumCodes);
865 
867  return Status;
868 }
869 
873  IN CODE_TYPE CodeType,
875  IN ULONG NumCodesToWrite,
876  IN PCOORD WriteCoord,
877  OUT PULONG NumCodesWritten OPTIONAL);
878 /* API_NUMBER: ConsolepFillConsoleOutput */
879 CSR_API(SrvFillConsoleOutput)
880 {
882  PCONSOLE_FILLOUTPUTCODE FillOutputRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.FillOutputRequest;
884  CODE_TYPE CodeType = FillOutputRequest->CodeType;
885 
886  DPRINT("SrvFillConsoleOutput\n");
887 
888  if ( (CodeType != CODE_ASCII ) &&
889  (CodeType != CODE_UNICODE ) &&
890  (CodeType != CODE_ATTRIBUTE) )
891  {
893  }
894 
896  FillOutputRequest->OutputHandle,
898  if (!NT_SUCCESS(Status))
899  {
900  FillOutputRequest->NumCodes = 0;
901  return Status;
902  }
903 
904  Status = ConDrvFillConsoleOutput(Buffer->Header.Console,
905  Buffer,
906  CodeType,
907  FillOutputRequest->Code,
908  FillOutputRequest->NumCodes,
909  &FillOutputRequest->WriteCoord,
910  &FillOutputRequest->NumCodes);
911 
913  return Status;
914 }
915 
919  OUT PCOORD ScreenBufferSize,
920  OUT PCOORD CursorPosition,
921  OUT PCOORD ViewOrigin,
923  OUT PCOORD MaximumViewSize,
925 /* API_NUMBER: ConsolepGetScreenBufferInfo */
926 CSR_API(SrvGetConsoleScreenBufferInfo)
927 {
929  PCONSOLE_GETSCREENBUFFERINFO ScreenBufferInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ScreenBufferInfoRequest;
931 
932  DPRINT("SrvGetConsoleScreenBufferInfo\n");
933 
935  ScreenBufferInfoRequest->OutputHandle,
937  if (!NT_SUCCESS(Status)) return Status;
938 
940  Buffer,
941  &ScreenBufferInfoRequest->ScreenBufferSize,
942  &ScreenBufferInfoRequest->CursorPosition,
943  &ScreenBufferInfoRequest->ViewOrigin,
944  &ScreenBufferInfoRequest->ViewSize,
945  &ScreenBufferInfoRequest->MaximumViewSize,
946  &ScreenBufferInfoRequest->Attributes);
947 
949  return Status;
950 }
951 
955  IN WORD Attributes);
956 /* API_NUMBER: ConsolepSetTextAttribute */
957 CSR_API(SrvSetConsoleTextAttribute)
958 {
960  PCONSOLE_SETTEXTATTRIB SetTextAttribRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetTextAttribRequest;
962 
963  DPRINT("SrvSetConsoleTextAttribute\n");
964 
966  SetTextAttribRequest->OutputHandle,
968  if (!NT_SUCCESS(Status)) return Status;
969 
970  Status = ConDrvSetConsoleTextAttribute(Buffer->Header.Console,
971  Buffer,
972  SetTextAttribRequest->Attributes);
973 
975  return Status;
976 }
977 
981  IN PCOORD Size);
982 /* API_NUMBER: ConsolepSetScreenBufferSize */
983 CSR_API(SrvSetConsoleScreenBufferSize)
984 {
986  PCONSOLE_SETSCREENBUFFERSIZE SetScreenBufferSizeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetScreenBufferSizeRequest;
988 
989  DPRINT("SrvSetConsoleScreenBufferSize\n");
990 
992  SetScreenBufferSizeRequest->OutputHandle,
994  if (!NT_SUCCESS(Status)) return Status;
995 
997  Buffer,
998  &SetScreenBufferSizeRequest->Size);
999 
1001  return Status;
1002 }
1003 
1007  IN BOOLEAN Unicode,
1008  IN PSMALL_RECT ScrollRectangle,
1009  IN BOOLEAN UseClipRectangle,
1010  IN PSMALL_RECT ClipRectangle OPTIONAL,
1011  IN PCOORD DestinationOrigin,
1012  IN CHAR_INFO FillChar);
1013 /* API_NUMBER: ConsolepScrollScreenBuffer */
1014 CSR_API(SrvScrollConsoleScreenBuffer)
1015 {
1016  NTSTATUS Status;
1017  PCONSOLE_SCROLLSCREENBUFFER ScrollScreenBufferRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ScrollScreenBufferRequest;
1019 
1020  DPRINT("SrvScrollConsoleScreenBuffer\n");
1021 
1023  ScrollScreenBufferRequest->OutputHandle,
1025  if (!NT_SUCCESS(Status)) return Status;
1026 
1027  Status = ConDrvScrollConsoleScreenBuffer(Buffer->Header.Console,
1028  Buffer,
1029  ScrollScreenBufferRequest->Unicode,
1030  &ScrollScreenBufferRequest->ScrollRectangle,
1031  ScrollScreenBufferRequest->UseClipRectangle,
1032  &ScrollScreenBufferRequest->ClipRectangle,
1033  &ScrollScreenBufferRequest->DestinationOrigin,
1034  ScrollScreenBufferRequest->Fill);
1035 
1037  return Status;
1038 }
1039 
1043  IN BOOLEAN Absolute,
1044  IN PSMALL_RECT WindowRect);
1045 /* API_NUMBER: ConsolepSetWindowInfo */
1046 CSR_API(SrvSetConsoleWindowInfo)
1047 {
1048  NTSTATUS Status;
1049  PCONSOLE_SETWINDOWINFO SetWindowInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetWindowInfoRequest;
1050  // PCONSOLE_SCREEN_BUFFER Buffer;
1052 
1053  DPRINT("SrvSetConsoleWindowInfo(0x%08x, %d, {L%d, T%d, R%d, B%d}) called\n",
1054  SetWindowInfoRequest->OutputHandle, SetWindowInfoRequest->Absolute,
1055  SetWindowInfoRequest->WindowRect.Left ,
1056  SetWindowInfoRequest->WindowRect.Top ,
1057  SetWindowInfoRequest->WindowRect.Right,
1058  SetWindowInfoRequest->WindowRect.Bottom);
1059 
1060  // ConSrvGetScreenBuffer
1062  SetWindowInfoRequest->OutputHandle,
1063  &Buffer, GENERIC_READ, TRUE);
1064  if (!NT_SUCCESS(Status)) return Status;
1065 
1066  Status = ConDrvSetConsoleWindowInfo(Buffer->Header.Console,
1067  Buffer,
1068  SetWindowInfoRequest->Absolute,
1069  &SetWindowInfoRequest->WindowRect);
1070 
1072  return Status;
1073 }
1074 
1075 /* EOF */
HANDLE OutputHandle
Definition: conmsg.h:587
CONSOLE_GRAPHICS_BUFFER_INFO Info
Definition: conio.h:167
CSR_API(SrvInvalidateBitMapRect)
Definition: conoutput.c:34
SMALL_RECT ScrollRectangle
Definition: conmsg.h:501
#define RTL_FIELD_SIZE(type, field)
Definition: kdb_expr.c:84
#define DEFAULT_SCREEN_ATTRIB
Definition: settings.c:29
SMALL_RECT ClipRectangle
Definition: conmsg.h:502
#define IN
Definition: typedefs.h:39
NTSTATUS NTAPI ConDrvSetConsoleActiveScreenBuffer(IN PCONSOLE Console, IN PCONSOLE_SCREEN_BUFFER Buffer)
Definition: conoutput.c:170
NTSTATUS ConSrvGetConsole(IN PCONSOLE_PROCESS_DATA ProcessData, OUT PCONSRV_CONSOLE *Console, IN BOOLEAN LockConsole)
Definition: console.c:271
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
static NTSTATUS DoWriteConsole(IN PCSR_API_MESSAGE ApiMessage, IN PCSR_THREAD ClientThread, IN BOOLEAN CreateWaitBlock OPTIONAL)
Definition: conoutput.c:399
CONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo
Definition: notevil.c:38
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)
Definition: conoutput.c:357
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
HPALETTE PaletteHandle
Definition: conmsg.h:479
CODE_TYPE CodeType
Definition: conmsg.h:535
#define STATUS_THREAD_IS_TERMINATING
Definition: ntstatus.h:297
static COORD Position
Definition: mouse.c:34
char CHAR
Definition: xmlstorage.h:175
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI CsrValidateMessageBuffer(IN PCSR_API_MESSAGE ApiMessage, IN PVOID *Buffer, IN ULONG ElementCount, IN ULONG ElementSize)
Definition: api.c:1315
#define ConsoleAllocHeap(Flags, Size)
Definition: heap.h:14
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
BOOLEAN IsCursorVisible
Definition: conio.h:147
BOOLEAN Unicode
Definition: conmsg.h:593
NTSTATUS ConDrvCreateScreenBuffer(OUT PCONSOLE_SCREEN_BUFFER *Buffer, IN PCONSOLE Console, IN HANDLE ProcessHandle OPTIONAL, IN ULONG BufferType, IN PVOID ScreenBufferInfo)
Definition: conoutput.c:79
static HPALETTE PaletteHandle
Definition: svga.c:215
#define TEXTMODE_BUFFER
Definition: pccons.c:21
CODE_ELEMENT Code
Definition: conmsg.h:557
#define PCONSRV_CONSOLE
Definition: conio.h:27
NTSTATUS NTAPI ConDrvGetConsoleCursorInfo(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, OUT PCONSOLE_CURSOR_INFO CursorInfo)
Definition: conoutput.c:263
HANDLE OutputHandle
Definition: conmsg.h:478
VOID ConSrvReleaseConsole(IN PCONSRV_CONSOLE Console, IN BOOLEAN IsConsoleLocked)
Definition: console.c:296
CONSOLE_IO_OBJECT Header
Definition: conio.h:82
BOOLEAN UseVirtualMemory
Definition: conmsg.h:612
NTSTATUS NTAPI ConDrvWriteConsoleOutputVDM(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN PCHAR_CELL CharInfo, IN COORD CharInfoSize, IN PSMALL_RECT WriteRegion)
Definition: text.c:602
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
CODE_TYPE CodeType
Definition: conmsg.h:556
#define GENERIC_WRITE
Definition: nt_native.h:90
SMALL_RECT WindowRect
Definition: conmsg.h:710
NTSTATUS APIENTRY NtUserConsoleControl(IN CONSOLECONTROL ConsoleCtrl, IN PVOID ConsoleCtrlInfo, IN ULONG ConsoleCtrlInfoLength)
Definition: console.c:14
unsigned char BOOLEAN
struct _CHAR_INFO CHAR_INFO
smooth NULL
Definition: ftsmooth.c:416
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)
Definition: text.c:1118
UINT CALLBACK ClientThread(_Inout_ PVOID Parameter)
void DPRINT(...)
Definition: polytest.cpp:61
HANDLE OutputHandle
Definition: conmsg.h:599
Definition: bufpool.h:45
CONSOLE_CURSOR_INFO Info
Definition: conmsg.h:346
NTSTATUS NTAPI ConDrvWriteConsoleOutput(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN BOOLEAN Unicode, IN PCHAR_INFO CharInfo, IN OUT PSMALL_RECT WriteRegion)
Definition: text.c:533
SHORT Left
Definition: blue.h:32
ULONG X
Definition: bl.h:1340
WORD * PWORD
Definition: pedump.c:67
#define Code
Definition: deflate.h:80
CHAR_INFO StaticBuffer
Definition: conmsg.h:601
NTSTATUS NTAPI ConDrvSetConsolePalette(IN PCONSOLE Console, IN PCONSOLE_SCREEN_BUFFER Buffer, IN HPALETTE PaletteHandle, IN UINT PaletteUsage)
Definition: conoutput.c:219
#define ConSrvGetTextModeBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:12
SHORT Bottom
Definition: blue.h:35
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
SMALL_RECT WriteRegion
Definition: conmsg.h:604
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
NTSTATUS NTAPI ConDrvSetConsoleTextAttribute(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN WORD Attributes)
Definition: text.c:1331
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
CHAR CodeStaticBuffer[80]
Definition: conmsg.h:536
unsigned short WORD
Definition: ntddk_ex.h:93
#define CSR_DEFAULT_CURSOR_SIZE
Definition: settings.c:26
NTSTATUS NTAPI ConDrvSetConsoleCursorPosition(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN PCOORD Position)
Definition: conoutput.c:311
PCHAR_INFO CharInfo
Definition: conmsg.h:590
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
SHORT Top
Definition: blue.h:33
NTSTATUS NTAPI NtReadVirtualMemory(IN HANDLE ProcessHandle, IN PVOID BaseAddress, OUT PVOID Buffer, IN SIZE_T NumberOfBytesToRead, OUT PSIZE_T NumberOfBytesRead OPTIONAL)
Definition: virtual.c:2691
#define ConSrvGetScreenBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:26
struct _GRAPHICS_SCREEN_BUFFER * PGRAPHICS_SCREEN_BUFFER
LPBITMAPINFO lpBitMapInfo
Definition: wincon.h:230
INT GetType(BOOL bLocal, LPOSVERSIONINFOEX osvi, LPSERVER_INFO_102 pBuf102)
Definition: gettype.c:129
NTSTATUS NTAPI ConDrvSetConsoleCursorInfo(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN PCONSOLE_CURSOR_INFO CursorInfo)
Definition: conoutput.c:281
SMALL_RECT ReadRegion
Definition: conmsg.h:592
CONSOLE_GRAPHICS_BUFFER_INFO GraphicsBufferInfo
Definition: conmsg.h:456
unsigned char BYTE
Definition: mem.h:68
#define GENERIC_READ
Definition: compat.h:124
Definition: typedefs.h:118
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
Definition: bl.h:1338
USHORT PopupAttrib
Definition: conio.h:145
Status
Definition: gdiplustypes.h:24
BOOLEAN UsingStaticBuffer
Definition: conmsg.h:246
#define DEFAULT_POPUP_ATTRIB
Definition: settings.c:30
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
#define CONSOLE_TEXTMODE_BUFFER
Definition: wincon.h:62
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
#define CONSOLE_GRAPHICS_BUFFER
Definition: wincon.h:63
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
NTSTATUS NTAPI ConDrvInvalidateBitMapRect(IN PCONSOLE Console, IN PCONSOLE_SCREEN_BUFFER Buffer, IN PSMALL_RECT Region)
Definition: conoutput.c:202
NTSTATUS NTAPI ConDrvSetConsoleWindowInfo(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN BOOLEAN Absolute, IN PSMALL_RECT WindowRect)
Definition: text.c:1453
CConsole Console
#define ConsoleFreeHeap(HeapBase)
Definition: heap.h:15
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
char TextBuffer[BUFFERLEN]
Definition: combotst.c:45
HANDLE ScreenBuffer
Definition: notevil.c:37
#define OUT
Definition: typedefs.h:40
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
Definition: mmfuncs.h:404
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)
Definition: text.c:1365
CHAR StaticBuffer[80]
Definition: conmsg.h:239
unsigned int ULONG
Definition: retypes.h:1
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)
Definition: text.c:1291
NTSTATUS NTAPI ConDrvSetConsoleScreenBufferSize(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN PCOORD Size)
Definition: text.c:1346
NTSTATUS ConSrvInsertObject(IN PCONSOLE_PROCESS_DATA ProcessData, OUT PHANDLE Handle, IN PCONSOLE_IO_OBJECT Object, IN ULONG Access, IN BOOLEAN Inheritable, IN ULONG ShareMode)
Definition: handle.c:310
NTSTATUS NTAPI ConDrvReadConsoleOutput(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN BOOLEAN Unicode, OUT PCHAR_INFO CharInfo, IN OUT PSMALL_RECT ReadRegion)
Definition: text.c:469
HANDLE OutputHandle
Definition: conmsg.h:532
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)
Definition: text.c:889
SHORT Right
Definition: blue.h:34
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)
Definition: wait.c:209
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
ULONG Y
Definition: bl.h:1341
WCHAR StringBuffer[156]
Definition: ldrinit.c:41
struct _TEXTMODE_SCREEN_BUFFER * PTEXTMODE_SCREEN_BUFFER
COORD ScreenBufferSize
Definition: conio.h:143
enum _CODE_TYPE CODE_TYPE
NTSTATUS NTAPI ConDrvWriteConsole(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER ScreenBuffer, IN BOOLEAN Unicode, IN PVOID StringBuffer, IN ULONG NumCharsToWrite, OUT PULONG NumCharsWritten OPTIONAL)
Definition: text.c:657
CHAR_INFO StaticBuffer
Definition: conmsg.h:589
PCHAR_INFO CharInfo
Definition: conmsg.h:602
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)
Definition: text.c:1174
USHORT ScreenAttrib
Definition: conio.h:144
RTL_CRITICAL_SECTION HandleTableLock
Definition: consrv.h:48
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68