2012-11-15 18:06:17 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS system libraries
|
|
|
|
* FILE: dll/win32/kernel32/client/console/readwrite.c
|
|
|
|
* PURPOSE: Win32 Console Client read-write functions
|
|
|
|
* PROGRAMMERS: Emanuele Aliberti
|
|
|
|
* Marty Dill
|
|
|
|
* Filip Navara (xnavara@volny.cz)
|
|
|
|
* Thomas Weidenmueller (w3seek@reactos.org)
|
|
|
|
* Jeffrey Morlan
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
|
|
|
#include <k32.h>
|
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/* See consrv/include/rect.h */
|
|
|
|
#define ConioRectHeight(Rect) \
|
|
|
|
(((Rect)->Top) > ((Rect)->Bottom) ? 0 : ((Rect)->Bottom) - ((Rect)->Top) + 1)
|
|
|
|
#define ConioRectWidth(Rect) \
|
|
|
|
(((Rect)->Left) > ((Rect)->Right) ? 0 : ((Rect)->Right) - ((Rect)->Left) + 1)
|
|
|
|
|
|
|
|
|
2012-11-15 18:06:17 +00:00
|
|
|
/* PRIVATE FUNCTIONS **********************************************************/
|
|
|
|
|
|
|
|
/******************
|
|
|
|
* Read functions *
|
|
|
|
******************/
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOL
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
IntReadConsole(IN HANDLE hConsoleInput,
|
|
|
|
OUT PVOID lpBuffer,
|
|
|
|
IN DWORD nNumberOfCharsToRead,
|
|
|
|
OUT LPDWORD lpNumberOfCharsRead,
|
|
|
|
IN PCONSOLE_READCONSOLE_CONTROL pInputControl OPTIONAL,
|
|
|
|
IN BOOLEAN bUnicode)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
BOOL Success;
|
2012-11-17 21:39:41 +00:00
|
|
|
CONSOLE_API_MESSAGE ApiMessage;
|
2013-01-05 23:10:12 +00:00
|
|
|
PCONSOLE_READCONSOLE ReadConsoleRequest = &ApiMessage.Data.ReadConsoleRequest;
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
PCSR_CAPTURE_BUFFER CaptureBuffer = NULL;
|
|
|
|
ULONG CharSize, SizeBytes;
|
|
|
|
|
|
|
|
DPRINT("IntReadConsole\n");
|
|
|
|
|
|
|
|
/* Set up the data to send to the Console Server */
|
|
|
|
ReadConsoleRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
|
|
|
|
ReadConsoleRequest->InputHandle = hConsoleInput;
|
|
|
|
ReadConsoleRequest->Unicode = bUnicode;
|
|
|
|
|
|
|
|
/*
|
2014-09-07 22:53:49 +00:00
|
|
|
* Retrieve the (current) Input EXE name string and length,
|
|
|
|
* not NULL-terminated (always in UNICODE format).
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
*/
|
|
|
|
ReadConsoleRequest->ExeLength =
|
2014-09-07 22:53:49 +00:00
|
|
|
GetCurrentExeName((PWCHAR)ReadConsoleRequest->StaticBuffer,
|
|
|
|
sizeof(ReadConsoleRequest->StaticBuffer));
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
|
|
|
|
/*** For DEBUGGING purposes ***/
|
|
|
|
{
|
|
|
|
UNICODE_STRING ExeName;
|
|
|
|
ExeName.Length = ExeName.MaximumLength = ReadConsoleRequest->ExeLength;
|
|
|
|
ExeName.Buffer = (PWCHAR)ReadConsoleRequest->StaticBuffer;
|
2017-12-09 10:53:54 +00:00
|
|
|
DPRINT("IntReadConsole(ExeName = %wZ)\n", &ExeName);
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
}
|
|
|
|
/******************************/
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2012-11-17 21:39:41 +00:00
|
|
|
/* Determine the needed size */
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
CharSize = (bUnicode ? sizeof(WCHAR) : sizeof(CHAR));
|
|
|
|
SizeBytes = nNumberOfCharsToRead * CharSize;
|
2012-11-17 21:39:41 +00:00
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
ReadConsoleRequest->CaptureBufferSize =
|
|
|
|
ReadConsoleRequest->NumBytes = SizeBytes;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For optimization purposes, Windows (and hence ReactOS, too, for
|
|
|
|
* compatibility reasons) uses a static buffer if no more than eighty
|
|
|
|
* bytes are read. Otherwise a new buffer is allocated.
|
|
|
|
* This behaviour is also expected in the server-side.
|
|
|
|
*/
|
|
|
|
if (SizeBytes <= sizeof(ReadConsoleRequest->StaticBuffer))
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
ReadConsoleRequest->Buffer = ReadConsoleRequest->StaticBuffer;
|
|
|
|
// CaptureBuffer = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Allocate a Capture Buffer */
|
|
|
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, SizeBytes);
|
|
|
|
if (CaptureBuffer == NULL)
|
|
|
|
{
|
|
|
|
DPRINT1("CsrAllocateCaptureBuffer failed!\n");
|
|
|
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate space in the Buffer */
|
|
|
|
CsrAllocateMessagePointer(CaptureBuffer,
|
|
|
|
SizeBytes,
|
|
|
|
(PVOID*)&ReadConsoleRequest->Buffer);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
ReadConsoleRequest->InitialNumBytes = 0;
|
|
|
|
ReadConsoleRequest->CtrlWakeupMask = 0;
|
|
|
|
ReadConsoleRequest->ControlKeyState = 0;
|
2012-11-17 21:39:41 +00:00
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
/*
|
|
|
|
* From MSDN (ReadConsole function), the description
|
|
|
|
* for pInputControl says:
|
|
|
|
* "This parameter requires Unicode input by default.
|
|
|
|
* For ANSI mode, set this parameter to NULL."
|
|
|
|
*/
|
2014-08-01 19:03:50 +00:00
|
|
|
_SEH2_TRY
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
{
|
2014-08-01 19:03:50 +00:00
|
|
|
if (bUnicode && pInputControl &&
|
|
|
|
pInputControl->nLength == sizeof(CONSOLE_READCONSOLE_CONTROL))
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
{
|
2014-08-01 19:03:50 +00:00
|
|
|
/* Sanity check */
|
|
|
|
if (pInputControl->nInitialChars <= nNumberOfCharsToRead)
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
{
|
2014-08-01 19:03:50 +00:00
|
|
|
ReadConsoleRequest->InitialNumBytes =
|
|
|
|
pInputControl->nInitialChars * sizeof(WCHAR); // CharSize
|
|
|
|
|
|
|
|
if (pInputControl->nInitialChars != 0)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* It is possible here to overwrite the static buffer, in case
|
|
|
|
* the number of bytes to read was smaller than the static buffer.
|
|
|
|
* In this case, this means we are continuing a pending read,
|
|
|
|
* and we do not need in fact the executable name that was
|
|
|
|
* stored in the static buffer because it was first grabbed when
|
|
|
|
* we started the first read.
|
|
|
|
*/
|
|
|
|
RtlCopyMemory(ReadConsoleRequest->Buffer,
|
|
|
|
lpBuffer,
|
|
|
|
ReadConsoleRequest->InitialNumBytes);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReadConsoleRequest->CtrlWakeupMask = pInputControl->dwCtrlWakeupMask;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Status = STATUS_INVALID_PARAMETER;
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-08-01 19:03:50 +00:00
|
|
|
/* We are in a situation where pInputControl has no meaning */
|
|
|
|
pInputControl = NULL;
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2014-08-01 19:03:50 +00:00
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-08-01 19:03:50 +00:00
|
|
|
// HACK
|
|
|
|
if (CaptureBuffer) CsrFreeCaptureBuffer(CaptureBuffer);
|
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
2014-08-04 16:25:12 +00:00
|
|
|
_SEH2_YIELD(return FALSE);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2014-08-01 19:03:50 +00:00
|
|
|
_SEH2_END;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/* FIXME: Check for sanity */
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
/*
|
|
|
|
if (!NT_SUCCESS(Status) && pInputControl)
|
|
|
|
{
|
|
|
|
// Free CaptureBuffer if needed
|
|
|
|
// Set last error to last status
|
|
|
|
// Return FALSE
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2012-12-08 00:39:24 +00:00
|
|
|
/* Call the server */
|
2014-07-28 13:37:54 +00:00
|
|
|
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
|
|
|
CaptureBuffer,
|
|
|
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepReadConsole),
|
|
|
|
sizeof(*ReadConsoleRequest));
|
2012-12-08 00:39:24 +00:00
|
|
|
|
|
|
|
/* Check for success */
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
Success = NT_SUCCESS(ApiMessage.Status);
|
|
|
|
|
|
|
|
/* Retrieve the results */
|
|
|
|
if (Success)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
_SEH2_TRY
|
|
|
|
{
|
|
|
|
*lpNumberOfCharsRead = ReadConsoleRequest->NumBytes / CharSize;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
if (bUnicode && pInputControl)
|
|
|
|
pInputControl->dwControlKeyState = ReadConsoleRequest->ControlKeyState;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
RtlCopyMemory(lpBuffer,
|
|
|
|
ReadConsoleRequest->Buffer,
|
|
|
|
ReadConsoleRequest->NumBytes);
|
|
|
|
}
|
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
|
|
|
Success = FALSE;
|
|
|
|
}
|
|
|
|
_SEH2_END;
|
2012-12-08 00:39:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-07-28 13:37:54 +00:00
|
|
|
BaseSetLastNTError(ApiMessage.Status);
|
2012-12-08 00:39:24 +00:00
|
|
|
}
|
2012-11-15 18:06:17 +00:00
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
/* Release the capture buffer if needed */
|
|
|
|
if (CaptureBuffer) CsrFreeCaptureBuffer(CaptureBuffer);
|
2012-11-15 18:06:17 +00:00
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
if (Success)
|
|
|
|
{
|
|
|
|
/* Yield execution to another thread if Ctrl-C or Ctrl-Break happened */
|
|
|
|
if (ApiMessage.Status == STATUS_ALERTED /* || ApiMessage.Status == STATUS_CANCELLED */)
|
|
|
|
{
|
|
|
|
NtYieldExecution();
|
|
|
|
SetLastError(ERROR_OPERATION_ABORTED); // STATUS_CANCELLED
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return success status */
|
|
|
|
return Success;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOL
|
2014-07-29 15:59:17 +00:00
|
|
|
IntGetConsoleInput(IN HANDLE hConsoleInput,
|
|
|
|
OUT PINPUT_RECORD lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsRead,
|
|
|
|
IN WORD wFlags,
|
|
|
|
IN BOOLEAN bUnicode)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
BOOL Success;
|
2012-11-17 21:39:41 +00:00
|
|
|
CONSOLE_API_MESSAGE ApiMessage;
|
2013-01-05 23:10:12 +00:00
|
|
|
PCONSOLE_GETINPUT GetInputRequest = &ApiMessage.Data.GetInputRequest;
|
2014-07-28 21:20:36 +00:00
|
|
|
PCSR_CAPTURE_BUFFER CaptureBuffer = NULL;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-28 21:20:36 +00:00
|
|
|
if (!IsConsoleHandle(hConsoleInput))
|
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_TRY
|
|
|
|
{
|
2014-07-28 21:20:36 +00:00
|
|
|
*lpNumberOfEventsRead = 0;
|
2014-07-29 15:59:17 +00:00
|
|
|
SetLastError(ERROR_INVALID_HANDLE);
|
|
|
|
}
|
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
|
|
|
}
|
|
|
|
_SEH2_END;
|
2012-11-17 21:39:41 +00:00
|
|
|
|
2012-11-15 18:06:17 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2014-07-28 21:20:36 +00:00
|
|
|
DPRINT("IntGetConsoleInput: %lx %p\n", nLength, lpNumberOfEventsRead);
|
2012-11-15 18:06:17 +00:00
|
|
|
|
|
|
|
/* Set up the data to send to the Console Server */
|
2014-07-28 21:20:36 +00:00
|
|
|
GetInputRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
|
|
|
|
GetInputRequest->InputHandle = hConsoleInput;
|
|
|
|
GetInputRequest->NumRecords = nLength;
|
|
|
|
GetInputRequest->Flags = wFlags;
|
|
|
|
GetInputRequest->Unicode = bUnicode;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For optimization purposes, Windows (and hence ReactOS, too, for
|
|
|
|
* compatibility reasons) uses a static buffer if no more than five
|
|
|
|
* input records are read. Otherwise a new buffer is allocated.
|
|
|
|
* This behaviour is also expected in the server-side.
|
|
|
|
*/
|
|
|
|
if (nLength <= sizeof(GetInputRequest->RecordStaticBuffer)/sizeof(INPUT_RECORD))
|
|
|
|
{
|
|
|
|
GetInputRequest->RecordBufPtr = GetInputRequest->RecordStaticBuffer;
|
|
|
|
// CaptureBuffer = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ULONG Size = nLength * sizeof(INPUT_RECORD);
|
|
|
|
|
|
|
|
/* Allocate a Capture Buffer */
|
|
|
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
|
|
|
if (CaptureBuffer == NULL)
|
|
|
|
{
|
|
|
|
DPRINT1("CsrAllocateCaptureBuffer failed!\n");
|
|
|
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate space in the Buffer */
|
|
|
|
CsrAllocateMessagePointer(CaptureBuffer,
|
|
|
|
Size,
|
|
|
|
(PVOID*)&GetInputRequest->RecordBufPtr);
|
|
|
|
}
|
2012-11-17 21:39:41 +00:00
|
|
|
|
|
|
|
/* Call the server */
|
2014-07-28 13:37:54 +00:00
|
|
|
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
|
|
|
CaptureBuffer,
|
|
|
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetConsoleInput),
|
|
|
|
sizeof(*GetInputRequest));
|
2012-11-17 21:39:41 +00:00
|
|
|
|
2012-12-08 00:39:24 +00:00
|
|
|
/* Check for success */
|
2014-07-29 15:59:17 +00:00
|
|
|
Success = NT_SUCCESS(ApiMessage.Status);
|
|
|
|
|
|
|
|
/* Retrieve the results */
|
|
|
|
_SEH2_TRY
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-28 21:20:36 +00:00
|
|
|
DPRINT("Events read: %lx\n", GetInputRequest->NumRecords);
|
2014-07-29 15:59:17 +00:00
|
|
|
*lpNumberOfEventsRead = GetInputRequest->NumRecords;
|
2012-12-08 00:39:24 +00:00
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
if (Success)
|
|
|
|
{
|
|
|
|
RtlCopyMemory(lpBuffer,
|
|
|
|
GetInputRequest->RecordBufPtr,
|
|
|
|
GetInputRequest->NumRecords * sizeof(INPUT_RECORD));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
BaseSetLastNTError(ApiMessage.Status);
|
|
|
|
}
|
2012-12-08 00:39:24 +00:00
|
|
|
}
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
2012-12-08 00:39:24 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
|
|
|
Success = FALSE;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_END;
|
2012-11-17 21:39:41 +00:00
|
|
|
|
2014-07-28 21:20:36 +00:00
|
|
|
/* Release the capture buffer if needed */
|
|
|
|
if (CaptureBuffer) CsrFreeCaptureBuffer(CaptureBuffer);
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
/* Return success status */
|
|
|
|
return Success;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOL
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
IntReadConsoleOutput(IN HANDLE hConsoleOutput,
|
|
|
|
OUT PCHAR_INFO lpBuffer,
|
|
|
|
IN COORD dwBufferSize,
|
|
|
|
IN COORD dwBufferCoord,
|
|
|
|
IN OUT PSMALL_RECT lpReadRegion,
|
|
|
|
IN BOOLEAN bUnicode)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-08-04 16:25:12 +00:00
|
|
|
BOOL Success;
|
2012-11-17 21:39:41 +00:00
|
|
|
CONSOLE_API_MESSAGE ApiMessage;
|
2013-01-05 23:10:12 +00:00
|
|
|
PCONSOLE_READOUTPUT ReadOutputRequest = &ApiMessage.Data.ReadOutputRequest;
|
2014-08-04 16:25:12 +00:00
|
|
|
PCSR_CAPTURE_BUFFER CaptureBuffer = NULL;
|
|
|
|
|
|
|
|
SHORT SizeX, SizeY;
|
|
|
|
ULONG NumCells;
|
|
|
|
|
|
|
|
/* Set up the data to send to the Console Server */
|
|
|
|
ReadOutputRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
|
|
|
|
ReadOutputRequest->OutputHandle = hConsoleOutput;
|
|
|
|
ReadOutputRequest->Unicode = bUnicode;
|
|
|
|
|
|
|
|
/* Update lpReadRegion */
|
|
|
|
_SEH2_TRY
|
|
|
|
{
|
|
|
|
SizeX = min(dwBufferSize.X - dwBufferCoord.X, ConioRectWidth(lpReadRegion));
|
|
|
|
SizeY = min(dwBufferSize.Y - dwBufferCoord.Y, ConioRectHeight(lpReadRegion));
|
|
|
|
if (SizeX <= 0 || SizeY <= 0)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
_SEH2_YIELD(return FALSE);
|
|
|
|
}
|
|
|
|
lpReadRegion->Right = lpReadRegion->Left + SizeX - 1;
|
|
|
|
lpReadRegion->Bottom = lpReadRegion->Top + SizeY - 1;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
ReadOutputRequest->ReadRegion = *lpReadRegion;
|
|
|
|
}
|
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-28 21:20:36 +00:00
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
2014-08-04 16:25:12 +00:00
|
|
|
_SEH2_YIELD(return FALSE);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2014-08-04 16:25:12 +00:00
|
|
|
_SEH2_END;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
NumCells = SizeX * SizeY;
|
2014-08-06 20:30:24 +00:00
|
|
|
DPRINT("IntReadConsoleOutput: (%d x %d)\n", SizeX, SizeY);
|
2012-11-17 21:39:41 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/*
|
|
|
|
* For optimization purposes, Windows (and hence ReactOS, too, for
|
|
|
|
* compatibility reasons) uses a static buffer if no more than one
|
|
|
|
* cell is read. Otherwise a new buffer is allocated.
|
|
|
|
* This behaviour is also expected in the server-side.
|
|
|
|
*/
|
|
|
|
if (NumCells <= 1)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-08-04 16:25:12 +00:00
|
|
|
ReadOutputRequest->CharInfo = &ReadOutputRequest->StaticBuffer;
|
|
|
|
// CaptureBuffer = NULL;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2014-08-04 16:25:12 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
ULONG Size = NumCells * sizeof(CHAR_INFO);
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/* Allocate a Capture Buffer */
|
|
|
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
|
|
|
if (CaptureBuffer == NULL)
|
|
|
|
{
|
|
|
|
DPRINT1("CsrAllocateCaptureBuffer failed with size %ld!\n", Size);
|
|
|
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/* Allocate space in the Buffer */
|
|
|
|
CsrAllocateMessagePointer(CaptureBuffer,
|
|
|
|
Size,
|
|
|
|
(PVOID*)&ReadOutputRequest->CharInfo);
|
|
|
|
}
|
2012-11-15 18:06:17 +00:00
|
|
|
|
|
|
|
/* Call the server */
|
2012-11-17 21:39:41 +00:00
|
|
|
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
2012-11-15 18:06:17 +00:00
|
|
|
CaptureBuffer,
|
2012-11-17 21:39:41 +00:00
|
|
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepReadConsoleOutput),
|
2014-07-28 13:37:54 +00:00
|
|
|
sizeof(*ReadOutputRequest));
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2013-03-09 01:39:49 +00:00
|
|
|
/* Check for success */
|
2014-08-04 16:25:12 +00:00
|
|
|
Success = NT_SUCCESS(ApiMessage.Status);
|
|
|
|
|
|
|
|
/* Retrieve the results */
|
|
|
|
_SEH2_TRY
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-08-04 16:25:12 +00:00
|
|
|
*lpReadRegion = ReadOutputRequest->ReadRegion;
|
|
|
|
|
|
|
|
if (Success)
|
|
|
|
{
|
|
|
|
#if 0
|
|
|
|
SHORT x, X;
|
|
|
|
#endif
|
|
|
|
SHORT y, Y;
|
|
|
|
|
|
|
|
/* Copy into the buffer */
|
|
|
|
|
|
|
|
SizeX = ReadOutputRequest->ReadRegion.Right -
|
|
|
|
ReadOutputRequest->ReadRegion.Left + 1;
|
|
|
|
|
|
|
|
for (y = 0, Y = ReadOutputRequest->ReadRegion.Top; Y <= ReadOutputRequest->ReadRegion.Bottom; ++y, ++Y)
|
|
|
|
{
|
|
|
|
RtlCopyMemory(lpBuffer + (y + dwBufferCoord.Y) * dwBufferSize.X + dwBufferCoord.X,
|
|
|
|
ReadOutputRequest->CharInfo + y * SizeX,
|
|
|
|
SizeX * sizeof(CHAR_INFO));
|
|
|
|
#if 0
|
|
|
|
for (x = 0, X = ReadOutputRequest->ReadRegion.Left; X <= ReadOutputRequest->ReadRegion.Right; ++x, ++X)
|
|
|
|
{
|
|
|
|
*(lpBuffer + (y + dwBufferCoord.Y) * dwBufferSize.X + (x + dwBufferCoord.X)) =
|
|
|
|
*(ReadOutputRequest->CharInfo + y * SizeX + x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
BaseSetLastNTError(ApiMessage.Status);
|
|
|
|
}
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2014-08-04 16:25:12 +00:00
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-08-04 16:25:12 +00:00
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
|
|
|
Success = FALSE;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2014-08-04 16:25:12 +00:00
|
|
|
_SEH2_END;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/* Release the capture buffer if needed */
|
|
|
|
if (CaptureBuffer) CsrFreeCaptureBuffer(CaptureBuffer);
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/* Return success status */
|
|
|
|
return Success;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOL
|
2014-07-29 15:59:17 +00:00
|
|
|
IntReadConsoleOutputCode(IN HANDLE hConsoleOutput,
|
|
|
|
IN CODE_TYPE CodeType,
|
|
|
|
OUT PVOID pCode,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwReadCoord,
|
|
|
|
OUT LPDWORD lpNumberOfCodesRead)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
BOOL Success;
|
2012-11-17 21:39:41 +00:00
|
|
|
CONSOLE_API_MESSAGE ApiMessage;
|
2013-01-05 23:10:12 +00:00
|
|
|
PCONSOLE_READOUTPUTCODE ReadOutputCodeRequest = &ApiMessage.Data.ReadOutputCodeRequest;
|
2014-07-29 00:00:21 +00:00
|
|
|
PCSR_CAPTURE_BUFFER CaptureBuffer = NULL;
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
ULONG CodeSize, SizeBytes;
|
2014-07-29 00:00:21 +00:00
|
|
|
|
|
|
|
DPRINT("IntReadConsoleOutputCode\n");
|
|
|
|
|
2014-07-29 13:49:03 +00:00
|
|
|
if ( (CodeType != CODE_ASCII ) &&
|
|
|
|
(CodeType != CODE_UNICODE ) &&
|
|
|
|
(CodeType != CODE_ATTRIBUTE) )
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2014-07-29 00:00:21 +00:00
|
|
|
/* Set up the data to send to the Console Server */
|
|
|
|
ReadOutputCodeRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
|
|
|
|
ReadOutputCodeRequest->OutputHandle = hConsoleOutput;
|
|
|
|
ReadOutputCodeRequest->Coord = dwReadCoord;
|
|
|
|
ReadOutputCodeRequest->NumCodes = nLength;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2012-11-17 21:39:41 +00:00
|
|
|
/* Determine the needed size */
|
2014-07-29 00:00:21 +00:00
|
|
|
ReadOutputCodeRequest->CodeType = CodeType;
|
2012-11-17 21:39:41 +00:00
|
|
|
switch (CodeType)
|
|
|
|
{
|
|
|
|
case CODE_ASCII:
|
2014-07-29 13:49:03 +00:00
|
|
|
CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, AsciiChar);
|
2012-11-17 21:39:41 +00:00
|
|
|
break;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2012-11-17 21:39:41 +00:00
|
|
|
case CODE_UNICODE:
|
2014-07-29 13:49:03 +00:00
|
|
|
CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, UnicodeChar);
|
2012-11-17 21:39:41 +00:00
|
|
|
break;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2012-11-17 21:39:41 +00:00
|
|
|
case CODE_ATTRIBUTE:
|
2014-07-29 13:49:03 +00:00
|
|
|
CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, Attribute);
|
2012-11-17 21:39:41 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
SizeBytes = nLength * CodeSize;
|
|
|
|
|
2014-07-29 00:00:21 +00:00
|
|
|
/*
|
|
|
|
* For optimization purposes, Windows (and hence ReactOS, too, for
|
|
|
|
* compatibility reasons) uses a static buffer if no more than eighty
|
|
|
|
* bytes are read. Otherwise a new buffer is allocated.
|
|
|
|
* This behaviour is also expected in the server-side.
|
|
|
|
*/
|
|
|
|
if (SizeBytes <= sizeof(ReadOutputCodeRequest->CodeStaticBuffer))
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 13:49:03 +00:00
|
|
|
ReadOutputCodeRequest->pCode = ReadOutputCodeRequest->CodeStaticBuffer;
|
2014-07-29 00:00:21 +00:00
|
|
|
// CaptureBuffer = NULL;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2014-07-29 00:00:21 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Allocate a Capture Buffer */
|
|
|
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, SizeBytes);
|
|
|
|
if (CaptureBuffer == NULL)
|
|
|
|
{
|
|
|
|
DPRINT1("CsrAllocateCaptureBuffer failed!\n");
|
|
|
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 00:00:21 +00:00
|
|
|
/* Allocate space in the Buffer */
|
|
|
|
CsrAllocateMessagePointer(CaptureBuffer,
|
|
|
|
SizeBytes,
|
2014-07-29 13:49:03 +00:00
|
|
|
(PVOID*)&ReadOutputCodeRequest->pCode);
|
2014-07-29 00:00:21 +00:00
|
|
|
}
|
2013-01-26 19:07:59 +00:00
|
|
|
|
2013-03-09 01:39:49 +00:00
|
|
|
/* Call the server */
|
2014-07-28 13:37:54 +00:00
|
|
|
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
|
|
|
CaptureBuffer,
|
|
|
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepReadConsoleOutputString),
|
|
|
|
sizeof(*ReadOutputCodeRequest));
|
2013-03-09 01:39:49 +00:00
|
|
|
|
|
|
|
/* Check for success */
|
2014-07-29 15:59:17 +00:00
|
|
|
Success = NT_SUCCESS(ApiMessage.Status);
|
|
|
|
|
|
|
|
/* Retrieve the results */
|
|
|
|
_SEH2_TRY
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
*lpNumberOfCodesRead = ReadOutputCodeRequest->NumCodes;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
if (Success)
|
|
|
|
{
|
|
|
|
RtlCopyMemory(pCode,
|
|
|
|
ReadOutputCodeRequest->pCode,
|
|
|
|
ReadOutputCodeRequest->NumCodes * CodeSize);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
BaseSetLastNTError(ApiMessage.Status);
|
|
|
|
}
|
2013-03-09 01:39:49 +00:00
|
|
|
}
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
2013-03-09 01:39:49 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
|
|
|
Success = FALSE;
|
2013-03-09 01:39:49 +00:00
|
|
|
}
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_END;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 00:00:21 +00:00
|
|
|
/* Release the capture buffer if needed */
|
|
|
|
if (CaptureBuffer) CsrFreeCaptureBuffer(CaptureBuffer);
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
/* Return success status */
|
|
|
|
return Success;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************
|
|
|
|
* Write functions *
|
|
|
|
*******************/
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOL
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
IntWriteConsole(IN HANDLE hConsoleOutput,
|
|
|
|
IN PVOID lpBuffer,
|
|
|
|
IN DWORD nNumberOfCharsToWrite,
|
|
|
|
OUT LPDWORD lpNumberOfCharsWritten,
|
2012-11-15 18:06:17 +00:00
|
|
|
LPVOID lpReserved,
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
IN BOOLEAN bUnicode)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
BOOL Success;
|
2012-11-19 21:48:22 +00:00
|
|
|
CONSOLE_API_MESSAGE ApiMessage;
|
2013-01-05 23:10:12 +00:00
|
|
|
PCONSOLE_WRITECONSOLE WriteConsoleRequest = &ApiMessage.Data.WriteConsoleRequest;
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
PCSR_CAPTURE_BUFFER CaptureBuffer = NULL;
|
|
|
|
ULONG CharSize, SizeBytes;
|
|
|
|
|
|
|
|
DPRINT("IntWriteConsole\n");
|
|
|
|
|
|
|
|
/* Set up the data to send to the Console Server */
|
|
|
|
WriteConsoleRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
|
|
|
|
WriteConsoleRequest->OutputHandle = hConsoleOutput;
|
|
|
|
WriteConsoleRequest->Unicode = bUnicode;
|
|
|
|
|
|
|
|
/* Those members are unused by the client, on Windows */
|
|
|
|
WriteConsoleRequest->Reserved1 = 0;
|
|
|
|
// WriteConsoleRequest->Reserved2 = {0};
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2012-11-19 23:26:36 +00:00
|
|
|
/* Determine the needed size */
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
CharSize = (bUnicode ? sizeof(WCHAR) : sizeof(CHAR));
|
|
|
|
SizeBytes = nNumberOfCharsToWrite * CharSize;
|
2012-11-19 21:48:22 +00:00
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
WriteConsoleRequest->NumBytes = SizeBytes;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For optimization purposes, Windows (and hence ReactOS, too, for
|
|
|
|
* compatibility reasons) uses a static buffer if no more than eighty
|
|
|
|
* bytes are written. Otherwise a new buffer is allocated.
|
|
|
|
* This behaviour is also expected in the server-side.
|
|
|
|
*/
|
|
|
|
if (SizeBytes <= sizeof(WriteConsoleRequest->StaticBuffer))
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
WriteConsoleRequest->Buffer = WriteConsoleRequest->StaticBuffer;
|
|
|
|
// CaptureBuffer = NULL;
|
|
|
|
WriteConsoleRequest->UsingStaticBuffer = TRUE;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
_SEH2_TRY
|
|
|
|
{
|
|
|
|
RtlCopyMemory(WriteConsoleRequest->Buffer,
|
|
|
|
lpBuffer,
|
|
|
|
SizeBytes);
|
|
|
|
}
|
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
2014-08-04 16:25:12 +00:00
|
|
|
_SEH2_YIELD(return FALSE);
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
}
|
|
|
|
_SEH2_END;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Allocate a Capture Buffer */
|
|
|
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, SizeBytes);
|
|
|
|
if (CaptureBuffer == NULL)
|
|
|
|
{
|
|
|
|
DPRINT1("CsrAllocateCaptureBuffer failed!\n");
|
|
|
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2012-11-15 18:06:17 +00:00
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
/* Capture the buffer to write */
|
|
|
|
CsrCaptureMessageBuffer(CaptureBuffer,
|
|
|
|
(PVOID)lpBuffer,
|
|
|
|
SizeBytes,
|
|
|
|
(PVOID*)&WriteConsoleRequest->Buffer);
|
|
|
|
WriteConsoleRequest->UsingStaticBuffer = FALSE;
|
|
|
|
}
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2013-03-09 01:39:49 +00:00
|
|
|
/* Call the server */
|
2014-07-28 13:37:54 +00:00
|
|
|
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
|
|
|
CaptureBuffer,
|
|
|
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsole),
|
|
|
|
sizeof(*WriteConsoleRequest));
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2013-03-09 01:39:49 +00:00
|
|
|
/* Check for success */
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
Success = NT_SUCCESS(ApiMessage.Status);
|
|
|
|
|
|
|
|
/* Release the capture buffer if needed */
|
|
|
|
if (CaptureBuffer) CsrFreeCaptureBuffer(CaptureBuffer);
|
2013-03-09 01:39:49 +00:00
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
/* Retrieve the results */
|
|
|
|
if (Success)
|
|
|
|
{
|
|
|
|
_SEH2_TRY
|
|
|
|
{
|
|
|
|
*lpNumberOfCharsWritten = WriteConsoleRequest->NumBytes / CharSize;
|
|
|
|
}
|
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
|
|
|
Success = FALSE;
|
|
|
|
}
|
|
|
|
_SEH2_END;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2013-03-09 01:39:49 +00:00
|
|
|
else
|
|
|
|
{
|
2014-07-28 13:37:54 +00:00
|
|
|
BaseSetLastNTError(ApiMessage.Status);
|
2013-03-09 01:39:49 +00:00
|
|
|
}
|
2012-11-19 21:48:22 +00:00
|
|
|
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
/* Return success status */
|
|
|
|
return Success;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOL
|
2014-07-29 15:59:17 +00:00
|
|
|
IntWriteConsoleInput(IN HANDLE hConsoleInput,
|
|
|
|
IN PINPUT_RECORD lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsWritten,
|
|
|
|
IN BOOLEAN bUnicode,
|
|
|
|
IN BOOLEAN bAppendToEnd)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
BOOL Success;
|
2012-11-18 13:54:32 +00:00
|
|
|
CONSOLE_API_MESSAGE ApiMessage;
|
2013-01-05 23:10:12 +00:00
|
|
|
PCONSOLE_WRITEINPUT WriteInputRequest = &ApiMessage.Data.WriteInputRequest;
|
2014-07-28 21:20:36 +00:00
|
|
|
PCSR_CAPTURE_BUFFER CaptureBuffer = NULL;
|
2012-11-18 13:54:32 +00:00
|
|
|
|
2014-07-28 21:20:36 +00:00
|
|
|
DPRINT("IntWriteConsoleInput: %lx %p\n", nLength, lpNumberOfEventsWritten);
|
2012-11-15 18:06:17 +00:00
|
|
|
|
|
|
|
/* Set up the data to send to the Console Server */
|
2014-07-28 21:20:36 +00:00
|
|
|
WriteInputRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
|
|
|
|
WriteInputRequest->InputHandle = hConsoleInput;
|
|
|
|
WriteInputRequest->NumRecords = nLength;
|
|
|
|
WriteInputRequest->Unicode = bUnicode;
|
|
|
|
WriteInputRequest->AppendToEnd = bAppendToEnd;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For optimization purposes, Windows (and hence ReactOS, too, for
|
|
|
|
* compatibility reasons) uses a static buffer if no more than five
|
|
|
|
* input records are written. Otherwise a new buffer is allocated.
|
|
|
|
* This behaviour is also expected in the server-side.
|
|
|
|
*/
|
|
|
|
if (nLength <= sizeof(WriteInputRequest->RecordStaticBuffer)/sizeof(INPUT_RECORD))
|
|
|
|
{
|
|
|
|
WriteInputRequest->RecordBufPtr = WriteInputRequest->RecordStaticBuffer;
|
|
|
|
// CaptureBuffer = NULL;
|
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_TRY
|
|
|
|
{
|
|
|
|
RtlCopyMemory(WriteInputRequest->RecordBufPtr,
|
|
|
|
lpBuffer,
|
|
|
|
nLength * sizeof(INPUT_RECORD));
|
|
|
|
}
|
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
2014-08-04 16:25:12 +00:00
|
|
|
_SEH2_YIELD(return FALSE);
|
2014-07-29 15:59:17 +00:00
|
|
|
}
|
|
|
|
_SEH2_END;
|
2014-07-28 21:20:36 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ULONG Size = nLength * sizeof(INPUT_RECORD);
|
|
|
|
|
|
|
|
/* Allocate a Capture Buffer */
|
|
|
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
|
|
|
if (CaptureBuffer == NULL)
|
|
|
|
{
|
|
|
|
DPRINT1("CsrAllocateCaptureBuffer failed!\n");
|
|
|
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Capture the user buffer */
|
|
|
|
CsrCaptureMessageBuffer(CaptureBuffer,
|
|
|
|
lpBuffer,
|
|
|
|
Size,
|
|
|
|
(PVOID*)&WriteInputRequest->RecordBufPtr);
|
|
|
|
}
|
2012-11-15 18:06:17 +00:00
|
|
|
|
|
|
|
/* Call the server */
|
2012-11-18 13:54:32 +00:00
|
|
|
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
2012-11-15 18:06:17 +00:00
|
|
|
CaptureBuffer,
|
2012-11-18 13:54:32 +00:00
|
|
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsoleInput),
|
2014-07-28 13:37:54 +00:00
|
|
|
sizeof(*WriteInputRequest));
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
/* Check for success */
|
|
|
|
Success = NT_SUCCESS(ApiMessage.Status);
|
|
|
|
|
2014-07-28 21:20:36 +00:00
|
|
|
/* Release the capture buffer if needed */
|
|
|
|
if (CaptureBuffer) CsrFreeCaptureBuffer(CaptureBuffer);
|
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
/* Retrieve the results */
|
|
|
|
_SEH2_TRY
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-28 21:20:36 +00:00
|
|
|
DPRINT("Events written: %lx\n", WriteInputRequest->NumRecords);
|
2014-07-29 15:59:17 +00:00
|
|
|
*lpNumberOfEventsWritten = WriteInputRequest->NumRecords;
|
2012-11-18 13:54:32 +00:00
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
if (!Success)
|
|
|
|
BaseSetLastNTError(ApiMessage.Status);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
|
|
|
Success = FALSE;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_END;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
/* Return success status */
|
|
|
|
return Success;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOL
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
IntWriteConsoleOutput(IN HANDLE hConsoleOutput,
|
|
|
|
IN CONST CHAR_INFO *lpBuffer,
|
|
|
|
IN COORD dwBufferSize,
|
|
|
|
IN COORD dwBufferCoord,
|
|
|
|
IN OUT PSMALL_RECT lpWriteRegion,
|
|
|
|
IN BOOLEAN bUnicode)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-08-04 16:25:12 +00:00
|
|
|
BOOL Success;
|
2012-11-18 13:54:32 +00:00
|
|
|
CONSOLE_API_MESSAGE ApiMessage;
|
2013-01-05 23:10:12 +00:00
|
|
|
PCONSOLE_WRITEOUTPUT WriteOutputRequest = &ApiMessage.Data.WriteOutputRequest;
|
2014-08-04 16:25:12 +00:00
|
|
|
PCSR_CAPTURE_BUFFER CaptureBuffer = NULL;
|
|
|
|
|
|
|
|
SHORT SizeX, SizeY;
|
|
|
|
ULONG NumCells;
|
|
|
|
|
|
|
|
/* Set up the data to send to the Console Server */
|
|
|
|
WriteOutputRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
|
|
|
|
WriteOutputRequest->OutputHandle = hConsoleOutput;
|
|
|
|
WriteOutputRequest->Unicode = bUnicode;
|
|
|
|
|
|
|
|
/* Update lpWriteRegion */
|
|
|
|
_SEH2_TRY
|
|
|
|
{
|
|
|
|
SizeX = min(dwBufferSize.X - dwBufferCoord.X, ConioRectWidth(lpWriteRegion));
|
|
|
|
SizeY = min(dwBufferSize.Y - dwBufferCoord.Y, ConioRectHeight(lpWriteRegion));
|
|
|
|
if (SizeX <= 0 || SizeY <= 0)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
_SEH2_YIELD(return FALSE);
|
|
|
|
}
|
|
|
|
lpWriteRegion->Right = lpWriteRegion->Left + SizeX - 1;
|
|
|
|
lpWriteRegion->Bottom = lpWriteRegion->Top + SizeY - 1;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
WriteOutputRequest->WriteRegion = *lpWriteRegion;
|
|
|
|
}
|
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
2012-11-18 13:54:32 +00:00
|
|
|
{
|
2014-07-28 21:20:36 +00:00
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
2014-08-04 16:25:12 +00:00
|
|
|
_SEH2_YIELD(return FALSE);
|
2012-11-18 13:54:32 +00:00
|
|
|
}
|
2014-08-04 16:25:12 +00:00
|
|
|
_SEH2_END;
|
|
|
|
|
|
|
|
NumCells = SizeX * SizeY;
|
2014-08-06 20:30:24 +00:00
|
|
|
DPRINT("IntWriteConsoleOutput: (%d x %d)\n", SizeX, SizeY);
|
2014-08-04 16:25:12 +00:00
|
|
|
|
2013-03-09 14:18:10 +00:00
|
|
|
/*
|
2014-08-04 16:25:12 +00:00
|
|
|
* For optimization purposes, Windows (and hence ReactOS, too, for
|
|
|
|
* compatibility reasons) uses a static buffer if no more than one
|
|
|
|
* cell is written. Otherwise a new buffer is allocated.
|
|
|
|
* This behaviour is also expected in the server-side.
|
|
|
|
*/
|
|
|
|
if (NumCells <= 1)
|
2013-03-09 14:18:10 +00:00
|
|
|
{
|
2014-08-04 16:25:12 +00:00
|
|
|
WriteOutputRequest->CharInfo = &WriteOutputRequest->StaticBuffer;
|
|
|
|
// CaptureBuffer = NULL;
|
2014-08-08 17:06:28 +00:00
|
|
|
WriteOutputRequest->UseVirtualMemory = FALSE;
|
2013-03-09 14:18:10 +00:00
|
|
|
}
|
2014-08-04 16:25:12 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
ULONG Size = NumCells * sizeof(CHAR_INFO);
|
2012-11-18 13:54:32 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/* Allocate a Capture Buffer */
|
|
|
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
2014-08-08 17:06:28 +00:00
|
|
|
if (CaptureBuffer)
|
2014-08-04 16:25:12 +00:00
|
|
|
{
|
2014-08-08 17:06:28 +00:00
|
|
|
/* Allocate space in the Buffer */
|
|
|
|
CsrAllocateMessagePointer(CaptureBuffer,
|
|
|
|
Size,
|
|
|
|
(PVOID*)&WriteOutputRequest->CharInfo);
|
|
|
|
WriteOutputRequest->UseVirtualMemory = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* CsrAllocateCaptureBuffer failed because we tried to allocate
|
|
|
|
* a too large (>= 64 kB, size of the CSR heap) data buffer.
|
|
|
|
* To circumvent this, Windows uses a trick (that we reproduce for
|
|
|
|
* compatibility reasons): we allocate a heap buffer in the process'
|
|
|
|
* memory, and CSR will read it via NtReadVirtualMemory.
|
|
|
|
*/
|
|
|
|
DPRINT1("CsrAllocateCaptureBuffer failed with size %ld, let's use local heap buffer...\n", Size);
|
|
|
|
|
|
|
|
WriteOutputRequest->CharInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, Size);
|
|
|
|
WriteOutputRequest->UseVirtualMemory = TRUE;
|
|
|
|
|
|
|
|
/* Bail out if we still cannot allocate memory */
|
|
|
|
if (WriteOutputRequest->CharInfo == NULL)
|
|
|
|
{
|
|
|
|
DPRINT1("Failed to allocate heap buffer with size %ld!\n", Size);
|
|
|
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2014-08-04 16:25:12 +00:00
|
|
|
}
|
|
|
|
}
|
2012-11-18 13:54:32 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/* Capture the user buffer contents */
|
|
|
|
_SEH2_TRY
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-08-04 16:25:12 +00:00
|
|
|
#if 0
|
|
|
|
SHORT x, X;
|
|
|
|
#endif
|
|
|
|
SHORT y, Y;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/* Copy into the buffer */
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
SizeX = WriteOutputRequest->WriteRegion.Right -
|
|
|
|
WriteOutputRequest->WriteRegion.Left + 1;
|
|
|
|
|
|
|
|
for (y = 0, Y = WriteOutputRequest->WriteRegion.Top; Y <= WriteOutputRequest->WriteRegion.Bottom; ++y, ++Y)
|
|
|
|
{
|
|
|
|
RtlCopyMemory(WriteOutputRequest->CharInfo + y * SizeX,
|
|
|
|
lpBuffer + (y + dwBufferCoord.Y) * dwBufferSize.X + dwBufferCoord.X,
|
|
|
|
SizeX * sizeof(CHAR_INFO));
|
|
|
|
#if 0
|
|
|
|
for (x = 0, X = WriteOutputRequest->WriteRegion.Left; X <= WriteOutputRequest->WriteRegion.Right; ++x, ++X)
|
|
|
|
{
|
|
|
|
*(WriteOutputRequest->CharInfo + y * SizeX + x) =
|
|
|
|
*(lpBuffer + (y + dwBufferCoord.Y) * dwBufferSize.X + (x + dwBufferCoord.X));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
|
|
|
_SEH2_YIELD(return FALSE);
|
|
|
|
}
|
|
|
|
_SEH2_END;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
|
|
|
/* Call the server */
|
2012-11-18 13:54:32 +00:00
|
|
|
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
2012-11-15 18:06:17 +00:00
|
|
|
CaptureBuffer,
|
2012-11-18 13:54:32 +00:00
|
|
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsoleOutput),
|
2014-07-28 13:37:54 +00:00
|
|
|
sizeof(*WriteOutputRequest));
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2013-03-09 01:39:49 +00:00
|
|
|
/* Check for success */
|
2014-08-04 16:25:12 +00:00
|
|
|
Success = NT_SUCCESS(ApiMessage.Status);
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/* Release the capture buffer if needed */
|
2014-08-08 17:06:28 +00:00
|
|
|
if (CaptureBuffer)
|
|
|
|
{
|
|
|
|
CsrFreeCaptureBuffer(CaptureBuffer);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* If we used a heap buffer, free it */
|
|
|
|
if (WriteOutputRequest->UseVirtualMemory)
|
|
|
|
RtlFreeHeap(RtlGetProcessHeap(), 0, WriteOutputRequest->CharInfo);
|
|
|
|
}
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/* Retrieve the results */
|
|
|
|
_SEH2_TRY
|
|
|
|
{
|
|
|
|
*lpWriteRegion = WriteOutputRequest->WriteRegion;
|
|
|
|
|
|
|
|
if (!Success)
|
|
|
|
BaseSetLastNTError(ApiMessage.Status);
|
|
|
|
}
|
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
|
|
|
Success = FALSE;
|
|
|
|
}
|
|
|
|
_SEH2_END;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-08-04 16:25:12 +00:00
|
|
|
/* Return success status */
|
|
|
|
return Success;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOL
|
2014-07-29 15:59:17 +00:00
|
|
|
IntWriteConsoleOutputCode(IN HANDLE hConsoleOutput,
|
|
|
|
IN CODE_TYPE CodeType,
|
|
|
|
IN CONST VOID *pCode,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwWriteCoord,
|
|
|
|
OUT LPDWORD lpNumberOfCodesWritten)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
BOOL Success;
|
2012-11-19 23:26:36 +00:00
|
|
|
CONSOLE_API_MESSAGE ApiMessage;
|
2013-01-05 23:10:12 +00:00
|
|
|
PCONSOLE_WRITEOUTPUTCODE WriteOutputCodeRequest = &ApiMessage.Data.WriteOutputCodeRequest;
|
2014-07-29 00:00:21 +00:00
|
|
|
PCSR_CAPTURE_BUFFER CaptureBuffer = NULL;
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
ULONG CodeSize, SizeBytes;
|
2014-07-29 00:00:21 +00:00
|
|
|
|
2014-07-29 13:49:03 +00:00
|
|
|
if ( (CodeType != CODE_ASCII ) &&
|
|
|
|
(CodeType != CODE_UNICODE ) &&
|
|
|
|
(CodeType != CODE_ATTRIBUTE) )
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2014-07-29 00:00:21 +00:00
|
|
|
DPRINT("IntWriteConsoleOutputCode\n");
|
|
|
|
|
|
|
|
/* Set up the data to send to the Console Server */
|
|
|
|
WriteOutputCodeRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
|
|
|
|
WriteOutputCodeRequest->OutputHandle = hConsoleOutput;
|
|
|
|
WriteOutputCodeRequest->Coord = dwWriteCoord;
|
|
|
|
WriteOutputCodeRequest->NumCodes = nLength;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2012-11-19 23:26:36 +00:00
|
|
|
/* Determine the needed size */
|
2014-07-29 00:00:21 +00:00
|
|
|
WriteOutputCodeRequest->CodeType = CodeType;
|
2012-11-19 23:26:36 +00:00
|
|
|
switch (CodeType)
|
|
|
|
{
|
|
|
|
case CODE_ASCII:
|
2014-07-29 13:49:03 +00:00
|
|
|
CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, AsciiChar);
|
2012-11-19 23:26:36 +00:00
|
|
|
break;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2012-11-19 23:26:36 +00:00
|
|
|
case CODE_UNICODE:
|
2014-07-29 13:49:03 +00:00
|
|
|
CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, UnicodeChar);
|
2012-11-19 23:26:36 +00:00
|
|
|
break;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2012-11-19 23:26:36 +00:00
|
|
|
case CODE_ATTRIBUTE:
|
2014-07-29 13:49:03 +00:00
|
|
|
CodeSize = RTL_FIELD_SIZE(CODE_ELEMENT, Attribute);
|
2012-11-19 23:26:36 +00:00
|
|
|
break;
|
|
|
|
}
|
2014-07-29 00:00:21 +00:00
|
|
|
SizeBytes = nLength * CodeSize;
|
2012-11-19 23:26:36 +00:00
|
|
|
|
2014-07-29 00:00:21 +00:00
|
|
|
/*
|
|
|
|
* For optimization purposes, Windows (and hence ReactOS, too, for
|
|
|
|
* compatibility reasons) uses a static buffer if no more than eighty
|
|
|
|
* bytes are written. Otherwise a new buffer is allocated.
|
|
|
|
* This behaviour is also expected in the server-side.
|
|
|
|
*/
|
|
|
|
if (SizeBytes <= sizeof(WriteOutputCodeRequest->CodeStaticBuffer))
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 13:49:03 +00:00
|
|
|
WriteOutputCodeRequest->pCode = WriteOutputCodeRequest->CodeStaticBuffer;
|
2014-07-29 00:00:21 +00:00
|
|
|
// CaptureBuffer = NULL;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_TRY
|
|
|
|
{
|
|
|
|
RtlCopyMemory(WriteOutputCodeRequest->pCode,
|
|
|
|
pCode,
|
|
|
|
SizeBytes);
|
|
|
|
}
|
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
2014-08-04 16:25:12 +00:00
|
|
|
_SEH2_YIELD(return FALSE);
|
2014-07-29 15:59:17 +00:00
|
|
|
}
|
|
|
|
_SEH2_END;
|
2014-07-29 00:00:21 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Allocate a Capture Buffer */
|
|
|
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, SizeBytes);
|
|
|
|
if (CaptureBuffer == NULL)
|
|
|
|
{
|
|
|
|
DPRINT1("CsrAllocateCaptureBuffer failed!\n");
|
|
|
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 00:00:21 +00:00
|
|
|
/* Capture the buffer to write */
|
|
|
|
CsrCaptureMessageBuffer(CaptureBuffer,
|
|
|
|
(PVOID)pCode,
|
|
|
|
SizeBytes,
|
2014-07-29 13:49:03 +00:00
|
|
|
(PVOID*)&WriteOutputCodeRequest->pCode);
|
2014-07-29 00:00:21 +00:00
|
|
|
}
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2013-03-09 01:39:49 +00:00
|
|
|
/* Call the server */
|
2014-07-28 13:37:54 +00:00
|
|
|
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
|
|
|
CaptureBuffer,
|
|
|
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsoleOutputString),
|
|
|
|
sizeof(*WriteOutputCodeRequest));
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
/* Check for success */
|
|
|
|
Success = NT_SUCCESS(ApiMessage.Status);
|
|
|
|
|
2014-07-29 00:00:21 +00:00
|
|
|
/* Release the capture buffer if needed */
|
|
|
|
if (CaptureBuffer) CsrFreeCaptureBuffer(CaptureBuffer);
|
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
/* Retrieve the results */
|
|
|
|
_SEH2_TRY
|
2013-03-09 01:39:49 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
*lpNumberOfCodesWritten = WriteOutputCodeRequest->NumCodes;
|
|
|
|
|
|
|
|
if (!Success)
|
|
|
|
BaseSetLastNTError(ApiMessage.Status);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
2013-03-09 01:39:49 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
|
|
|
Success = FALSE;
|
2013-03-09 01:39:49 +00:00
|
|
|
}
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_END;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
/* Return success status */
|
|
|
|
return Success;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOL
|
2014-07-29 15:59:17 +00:00
|
|
|
IntFillConsoleOutputCode(IN HANDLE hConsoleOutput,
|
|
|
|
IN CODE_TYPE CodeType,
|
|
|
|
IN CODE_ELEMENT Code,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwWriteCoord,
|
|
|
|
OUT LPDWORD lpNumberOfCodesWritten)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
BOOL Success;
|
2012-11-18 17:06:48 +00:00
|
|
|
CONSOLE_API_MESSAGE ApiMessage;
|
2013-01-05 23:10:12 +00:00
|
|
|
PCONSOLE_FILLOUTPUTCODE FillOutputRequest = &ApiMessage.Data.FillOutputRequest;
|
2012-11-15 18:06:17 +00:00
|
|
|
|
2014-07-29 13:49:03 +00:00
|
|
|
DPRINT("IntFillConsoleOutputCode\n");
|
|
|
|
|
2014-07-29 13:18:59 +00:00
|
|
|
if ( (CodeType != CODE_ASCII ) &&
|
|
|
|
(CodeType != CODE_UNICODE ) &&
|
|
|
|
(CodeType != CODE_ATTRIBUTE) )
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2014-07-29 00:00:21 +00:00
|
|
|
/* Set up the data to send to the Console Server */
|
|
|
|
FillOutputRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle;
|
|
|
|
FillOutputRequest->OutputHandle = hConsoleOutput;
|
|
|
|
FillOutputRequest->WriteCoord = dwWriteCoord;
|
|
|
|
FillOutputRequest->CodeType = CodeType;
|
2014-07-29 13:18:59 +00:00
|
|
|
FillOutputRequest->Code = Code;
|
|
|
|
FillOutputRequest->NumCodes = nLength;
|
2012-11-18 17:06:48 +00:00
|
|
|
|
2013-03-09 01:39:49 +00:00
|
|
|
/* Call the server */
|
2014-07-28 13:37:54 +00:00
|
|
|
CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
|
|
|
NULL,
|
|
|
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepFillConsoleOutput),
|
|
|
|
sizeof(*FillOutputRequest));
|
2013-03-09 01:39:49 +00:00
|
|
|
|
|
|
|
/* Check for success */
|
2014-07-29 15:59:17 +00:00
|
|
|
Success = NT_SUCCESS(ApiMessage.Status);
|
|
|
|
|
|
|
|
/* Retrieve the results */
|
|
|
|
_SEH2_TRY
|
2013-03-09 01:39:49 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
*lpNumberOfCodesWritten = FillOutputRequest->NumCodes;
|
|
|
|
|
|
|
|
if (!Success)
|
|
|
|
BaseSetLastNTError(ApiMessage.Status);
|
2013-03-09 01:39:49 +00:00
|
|
|
}
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 15:59:17 +00:00
|
|
|
SetLastError(ERROR_INVALID_ACCESS);
|
|
|
|
Success = FALSE;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
2014-07-29 15:59:17 +00:00
|
|
|
_SEH2_END;
|
2014-07-29 00:00:21 +00:00
|
|
|
|
2014-07-29 15:59:17 +00:00
|
|
|
/* Return success status */
|
|
|
|
return Success;
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
|
|
|
/******************
|
|
|
|
* Read functions *
|
|
|
|
******************/
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
ReadConsoleW(IN HANDLE hConsoleInput,
|
|
|
|
OUT LPVOID lpBuffer,
|
|
|
|
IN DWORD nNumberOfCharsToRead,
|
|
|
|
OUT LPDWORD lpNumberOfCharsRead,
|
|
|
|
IN PCONSOLE_READCONSOLE_CONTROL pInputControl OPTIONAL)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
|
|
|
return IntReadConsole(hConsoleInput,
|
|
|
|
lpBuffer,
|
|
|
|
nNumberOfCharsToRead,
|
|
|
|
lpNumberOfCharsRead,
|
|
|
|
pInputControl,
|
|
|
|
TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
ReadConsoleA(IN HANDLE hConsoleInput,
|
|
|
|
OUT LPVOID lpBuffer,
|
|
|
|
IN DWORD nNumberOfCharsToRead,
|
|
|
|
OUT LPDWORD lpNumberOfCharsRead,
|
|
|
|
IN PCONSOLE_READCONSOLE_CONTROL pInputControl OPTIONAL)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
|
|
|
return IntReadConsole(hConsoleInput,
|
|
|
|
lpBuffer,
|
|
|
|
nNumberOfCharsToRead,
|
|
|
|
lpNumberOfCharsRead,
|
|
|
|
NULL,
|
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
PeekConsoleInputW(IN HANDLE hConsoleInput,
|
|
|
|
OUT PINPUT_RECORD lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsRead)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2012-11-17 21:39:41 +00:00
|
|
|
return IntGetConsoleInput(hConsoleInput,
|
|
|
|
lpBuffer,
|
|
|
|
nLength,
|
|
|
|
lpNumberOfEventsRead,
|
2013-11-10 20:20:57 +00:00
|
|
|
CONSOLE_READ_KEEPEVENT | CONSOLE_READ_CONTINUE,
|
2012-11-17 21:39:41 +00:00
|
|
|
TRUE);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
PeekConsoleInputA(IN HANDLE hConsoleInput,
|
|
|
|
OUT PINPUT_RECORD lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsRead)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2012-11-17 21:39:41 +00:00
|
|
|
return IntGetConsoleInput(hConsoleInput,
|
|
|
|
lpBuffer,
|
|
|
|
nLength,
|
|
|
|
lpNumberOfEventsRead,
|
2013-11-10 20:20:57 +00:00
|
|
|
CONSOLE_READ_KEEPEVENT | CONSOLE_READ_CONTINUE,
|
2012-11-17 21:39:41 +00:00
|
|
|
FALSE);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
ReadConsoleInputW(IN HANDLE hConsoleInput,
|
|
|
|
OUT PINPUT_RECORD lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsRead)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2012-11-17 21:39:41 +00:00
|
|
|
return IntGetConsoleInput(hConsoleInput,
|
|
|
|
lpBuffer,
|
|
|
|
nLength,
|
|
|
|
lpNumberOfEventsRead,
|
2013-11-10 20:20:57 +00:00
|
|
|
0,
|
2012-11-17 21:39:41 +00:00
|
|
|
TRUE);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
ReadConsoleInputA(IN HANDLE hConsoleInput,
|
|
|
|
OUT PINPUT_RECORD lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsRead)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2012-11-17 21:39:41 +00:00
|
|
|
return IntGetConsoleInput(hConsoleInput,
|
|
|
|
lpBuffer,
|
|
|
|
nLength,
|
|
|
|
lpNumberOfEventsRead,
|
2013-11-10 20:20:57 +00:00
|
|
|
0,
|
2012-11-17 21:39:41 +00:00
|
|
|
FALSE);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2013-11-10 20:20:57 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
2012-11-15 18:06:17 +00:00
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
ReadConsoleInputExW(IN HANDLE hConsoleInput,
|
|
|
|
OUT PINPUT_RECORD lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsRead,
|
|
|
|
IN WORD wFlags)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2013-11-10 20:20:57 +00:00
|
|
|
return IntGetConsoleInput(hConsoleInput,
|
|
|
|
lpBuffer,
|
|
|
|
nLength,
|
|
|
|
lpNumberOfEventsRead,
|
|
|
|
wFlags,
|
|
|
|
TRUE);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2013-11-10 20:20:57 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
2012-11-15 18:06:17 +00:00
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
ReadConsoleInputExA(IN HANDLE hConsoleInput,
|
|
|
|
OUT PINPUT_RECORD lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsRead,
|
|
|
|
IN WORD wFlags)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2013-11-10 20:20:57 +00:00
|
|
|
return IntGetConsoleInput(hConsoleInput,
|
|
|
|
lpBuffer,
|
|
|
|
nLength,
|
|
|
|
lpNumberOfEventsRead,
|
|
|
|
wFlags,
|
|
|
|
FALSE);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
ReadConsoleOutputW(IN HANDLE hConsoleOutput,
|
|
|
|
OUT PCHAR_INFO lpBuffer,
|
|
|
|
IN COORD dwBufferSize,
|
|
|
|
IN COORD dwBufferCoord,
|
|
|
|
IN OUT PSMALL_RECT lpReadRegion)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
|
|
|
return IntReadConsoleOutput(hConsoleOutput,
|
|
|
|
lpBuffer,
|
|
|
|
dwBufferSize,
|
|
|
|
dwBufferCoord,
|
|
|
|
lpReadRegion,
|
|
|
|
TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
ReadConsoleOutputA(IN HANDLE hConsoleOutput,
|
|
|
|
OUT PCHAR_INFO lpBuffer,
|
|
|
|
IN COORD dwBufferSize,
|
|
|
|
IN COORD dwBufferCoord,
|
|
|
|
IN OUT PSMALL_RECT lpReadRegion)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
|
|
|
return IntReadConsoleOutput(hConsoleOutput,
|
|
|
|
lpBuffer,
|
|
|
|
dwBufferSize,
|
|
|
|
dwBufferCoord,
|
|
|
|
lpReadRegion,
|
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
ReadConsoleOutputCharacterW(IN HANDLE hConsoleOutput,
|
|
|
|
OUT LPWSTR lpCharacter,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwReadCoord,
|
|
|
|
OUT LPDWORD lpNumberOfCharsRead)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2012-11-17 21:39:41 +00:00
|
|
|
return IntReadConsoleOutputCode(hConsoleOutput,
|
|
|
|
CODE_UNICODE,
|
|
|
|
lpCharacter,
|
|
|
|
nLength,
|
|
|
|
dwReadCoord,
|
|
|
|
lpNumberOfCharsRead);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
ReadConsoleOutputCharacterA(IN HANDLE hConsoleOutput,
|
|
|
|
OUT LPSTR lpCharacter,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwReadCoord,
|
|
|
|
OUT LPDWORD lpNumberOfCharsRead)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2012-11-17 21:39:41 +00:00
|
|
|
return IntReadConsoleOutputCode(hConsoleOutput,
|
|
|
|
CODE_ASCII,
|
|
|
|
lpCharacter,
|
|
|
|
nLength,
|
|
|
|
dwReadCoord,
|
|
|
|
lpNumberOfCharsRead);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
ReadConsoleOutputAttribute(IN HANDLE hConsoleOutput,
|
|
|
|
OUT LPWORD lpAttribute,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwReadCoord,
|
|
|
|
OUT LPDWORD lpNumberOfAttrsRead)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2012-11-17 21:39:41 +00:00
|
|
|
return IntReadConsoleOutputCode(hConsoleOutput,
|
|
|
|
CODE_ATTRIBUTE,
|
|
|
|
lpAttribute,
|
|
|
|
nLength,
|
|
|
|
dwReadCoord,
|
|
|
|
lpNumberOfAttrsRead);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************
|
|
|
|
* Write functions *
|
|
|
|
*******************/
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
WriteConsoleW(IN HANDLE hConsoleOutput,
|
|
|
|
IN CONST VOID *lpBuffer,
|
|
|
|
IN DWORD nNumberOfCharsToWrite,
|
|
|
|
OUT LPDWORD lpNumberOfCharsWritten,
|
2012-11-15 18:06:17 +00:00
|
|
|
LPVOID lpReserved)
|
|
|
|
{
|
|
|
|
return IntWriteConsole(hConsoleOutput,
|
|
|
|
(PVOID)lpBuffer,
|
|
|
|
nNumberOfCharsToWrite,
|
|
|
|
lpNumberOfCharsWritten,
|
|
|
|
lpReserved,
|
|
|
|
TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
WriteConsoleA(IN HANDLE hConsoleOutput,
|
|
|
|
IN CONST VOID *lpBuffer,
|
|
|
|
IN DWORD nNumberOfCharsToWrite,
|
|
|
|
OUT LPDWORD lpNumberOfCharsWritten,
|
2012-11-15 18:06:17 +00:00
|
|
|
LPVOID lpReserved)
|
|
|
|
{
|
|
|
|
return IntWriteConsole(hConsoleOutput,
|
|
|
|
(PVOID)lpBuffer,
|
|
|
|
nNumberOfCharsToWrite,
|
|
|
|
lpNumberOfCharsWritten,
|
|
|
|
lpReserved,
|
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
WriteConsoleInputW(IN HANDLE hConsoleInput,
|
|
|
|
IN CONST INPUT_RECORD *lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsWritten)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
|
|
|
return IntWriteConsoleInput(hConsoleInput,
|
|
|
|
(PINPUT_RECORD)lpBuffer,
|
|
|
|
nLength,
|
|
|
|
lpNumberOfEventsWritten,
|
2013-10-26 20:53:05 +00:00
|
|
|
TRUE,
|
2012-11-15 18:06:17 +00:00
|
|
|
TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
WriteConsoleInputA(IN HANDLE hConsoleInput,
|
|
|
|
IN CONST INPUT_RECORD *lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsWritten)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
|
|
|
return IntWriteConsoleInput(hConsoleInput,
|
|
|
|
(PINPUT_RECORD)lpBuffer,
|
|
|
|
nLength,
|
|
|
|
lpNumberOfEventsWritten,
|
2013-10-26 20:53:05 +00:00
|
|
|
FALSE,
|
|
|
|
TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2013-10-26 20:53:05 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
WriteConsoleInputVDMW(IN HANDLE hConsoleInput,
|
|
|
|
IN CONST INPUT_RECORD *lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsWritten)
|
2013-10-26 20:53:05 +00:00
|
|
|
{
|
|
|
|
return IntWriteConsoleInput(hConsoleInput,
|
|
|
|
(PINPUT_RECORD)lpBuffer,
|
|
|
|
nLength,
|
|
|
|
lpNumberOfEventsWritten,
|
|
|
|
TRUE,
|
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2013-10-26 20:53:05 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
WriteConsoleInputVDMA(IN HANDLE hConsoleInput,
|
|
|
|
IN CONST INPUT_RECORD *lpBuffer,
|
|
|
|
IN DWORD nLength,
|
|
|
|
OUT LPDWORD lpNumberOfEventsWritten)
|
2013-10-26 20:53:05 +00:00
|
|
|
{
|
|
|
|
return IntWriteConsoleInput(hConsoleInput,
|
|
|
|
(PINPUT_RECORD)lpBuffer,
|
|
|
|
nLength,
|
|
|
|
lpNumberOfEventsWritten,
|
|
|
|
FALSE,
|
2012-11-15 18:06:17 +00:00
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
WriteConsoleOutputW(IN HANDLE hConsoleOutput,
|
|
|
|
IN CONST CHAR_INFO *lpBuffer,
|
|
|
|
IN COORD dwBufferSize,
|
|
|
|
IN COORD dwBufferCoord,
|
|
|
|
IN OUT PSMALL_RECT lpWriteRegion)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
|
|
|
return IntWriteConsoleOutput(hConsoleOutput,
|
|
|
|
lpBuffer,
|
|
|
|
dwBufferSize,
|
|
|
|
dwBufferCoord,
|
|
|
|
lpWriteRegion,
|
|
|
|
TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
[KERNEL32][CONSRV]
- Make kernel32 / winsrv console CSR structures Win2k3-compliant for Read/WriteConsole functions.
An attentive code reader will see that there are structure members in CONSOLE_WRITECONSOLE that are
indeed unused by kernel32 that can be used in ReactOS for undocumented extensions of WriteConsole...
(for instance, adding a parameter for ANSI codes support, who knows!... :P)
- Fix a bit the support for the CONSOLE_READCONSOLE_CONTROL parameter in ReadConsole (for unicode only).
- Use the actual exe name for command history management, given via a hackish way by ReadConsole:
the exe name is passed via the 80-byte-length limited static buffer, and is of course retrieved before
actually using the static buffer (if needed).
[CONSRV]
- Fix writing input events in the console, but first preprocessing them for pausing commands (we treat them separately and remove them),
then, in case we write many single events, we merge them in case they are mouse moves or repeated key down presses. This helps in not
overflowing too quickly the input buffer, and that fixes all the remaining kernel32:console winetests!! (see CORE-8256)
- Use the actual exe name for command history management, given via a hackish way by ReadConsole (blame MS!)
Part 8/X
CORE-7931
CORE-8256 #resolve #comment Fixed in the condrv_restructure branch in revision .
svn path=/branches/condrv_restructure/; revision=63793
2014-08-01 18:08:29 +00:00
|
|
|
WriteConsoleOutputA(IN HANDLE hConsoleOutput,
|
|
|
|
IN CONST CHAR_INFO *lpBuffer,
|
|
|
|
IN COORD dwBufferSize,
|
|
|
|
IN COORD dwBufferCoord,
|
|
|
|
IN OUT PSMALL_RECT lpWriteRegion)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
|
|
|
return IntWriteConsoleOutput(hConsoleOutput,
|
|
|
|
lpBuffer,
|
|
|
|
dwBufferSize,
|
|
|
|
dwBufferCoord,
|
|
|
|
lpWriteRegion,
|
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
WriteConsoleOutputCharacterW(IN HANDLE hConsoleOutput,
|
|
|
|
IN LPCWSTR lpCharacter,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwWriteCoord,
|
|
|
|
OUT LPDWORD lpNumberOfCharsWritten)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2012-11-19 23:26:36 +00:00
|
|
|
return IntWriteConsoleOutputCode(hConsoleOutput,
|
|
|
|
CODE_UNICODE,
|
|
|
|
lpCharacter,
|
|
|
|
nLength,
|
|
|
|
dwWriteCoord,
|
|
|
|
lpNumberOfCharsWritten);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
WriteConsoleOutputCharacterA(IN HANDLE hConsoleOutput,
|
|
|
|
IN LPCSTR lpCharacter,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwWriteCoord,
|
|
|
|
OUT LPDWORD lpNumberOfCharsWritten)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2012-11-19 23:26:36 +00:00
|
|
|
return IntWriteConsoleOutputCode(hConsoleOutput,
|
|
|
|
CODE_ASCII,
|
|
|
|
lpCharacter,
|
|
|
|
nLength,
|
|
|
|
dwWriteCoord,
|
|
|
|
lpNumberOfCharsWritten);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
WriteConsoleOutputAttribute(IN HANDLE hConsoleOutput,
|
|
|
|
IN CONST WORD *lpAttribute,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwWriteCoord,
|
|
|
|
OUT LPDWORD lpNumberOfAttrsWritten)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2012-11-19 23:26:36 +00:00
|
|
|
return IntWriteConsoleOutputCode(hConsoleOutput,
|
|
|
|
CODE_ATTRIBUTE,
|
|
|
|
lpAttribute,
|
|
|
|
nLength,
|
|
|
|
dwWriteCoord,
|
|
|
|
lpNumberOfAttrsWritten);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
FillConsoleOutputCharacterW(IN HANDLE hConsoleOutput,
|
|
|
|
IN WCHAR cCharacter,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwWriteCoord,
|
|
|
|
OUT LPDWORD lpNumberOfCharsWritten)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 13:18:59 +00:00
|
|
|
CODE_ELEMENT Code;
|
|
|
|
Code.UnicodeChar = cCharacter;
|
2012-11-18 17:06:48 +00:00
|
|
|
return IntFillConsoleOutputCode(hConsoleOutput,
|
|
|
|
CODE_UNICODE,
|
2014-07-29 13:18:59 +00:00
|
|
|
Code,
|
2012-11-18 17:06:48 +00:00
|
|
|
nLength,
|
|
|
|
dwWriteCoord,
|
|
|
|
lpNumberOfCharsWritten);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
FillConsoleOutputCharacterA(IN HANDLE hConsoleOutput,
|
|
|
|
IN CHAR cCharacter,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwWriteCoord,
|
2012-11-15 18:06:17 +00:00
|
|
|
LPDWORD lpNumberOfCharsWritten)
|
|
|
|
{
|
2014-07-29 13:18:59 +00:00
|
|
|
CODE_ELEMENT Code;
|
|
|
|
Code.AsciiChar = cCharacter;
|
2012-11-18 17:06:48 +00:00
|
|
|
return IntFillConsoleOutputCode(hConsoleOutput,
|
|
|
|
CODE_ASCII,
|
2014-07-29 13:18:59 +00:00
|
|
|
Code,
|
2012-11-18 17:06:48 +00:00
|
|
|
nLength,
|
|
|
|
dwWriteCoord,
|
|
|
|
lpNumberOfCharsWritten);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-09 21:24:44 +00:00
|
|
|
/*
|
2012-11-15 18:06:17 +00:00
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOL
|
|
|
|
WINAPI
|
2014-11-01 15:35:45 +00:00
|
|
|
DECLSPEC_HOTPATCH
|
2014-07-29 15:59:17 +00:00
|
|
|
FillConsoleOutputAttribute(IN HANDLE hConsoleOutput,
|
|
|
|
IN WORD wAttribute,
|
|
|
|
IN DWORD nLength,
|
|
|
|
IN COORD dwWriteCoord,
|
|
|
|
OUT LPDWORD lpNumberOfAttrsWritten)
|
2012-11-15 18:06:17 +00:00
|
|
|
{
|
2014-07-29 13:18:59 +00:00
|
|
|
CODE_ELEMENT Code;
|
|
|
|
Code.Attribute = wAttribute;
|
2012-11-18 17:06:48 +00:00
|
|
|
return IntFillConsoleOutputCode(hConsoleOutput,
|
|
|
|
CODE_ATTRIBUTE,
|
2014-07-29 13:18:59 +00:00
|
|
|
Code,
|
2012-11-18 17:06:48 +00:00
|
|
|
nLength,
|
|
|
|
dwWriteCoord,
|
|
|
|
lpNumberOfAttrsWritten);
|
2012-11-15 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|