Author: hbelusca
Date: Sat Oct 26 20:53:05 2013
New Revision: 60756
URL:
http://svn.reactos.org/svn/reactos?rev=60756&view=rev
Log:
[KERNEL32][CONSRV]
Implement WriteConsoleInputVDMA/W, its only purpose being putting console input events at
the beginning of the console input event list instead of putting them at the end, as it is
done with WriteConsoleInputA/W .
Modified:
trunk/reactos/dll/win32/kernel32/client/console/console.c
trunk/reactos/dll/win32/kernel32/client/console/readwrite.c
trunk/reactos/include/psdk/wincon.h
trunk/reactos/include/reactos/subsys/win/conmsg.h
trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c
trunk/reactos/win32ss/user/winsrv/consrv/coninput.c
trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h
Modified: trunk/reactos/dll/win32/kernel32/client/console/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/console/console.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/console/console.c [iso-8859-1] Sat Oct 26
20:53:05 2013
@@ -801,38 +801,6 @@
}
return TRUE;
-}
-
-
-/*
- * @unimplemented
- */
-DWORD
-WINAPI
-WriteConsoleInputVDMA(DWORD Unknown0,
- DWORD Unknown1,
- DWORD Unknown2,
- DWORD Unknown3)
-{
- DPRINT1("WriteConsoleInputVDMA(0x%x, 0x%x, 0x%x, 0x%x) UNIMPLEMENTED!\n",
Unknown0, Unknown1, Unknown2, Unknown3);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-
-/*
- * @unimplemented
- */
-DWORD
-WINAPI
-WriteConsoleInputVDMW(DWORD Unknown0,
- DWORD Unknown1,
- DWORD Unknown2,
- DWORD Unknown3)
-{
- DPRINT1("WriteConsoleInputVDMW(0x%x, 0x%x, 0x%x, 0x%x) UNIMPLEMENTED!\n",
Unknown0, Unknown1, Unknown2, Unknown3);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
}
Modified: trunk/reactos/dll/win32/kernel32/client/console/readwrite.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] Sat Oct 26
20:53:05 2013
@@ -460,7 +460,8 @@
PINPUT_RECORD lpBuffer,
DWORD nLength,
LPDWORD lpNumberOfEventsWritten,
- BOOL bUnicode)
+ BOOL bUnicode,
+ BOOL bAppendToEnd)
{
CONSOLE_API_MESSAGE ApiMessage;
PCONSOLE_WRITEINPUT WriteInputRequest = &ApiMessage.Data.WriteInputRequest;
@@ -488,8 +489,9 @@
/* Set up the data to send to the Console Server */
WriteInputRequest->InputHandle = hConsoleInput;
+ WriteInputRequest->Length = nLength;
WriteInputRequest->Unicode = bUnicode;
- WriteInputRequest->Length = nLength;
+ WriteInputRequest->AppendToEnd = bAppendToEnd;
/* Call the server */
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
@@ -1086,6 +1088,7 @@
(PINPUT_RECORD)lpBuffer,
nLength,
lpNumberOfEventsWritten,
+ TRUE,
TRUE);
}
@@ -1106,6 +1109,49 @@
(PINPUT_RECORD)lpBuffer,
nLength,
lpNumberOfEventsWritten,
+ FALSE,
+ TRUE);
+}
+
+
+/*--------------------------------------------------------------
+ * WriteConsoleInputVDMW
+ *
+ * @implemented
+ */
+BOOL
+WINAPI
+WriteConsoleInputVDMW(HANDLE hConsoleInput,
+ CONST INPUT_RECORD *lpBuffer,
+ DWORD nLength,
+ LPDWORD lpNumberOfEventsWritten)
+{
+ return IntWriteConsoleInput(hConsoleInput,
+ (PINPUT_RECORD)lpBuffer,
+ nLength,
+ lpNumberOfEventsWritten,
+ TRUE,
+ FALSE);
+}
+
+
+/*--------------------------------------------------------------
+ * WriteConsoleInputVDMA
+ *
+ * @implemented
+ */
+BOOL
+WINAPI
+WriteConsoleInputVDMA(HANDLE hConsoleInput,
+ CONST INPUT_RECORD *lpBuffer,
+ DWORD nLength,
+ LPDWORD lpNumberOfEventsWritten)
+{
+ return IntWriteConsoleInput(hConsoleInput,
+ (PINPUT_RECORD)lpBuffer,
+ nLength,
+ lpNumberOfEventsWritten,
+ FALSE,
FALSE);
}
Modified: trunk/reactos/include/psdk/wincon.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wincon.h?rev=…
==============================================================================
--- trunk/reactos/include/psdk/wincon.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/wincon.h [iso-8859-1] Sat Oct 26 20:53:05 2013
@@ -611,6 +611,22 @@
BOOL
WINAPI
WriteConsoleInputW(
+ _In_ HANDLE hConsoleInput,
+ _In_reads_(nLength) CONST INPUT_RECORD *lpBuffer,
+ _In_ DWORD nLength,
+ _Out_ LPDWORD lpNumberOfEventsWritten);
+
+BOOL
+WINAPI
+WriteConsoleInputVDMA(
+ _In_ HANDLE hConsoleInput,
+ _In_reads_(nLength) CONST INPUT_RECORD *lpBuffer,
+ _In_ DWORD nLength,
+ _Out_ LPDWORD lpNumberOfEventsWritten);
+
+BOOL
+WINAPI
+WriteConsoleInputVDMW(
_In_ HANDLE hConsoleInput,
_In_reads_(nLength) CONST INPUT_RECORD *lpBuffer,
_In_ DWORD nLength,
Modified: trunk/reactos/include/reactos/subsys/win/conmsg.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/win…
==============================================================================
--- trunk/reactos/include/reactos/subsys/win/conmsg.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/subsys/win/conmsg.h [iso-8859-1] Sat Oct 26 20:53:05
2013
@@ -492,9 +492,10 @@
typedef struct
{
HANDLE InputHandle;
- BOOL Unicode;
DWORD Length;
INPUT_RECORD* InputRecord;
+ BOOL Unicode;
+ BOOL AppendToEnd;
} CONSOLE_WRITEINPUT, *PCONSOLE_WRITEINPUT;
typedef struct
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c [iso-8859-1] Sat Oct 26
20:53:05 2013
@@ -60,8 +60,9 @@
}
NTSTATUS FASTCALL
-ConioProcessInputEvent(PCONSOLE Console,
- PINPUT_RECORD InputEvent)
+ConioAddInputEvent(PCONSOLE Console,
+ PINPUT_RECORD InputEvent,
+ BOOLEAN AppendToEnd)
{
ConsoleInput *ConInRec;
@@ -97,7 +98,17 @@
if (ConInRec == NULL) return STATUS_INSUFFICIENT_RESOURCES;
ConInRec->InputEvent = *InputEvent;
- InsertTailList(&Console->InputBuffer.InputEvents,
&ConInRec->ListEntry);
+
+ if (AppendToEnd)
+ {
+ /* Append the event to the end of the queue */
+ InsertTailList(&Console->InputBuffer.InputEvents,
&ConInRec->ListEntry);
+ }
+ else
+ {
+ /* Append the event to the beginning of the queue */
+ InsertHeadList(&Console->InputBuffer.InputEvents,
&ConInRec->ListEntry);
+ }
SetEvent(Console->InputBuffer.ActiveEvent);
CsrNotifyWait(&Console->InputBuffer.ReadWaitQueue,
@@ -110,6 +121,13 @@
}
return STATUS_SUCCESS;
+}
+
+NTSTATUS FASTCALL
+ConioProcessInputEvent(PCONSOLE Console,
+ PINPUT_RECORD InputEvent)
+{
+ return ConioAddInputEvent(Console, InputEvent, TRUE);
}
VOID FASTCALL
@@ -429,6 +447,7 @@
ConDrvWriteConsoleInput(IN PCONSOLE Console,
IN PCONSOLE_INPUT_BUFFER InputBuffer,
IN BOOLEAN Unicode,
+ IN BOOLEAN AppendToEnd,
IN PINPUT_RECORD InputRecord,
IN ULONG NumEventsToWrite,
OUT PULONG NumEventsWritten OPTIONAL)
@@ -457,7 +476,7 @@
&AsciiChar);
}
- Status = ConioProcessInputEvent(Console, InputRecord++);
+ Status = ConioAddInputEvent(Console, InputRecord++, AppendToEnd);
}
if (NumEventsWritten) *NumEventsWritten = i;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/coninput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] Sat Oct 26 20:53:05
2013
@@ -391,6 +391,7 @@
ConDrvWriteConsoleInput(IN PCONSOLE Console,
IN PCONSOLE_INPUT_BUFFER InputBuffer,
IN BOOLEAN Unicode,
+ IN BOOLEAN AppendToEnd,
IN PINPUT_RECORD InputRecord,
IN ULONG NumEventsToWrite,
OUT PULONG NumEventsWritten OPTIONAL);
@@ -420,6 +421,7 @@
Status = ConDrvWriteConsoleInput(InputBuffer->Header.Console,
InputBuffer,
WriteInputRequest->Unicode,
+ WriteInputRequest->AppendToEnd,
WriteInputRequest->InputRecord,
WriteInputRequest->Length,
&NumEventsWritten);
Modified: trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] Sat Oct 26
20:53:05 2013
@@ -348,6 +348,9 @@
/* coninput.c */
VOID NTAPI ConioProcessKey(PCONSOLE Console, MSG* msg);
+NTSTATUS FASTCALL ConioAddInputEvent(PCONSOLE Console,
+ PINPUT_RECORD InputEvent,
+ BOOLEAN AppendToEnd);
NTSTATUS FASTCALL ConioProcessInputEvent(PCONSOLE Console,
PINPUT_RECORD InputEvent);