From f995f5fef8d36b91156650c333222fb18598b573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 14 Dec 2014 16:53:47 +0000 Subject: [PATCH] [CONSRV]: Use an optional parameter for passing things to the "line discipline" functions. svn path=/branches/condrv_restructure/; revision=65640 --- win32ss/user/winsrv/consrv/condrv/coninput.c | 4 ++-- win32ss/user/winsrv/consrv/condrv/dummyterm.c | 2 +- win32ss/user/winsrv/consrv/coninput.c | 6 +++--- win32ss/user/winsrv/consrv/frontends/terminal.c | 3 ++- win32ss/user/winsrv/consrv/include/conio.h | 14 +++++++------- win32ss/user/winsrv/consrv/include/term.h | 6 +++--- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/win32ss/user/winsrv/consrv/condrv/coninput.c b/win32ss/user/winsrv/consrv/condrv/coninput.c index a3f38419c00..1f4a34a63d5 100644 --- a/win32ss/user/winsrv/consrv/condrv/coninput.c +++ b/win32ss/user/winsrv/consrv/condrv/coninput.c @@ -238,10 +238,10 @@ ConDrvDeinitInputBuffer(IN PCONSOLE Console) NTSTATUS NTAPI ConDrvReadConsole(IN PCONSOLE Console, IN PCONSOLE_INPUT_BUFFER InputBuffer, - /**/IN PUNICODE_STRING ExeName /**/OPTIONAL/**/,/**/ IN BOOLEAN Unicode, OUT PVOID Buffer, IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, + IN PVOID Parameter OPTIONAL, IN ULONG NumCharsToRead, OUT PULONG NumCharsRead OPTIONAL) { @@ -260,10 +260,10 @@ ConDrvReadConsole(IN PCONSOLE Console, /* Call the line-discipline */ return TermReadStream(Console, - ExeName, Unicode, Buffer, ReadControl, + Parameter, NumCharsToRead, NumCharsRead); } diff --git a/win32ss/user/winsrv/consrv/condrv/dummyterm.c b/win32ss/user/winsrv/consrv/condrv/dummyterm.c index 2066cb54ee4..73cbe8f8b4d 100644 --- a/win32ss/user/winsrv/consrv/condrv/dummyterm.c +++ b/win32ss/user/winsrv/consrv/condrv/dummyterm.c @@ -31,11 +31,11 @@ DummyDeinitTerminal(IN OUT PTERMINAL This) static NTSTATUS NTAPI DummyReadStream(IN OUT PTERMINAL This, - /**/IN PUNICODE_STRING ExeName /**/OPTIONAL/**/,/**/ IN BOOLEAN Unicode, /**PWCHAR Buffer,**/ OUT PVOID Buffer, IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, + IN PVOID Parameter OPTIONAL, IN ULONG NumCharsToRead, OUT PULONG NumCharsRead OPTIONAL) { diff --git a/win32ss/user/winsrv/consrv/coninput.c b/win32ss/user/winsrv/consrv/coninput.c index c2c5d2cc956..e7ee44d5ee2 100644 --- a/win32ss/user/winsrv/consrv/coninput.c +++ b/win32ss/user/winsrv/consrv/coninput.c @@ -302,10 +302,10 @@ Quit: NTSTATUS NTAPI ConDrvReadConsole(IN PCONSOLE Console, IN PCONSOLE_INPUT_BUFFER InputBuffer, - /**/IN PUNICODE_STRING ExeName /**/OPTIONAL/**/,/**/ IN BOOLEAN Unicode, OUT PVOID Buffer, IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, + IN PVOID Parameter OPTIONAL, IN ULONG NumCharsToRead, OUT PULONG NumCharsRead OPTIONAL); static NTSTATUS @@ -324,7 +324,7 @@ ReadChars(IN PGET_INPUT_INFO InputInfo, ULONG NrCharactersRead = 0; ULONG CharSize = (ReadConsoleRequest->Unicode ? sizeof(WCHAR) : sizeof(CHAR)); - /* Compute the executable name, if needed */ + /* Retrieve the executable name, if needed */ if (ReadConsoleRequest->InitialNumBytes == 0 && ReadConsoleRequest->ExeLength <= sizeof(ReadConsoleRequest->StaticBuffer)) { @@ -366,10 +366,10 @@ ReadChars(IN PGET_INPUT_INFO InputInfo, DPRINT("Calling ConDrvReadConsole(%wZ)\n", &ExeName); Status = ConDrvReadConsole(InputBuffer->Header.Console, InputBuffer, - &ExeName, ReadConsoleRequest->Unicode, Buffer, &ReadControl, + &ExeName, ReadConsoleRequest->NumBytes / CharSize, // NrCharactersToRead &NrCharactersRead); DPRINT("ConDrvReadConsole returned (%d ; Status = 0x%08x)\n", diff --git a/win32ss/user/winsrv/consrv/frontends/terminal.c b/win32ss/user/winsrv/consrv/frontends/terminal.c index 668b4d6b3e6..5a594921cf8 100644 --- a/win32ss/user/winsrv/consrv/frontends/terminal.c +++ b/win32ss/user/winsrv/consrv/frontends/terminal.c @@ -296,17 +296,18 @@ ConSrvTermDeinitTerminal(IN OUT PTERMINAL This) static NTSTATUS NTAPI ConSrvTermReadStream(IN OUT PTERMINAL This, - /**/IN PUNICODE_STRING ExeName /**/OPTIONAL/**/,/**/ IN BOOLEAN Unicode, /**PWCHAR Buffer,**/ OUT PVOID Buffer, IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, + IN PVOID Parameter OPTIONAL, IN ULONG NumCharsToRead, OUT PULONG NumCharsRead OPTIONAL) { PFRONTEND FrontEnd = This->Data; PCONSRV_CONSOLE Console = FrontEnd->Console; PCONSOLE_INPUT_BUFFER InputBuffer = &Console->InputBuffer; + PUNICODE_STRING ExeName = Parameter; // STATUS_PENDING : Wait if more to read ; STATUS_SUCCESS : Don't wait. NTSTATUS Status = STATUS_PENDING; diff --git a/win32ss/user/winsrv/consrv/include/conio.h b/win32ss/user/winsrv/consrv/include/conio.h index a3728641c4d..271a130bdef 100644 --- a/win32ss/user/winsrv/consrv/include/conio.h +++ b/win32ss/user/winsrv/consrv/include/conio.h @@ -217,13 +217,13 @@ typedef struct _TERMINAL_VTBL /* Interface used only for text-mode screen buffers */ NTSTATUS (NTAPI *ReadStream)(IN OUT PTERMINAL This, - /**/IN PUNICODE_STRING ExeName /**/OPTIONAL/**/,/**/ - IN BOOLEAN Unicode, - /**PWCHAR Buffer,**/ - OUT PVOID Buffer, - IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, - IN ULONG NumCharsToRead, - OUT PULONG NumCharsRead OPTIONAL); + IN BOOLEAN Unicode, + /**PWCHAR Buffer,**/ + OUT PVOID Buffer, + IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, + IN PVOID Parameter OPTIONAL, + IN ULONG NumCharsToRead, + OUT PULONG NumCharsRead OPTIONAL); NTSTATUS (NTAPI *WriteStream)(IN OUT PTERMINAL This, PTEXTMODE_SCREEN_BUFFER Buff, PWCHAR Buffer, diff --git a/win32ss/user/winsrv/consrv/include/term.h b/win32ss/user/winsrv/consrv/include/term.h index ecea140aff1..a672499acf9 100644 --- a/win32ss/user/winsrv/consrv/include/term.h +++ b/win32ss/user/winsrv/consrv/include/term.h @@ -10,9 +10,9 @@ /* Macros used to call functions in the TERMINAL_VTBL virtual table */ -#define TermReadStream(Console, ExeName, /**/ Unicode, /**/ Buffer, ReadControl, NumCharsToRead, NumCharsRead) \ - (Console)->TermIFace.Vtbl->ReadStream(&(Console)->TermIFace, (ExeName), /**/ (Unicode), /**/ \ - (Buffer), (ReadControl), (NumCharsToRead), (NumCharsRead)) +#define TermReadStream(Console, /**/ Unicode, /**/ Buffer, ReadControl, Parameter, NumCharsToRead, NumCharsRead) \ + (Console)->TermIFace.Vtbl->ReadStream(&(Console)->TermIFace, /**/ (Unicode), /**/ \ + (Buffer), (ReadControl), (Parameter), (NumCharsToRead), (NumCharsRead)) #define TermWriteStream(Console, ScreenBuffer, Buffer, Length, Attrib) \ (Console)->TermIFace.Vtbl->WriteStream(&(Console)->TermIFace, (ScreenBuffer), (Buffer), \