ReactOS  0.4.14-dev-77-gd9e7c48
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 CSR_API(SrvInvalidateBitMapRect)
34 {
36  PCONSOLE_INVALIDATEDIBITS InvalidateDIBitsRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.InvalidateDIBitsRequest;
38 
39  DPRINT("SrvInvalidateBitMapRect\n");
40 
42  InvalidateDIBitsRequest->OutputHandle,
44  if (!NT_SUCCESS(Status)) return Status;
45 
46  /* In text-mode only, draw the VDM buffer if present */
47  if (GetType(Buffer) == TEXTMODE_BUFFER && Buffer->Header.Console->VDMBuffer)
48  {
50 
51  /*Status =*/ ConDrvWriteConsoleOutputVDM(Buffer->Header.Console,
52  TextBuffer,
53  Buffer->Header.Console->VDMBuffer,
54  Buffer->Header.Console->VDMBufferSize,
55  &InvalidateDIBitsRequest->Region);
56  }
57 
58  Status = ConDrvInvalidateBitMapRect(Buffer->Header.Console,
59  Buffer,
60  &InvalidateDIBitsRequest->Region);
61 
63  return Status;
64 }
65 
68  // IN PGRAPHICS_SCREEN_BUFFER Buffer,
70  IN HPALETTE PaletteHandle,
71  IN UINT PaletteUsage);
72 CSR_API(SrvSetConsolePalette)
73 {
75  PCONSOLE_SETPALETTE SetPaletteRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetPaletteRequest;
76  // PGRAPHICS_SCREEN_BUFFER Buffer;
78 
79  DPRINT("SrvSetConsolePalette\n");
80 
81  // NOTE: Tests show that this function is used only for graphics screen buffers
82  // and otherwise it returns FALSE + sets last error to invalid handle.
83  // I think it's ridiculous, because if you are in text mode, simulating
84  // a change of VGA palette via DAC registers (done by a call to SetConsolePalette)
85  // cannot be done... So I allow it in ReactOS !
86  /*
87  Status = ConSrvGetGraphicsBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
88  SetPaletteRequest->OutputHandle,
89  &Buffer, GENERIC_WRITE, TRUE);
90  */
92  SetPaletteRequest->OutputHandle,
94  if (!NT_SUCCESS(Status)) return Status;
95 
96  /*
97  * Make the palette handle public, so that it can be
98  * used by other threads calling GDI functions on it.
99  * Indeed, the palette handle comes from a console app
100  * calling ourselves, running in CSRSS.
101  */
103  &SetPaletteRequest->PaletteHandle,
104  sizeof(SetPaletteRequest->PaletteHandle));
105 
106  Status = ConDrvSetConsolePalette(Buffer->Header.Console,
107  Buffer,
108  SetPaletteRequest->PaletteHandle,
109  SetPaletteRequest->Usage);
110 
112  return Status;
113 }
114 
118  OUT PCONSOLE_CURSOR_INFO CursorInfo);
119 CSR_API(SrvGetConsoleCursorInfo)
120 {
122  PCONSOLE_GETSETCURSORINFO CursorInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.CursorInfoRequest;
124 
125  DPRINT("SrvGetConsoleCursorInfo\n");
126 
128  CursorInfoRequest->OutputHandle,
130  if (!NT_SUCCESS(Status)) return Status;
131 
132  Status = ConDrvGetConsoleCursorInfo(Buffer->Header.Console,
133  Buffer,
134  &CursorInfoRequest->Info);
135 
137  return Status;
138 }
139 
143  IN PCONSOLE_CURSOR_INFO CursorInfo);
144 CSR_API(SrvSetConsoleCursorInfo)
145 {
147  PCONSOLE_GETSETCURSORINFO CursorInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.CursorInfoRequest;
149 
150  DPRINT("SrvSetConsoleCursorInfo\n");
151 
153  CursorInfoRequest->OutputHandle,
155  if (!NT_SUCCESS(Status)) return Status;
156 
157  Status = ConDrvSetConsoleCursorInfo(Buffer->Header.Console,
158  Buffer,
159  &CursorInfoRequest->Info);
160 
162  return Status;
163 }
164 
168  IN PCOORD Position);
169 CSR_API(SrvSetConsoleCursorPosition)
170 {
172  PCONSOLE_SETCURSORPOSITION SetCursorPositionRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetCursorPositionRequest;
174 
175  DPRINT("SrvSetConsoleCursorPosition\n");
176 
178  SetCursorPositionRequest->OutputHandle,
180  if (!NT_SUCCESS(Status)) return Status;
181 
182  Status = ConDrvSetConsoleCursorPosition(Buffer->Header.Console,
183  Buffer,
184  &SetCursorPositionRequest->Position);
185 
187  return Status;
188 }
189 
190 CSR_API(SrvCreateConsoleScreenBuffer)
191 {
193  PCONSOLE_CREATESCREENBUFFER CreateScreenBufferRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.CreateScreenBufferRequest;
198 
200  TEXTMODE_BUFFER_INFO TextModeInfo = {{80, 25},
203  TRUE,
205  GRAPHICS_BUFFER_INFO GraphicsInfo;
206  GraphicsInfo.Info = CreateScreenBufferRequest->GraphicsBufferInfo; // HACK for MSVC
207 
208  DPRINT("SrvCreateConsoleScreenBuffer\n");
209 
210  Status = ConSrvGetConsole(ProcessData, &Console, TRUE);
211  if (!NT_SUCCESS(Status)) return Status;
212 
213  if (CreateScreenBufferRequest->ScreenBufferType == CONSOLE_TEXTMODE_BUFFER)
214  {
215  ScreenBufferInfo = &TextModeInfo;
216 
217  /*
218  if (Console->ActiveBuffer)
219  {
220  TextModeInfo.ScreenBufferSize = Console->ActiveBuffer->ScreenBufferSize;
221  if (TextModeInfo.ScreenBufferSize.X == 0) TextModeInfo.ScreenBufferSize.X = 80;
222  if (TextModeInfo.ScreenBufferSize.Y == 0) TextModeInfo.ScreenBufferSize.Y = 25;
223 
224  TextModeInfo.ScreenAttrib = Console->ActiveBuffer->ScreenBuffer.TextBuffer.ScreenDefaultAttrib;
225  TextModeInfo.PopupAttrib = Console->ActiveBuffer->ScreenBuffer.TextBuffer.PopupDefaultAttrib;
226 
227  TextModeInfo.IsCursorVisible = Console->ActiveBuffer->CursorInfo.bVisible;
228  TextModeInfo.CursorSize = Console->ActiveBuffer->CursorInfo.dwSize;
229  }
230  */
231 
232  /*
233  * This is Windows' behaviour
234  */
235 
236  /* Use the current console size. Regularize it if needed. */
237  TextModeInfo.ScreenBufferSize = Console->ConsoleSize;
238  if (TextModeInfo.ScreenBufferSize.X == 0) TextModeInfo.ScreenBufferSize.X = 1;
239  if (TextModeInfo.ScreenBufferSize.Y == 0) TextModeInfo.ScreenBufferSize.Y = 1;
240 
241  /* If we have an active screen buffer, use its attributes as the new ones */
242  if (Console->ActiveBuffer && GetType(Console->ActiveBuffer) == TEXTMODE_BUFFER)
243  {
245 
246  TextModeInfo.ScreenAttrib = Buffer->ScreenDefaultAttrib;
247  TextModeInfo.PopupAttrib = Buffer->PopupDefaultAttrib;
248 
249  TextModeInfo.IsCursorVisible = Buffer->CursorInfo.bVisible;
250  TextModeInfo.CursorSize = Buffer->CursorInfo.dwSize;
251  }
252  }
253  else if (CreateScreenBufferRequest->ScreenBufferType == CONSOLE_GRAPHICS_BUFFER)
254  {
255  /* Get infos from the graphics buffer information structure */
256  if (!CsrValidateMessageBuffer(ApiMessage,
257  (PVOID*)&CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMapInfo,
258  CreateScreenBufferRequest->GraphicsBufferInfo.dwBitMapInfoLength,
259  sizeof(BYTE)))
260  {
262  goto Quit;
263  }
264 
265  ScreenBufferInfo = &GraphicsInfo;
266 
267  /* Initialize shared variables */
268  // CreateScreenBufferRequest->GraphicsBufferInfo.hMutex
269  CreateScreenBufferRequest->hMutex = GraphicsInfo.Info.hMutex = INVALID_HANDLE_VALUE;
270  // CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMap
271  CreateScreenBufferRequest->lpBitMap = GraphicsInfo.Info.lpBitMap = NULL;
272 
273  /* A graphics screen buffer is never inheritable */
274  CreateScreenBufferRequest->InheritHandle = FALSE;
275  }
276 
278  (PCONSOLE)Console,
279  Process->ProcessHandle,
280  CreateScreenBufferRequest->ScreenBufferType,
282  if (!NT_SUCCESS(Status)) goto Quit;
283 
284  /* Insert the new handle inside the process handles table */
286 
287  Status = ConSrvInsertObject(ProcessData,
288  &CreateScreenBufferRequest->OutputHandle,
289  &Buff->Header,
290  CreateScreenBufferRequest->DesiredAccess,
291  CreateScreenBufferRequest->InheritHandle,
292  CreateScreenBufferRequest->ShareMode);
293 
295 
296  if (!NT_SUCCESS(Status)) goto Quit;
297 
298  if (CreateScreenBufferRequest->ScreenBufferType == CONSOLE_GRAPHICS_BUFFER)
299  {
301  /*
302  * Initialize the graphics buffer information structure
303  * and give it back to the client.
304  */
305  // CreateScreenBufferRequest->GraphicsBufferInfo.hMutex
306  CreateScreenBufferRequest->hMutex = Buffer->ClientMutex;
307  // CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMap
308  CreateScreenBufferRequest->lpBitMap = Buffer->ClientBitMap;
309  }
310 
311 Quit:
313  return Status;
314 }
315 
319 CSR_API(SrvSetConsoleActiveScreenBuffer)
320 {
322  PCONSOLE_SETACTIVESCREENBUFFER SetScreenBufferRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetScreenBufferRequest;
324 
325  DPRINT("SrvSetConsoleActiveScreenBuffer\n");
326 
328  SetScreenBufferRequest->OutputHandle,
330  if (!NT_SUCCESS(Status)) return Status;
331 
333  Buffer);
334 
336  return Status;
337 }
338 
339 
340 /* CSR THREADS FOR WriteConsole ***********************************************/
341 
342 static NTSTATUS
345  IN BOOLEAN CreateWaitBlock OPTIONAL);
346 
347 // Wait function CSR_WAIT_FUNCTION
348 static BOOLEAN
349 NTAPI
351  IN PCSR_THREAD WaitThread,
352  IN PCSR_API_MESSAGE WaitApiMessage,
353  IN PVOID WaitContext,
354  IN PVOID WaitArgument1,
355  IN PVOID WaitArgument2,
356  IN ULONG WaitFlags)
357 {
359 
360  DPRINT("WriteConsoleThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
361 
362  /*
363  * If we are notified of the process termination via a call
364  * to CsrNotifyWaitBlock triggered by CsrDestroyProcess or
365  * CsrDestroyThread, just return.
366  */
367  if (WaitFlags & CsrProcessTerminating)
368  {
370  goto Quit;
371  }
372 
373  Status = DoWriteConsole(WaitApiMessage, WaitThread, FALSE);
374 
375 Quit:
376  if (Status != STATUS_PENDING)
377  {
378  WaitApiMessage->Status = Status;
379  }
380 
381  return (Status == STATUS_PENDING ? FALSE : TRUE);
382 }
383 
387  IN BOOLEAN Unicode,
389  IN ULONG NumCharsToWrite,
390  OUT PULONG NumCharsWritten OPTIONAL);
391 static NTSTATUS
394  IN BOOLEAN CreateWaitBlock OPTIONAL)
395 {
397  PCONSOLE_WRITECONSOLE WriteConsoleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.WriteConsoleRequest;
399 
400  PVOID Buffer;
401  ULONG NrCharactersWritten = 0;
402  ULONG CharSize = (WriteConsoleRequest->Unicode ? sizeof(WCHAR) : sizeof(CHAR));
403 
405  WriteConsoleRequest->OutputHandle,
407  if (!NT_SUCCESS(Status)) return Status;
408 
409  /*
410  * For optimization purposes, Windows (and hence ReactOS, too, for
411  * compatibility reasons) uses a static buffer if no more than eighty
412  * bytes are written. Otherwise a new buffer is used.
413  * The client-side expects that we know this behaviour.
414  */
415  if (WriteConsoleRequest->UsingStaticBuffer &&
416  WriteConsoleRequest->NumBytes <= sizeof(WriteConsoleRequest->StaticBuffer))
417  {
418  /*
419  * Adjust the internal pointer, because its old value points to
420  * the static buffer in the original ApiMessage structure.
421  */
422  // WriteConsoleRequest->Buffer = WriteConsoleRequest->StaticBuffer;
423  Buffer = WriteConsoleRequest->StaticBuffer;
424  }
425  else
426  {
427  Buffer = WriteConsoleRequest->Buffer;
428  }
429 
430  DPRINT("Calling ConDrvWriteConsole\n");
431  Status = ConDrvWriteConsole(ScreenBuffer->Header.Console,
432  ScreenBuffer,
433  WriteConsoleRequest->Unicode,
434  Buffer,
435  WriteConsoleRequest->NumBytes / CharSize, // NrCharactersToWrite
436  &NrCharactersWritten);
437  DPRINT("ConDrvWriteConsole returned (%d ; Status = 0x%08x)\n",
438  NrCharactersWritten, Status);
439 
440  if (Status == STATUS_PENDING)
441  {
442  if (CreateWaitBlock)
443  {
445 
446  if (!CsrCreateWait(&Console->WriteWaitQueue,
448  ClientThread,
449  ApiMessage,
450  NULL))
451  {
452  /* Fail */
454  goto Quit;
455  }
456  }
457 
458  /* Wait until we un-pause the console */
459  // Status = STATUS_PENDING;
460  }
461  else
462  {
463  /* We read all what we wanted. Set the number of bytes written. */
464  WriteConsoleRequest->NumBytes = NrCharactersWritten * CharSize;
465  }
466 
467 Quit:
469  return Status;
470 }
471 
472 
473 /* TEXT OUTPUT APIS ***********************************************************/
474 
478  IN BOOLEAN Unicode,
479  OUT PCHAR_INFO CharInfo/*Buffer*/,
480  IN OUT PSMALL_RECT ReadRegion);
481 CSR_API(SrvReadConsoleOutput)
482 {
484  PCONSOLE_READOUTPUT ReadOutputRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ReadOutputRequest;
486 
487  ULONG NumCells;
488  PCHAR_INFO CharInfo;
489 
490  DPRINT("SrvReadConsoleOutput\n");
491 
492  NumCells = (ReadOutputRequest->ReadRegion.Right - ReadOutputRequest->ReadRegion.Left + 1) *
493  (ReadOutputRequest->ReadRegion.Bottom - ReadOutputRequest->ReadRegion.Top + 1);
494 
495  /*
496  * For optimization purposes, Windows (and hence ReactOS, too, for
497  * compatibility reasons) uses a static buffer if no more than one
498  * cell is read. Otherwise a new buffer is used.
499  * The client-side expects that we know this behaviour.
500  */
501  if (NumCells <= 1)
502  {
503  /*
504  * Adjust the internal pointer, because its old value points to
505  * the static buffer in the original ApiMessage structure.
506  */
507  // ReadOutputRequest->CharInfo = &ReadOutputRequest->StaticBuffer;
508  CharInfo = &ReadOutputRequest->StaticBuffer;
509  }
510  else
511  {
512  if (!CsrValidateMessageBuffer(ApiMessage,
513  (PVOID*)&ReadOutputRequest->CharInfo,
514  NumCells,
515  sizeof(CHAR_INFO)))
516  {
518  }
519 
520  CharInfo = ReadOutputRequest->CharInfo;
521  }
522 
524  ReadOutputRequest->OutputHandle,
526  if (!NT_SUCCESS(Status)) return Status;
527 
528  Status = ConDrvReadConsoleOutput(Buffer->Header.Console,
529  Buffer,
530  ReadOutputRequest->Unicode,
531  CharInfo,
532  &ReadOutputRequest->ReadRegion);
533 
535  return Status;
536 }
537 
541  IN BOOLEAN Unicode,
542  IN PCHAR_INFO CharInfo/*Buffer*/,
543  IN OUT PSMALL_RECT WriteRegion);
544 CSR_API(SrvWriteConsoleOutput)
545 {
547  PCONSOLE_WRITEOUTPUT WriteOutputRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.WriteOutputRequest;
550 
551  ULONG NumCells;
552  PCHAR_INFO CharInfo;
553 
554  DPRINT("SrvWriteConsoleOutput\n");
555 
556  NumCells = (WriteOutputRequest->WriteRegion.Right - WriteOutputRequest->WriteRegion.Left + 1) *
557  (WriteOutputRequest->WriteRegion.Bottom - WriteOutputRequest->WriteRegion.Top + 1);
558 
560  WriteOutputRequest->OutputHandle,
562  if (!NT_SUCCESS(Status)) return Status;
563 
564  /*
565  * Validate the message buffer if we do not use a process' heap buffer
566  * (CsrAllocateCaptureBuffer succeeded because we haven't allocated
567  * a too large (>= 64 kB, size of the CSR heap) data buffer).
568  */
569  if (!WriteOutputRequest->UseVirtualMemory)
570  {
571  /*
572  * For optimization purposes, Windows (and hence ReactOS, too, for
573  * compatibility reasons) uses a static buffer if no more than one
574  * cell is written. Otherwise a new buffer is used.
575  * The client-side expects that we know this behaviour.
576  */
577  if (NumCells <= 1)
578  {
579  /*
580  * Adjust the internal pointer, because its old value points to
581  * the static buffer in the original ApiMessage structure.
582  */
583  // WriteOutputRequest->CharInfo = &WriteOutputRequest->StaticBuffer;
584  CharInfo = &WriteOutputRequest->StaticBuffer;
585  }
586  else
587  {
588  if (!CsrValidateMessageBuffer(ApiMessage,
589  (PVOID*)&WriteOutputRequest->CharInfo,
590  NumCells,
591  sizeof(CHAR_INFO)))
592  {
594  goto Quit;
595  }
596 
597  CharInfo = WriteOutputRequest->CharInfo;
598  }
599  }
600  else
601  {
602  /*
603  * This was not the case: we use a heap buffer. Retrieve its contents.
604  */
605  ULONG Size = NumCells * sizeof(CHAR_INFO);
606 
608  if (CharInfo == NULL)
609  {
611  goto Quit;
612  }
613 
614  Status = NtReadVirtualMemory(Process->ProcessHandle,
615  WriteOutputRequest->CharInfo,
616  CharInfo,
617  Size,
618  NULL);
619  if (!NT_SUCCESS(Status))
620  {
621  ConsoleFreeHeap(CharInfo);
622  // Status = STATUS_NO_MEMORY;
623  goto Quit;
624  }
625  }
626 
627  Status = ConDrvWriteConsoleOutput(Buffer->Header.Console,
628  Buffer,
629  WriteOutputRequest->Unicode,
630  CharInfo,
631  &WriteOutputRequest->WriteRegion);
632 
633  /* Free the temporary buffer if we used the process' heap buffer */
634  if (WriteOutputRequest->UseVirtualMemory && CharInfo)
635  ConsoleFreeHeap(CharInfo);
636 
637 Quit:
639  return Status;
640 }
641 
642 CSR_API(SrvWriteConsole)
643 {
645  PCONSOLE_WRITECONSOLE WriteConsoleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.WriteConsoleRequest;
646 
647  DPRINT("SrvWriteConsole\n");
648 
649  /*
650  * For optimization purposes, Windows (and hence ReactOS, too, for
651  * compatibility reasons) uses a static buffer if no more than eighty
652  * bytes are written. Otherwise a new buffer is used.
653  * The client-side expects that we know this behaviour.
654  */
655  if (WriteConsoleRequest->UsingStaticBuffer &&
656  WriteConsoleRequest->NumBytes <= sizeof(WriteConsoleRequest->StaticBuffer))
657  {
658  /*
659  * Adjust the internal pointer, because its old value points to
660  * the static buffer in the original ApiMessage structure.
661  */
662  // WriteConsoleRequest->Buffer = WriteConsoleRequest->StaticBuffer;
663  }
664  else
665  {
666  if (!CsrValidateMessageBuffer(ApiMessage,
667  (PVOID)&WriteConsoleRequest->Buffer,
668  WriteConsoleRequest->NumBytes,
669  sizeof(BYTE)))
670  {
672  }
673  }
674 
675  Status = DoWriteConsole(ApiMessage, CsrGetClientThread(), TRUE);
676 
677  if (Status == STATUS_PENDING) *ReplyCode = CsrReplyPending;
678 
679  return Status;
680 }
681 
685  IN CODE_TYPE CodeType,
687  IN ULONG NumCodesToRead,
688  IN PCOORD ReadCoord,
689  // OUT PCOORD EndCoord,
690  OUT PULONG NumCodesRead OPTIONAL);
691 CSR_API(SrvReadConsoleOutputString)
692 {
694  PCONSOLE_READOUTPUTCODE ReadOutputCodeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ReadOutputCodeRequest;
696  ULONG CodeSize;
697 
698  PVOID pCode;
699 
700  DPRINT("SrvReadConsoleOutputString\n");
701 
702  switch (ReadOutputCodeRequest->CodeType)
703  {
704  case CODE_ASCII:
705  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, AsciiChar);
706  break;
707 
708  case CODE_UNICODE:
709  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, UnicodeChar);
710  break;
711 
712  case CODE_ATTRIBUTE:
713  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, Attribute);
714  break;
715 
716  default:
718  }
719 
720  /*
721  * For optimization purposes, Windows (and hence ReactOS, too, for
722  * compatibility reasons) uses a static buffer if no more than eighty
723  * bytes are read. Otherwise a new buffer is used.
724  * The client-side expects that we know this behaviour.
725  */
726  if (ReadOutputCodeRequest->NumCodes * CodeSize <= sizeof(ReadOutputCodeRequest->CodeStaticBuffer))
727  {
728  /*
729  * Adjust the internal pointer, because its old value points to
730  * the static buffer in the original ApiMessage structure.
731  */
732  // ReadOutputCodeRequest->pCode = ReadOutputCodeRequest->CodeStaticBuffer;
733  pCode = ReadOutputCodeRequest->CodeStaticBuffer;
734  }
735  else
736  {
737  if (!CsrValidateMessageBuffer(ApiMessage,
738  (PVOID*)&ReadOutputCodeRequest->pCode,
739  ReadOutputCodeRequest->NumCodes,
740  CodeSize))
741  {
743  }
744 
745  pCode = ReadOutputCodeRequest->pCode;
746  }
747 
749  ReadOutputCodeRequest->OutputHandle,
751  if (!NT_SUCCESS(Status))
752  {
753  ReadOutputCodeRequest->NumCodes = 0;
754  return Status;
755  }
756 
757  Status = ConDrvReadConsoleOutputString(Buffer->Header.Console,
758  Buffer,
759  ReadOutputCodeRequest->CodeType,
760  pCode,
761  ReadOutputCodeRequest->NumCodes,
762  &ReadOutputCodeRequest->Coord,
763  // &ReadOutputCodeRequest->EndCoord,
764  &ReadOutputCodeRequest->NumCodes);
765 
767  return Status;
768 }
769 
773  IN CODE_TYPE CodeType,
775  IN ULONG NumCodesToWrite,
776  IN PCOORD WriteCoord,
777  // OUT PCOORD EndCoord,
778  OUT PULONG NumCodesWritten OPTIONAL);
779 CSR_API(SrvWriteConsoleOutputString)
780 {
782  PCONSOLE_WRITEOUTPUTCODE WriteOutputCodeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.WriteOutputCodeRequest;
784  ULONG CodeSize;
785 
786  PVOID pCode;
787 
788  DPRINT("SrvWriteConsoleOutputString\n");
789 
790  switch (WriteOutputCodeRequest->CodeType)
791  {
792  case CODE_ASCII:
793  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, AsciiChar);
794  break;
795 
796  case CODE_UNICODE:
797  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, UnicodeChar);
798  break;
799 
800  case CODE_ATTRIBUTE:
801  CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, Attribute);
802  break;
803 
804  default:
806  }
807 
808  /*
809  * For optimization purposes, Windows (and hence ReactOS, too, for
810  * compatibility reasons) uses a static buffer if no more than eighty
811  * bytes are written. Otherwise a new buffer is used.
812  * The client-side expects that we know this behaviour.
813  */
814  if (WriteOutputCodeRequest->NumCodes * CodeSize <= sizeof(WriteOutputCodeRequest->CodeStaticBuffer))
815  {
816  /*
817  * Adjust the internal pointer, because its old value points to
818  * the static buffer in the original ApiMessage structure.
819  */
820  // WriteOutputCodeRequest->pCode = WriteOutputCodeRequest->CodeStaticBuffer;
821  pCode = WriteOutputCodeRequest->CodeStaticBuffer;
822  }
823  else
824  {
825  if (!CsrValidateMessageBuffer(ApiMessage,
826  (PVOID*)&WriteOutputCodeRequest->pCode,
827  WriteOutputCodeRequest->NumCodes,
828  CodeSize))
829  {
831  }
832 
833  pCode = WriteOutputCodeRequest->pCode;
834  }
835 
837  WriteOutputCodeRequest->OutputHandle,
839  if (!NT_SUCCESS(Status))
840  {
841  WriteOutputCodeRequest->NumCodes = 0;
842  return Status;
843  }
844 
845  Status = ConDrvWriteConsoleOutputString(Buffer->Header.Console,
846  Buffer,
847  WriteOutputCodeRequest->CodeType,
848  pCode,
849  WriteOutputCodeRequest->NumCodes,
850  &WriteOutputCodeRequest->Coord,
851  // &WriteOutputCodeRequest->EndCoord,
852  &WriteOutputCodeRequest->NumCodes);
853 
855  return Status;
856 }
857 
861  IN CODE_TYPE CodeType,
863  IN ULONG NumCodesToWrite,
864  IN PCOORD WriteCoord,
865  OUT PULONG NumCodesWritten OPTIONAL);
866 CSR_API(SrvFillConsoleOutput)
867 {
869  PCONSOLE_FILLOUTPUTCODE FillOutputRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.FillOutputRequest;
871  CODE_TYPE CodeType = FillOutputRequest->CodeType;
872 
873  DPRINT("SrvFillConsoleOutput\n");
874 
875  if ( (CodeType != CODE_ASCII ) &&
876  (CodeType != CODE_UNICODE ) &&
877  (CodeType != CODE_ATTRIBUTE) )
878  {
880  }
881 
883  FillOutputRequest->OutputHandle,
885  if (!NT_SUCCESS(Status))
886  {
887  FillOutputRequest->NumCodes = 0;
888  return Status;
889  }
890 
891  Status = ConDrvFillConsoleOutput(Buffer->Header.Console,
892  Buffer,
893  CodeType,
894  FillOutputRequest->Code,
895  FillOutputRequest->NumCodes,
896  &FillOutputRequest->WriteCoord,
897  &FillOutputRequest->NumCodes);
898 
900  return Status;
901 }
902 
906  OUT PCOORD ScreenBufferSize,
907  OUT PCOORD CursorPosition,
908  OUT PCOORD ViewOrigin,
910  OUT PCOORD MaximumViewSize,
912 CSR_API(SrvGetConsoleScreenBufferInfo)
913 {
915  PCONSOLE_GETSCREENBUFFERINFO ScreenBufferInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ScreenBufferInfoRequest;
917 
918  DPRINT("SrvGetConsoleScreenBufferInfo\n");
919 
921  ScreenBufferInfoRequest->OutputHandle,
923  if (!NT_SUCCESS(Status)) return Status;
924 
926  Buffer,
927  &ScreenBufferInfoRequest->ScreenBufferSize,
928  &ScreenBufferInfoRequest->CursorPosition,
929  &ScreenBufferInfoRequest->ViewOrigin,
930  &ScreenBufferInfoRequest->ViewSize,
931  &ScreenBufferInfoRequest->MaximumViewSize,
932  &ScreenBufferInfoRequest->Attributes);
933 
935  return Status;
936 }
937 
941  IN WORD Attributes);
942 CSR_API(SrvSetConsoleTextAttribute)
943 {
945  PCONSOLE_SETTEXTATTRIB SetTextAttribRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetTextAttribRequest;
947 
948  DPRINT("SrvSetConsoleTextAttribute\n");
949 
951  SetTextAttribRequest->OutputHandle,
953  if (!NT_SUCCESS(Status)) return Status;
954 
955  Status = ConDrvSetConsoleTextAttribute(Buffer->Header.Console,
956  Buffer,
957  SetTextAttribRequest->Attributes);
958 
960  return Status;
961 }
962 
966  IN PCOORD Size);
967 CSR_API(SrvSetConsoleScreenBufferSize)
968 {
970  PCONSOLE_SETSCREENBUFFERSIZE SetScreenBufferSizeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetScreenBufferSizeRequest;
972 
973  DPRINT("SrvSetConsoleScreenBufferSize\n");
974 
976  SetScreenBufferSizeRequest->OutputHandle,
978  if (!NT_SUCCESS(Status)) return Status;
979 
981  Buffer,
982  &SetScreenBufferSizeRequest->Size);
983 
985  return Status;
986 }
987 
991  IN BOOLEAN Unicode,
992  IN PSMALL_RECT ScrollRectangle,
993  IN BOOLEAN UseClipRectangle,
994  IN PSMALL_RECT ClipRectangle OPTIONAL,
995  IN PCOORD DestinationOrigin,
996  IN CHAR_INFO FillChar);
997 CSR_API(SrvScrollConsoleScreenBuffer)
998 {
1000  PCONSOLE_SCROLLSCREENBUFFER ScrollScreenBufferRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ScrollScreenBufferRequest;
1002 
1003  DPRINT("SrvScrollConsoleScreenBuffer\n");
1004 
1006  ScrollScreenBufferRequest->OutputHandle,
1008  if (!NT_SUCCESS(Status)) return Status;
1009 
1010  Status = ConDrvScrollConsoleScreenBuffer(Buffer->Header.Console,
1011  Buffer,
1012  ScrollScreenBufferRequest->Unicode,
1013  &ScrollScreenBufferRequest->ScrollRectangle,
1014  ScrollScreenBufferRequest->UseClipRectangle,
1015  &ScrollScreenBufferRequest->ClipRectangle,
1016  &ScrollScreenBufferRequest->DestinationOrigin,
1017  ScrollScreenBufferRequest->Fill);
1018 
1020  return Status;
1021 }
1022 
1026  IN BOOLEAN Absolute,
1027  IN PSMALL_RECT WindowRect);
1028 CSR_API(SrvSetConsoleWindowInfo)
1029 {
1030  NTSTATUS Status;
1031  PCONSOLE_SETWINDOWINFO SetWindowInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetWindowInfoRequest;
1032  // PCONSOLE_SCREEN_BUFFER Buffer;
1034 
1035  DPRINT1("SrvSetConsoleWindowInfo(0x%08x, %d, {L%d, T%d, R%d, B%d}) called\n",
1036  SetWindowInfoRequest->OutputHandle, SetWindowInfoRequest->Absolute,
1037  SetWindowInfoRequest->WindowRect.Left ,
1038  SetWindowInfoRequest->WindowRect.Top ,
1039  SetWindowInfoRequest->WindowRect.Right,
1040  SetWindowInfoRequest->WindowRect.Bottom);
1041 
1042  // ConSrvGetScreenBuffer
1044  SetWindowInfoRequest->OutputHandle,
1045  &Buffer, GENERIC_READ, TRUE);
1046  if (!NT_SUCCESS(Status)) return Status;
1047 
1048  Status = ConDrvSetConsoleWindowInfo(Buffer->Header.Console,
1049  Buffer,
1050  SetWindowInfoRequest->Absolute,
1051  &SetWindowInfoRequest->WindowRect);
1052 
1054  return Status;
1055 }
1056 
1057 /* EOF */
HANDLE OutputHandle
Definition: conmsg.h:587
CONSOLE_GRAPHICS_BUFFER_INFO Info
Definition: conio.h:167
CSR_API(SrvInvalidateBitMapRect)
Definition: conoutput.c:33
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:38
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:392
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:350
#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:391
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:600
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:840
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:531
SHORT Left
Definition: blue.h:25
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:28
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:1099
#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:26
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
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:117
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:59
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
#define CONSOLE_GRAPHICS_BUFFER
Definition: wincon.h:60
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:1221
CConsole Console
#define DPRINT1
Definition: precomp.h:8
#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:39
_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:1133
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:1059
NTSTATUS NTAPI ConDrvSetConsoleScreenBufferSize(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN PCOORD Size)
Definition: text.c:1114
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:467
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:727
SHORT Right
Definition: blue.h:27
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:655
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:978
USHORT ScreenAttrib
Definition: conio.h:144
RTL_CRITICAL_SECTION HandleTableLock
Definition: consrv.h:48
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68