2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis and Cameron Heide
5 * Copyright 1997 Karl Garrison
6 * Copyright 1998 John Richardson
7 * Copyright 1998 Marcus Meissner
11 * - Completely lacks SCREENBUFFER interface.
12 * - No abstraction for something other than xterm.
13 * - Key input translation shouldn't use VkKeyScan and MapVirtualKey, since
14 * they are window (USER) driver dependend.
15 * - Output sometimes is buffered (We switched off buffering by ~ICANON ?)
17 /* Reference applications:
18 * - IDA (interactive disassembler) full version 3.75. Works.
19 * - LYNX/W32. Works mostly, some keys crash it.
26 #include <sys/ioctl.h>
27 #include <sys/types.h>
32 #include <sys/errno.h>
47 #include "server/request.h"
50 /* The CONSOLE kernel32 Object */
51 typedef struct _CONSOLE
{
54 INPUT_RECORD
*irs
; /* buffered input records */
55 int nrofirs
;/* nr of buffered input records */
58 static void CONSOLE_Destroy( K32OBJ
*obj
);
60 const K32OBJ_OPS CONSOLE_Ops
=
62 CONSOLE_Destroy
/* destroy */
65 /***********************************************************************
68 static void CONSOLE_Destroy(K32OBJ
*obj
)
70 CONSOLE
*console
= (CONSOLE
*)obj
;
71 assert(obj
->type
== K32OBJ_CONSOLE
);
73 obj
->type
= K32OBJ_UNKNOWN
;
75 HeapFree(SystemHeap
, 0, console
);
79 /***********************************************************************
82 static CONSOLE
*CONSOLE_GetPtr( HANDLE32 handle
)
84 return (CONSOLE
*)HANDLE_GetObjPtr( PROCESS_Current(), handle
,
85 K32OBJ_CONSOLE
, 0, NULL
);
88 /****************************************************************************
91 static BOOL32
CONSOLE_GetInfo( HANDLE32 handle
, struct get_console_info_reply
*reply
)
93 struct get_console_info_request req
;
95 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), handle
,
96 K32OBJ_CONSOLE
, GENERIC_READ
)) == -1)
98 CLIENT_SendRequest( REQ_GET_CONSOLE_INFO
, -1, 1, &req
, sizeof(req
) );
99 return !CLIENT_WaitSimpleReply( reply
, sizeof(*reply
), NULL
);
103 /****************************************************************************
104 * CONSOLE_add_input_record [internal]
106 * Adds an INPUT_RECORD to the CONSOLEs input queue.
109 CONSOLE_add_input_record(CONSOLE
*console
,INPUT_RECORD
*inp
) {
110 console
->irs
= HeapReAlloc(GetProcessHeap(),0,console
->irs
,sizeof(INPUT_RECORD
)*(console
->nrofirs
+1));
111 console
->irs
[console
->nrofirs
++]=*inp
;
114 /****************************************************************************
115 * XTERM_string_to_IR [internal]
117 * Transfers a string read from XTERM to INPUT_RECORDs and adds them to the
118 * queue. Does translation of vt100 style function keys and xterm-mouse clicks.
121 CONSOLE_string_to_IR( HANDLE32 hConsoleInput
,unsigned char *buf
,int len
) {
124 CONSOLE
*console
= CONSOLE_GetPtr( hConsoleInput
);
126 for (j
=0;j
<len
;j
++) {
127 unsigned char inchar
= buf
[j
];
129 if (inchar
!=27) { /* no escape -> 'normal' keyboard event */
130 ir
.EventType
= 1; /* Key_event */
132 ir
.Event
.KeyEvent
.bKeyDown
= 1;
133 ir
.Event
.KeyEvent
.wRepeatCount
= 0;
135 ir
.Event
.KeyEvent
.dwControlKeyState
= 0;
137 ir
.Event
.KeyEvent
.dwControlKeyState
|=LEFT_ALT_PRESSED
;
140 ir
.Event
.KeyEvent
.wVirtualKeyCode
= VkKeyScan16(inchar
);
141 if (ir
.Event
.KeyEvent
.wVirtualKeyCode
& 0x0100)
142 ir
.Event
.KeyEvent
.dwControlKeyState
|=SHIFT_PRESSED
;
143 if (ir
.Event
.KeyEvent
.wVirtualKeyCode
& 0x0200)
144 ir
.Event
.KeyEvent
.dwControlKeyState
|=LEFT_CTRL_PRESSED
;
145 if (ir
.Event
.KeyEvent
.wVirtualKeyCode
& 0x0400)
146 ir
.Event
.KeyEvent
.dwControlKeyState
|=LEFT_ALT_PRESSED
;
147 ir
.Event
.KeyEvent
.wVirtualScanCode
= MapVirtualKey16(
148 ir
.Event
.KeyEvent
.wVirtualKeyCode
& 0x00ff,
149 0 /* VirtualKeyCodes to ScanCode */
152 ir
.Event
.KeyEvent
.uChar
.AsciiChar
= '\r';
153 ir
.Event
.KeyEvent
.wVirtualKeyCode
= 0x0d;
154 ir
.Event
.KeyEvent
.wVirtualScanCode
= 0x1c;
156 ir
.Event
.KeyEvent
.uChar
.AsciiChar
= inchar
;
158 /* FIXME: find good values for ^X */
159 ir
.Event
.KeyEvent
.wVirtualKeyCode
= 0xdead;
160 ir
.Event
.KeyEvent
.wVirtualScanCode
= 0xbeef;
164 CONSOLE_add_input_record(console
,&ir
);
165 ir
.Event
.KeyEvent
.bKeyDown
= 0;
166 CONSOLE_add_input_record(console
,&ir
);
170 if ((j
==len
-1) || (buf
[j
+1]!='[')) {/* add ESCape on its own */
171 ir
.EventType
= 1; /* Key_event */
172 ir
.Event
.KeyEvent
.bKeyDown
= 1;
173 ir
.Event
.KeyEvent
.wRepeatCount
= 0;
175 ir
.Event
.KeyEvent
.wVirtualKeyCode
= VkKeyScan16(27);
176 ir
.Event
.KeyEvent
.wVirtualScanCode
= MapVirtualKey16(
177 ir
.Event
.KeyEvent
.wVirtualKeyCode
,0
179 ir
.Event
.KeyEvent
.dwControlKeyState
= 0;
180 ir
.Event
.KeyEvent
.uChar
.AsciiChar
= 27;
181 CONSOLE_add_input_record(console
,&ir
);
182 ir
.Event
.KeyEvent
.bKeyDown
= 0;
183 CONSOLE_add_input_record(console
,&ir
);
186 for (k
=j
;k
<len
;k
++) {
187 if (((buf
[k
]>='A') && (buf
[k
]<='Z')) ||
188 ((buf
[k
]>='a') && (buf
[k
]<='z')) ||
194 int subid
,scancode
=0;
196 ir
.EventType
= 1; /* Key_event */
197 ir
.Event
.KeyEvent
.bKeyDown
= 1;
198 ir
.Event
.KeyEvent
.wRepeatCount
= 0;
199 ir
.Event
.KeyEvent
.dwControlKeyState
= 0;
201 ir
.Event
.KeyEvent
.wVirtualKeyCode
= 0xad; /* FIXME */
202 ir
.Event
.KeyEvent
.wVirtualScanCode
= 0xad; /* FIXME */
203 ir
.Event
.KeyEvent
.uChar
.AsciiChar
= 0;
207 sscanf(&buf
[j
+2],"%d",&subid
);
209 case 2:/*INS */scancode
= 0xe052;break;
210 case 3:/*DEL */scancode
= 0xe053;break;
211 case 6:/*PGDW*/scancode
= 0xe051;break;
212 case 5:/*PGUP*/scancode
= 0xe049;break;
213 case 11:/*F1 */scancode
= 0x003b;break;
214 case 12:/*F2 */scancode
= 0x003c;break;
215 case 13:/*F3 */scancode
= 0x003d;break;
216 case 14:/*F4 */scancode
= 0x003e;break;
217 case 15:/*F5 */scancode
= 0x003f;break;
218 case 17:/*F6 */scancode
= 0x0040;break;
219 case 18:/*F7 */scancode
= 0x0041;break;
220 case 19:/*F8 */scancode
= 0x0042;break;
221 case 20:/*F9 */scancode
= 0x0043;break;
222 case 21:/*F10 */scancode
= 0x0044;break;
223 case 23:/*F11 */scancode
= 0x00d9;break;
224 case 24:/*F12 */scancode
= 0x00da;break;
225 /* FIXME: Shift-Fx */
227 FIXME(console
,"parse ESC[%d~\n",subid
);
231 case 'A': /* Cursor Up */scancode
= 0xe048;break;
232 case 'B': /* Cursor Down */scancode
= 0xe050;break;
233 case 'D': /* Cursor Left */scancode
= 0xe04b;break;
234 case 'C': /* Cursor Right */scancode
= 0xe04d;break;
235 case 'F': /* End */scancode
= 0xe04f;break;
236 case 'H': /* Home */scancode
= 0xe047;break;
238 /* Mouse Button Press (ESCM<button+'!'><x+'!'><y+'!'>) or
239 * Release (ESCM#<x+'!'><y+'!'>
242 ir
.EventType
= MOUSE_EVENT
;
243 ir
.Event
.MouseEvent
.dwMousePosition
.x
= buf
[k
+2]-'!';
244 ir
.Event
.MouseEvent
.dwMousePosition
.y
= buf
[k
+3]-'!';
246 ir
.Event
.MouseEvent
.dwButtonState
= 0;
248 ir
.Event
.MouseEvent
.dwButtonState
= 1<<(buf
[k
+1]-' ');
249 ir
.Event
.MouseEvent
.dwEventFlags
= 0; /* FIXME */
250 CONSOLE_add_input_record(console
,&ir
);
257 ir
.Event
.KeyEvent
.wVirtualScanCode
= scancode
;
258 ir
.Event
.KeyEvent
.wVirtualKeyCode
= MapVirtualKey16(scancode
,1);
259 CONSOLE_add_input_record(console
,&ir
);
260 ir
.Event
.KeyEvent
.bKeyDown
= 0;
261 CONSOLE_add_input_record(console
,&ir
);
267 K32OBJ_DecCount(&console
->header
);
270 /****************************************************************************
271 * CONSOLE_get_input (internal)
273 * Reads (nonblocking) as much input events as possible and stores them
274 * in an internal queue.
277 CONSOLE_get_input( HANDLE32 handle
)
279 char *buf
= HeapAlloc(GetProcessHeap(),0,1);
286 if (WaitForSingleObject( handle
, 0 )) break;
287 if (!ReadFile( handle
, &inchar
, 1, &res
, NULL
)) break;
288 if (!res
) /* res 0 but readable means EOF? Hmm. */
290 buf
= HeapReAlloc(GetProcessHeap(),0,buf
,len
+1);
293 CONSOLE_string_to_IR(handle
,buf
,len
);
294 HeapFree(GetProcessHeap(),0,buf
);
297 /****************************************************************************
298 * CONSOLE_drain_input (internal)
300 * Drains 'n' console input events from the queue.
303 CONSOLE_drain_input(CONSOLE
*console
,int n
) {
304 assert(n
<=console
->nrofirs
);
307 memcpy( &console
->irs
[0],
309 console
->nrofirs
*sizeof(INPUT_RECORD
)
311 console
->irs
= HeapReAlloc(
315 console
->nrofirs
*sizeof(INPUT_RECORD
)
321 /******************************************************************************
322 * SetConsoleCtrlHandler [KERNEL32.459] Adds function to calling process list
325 * func [I] Address of handler function
326 * add [I] Handler to add or remove
333 * James Sutherland (JamesSutherland@gmx.de)
334 * Added global variables console_ignore_ctrl_c and handlers[]
335 * Does not yet do any error checking, or set LastError if failed.
336 * This doesn't yet matter, since these handlers are not yet called...!
338 static unsigned int console_ignore_ctrl_c
= 0;
339 static HANDLER_ROUTINE
*handlers
[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
340 BOOL32 WINAPI
SetConsoleCtrlHandler( HANDLER_ROUTINE
*func
, BOOL32 add
)
342 unsigned int alloc_loop
= sizeof(handlers
)/sizeof(HANDLER_ROUTINE
*);
343 unsigned int done
= 0;
344 FIXME(console
, "(%p,%i) - no error checking or testing yet\n", func
, add
);
347 console_ignore_ctrl_c
= add
;
353 if (!handlers
[alloc_loop
] && !done
)
355 handlers
[alloc_loop
] = func
;
359 FIXME(console
, "Out of space on CtrlHandler table\n");
365 if (handlers
[alloc_loop
] == func
&& !done
)
367 handlers
[alloc_loop
] = 0;
371 WARN(console
, "Attempt to remove non-installed CtrlHandler %p\n",
379 /******************************************************************************
380 * GenerateConsoleCtrlEvent [KERNEL32.275] Simulate a CTRL-C or CTRL-BREAK
383 * dwCtrlEvent [I] Type of event
384 * dwProcessGroupID [I] Process group ID to send event to
387 * Doesn't yet work...!
391 * Failure: False (and *should* [but doesn't] set LastError)
393 BOOL32 WINAPI
GenerateConsoleCtrlEvent( DWORD dwCtrlEvent
,
394 DWORD dwProcessGroupID
)
396 if (dwCtrlEvent
!= CTRL_C_EVENT
&& dwCtrlEvent
!= CTRL_BREAK_EVENT
)
398 ERR( console
, "invalid event %d for PGID %ld\n",
399 (unsigned short)dwCtrlEvent
, dwProcessGroupID
);
402 if (dwProcessGroupID
== GetCurrentProcessId() )
404 FIXME( console
, "Attempt to send event %d to self - stub\n",
405 (unsigned short)dwCtrlEvent
);
408 FIXME( console
,"event %d to external PGID %ld - not implemented yet\n",
409 (unsigned short)dwCtrlEvent
, dwProcessGroupID
);
414 /******************************************************************************
415 * CreateConsoleScreenBuffer [KERNEL32.151] Creates a console screen buffer
418 * dwDesiredAccess [I] Access flag
419 * dwShareMode [I] Buffer share mode
420 * sa [I] Security attributes
421 * dwFlags [I] Type of buffer to create
422 * lpScreenBufferData [I] Reserved
425 * Should call SetLastError
428 * Success: Handle to new console screen buffer
429 * Failure: INVALID_HANDLE_VALUE
431 HANDLE32 WINAPI
CreateConsoleScreenBuffer( DWORD dwDesiredAccess
,
432 DWORD dwShareMode
, LPSECURITY_ATTRIBUTES sa
,
433 DWORD dwFlags
, LPVOID lpScreenBufferData
)
435 FIXME(console
, "(%ld,%ld,%p,%ld,%p): stub\n",dwDesiredAccess
,
436 dwShareMode
, sa
, dwFlags
, lpScreenBufferData
);
437 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
438 return INVALID_HANDLE_VALUE32
;
442 /***********************************************************************
443 * GetConsoleScreenBufferInfo (KERNEL32.190)
445 BOOL32 WINAPI
GetConsoleScreenBufferInfo( HANDLE32 hConsoleOutput
,
446 LPCONSOLE_SCREEN_BUFFER_INFO csbi
)
450 csbi
->dwCursorPosition
.x
= 0;
451 csbi
->dwCursorPosition
.y
= 0;
452 csbi
->wAttributes
= 0;
453 csbi
->srWindow
.Left
= 0;
454 csbi
->srWindow
.Right
= 79;
455 csbi
->srWindow
.Top
= 0;
456 csbi
->srWindow
.Bottom
= 23;
457 csbi
->dwMaximumWindowSize
.x
= 80;
458 csbi
->dwMaximumWindowSize
.y
= 24;
463 /******************************************************************************
464 * SetConsoleActiveScreenBuffer [KERNEL32.623] Sets buffer to current console
470 BOOL32 WINAPI
SetConsoleActiveScreenBuffer(
471 HANDLE32 hConsoleOutput
) /* [in] Handle to console screen buffer */
473 FIXME(console
, "(%x): stub\n", hConsoleOutput
);
478 /***********************************************************************
479 * GetLargestConsoleWindowSize (KERNEL32.226)
481 DWORD WINAPI
GetLargestConsoleWindowSize( HANDLE32 hConsoleOutput
)
483 return (DWORD
)MAKELONG(80,24);
486 /***********************************************************************
487 * FreeConsole (KERNEL32.267)
489 BOOL32 WINAPI
FreeConsole(VOID
)
492 PDB32
*pdb
= PROCESS_Current();
497 console
= (CONSOLE
*)pdb
->console
;
499 if (console
== NULL
) {
500 SetLastError(ERROR_INVALID_PARAMETER
);
504 CLIENT_SendRequest( REQ_FREE_CONSOLE
, -1, 0 );
505 if (CLIENT_WaitReply( NULL
, NULL
, 0 ) != ERROR_SUCCESS
)
507 K32OBJ_DecCount(&console
->header
);
512 HANDLE_CloseAll( pdb
, &console
->header
);
513 K32OBJ_DecCount( &console
->header
);
520 /*************************************************************************
523 * Open a handle to the current process console.
525 HANDLE32
CONSOLE_OpenHandle( BOOL32 output
, DWORD access
, LPSECURITY_ATTRIBUTES sa
)
527 struct open_console_request req
;
528 struct open_console_reply reply
;
534 req
.inherit
= (sa
&& (sa
->nLength
>=sizeof(*sa
)) && sa
->bInheritHandle
);
535 CLIENT_SendRequest( REQ_OPEN_CONSOLE
, -1, 1, &req
, sizeof(req
) );
536 CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
);
537 if (reply
.handle
== -1) return INVALID_HANDLE_VALUE32
;
540 if (!(console
= (CONSOLE
*)HeapAlloc( SystemHeap
, 0, sizeof(*console
))))
545 console
->header
.type
= K32OBJ_CONSOLE
;
546 console
->header
.refcount
= 1;
547 console
->nrofirs
= 0;
548 console
->irs
= HeapAlloc(GetProcessHeap(),0,1);;
549 handle
= HANDLE_Alloc( PROCESS_Current(), &console
->header
, req
.access
,
550 req
.inherit
, reply
.handle
);
552 K32OBJ_DecCount(&console
->header
);
557 /*************************************************************************
558 * CONSOLE_make_complex [internal]
560 * Turns a CONSOLE kernel object into a complex one.
561 * (switches from output/input using the terminal where WINE was started to
564 * This makes simple commandline tools pipeable, while complex commandline
565 * tools work without getting messed up by debugoutput.
567 * All other functions should work indedependend from this call.
569 * To test for complex console: pid == 0 -> simple, otherwise complex.
571 static BOOL32
CONSOLE_make_complex(HANDLE32 handle
)
573 struct set_console_fd_request req
;
574 struct get_console_info_reply info
;
579 int i
,xpid
,master
,slave
;
582 if (!CONSOLE_GetInfo( handle
, &info
)) return FALSE
;
583 if (info
.pid
) return TRUE
; /* already complex */
585 MSG("Console: Making console complex (creating an xterm)...\n");
587 if (tcgetattr(0, &term
) < 0) {
588 /* ignore failure, or we can't run from a script */
590 term
.c_lflag
= ~(ECHO
|ICANON
);
592 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), handle
,
593 K32OBJ_CONSOLE
, 0 )) == -1)
596 if (wine_openpty(&master
, &slave
, NULL
, &term
, NULL
) < 0)
599 if ((xpid
=fork()) == 0) {
600 tcsetattr(slave
, TCSADRAIN
, &term
);
601 sprintf(buf
, "-Sxx%d", master
);
602 /* "-fn vga" for VGA font. Harmless if vga is not present:
603 * xterm: unable to open font "vga", trying "fixed"....
605 execlp("xterm", "xterm", buf
, "-fn","vga",NULL
);
606 ERR(console
, "error creating AllocConsole xterm\n");
611 CLIENT_SendRequest( REQ_SET_CONSOLE_FD
, dup(slave
), 1, &req
, sizeof(req
) );
612 CLIENT_WaitReply( NULL
, NULL
, 0 );
614 /* most xterms like to print their window ID when used with -S;
615 * read it and continue before the user has a chance...
617 for (i
=0; c
!='\n'; (status
=read(slave
, &c
, 1)), i
++) {
618 if (status
== -1 && c
== '\0') {
619 /* wait for xterm to be created */
623 ERR(console
, "can't read xterm WID\n");
628 /* enable mouseclicks */
629 sprintf(buf
,"%c[?1001s%c[?1000h",27,27);
630 WriteFile(handle
,buf
,strlen(buf
),&xlen
,NULL
);
632 if (GetConsoleTitle32A( buf
, sizeof(buf
) ))
634 WriteFile(handle
,"\033]2;",4,&xlen
,NULL
);
635 WriteFile(handle
,buf
,strlen(buf
),&xlen
,NULL
);
636 WriteFile(handle
,"\a",1,&xlen
,NULL
);
643 /***********************************************************************
644 * AllocConsole (KERNEL32.103)
646 * creates an xterm with a pty to our program
648 BOOL32 WINAPI
AllocConsole(VOID
)
650 struct open_console_request req
;
651 struct open_console_reply reply
;
652 PDB32
*pdb
= PROCESS_Current();
654 HANDLE32 hIn
, hOut
, hErr
;
656 SYSTEM_LOCK(); /* FIXME: really only need to lock the process */
658 console
= (CONSOLE
*)pdb
->console
;
660 /* don't create a console if we already have one */
661 if (console
!= NULL
) {
662 SetLastError(ERROR_ACCESS_DENIED
);
667 if (!(console
= (CONSOLE
*)HeapAlloc( SystemHeap
, 0, sizeof(*console
))))
673 console
->header
.type
= K32OBJ_CONSOLE
;
674 console
->header
.refcount
= 1;
675 console
->nrofirs
= 0;
676 console
->irs
= HeapAlloc(GetProcessHeap(),0,1);;
678 CLIENT_SendRequest( REQ_ALLOC_CONSOLE
, -1, 0 );
679 if (CLIENT_WaitReply( NULL
, NULL
, 0 ) != ERROR_SUCCESS
)
681 K32OBJ_DecCount(&console
->header
);
687 req
.access
= GENERIC_READ
| GENERIC_WRITE
| SYNCHRONIZE
;
689 CLIENT_SendRequest( REQ_OPEN_CONSOLE
, -1, 1, &req
, sizeof(req
) );
690 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
) != ERROR_SUCCESS
)
692 K32OBJ_DecCount(&console
->header
);
696 if ((hIn
= HANDLE_Alloc(pdb
,&console
->header
, req
.access
,
697 FALSE
, reply
.handle
)) == INVALID_HANDLE_VALUE32
)
699 K32OBJ_DecCount(&console
->header
);
705 CLIENT_SendRequest( REQ_OPEN_CONSOLE
, -1, 1, &req
, sizeof(req
) );
706 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
) != ERROR_SUCCESS
)
709 K32OBJ_DecCount(&console
->header
);
713 if ((hOut
= HANDLE_Alloc(pdb
,&console
->header
, req
.access
,
714 FALSE
, reply
.handle
)) == INVALID_HANDLE_VALUE32
)
717 K32OBJ_DecCount(&console
->header
);
722 if (!DuplicateHandle( GetCurrentProcess(), hOut
,
723 GetCurrentProcess(), &hErr
,
724 0, TRUE
, DUPLICATE_SAME_ACCESS
))
728 K32OBJ_DecCount(&console
->header
);
733 if (pdb
->console
) K32OBJ_DecCount( pdb
->console
);
734 pdb
->console
= (K32OBJ
*)console
;
735 K32OBJ_IncCount( pdb
->console
);
737 /* NT resets the STD_*_HANDLEs on console alloc */
738 SetStdHandle(STD_INPUT_HANDLE
, hIn
);
739 SetStdHandle(STD_OUTPUT_HANDLE
, hOut
);
740 SetStdHandle(STD_ERROR_HANDLE
, hErr
);
742 SetLastError(ERROR_SUCCESS
);
744 SetConsoleTitle32A("Wine Console");
749 /******************************************************************************
750 * GetConsoleCP [KERNEL32.295] Returns the OEM code page for the console
755 UINT32 WINAPI
GetConsoleCP(VOID
)
761 /***********************************************************************
762 * GetConsoleOutputCP (KERNEL32.189)
764 UINT32 WINAPI
GetConsoleOutputCP(VOID
)
766 return GetConsoleCP();
769 /***********************************************************************
770 * GetConsoleMode (KERNEL32.188)
772 BOOL32 WINAPI
GetConsoleMode(HANDLE32 hcon
,LPDWORD mode
)
774 struct get_console_mode_request req
;
775 struct get_console_mode_reply reply
;
777 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), hcon
,
778 K32OBJ_CONSOLE
, GENERIC_READ
)) == -1)
780 CLIENT_SendRequest( REQ_GET_CONSOLE_MODE
, -1, 1, &req
, sizeof(req
));
781 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) return FALSE
;
787 /******************************************************************************
788 * SetConsoleMode [KERNEL32.628] Sets input mode of console's input buffer
791 * hcon [I] Handle to console input or screen buffer
792 * mode [I] Input or output mode to set
798 BOOL32 WINAPI
SetConsoleMode( HANDLE32 hcon
, DWORD mode
)
800 struct set_console_mode_request req
;
802 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), hcon
,
803 K32OBJ_CONSOLE
, GENERIC_READ
)) == -1)
806 CLIENT_SendRequest( REQ_SET_CONSOLE_MODE
, -1, 1, &req
, sizeof(req
));
807 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
811 /***********************************************************************
812 * GetConsoleTitleA (KERNEL32.191)
814 DWORD WINAPI
GetConsoleTitle32A(LPSTR title
,DWORD size
)
816 struct get_console_info_request req
;
817 struct get_console_info_reply reply
;
822 if ((hcon
= CreateFile32A( "CONOUT$", GENERIC_READ
, 0, NULL
,
823 OPEN_EXISTING
, 0, 0 )) == INVALID_HANDLE_VALUE32
)
825 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), hcon
,
826 K32OBJ_CONSOLE
, GENERIC_READ
)) == -1)
831 CLIENT_SendRequest( REQ_GET_CONSOLE_INFO
, -1, 1, &req
, sizeof(req
) );
832 if (!CLIENT_WaitReply( &len
, NULL
, 2, &reply
, sizeof(reply
), title
, size
))
834 if (len
> sizeof(reply
)+size
) title
[size
-1] = 0;
842 /******************************************************************************
843 * GetConsoleTitle32W [KERNEL32.192] Retrieves title string for console
846 * title [O] Address of buffer for title
847 * size [I] Size of buffer
850 * Success: Length of string copied
853 DWORD WINAPI
GetConsoleTitle32W( LPWSTR title
, DWORD size
)
858 if (!(tmp
= HeapAlloc( GetProcessHeap(), 0, size
))) return 0;
859 ret
= GetConsoleTitle32A( tmp
, size
);
860 lstrcpyAtoW( title
, tmp
);
861 HeapFree( GetProcessHeap(), 0, tmp
);
866 /***********************************************************************
867 * WriteConsoleA (KERNEL32.729)
869 BOOL32 WINAPI
WriteConsole32A( HANDLE32 hConsoleOutput
,
871 DWORD nNumberOfCharsToWrite
,
872 LPDWORD lpNumberOfCharsWritten
,
875 /* FIXME: should I check if this is a console handle? */
876 return WriteFile(hConsoleOutput
, lpBuffer
, nNumberOfCharsToWrite
,
877 lpNumberOfCharsWritten
, NULL
);
882 if (bufused==curbufsize-1) \
883 buffer = HeapReAlloc(GetProcessHeap(),0,buffer,(curbufsize+=100));\
885 #define SADD(s) { char *x=s;while (*x) {CADD(*x);x++;}}
887 /***********************************************************************
888 * WriteConsoleOutputA (KERNEL32.732)
890 BOOL32 WINAPI
WriteConsoleOutput32A( HANDLE32 hConsoleOutput
,
891 LPCHAR_INFO lpBuffer
,
894 LPSMALL_RECT lpWriteRegion
)
896 int i
,j
,off
=0,lastattr
=-1;
897 char sbuf
[20],*buffer
=NULL
;
898 int bufused
=0,curbufsize
= 100;
900 const int colormap
[8] = {
904 CONSOLE_make_complex(hConsoleOutput
);
905 buffer
= HeapAlloc(GetProcessHeap(),0,100);;
908 TRACE(console
,"wr: top = %d, bottom=%d, left=%d,right=%d\n",
910 lpWriteRegion
->Bottom
,
915 for (i
=lpWriteRegion
->Top
;i
<=lpWriteRegion
->Bottom
;i
++) {
916 sprintf(sbuf
,"%c[%d;%dH",27,i
+1,lpWriteRegion
->Left
+1);
918 for (j
=lpWriteRegion
->Left
;j
<=lpWriteRegion
->Right
;j
++) {
919 if (lastattr
!=lpBuffer
[off
].Attributes
) {
920 lastattr
= lpBuffer
[off
].Attributes
;
921 sprintf(sbuf
,"%c[0;%s3%d;4%dm",
923 (lastattr
& FOREGROUND_INTENSITY
)?"1;":"",
924 colormap
[lastattr
&7],
925 colormap
[(lastattr
&0x70)>>4]
927 /* FIXME: BACKGROUND_INTENSITY */
930 CADD(lpBuffer
[off
].Char
.AsciiChar
);
934 sprintf(sbuf
,"%c[0m",27);SADD(sbuf
);
935 WriteFile(hConsoleOutput
,buffer
,bufused
,&res
,NULL
);
936 HeapFree(GetProcessHeap(),0,buffer
);
940 /***********************************************************************
941 * WriteConsoleW (KERNEL32.577)
943 BOOL32 WINAPI
WriteConsole32W( HANDLE32 hConsoleOutput
,
945 DWORD nNumberOfCharsToWrite
,
946 LPDWORD lpNumberOfCharsWritten
,
950 LPSTR xstring
=HeapAlloc( GetProcessHeap(), 0, nNumberOfCharsToWrite
);
952 lstrcpynWtoA( xstring
, lpBuffer
,nNumberOfCharsToWrite
);
954 /* FIXME: should I check if this is a console handle? */
955 ret
= WriteFile(hConsoleOutput
, xstring
, nNumberOfCharsToWrite
,
956 lpNumberOfCharsWritten
, NULL
);
957 HeapFree( GetProcessHeap(), 0, xstring
);
962 /***********************************************************************
963 * ReadConsoleA (KERNEL32.419)
965 BOOL32 WINAPI
ReadConsole32A( HANDLE32 hConsoleInput
,
967 DWORD nNumberOfCharsToRead
,
968 LPDWORD lpNumberOfCharsRead
,
971 CONSOLE
*console
= CONSOLE_GetPtr( hConsoleInput
);
973 LPSTR xbuf
= (LPSTR
)lpBuffer
;
976 SetLastError(ERROR_INVALID_HANDLE
);
977 FIXME(console
,"(%d,...), no console handle!\n",hConsoleInput
);
980 TRACE(console
,"(%d,%p,%ld,%p,%p)\n",
981 hConsoleInput
,lpBuffer
,nNumberOfCharsToRead
,
982 lpNumberOfCharsRead
,lpReserved
984 CONSOLE_get_input(hConsoleInput
);
986 /* FIXME: should we read at least 1 char? The SDK does not say */
987 for (i
=0;(i
<console
->nrofirs
)&&(charsread
<nNumberOfCharsToRead
);i
++) {
988 if (console
->irs
[i
].EventType
!= KEY_EVENT
)
990 if (!console
->irs
[i
].Event
.KeyEvent
.bKeyDown
)
992 *xbuf
++ = console
->irs
[i
].Event
.KeyEvent
.uChar
.AsciiChar
;
995 /* SDK says: Drains all other input events from queue. */
996 CONSOLE_drain_input(console
,i
);
997 if (lpNumberOfCharsRead
)
998 *lpNumberOfCharsRead
= charsread
;
999 K32OBJ_DecCount(&console
->header
);
1003 /***********************************************************************
1004 * ReadConsoleW (KERNEL32.427)
1006 BOOL32 WINAPI
ReadConsole32W( HANDLE32 hConsoleInput
,
1008 DWORD nNumberOfCharsToRead
,
1009 LPDWORD lpNumberOfCharsRead
,
1013 LPSTR buf
= (LPSTR
)HeapAlloc(GetProcessHeap(), 0, nNumberOfCharsToRead
);
1015 ret
= ReadConsole32A(
1018 nNumberOfCharsToRead
,
1019 lpNumberOfCharsRead
,
1023 lstrcpynAtoW(lpBuffer
,buf
,nNumberOfCharsToRead
);
1024 HeapFree( GetProcessHeap(), 0, buf
);
1029 /******************************************************************************
1030 * ReadConsoleInput32A [KERNEL32.569] Reads data from a console
1033 * hConsoleInput [I] Handle to console input buffer
1034 * lpBuffer [O] Address of buffer for read data
1035 * nLength [I] Number of records to read
1036 * lpNumberOfEventsRead [O] Address of number of records read
1042 BOOL32 WINAPI
ReadConsoleInput32A(HANDLE32 hConsoleInput
,
1043 LPINPUT_RECORD lpBuffer
,
1044 DWORD nLength
, LPDWORD lpNumberOfEventsRead
)
1046 CONSOLE
*console
= CONSOLE_GetPtr( hConsoleInput
);
1048 TRACE(console
, "(%d,%p,%ld,%p)\n",hConsoleInput
, lpBuffer
, nLength
,
1049 lpNumberOfEventsRead
);
1051 FIXME(console
, "(%d,%p,%ld,%p), No console handle!\n",hConsoleInput
,
1052 lpBuffer
, nLength
, lpNumberOfEventsRead
);
1054 /* Indicate that nothing was read */
1055 *lpNumberOfEventsRead
= 0;
1059 CONSOLE_get_input(hConsoleInput
);
1060 /* SDK: return at least 1 input record */
1061 while (!console
->nrofirs
) {
1064 res
=WaitForSingleObject(hConsoleInput
,0);
1066 case STATUS_TIMEOUT
: continue;
1067 case 0: break; /*ok*/
1068 case WAIT_FAILED
: return 0;/*FIXME: SetLastError?*/
1069 default: break; /*hmm*/
1071 CONSOLE_get_input(hConsoleInput
);
1074 if (nLength
>console
->nrofirs
)
1075 nLength
= console
->nrofirs
;
1076 memcpy(lpBuffer
,console
->irs
,sizeof(INPUT_RECORD
)*nLength
);
1077 if (lpNumberOfEventsRead
)
1078 *lpNumberOfEventsRead
= nLength
;
1079 CONSOLE_drain_input(console
,nLength
);
1080 K32OBJ_DecCount(&console
->header
);
1084 /***********************************************************************
1085 * SetConsoleTitle32A (KERNEL32.476)
1087 * Sets the console title.
1089 * We do not necessarily need to create a complex console for that,
1090 * but should remember the title and set it on creation of the latter.
1091 * (not fixed at this time).
1093 BOOL32 WINAPI
SetConsoleTitle32A(LPCSTR title
)
1096 PDB32
*pdb
= PROCESS_Current();
1099 char titleformat
[]="\033]2;%s\a"; /*this should work for xterms*/
1103 TRACE(console
,"(%s)\n",title
);
1105 console
= (CONSOLE
*)pdb
->console
;
1108 if(console
->title
) /* Free old title, if there is one */
1109 HeapFree( SystemHeap
, 0, console
->title
);
1110 console
->title
= (LPSTR
)HeapAlloc(SystemHeap
, 0,strlen(title
)+1);
1111 if(console
->title
) strcpy(console
->title
,title
);
1112 titlestring
= HeapAlloc(GetProcessHeap(), 0,strlen(title
)+strlen(titleformat
)+1);
1114 K32OBJ_DecCount(&console
->header
);
1118 sprintf(titlestring
,titleformat
,title
);
1120 /* only set title for complex console (own xterm) */
1121 if (console
->pid
!= -1) {
1122 WriteFile(GetStdHandle(STD_OUTPUT_HANDLE
),titlestring
,strlen(titlestring
),&written
,NULL
);
1123 if (written
== strlen(titlestring
))
1128 HeapFree( GetProcessHeap(), 0, titlestring
);
1129 K32OBJ_DecCount(&console
->header
);
1136 struct set_console_info_request req
;
1137 struct get_console_info_reply info
;
1141 if ((hcon
= CreateFile32A( "CONOUT$", GENERIC_READ
|GENERIC_WRITE
, 0, NULL
,
1142 OPEN_EXISTING
, 0, 0 )) == INVALID_HANDLE_VALUE32
)
1144 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), hcon
,
1145 K32OBJ_CONSOLE
, GENERIC_WRITE
)) == -1)
1147 req
.mask
= SET_CONSOLE_INFO_TITLE
;
1148 CLIENT_SendRequest( REQ_SET_CONSOLE_INFO
, -1, 2, &req
, sizeof(req
),
1149 title
, strlen(title
)+1 );
1150 if (CLIENT_WaitReply( NULL
, NULL
, 0 )) goto error
;
1151 if (CONSOLE_GetInfo( hcon
, &info
) && info
.pid
)
1153 /* only set title for complex console (own xterm) */
1154 WriteFile( hcon
, "\033]2;", 4, &written
, NULL
);
1155 WriteFile( hcon
, title
, strlen(title
), &written
, NULL
);
1156 WriteFile( hcon
, "\a", 1, &written
, NULL
);
1160 CloseHandle( hcon
);
1165 /******************************************************************************
1166 * SetConsoleTitle32W [KERNEL32.477] Sets title bar string for console
1169 * title [I] Address of new title
1172 * This should not be calling the A version
1178 BOOL32 WINAPI
SetConsoleTitle32W( LPCWSTR title
)
1182 LPSTR titleA
= HEAP_strdupWtoA( GetProcessHeap(), 0, title
);
1183 ret
= SetConsoleTitle32A(titleA
);
1184 HeapFree( GetProcessHeap(), 0, titleA
);
1188 /***********************************************************************
1189 * ReadConsoleInput32W (KERNEL32.570)
1191 BOOL32 WINAPI
ReadConsoleInput32W(HANDLE32 hConsoleInput
,
1192 LPINPUT_RECORD lpBuffer
,
1193 DWORD nLength
, LPDWORD lpNumberOfEventsRead
)
1195 FIXME(console
, "(%d,%p,%ld,%p): stub\n",hConsoleInput
, lpBuffer
, nLength
,
1196 lpNumberOfEventsRead
);
1200 /***********************************************************************
1201 * FlushConsoleInputBuffer (KERNEL32.132)
1203 BOOL32 WINAPI
FlushConsoleInputBuffer(HANDLE32 hConsoleInput
)
1205 CONSOLE
*console
= CONSOLE_GetPtr( hConsoleInput
);
1209 CONSOLE_drain_input(console
,console
->nrofirs
);
1210 K32OBJ_DecCount(&console
->header
);
1215 /******************************************************************************
1216 * SetConsoleCursorPosition [KERNEL32.627]
1217 * Sets the cursor position in console
1220 * hConsoleOutput [I] Handle of console screen buffer
1221 * dwCursorPosition [I] New cursor position coordinates
1225 BOOL32 WINAPI
SetConsoleCursorPosition( HANDLE32 hcon
, COORD pos
)
1230 /* make console complex only if we change lines, not just in the line */
1232 CONSOLE_make_complex(hcon
);
1234 TRACE(console
, "%d (%dx%d)\n", hcon
, pos
.x
, pos
.y
);
1235 /* x are columns, y rows */
1237 /* full screen cursor absolute positioning */
1238 sprintf(xbuf
,"%c[%d;%dH", 0x1B, pos
.y
+1, pos
.x
+1);
1240 /* relative cursor positioning in line (\r to go to 0) */
1241 sprintf(xbuf
,"\r%c[%dC", 0x1B, pos
.x
);
1242 /* FIXME: store internal if we start using own console buffers */
1243 WriteFile(hcon
,xbuf
,strlen(xbuf
),&xlen
,NULL
);
1247 /***********************************************************************
1248 * GetNumberOfConsoleInputEvents (KERNEL32.246)
1250 BOOL32 WINAPI
GetNumberOfConsoleInputEvents(HANDLE32 hcon
,LPDWORD nrofevents
)
1252 CONSOLE
*console
= CONSOLE_GetPtr( hcon
);
1255 FIXME(console
,"(%d,%p), no console handle!\n",hcon
,nrofevents
);
1258 CONSOLE_get_input(hcon
);
1259 *nrofevents
= console
->nrofirs
;
1260 K32OBJ_DecCount(&console
->header
);
1264 /***********************************************************************
1265 * GetNumberOfConsoleMouseButtons (KERNEL32.358)
1267 BOOL32 WINAPI
GetNumberOfConsoleMouseButtons(LPDWORD nrofbuttons
)
1269 FIXME(console
,"(%p): stub\n", nrofbuttons
);
1274 /***********************************************************************
1275 * PeekConsoleInputA (KERNEL32.550)
1277 * Gets 'cInRecords' first events (or less) from input queue.
1279 * Does not need a complex console.
1281 BOOL32 WINAPI
PeekConsoleInput32A(HANDLE32 hConsoleInput
,
1282 LPINPUT_RECORD pirBuffer
,
1286 CONSOLE
*console
= CONSOLE_GetPtr( hConsoleInput
);
1289 FIXME(console
,"(%d,%p,%ld,%p), No console handle passed!\n",hConsoleInput
, pirBuffer
, cInRecords
, lpcRead
);
1291 /* Indicate that nothing was read */
1296 TRACE(console
,"(%d,%p,%ld,%p)\n",hConsoleInput
, pirBuffer
, cInRecords
, lpcRead
);
1297 CONSOLE_get_input(hConsoleInput
);
1298 if (cInRecords
>console
->nrofirs
)
1299 cInRecords
= console
->nrofirs
;
1301 memcpy(pirBuffer
,console
->irs
,cInRecords
*sizeof(INPUT_RECORD
));
1303 *lpcRead
= cInRecords
;
1304 K32OBJ_DecCount(&console
->header
);
1308 /***********************************************************************
1309 * PeekConsoleInputW (KERNEL32.551)
1311 BOOL32 WINAPI
PeekConsoleInput32W(HANDLE32 hConsoleInput
,
1312 LPINPUT_RECORD pirBuffer
,
1316 /* FIXME: Hmm. Fix this if we get UNICODE input. */
1317 return PeekConsoleInput32A(hConsoleInput
,pirBuffer
,cInRecords
,lpcRead
);
1321 /******************************************************************************
1322 * GetConsoleCursorInfo32 [KERNEL32.296] Gets size and visibility of console
1325 * hcon [I] Handle to console screen buffer
1326 * cinfo [O] Address of cursor information
1332 BOOL32 WINAPI
GetConsoleCursorInfo32( HANDLE32 hcon
,
1333 LPCONSOLE_CURSOR_INFO cinfo
)
1335 struct get_console_info_reply reply
;
1337 if (!CONSOLE_GetInfo( hcon
, &reply
)) return FALSE
;
1340 cinfo
->dwSize
= reply
.cursor_size
;
1341 cinfo
->bVisible
= reply
.cursor_visible
;
1347 /******************************************************************************
1348 * SetConsoleCursorInfo32 [KERNEL32.626] Sets size and visibility of cursor
1354 BOOL32 WINAPI
SetConsoleCursorInfo32(
1355 HANDLE32 hcon
, /* [in] Handle to console screen buffer */
1356 LPCONSOLE_CURSOR_INFO cinfo
) /* [in] Address of cursor information */
1358 struct set_console_info_request req
;
1362 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), hcon
,
1363 K32OBJ_CONSOLE
, GENERIC_WRITE
)) == -1)
1365 CONSOLE_make_complex(hcon
);
1366 sprintf(buf
,"\033[?25%c",cinfo
->bVisible
?'h':'l');
1367 WriteFile(hcon
,buf
,strlen(buf
),&xlen
,NULL
);
1369 req
.cursor_size
= cinfo
->dwSize
;
1370 req
.cursor_visible
= cinfo
->bVisible
;
1371 req
.mask
= SET_CONSOLE_INFO_CURSOR
;
1372 CLIENT_SendRequest( REQ_SET_CONSOLE_INFO
, -1, 1, &req
, sizeof(req
) );
1373 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
1377 /******************************************************************************
1378 * SetConsoleWindowInfo [KERNEL32.634] Sets size and position of console
1384 BOOL32 WINAPI
SetConsoleWindowInfo(
1385 HANDLE32 hcon
, /* [in] Handle to console screen buffer */
1386 BOOL32 bAbsolute
, /* [in] Coordinate type flag */
1387 LPSMALL_RECT window
) /* [in] Address of new window rectangle */
1389 FIXME(console
, "(%x,%d,%p): stub\n", hcon
, bAbsolute
, window
);
1394 /******************************************************************************
1395 * SetConsoleTextAttribute32 [KERNEL32.631] Sets colors for text
1397 * Sets the foreground and background color attributes of characters
1398 * written to the screen buffer.
1404 BOOL32 WINAPI
SetConsoleTextAttribute32(HANDLE32 hConsoleOutput
,WORD wAttr
)
1406 const int colormap
[8] = {
1413 TRACE(console
,"(%d,%d)\n",hConsoleOutput
,wAttr
);
1414 sprintf(buffer
,"%c[0;%s3%d;4%dm",
1416 (wAttr
& FOREGROUND_INTENSITY
)?"1;":"",
1418 colormap
[(wAttr
&0x70)>>4]
1420 WriteFile(hConsoleOutput
,buffer
,strlen(buffer
),&xlen
,NULL
);
1425 /******************************************************************************
1426 * SetConsoleScreenBufferSize [KERNEL32.630] Changes size of console
1429 * hConsoleOutput [I] Handle to console screen buffer
1430 * dwSize [I] New size in character rows and cols
1436 BOOL32 WINAPI
SetConsoleScreenBufferSize( HANDLE32 hConsoleOutput
,
1439 FIXME(console
, "(%d,%dx%d): stub\n",hConsoleOutput
,dwSize
.x
,dwSize
.y
);
1444 /******************************************************************************
1445 * FillConsoleOutputCharacterA [KERNEL32.242]
1448 * hConsoleOutput [I] Handle to screen buffer
1449 * cCharacter [I] Character to write
1450 * nLength [I] Number of cells to write to
1451 * dwCoord [I] Coords of first cell
1452 * lpNumCharsWritten [O] Pointer to number of cells written
1458 BOOL32 WINAPI
FillConsoleOutputCharacterA(
1459 HANDLE32 hConsoleOutput
,
1463 LPDWORD lpNumCharsWritten
)
1468 SetConsoleCursorPosition(hConsoleOutput
,dwCoord
);
1469 for(count
=0;count
<nLength
;count
++)
1470 WriteFile(hConsoleOutput
,&cCharacter
,1,&xlen
,NULL
);
1471 *lpNumCharsWritten
= nLength
;
1476 /******************************************************************************
1477 * FillConsoleOutputCharacterW [KERNEL32.243] Writes characters to console
1480 * hConsoleOutput [I] Handle to screen buffer
1481 * cCharacter [I] Character to write
1482 * nLength [I] Number of cells to write to
1483 * dwCoord [I] Coords of first cell
1484 * lpNumCharsWritten [O] Pointer to number of cells written
1490 BOOL32 WINAPI
FillConsoleOutputCharacterW(HANDLE32 hConsoleOutput
,
1494 LPDWORD lpNumCharsWritten
)
1499 SetConsoleCursorPosition(hConsoleOutput
,dwCoord
);
1500 /* FIXME: not quite correct ... but the lower part of UNICODE char comes
1503 for(count
=0;count
<nLength
;count
++)
1504 WriteFile(hConsoleOutput
,&cCharacter
,1,&xlen
,NULL
);
1505 *lpNumCharsWritten
= nLength
;
1510 /******************************************************************************
1511 * FillConsoleOutputAttribute [KERNEL32.241] Sets attributes for console
1514 * hConsoleOutput [I] Handle to screen buffer
1515 * wAttribute [I] Color attribute to write
1516 * nLength [I] Number of cells to write to
1517 * dwCoord [I] Coords of first cell
1518 * lpNumAttrsWritten [O] Pointer to number of cells written
1524 BOOL32 WINAPI
FillConsoleOutputAttribute( HANDLE32 hConsoleOutput
,
1525 WORD wAttribute
, DWORD nLength
, COORD dwCoord
,
1526 LPDWORD lpNumAttrsWritten
)
1528 FIXME(console
, "(%d,%d,%ld,%dx%d,%p): stub\n", hConsoleOutput
,
1529 wAttribute
,nLength
,dwCoord
.x
,dwCoord
.y
,lpNumAttrsWritten
);
1530 *lpNumAttrsWritten
= nLength
;
1534 /******************************************************************************
1535 * ReadConsoleOutputCharacter32A [KERNEL32.573]
1540 BOOL32 WINAPI
ReadConsoleOutputCharacter32A(HANDLE32 hConsoleOutput
,
1541 LPSTR lpstr
, DWORD dword
, COORD coord
, LPDWORD lpdword
)
1543 FIXME(console
, "(%d,%p,%ld,%dx%d,%p): stub\n", hConsoleOutput
,lpstr
,
1544 dword
,coord
.x
,coord
.y
,lpdword
);
1545 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1550 /******************************************************************************
1551 * ScrollConsoleScreenBuffer [KERNEL32.612]
1556 BOOL32 WINAPI
ScrollConsoleScreenBuffer( HANDLE32 hConsoleOutput
,
1557 LPSMALL_RECT lpScrollRect
, LPSMALL_RECT lpClipRect
,
1558 COORD dwDestOrigin
, LPCHAR_INFO lpFill
)
1560 FIXME(console
, "(%d,%p,%p,%dx%d,%p): stub\n", hConsoleOutput
,lpScrollRect
,
1561 lpClipRect
,dwDestOrigin
.x
,dwDestOrigin
.y
,lpFill
);
1562 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);