[CONSRV]: Use an optional parameter for passing things to the "line discipline" functions.

svn path=/branches/condrv_restructure/; revision=65640
This commit is contained in:
Hermès Bélusca-Maïto 2014-12-14 16:53:47 +00:00
parent f6b392dd4c
commit f995f5fef8
6 changed files with 18 additions and 17 deletions

View file

@ -238,10 +238,10 @@ ConDrvDeinitInputBuffer(IN PCONSOLE Console)
NTSTATUS NTAPI NTSTATUS NTAPI
ConDrvReadConsole(IN PCONSOLE Console, ConDrvReadConsole(IN PCONSOLE Console,
IN PCONSOLE_INPUT_BUFFER InputBuffer, IN PCONSOLE_INPUT_BUFFER InputBuffer,
/**/IN PUNICODE_STRING ExeName /**/OPTIONAL/**/,/**/
IN BOOLEAN Unicode, IN BOOLEAN Unicode,
OUT PVOID Buffer, OUT PVOID Buffer,
IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl,
IN PVOID Parameter OPTIONAL,
IN ULONG NumCharsToRead, IN ULONG NumCharsToRead,
OUT PULONG NumCharsRead OPTIONAL) OUT PULONG NumCharsRead OPTIONAL)
{ {
@ -260,10 +260,10 @@ ConDrvReadConsole(IN PCONSOLE Console,
/* Call the line-discipline */ /* Call the line-discipline */
return TermReadStream(Console, return TermReadStream(Console,
ExeName,
Unicode, Unicode,
Buffer, Buffer,
ReadControl, ReadControl,
Parameter,
NumCharsToRead, NumCharsToRead,
NumCharsRead); NumCharsRead);
} }

View file

@ -31,11 +31,11 @@ DummyDeinitTerminal(IN OUT PTERMINAL This)
static NTSTATUS NTAPI static NTSTATUS NTAPI
DummyReadStream(IN OUT PTERMINAL This, DummyReadStream(IN OUT PTERMINAL This,
/**/IN PUNICODE_STRING ExeName /**/OPTIONAL/**/,/**/
IN BOOLEAN Unicode, IN BOOLEAN Unicode,
/**PWCHAR Buffer,**/ /**PWCHAR Buffer,**/
OUT PVOID Buffer, OUT PVOID Buffer,
IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl,
IN PVOID Parameter OPTIONAL,
IN ULONG NumCharsToRead, IN ULONG NumCharsToRead,
OUT PULONG NumCharsRead OPTIONAL) OUT PULONG NumCharsRead OPTIONAL)
{ {

View file

@ -302,10 +302,10 @@ Quit:
NTSTATUS NTAPI NTSTATUS NTAPI
ConDrvReadConsole(IN PCONSOLE Console, ConDrvReadConsole(IN PCONSOLE Console,
IN PCONSOLE_INPUT_BUFFER InputBuffer, IN PCONSOLE_INPUT_BUFFER InputBuffer,
/**/IN PUNICODE_STRING ExeName /**/OPTIONAL/**/,/**/
IN BOOLEAN Unicode, IN BOOLEAN Unicode,
OUT PVOID Buffer, OUT PVOID Buffer,
IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl,
IN PVOID Parameter OPTIONAL,
IN ULONG NumCharsToRead, IN ULONG NumCharsToRead,
OUT PULONG NumCharsRead OPTIONAL); OUT PULONG NumCharsRead OPTIONAL);
static NTSTATUS static NTSTATUS
@ -324,7 +324,7 @@ ReadChars(IN PGET_INPUT_INFO InputInfo,
ULONG NrCharactersRead = 0; ULONG NrCharactersRead = 0;
ULONG CharSize = (ReadConsoleRequest->Unicode ? sizeof(WCHAR) : sizeof(CHAR)); ULONG CharSize = (ReadConsoleRequest->Unicode ? sizeof(WCHAR) : sizeof(CHAR));
/* Compute the executable name, if needed */ /* Retrieve the executable name, if needed */
if (ReadConsoleRequest->InitialNumBytes == 0 && if (ReadConsoleRequest->InitialNumBytes == 0 &&
ReadConsoleRequest->ExeLength <= sizeof(ReadConsoleRequest->StaticBuffer)) ReadConsoleRequest->ExeLength <= sizeof(ReadConsoleRequest->StaticBuffer))
{ {
@ -366,10 +366,10 @@ ReadChars(IN PGET_INPUT_INFO InputInfo,
DPRINT("Calling ConDrvReadConsole(%wZ)\n", &ExeName); DPRINT("Calling ConDrvReadConsole(%wZ)\n", &ExeName);
Status = ConDrvReadConsole(InputBuffer->Header.Console, Status = ConDrvReadConsole(InputBuffer->Header.Console,
InputBuffer, InputBuffer,
&ExeName,
ReadConsoleRequest->Unicode, ReadConsoleRequest->Unicode,
Buffer, Buffer,
&ReadControl, &ReadControl,
&ExeName,
ReadConsoleRequest->NumBytes / CharSize, // NrCharactersToRead ReadConsoleRequest->NumBytes / CharSize, // NrCharactersToRead
&NrCharactersRead); &NrCharactersRead);
DPRINT("ConDrvReadConsole returned (%d ; Status = 0x%08x)\n", DPRINT("ConDrvReadConsole returned (%d ; Status = 0x%08x)\n",

View file

@ -296,17 +296,18 @@ ConSrvTermDeinitTerminal(IN OUT PTERMINAL This)
static NTSTATUS NTAPI static NTSTATUS NTAPI
ConSrvTermReadStream(IN OUT PTERMINAL This, ConSrvTermReadStream(IN OUT PTERMINAL This,
/**/IN PUNICODE_STRING ExeName /**/OPTIONAL/**/,/**/
IN BOOLEAN Unicode, IN BOOLEAN Unicode,
/**PWCHAR Buffer,**/ /**PWCHAR Buffer,**/
OUT PVOID Buffer, OUT PVOID Buffer,
IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl,
IN PVOID Parameter OPTIONAL,
IN ULONG NumCharsToRead, IN ULONG NumCharsToRead,
OUT PULONG NumCharsRead OPTIONAL) OUT PULONG NumCharsRead OPTIONAL)
{ {
PFRONTEND FrontEnd = This->Data; PFRONTEND FrontEnd = This->Data;
PCONSRV_CONSOLE Console = FrontEnd->Console; PCONSRV_CONSOLE Console = FrontEnd->Console;
PCONSOLE_INPUT_BUFFER InputBuffer = &Console->InputBuffer; PCONSOLE_INPUT_BUFFER InputBuffer = &Console->InputBuffer;
PUNICODE_STRING ExeName = Parameter;
// STATUS_PENDING : Wait if more to read ; STATUS_SUCCESS : Don't wait. // STATUS_PENDING : Wait if more to read ; STATUS_SUCCESS : Don't wait.
NTSTATUS Status = STATUS_PENDING; NTSTATUS Status = STATUS_PENDING;

View file

@ -217,13 +217,13 @@ typedef struct _TERMINAL_VTBL
/* Interface used only for text-mode screen buffers */ /* Interface used only for text-mode screen buffers */
NTSTATUS (NTAPI *ReadStream)(IN OUT PTERMINAL This, NTSTATUS (NTAPI *ReadStream)(IN OUT PTERMINAL This,
/**/IN PUNICODE_STRING ExeName /**/OPTIONAL/**/,/**/ IN BOOLEAN Unicode,
IN BOOLEAN Unicode, /**PWCHAR Buffer,**/
/**PWCHAR Buffer,**/ OUT PVOID Buffer,
OUT PVOID Buffer, IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl,
IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, IN PVOID Parameter OPTIONAL,
IN ULONG NumCharsToRead, IN ULONG NumCharsToRead,
OUT PULONG NumCharsRead OPTIONAL); OUT PULONG NumCharsRead OPTIONAL);
NTSTATUS (NTAPI *WriteStream)(IN OUT PTERMINAL This, NTSTATUS (NTAPI *WriteStream)(IN OUT PTERMINAL This,
PTEXTMODE_SCREEN_BUFFER Buff, PTEXTMODE_SCREEN_BUFFER Buff,
PWCHAR Buffer, PWCHAR Buffer,

View file

@ -10,9 +10,9 @@
/* Macros used to call functions in the TERMINAL_VTBL virtual table */ /* Macros used to call functions in the TERMINAL_VTBL virtual table */
#define TermReadStream(Console, ExeName, /**/ Unicode, /**/ Buffer, ReadControl, NumCharsToRead, NumCharsRead) \ #define TermReadStream(Console, /**/ Unicode, /**/ Buffer, ReadControl, Parameter, NumCharsToRead, NumCharsRead) \
(Console)->TermIFace.Vtbl->ReadStream(&(Console)->TermIFace, (ExeName), /**/ (Unicode), /**/ \ (Console)->TermIFace.Vtbl->ReadStream(&(Console)->TermIFace, /**/ (Unicode), /**/ \
(Buffer), (ReadControl), (NumCharsToRead), (NumCharsRead)) (Buffer), (ReadControl), (Parameter), (NumCharsToRead), (NumCharsRead))
#define TermWriteStream(Console, ScreenBuffer, Buffer, Length, Attrib) \ #define TermWriteStream(Console, ScreenBuffer, Buffer, Length, Attrib) \
(Console)->TermIFace.Vtbl->WriteStream(&(Console)->TermIFace, (ScreenBuffer), (Buffer), \ (Console)->TermIFace.Vtbl->WriteStream(&(Console)->TermIFace, (ScreenBuffer), (Buffer), \