mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
Implemented WriteConsoleOutputCharacterW().
svn path=/trunk/; revision=5021
This commit is contained in:
parent
33859812f3
commit
b2805cde6e
1 changed files with 56 additions and 15 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: console.c,v 1.58 2003/06/19 19:38:26 ea Exp $
|
/* $Id: console.c,v 1.59 2003/07/09 10:43:08 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -1713,21 +1713,62 @@ WriteConsoleOutputCharacterA(HANDLE hConsoleOutput,
|
||||||
/*--------------------------------------------------------------
|
/*--------------------------------------------------------------
|
||||||
* WriteConsoleOutputCharacterW
|
* WriteConsoleOutputCharacterW
|
||||||
*/
|
*/
|
||||||
WINBASEAPI
|
WINBASEAPI BOOL WINAPI
|
||||||
BOOL
|
WriteConsoleOutputCharacterW(HANDLE hConsoleOutput,
|
||||||
WINAPI
|
|
||||||
WriteConsoleOutputCharacterW(
|
|
||||||
HANDLE hConsoleOutput,
|
|
||||||
LPCWSTR lpCharacter,
|
LPCWSTR lpCharacter,
|
||||||
DWORD nLength,
|
DWORD nLength,
|
||||||
COORD dwWriteCoord,
|
COORD dwWriteCoord,
|
||||||
LPDWORD lpNumberOfCharsWritten
|
LPDWORD lpNumberOfCharsWritten)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
/* TO DO */
|
PCSRSS_API_REQUEST Request;
|
||||||
return FALSE;
|
CSRSS_API_REPLY Reply;
|
||||||
}
|
NTSTATUS Status;
|
||||||
|
WORD Size;
|
||||||
|
|
||||||
|
Request = RtlAllocateHeap(GetProcessHeap(),
|
||||||
|
HEAP_ZERO_MEMORY,
|
||||||
|
sizeof(CSRSS_API_REQUEST) + CSRSS_MAX_WRITE_CONSOLE_OUTPUT_CHAR);
|
||||||
|
if( !Request )
|
||||||
|
{
|
||||||
|
SetLastError( ERROR_OUTOFMEMORY );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
Request->Type = CSRSS_WRITE_CONSOLE_OUTPUT_CHAR;
|
||||||
|
Request->Data.WriteConsoleOutputCharRequest.ConsoleHandle = hConsoleOutput;
|
||||||
|
Request->Data.WriteConsoleOutputCharRequest.Coord = dwWriteCoord;
|
||||||
|
if( lpNumberOfCharsWritten )
|
||||||
|
*lpNumberOfCharsWritten = nLength;
|
||||||
|
while( nLength )
|
||||||
|
{
|
||||||
|
Size = nLength > CSRSS_MAX_WRITE_CONSOLE_OUTPUT_CHAR ? CSRSS_MAX_WRITE_CONSOLE_OUTPUT_CHAR : nLength;
|
||||||
|
Request->Data.WriteConsoleOutputCharRequest.Length = Size;
|
||||||
|
Status = RtlUnicodeToOemN (&Request->Data.WriteConsoleOutputCharRequest.String[0],
|
||||||
|
Size,
|
||||||
|
NULL,
|
||||||
|
(PWCHAR)lpCharacter,
|
||||||
|
Size * sizeof(WCHAR));
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
RtlFreeHeap (GetProcessHeap(), 0, Request);
|
||||||
|
SetLastErrorByStatus (Status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = CsrClientCallServer( Request, &Reply, sizeof( CSRSS_API_REQUEST ) + Size, sizeof( CSRSS_API_REPLY ) );
|
||||||
|
if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Reply.Status ) )
|
||||||
|
{
|
||||||
|
RtlFreeHeap( GetProcessHeap(), 0, Request );
|
||||||
|
SetLastErrorByStatus ( Status );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
nLength -= Size;
|
||||||
|
lpCharacter += Size;
|
||||||
|
Request->Data.WriteConsoleOutputCharRequest.Coord = Reply.Data.WriteConsoleOutputCharReply.EndCoord;
|
||||||
|
}
|
||||||
|
|
||||||
|
RtlFreeHeap( GetProcessHeap(), 0, Request );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------
|
/*--------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue