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 buf
= HeapReAlloc(GetProcessHeap(),0,buf
,len
+1);
291 CONSOLE_string_to_IR(handle
,buf
,len
);
292 HeapFree(GetProcessHeap(),0,buf
);
295 /****************************************************************************
296 * CONSOLE_drain_input (internal)
298 * Drains 'n' console input events from the queue.
301 CONSOLE_drain_input(CONSOLE
*console
,int n
) {
302 assert(n
<=console
->nrofirs
);
305 memcpy( &console
->irs
[0],
307 console
->nrofirs
*sizeof(INPUT_RECORD
)
309 console
->irs
= HeapReAlloc(
313 console
->nrofirs
*sizeof(INPUT_RECORD
)
319 /******************************************************************************
320 * SetConsoleCtrlHandler [KERNEL32.459] Adds function to calling process list
323 * func [I] Address of handler function
324 * add [I] Handler to add or remove
331 * James Sutherland (JamesSutherland@gmx.de)
332 * Added global variables console_ignore_ctrl_c and handlers[]
333 * Does not yet do any error checking, or set LastError if failed.
334 * This doesn't yet matter, since these handlers are not yet called...!
336 static unsigned int console_ignore_ctrl_c
= 0;
337 static HANDLER_ROUTINE
*handlers
[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
338 BOOL32 WINAPI
SetConsoleCtrlHandler( HANDLER_ROUTINE
*func
, BOOL32 add
)
340 unsigned int alloc_loop
= sizeof(handlers
)/sizeof(HANDLER_ROUTINE
*);
341 unsigned int done
= 0;
342 FIXME(console
, "(%p,%i) - no error checking or testing yet\n", func
, add
);
345 console_ignore_ctrl_c
= add
;
351 if (!handlers
[alloc_loop
] && !done
)
353 handlers
[alloc_loop
] = func
;
357 FIXME(console
, "Out of space on CtrlHandler table\n");
363 if (handlers
[alloc_loop
] == func
&& !done
)
365 handlers
[alloc_loop
] = 0;
369 WARN(console
, "Attempt to remove non-installed CtrlHandler %p\n",
377 /******************************************************************************
378 * GenerateConsoleCtrlEvent [KERNEL32.275] Simulate a CTRL-C or CTRL-BREAK
381 * dwCtrlEvent [I] Type of event
382 * dwProcessGroupID [I] Process group ID to send event to
385 * Doesn't yet work...!
389 * Failure: False (and *should* [but doesn't] set LastError)
391 BOOL32 WINAPI
GenerateConsoleCtrlEvent( DWORD dwCtrlEvent
,
392 DWORD dwProcessGroupID
)
394 if (dwCtrlEvent
!= CTRL_C_EVENT
&& dwCtrlEvent
!= CTRL_BREAK_EVENT
)
396 ERR( console
, "invalid event %d for PGID %ld\n",
397 (unsigned short)dwCtrlEvent
, dwProcessGroupID
);
400 if (dwProcessGroupID
== GetCurrentProcessId() )
402 FIXME( console
, "Attempt to send event %d to self - stub\n",
403 (unsigned short)dwCtrlEvent
);
406 FIXME( console
,"event %d to external PGID %ld - not implemented yet\n",
407 (unsigned short)dwCtrlEvent
, dwProcessGroupID
);
412 /******************************************************************************
413 * CreateConsoleScreenBuffer [KERNEL32.151] Creates a console screen buffer
416 * dwDesiredAccess [I] Access flag
417 * dwShareMode [I] Buffer share mode
418 * sa [I] Security attributes
419 * dwFlags [I] Type of buffer to create
420 * lpScreenBufferData [I] Reserved
423 * Should call SetLastError
426 * Success: Handle to new console screen buffer
427 * Failure: INVALID_HANDLE_VALUE
429 HANDLE32 WINAPI
CreateConsoleScreenBuffer( DWORD dwDesiredAccess
,
430 DWORD dwShareMode
, LPSECURITY_ATTRIBUTES sa
,
431 DWORD dwFlags
, LPVOID lpScreenBufferData
)
433 FIXME(console
, "(%ld,%ld,%p,%ld,%p): stub\n",dwDesiredAccess
,
434 dwShareMode
, sa
, dwFlags
, lpScreenBufferData
);
435 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
436 return INVALID_HANDLE_VALUE32
;
440 /***********************************************************************
441 * GetConsoleScreenBufferInfo (KERNEL32.190)
443 BOOL32 WINAPI
GetConsoleScreenBufferInfo( HANDLE32 hConsoleOutput
,
444 LPCONSOLE_SCREEN_BUFFER_INFO csbi
)
448 csbi
->dwCursorPosition
.x
= 0;
449 csbi
->dwCursorPosition
.y
= 0;
450 csbi
->wAttributes
= 0;
451 csbi
->srWindow
.Left
= 0;
452 csbi
->srWindow
.Right
= 79;
453 csbi
->srWindow
.Top
= 0;
454 csbi
->srWindow
.Bottom
= 23;
455 csbi
->dwMaximumWindowSize
.x
= 80;
456 csbi
->dwMaximumWindowSize
.y
= 24;
461 /******************************************************************************
462 * SetConsoleActiveScreenBuffer [KERNEL32.623] Sets buffer to current console
468 BOOL32 WINAPI
SetConsoleActiveScreenBuffer(
469 HANDLE32 hConsoleOutput
) /* [in] Handle to console screen buffer */
471 FIXME(console
, "(%x): stub\n", hConsoleOutput
);
476 /***********************************************************************
477 * GetLargestConsoleWindowSize (KERNEL32.226)
479 DWORD WINAPI
GetLargestConsoleWindowSize( HANDLE32 hConsoleOutput
)
481 return (DWORD
)MAKELONG(80,24);
484 /***********************************************************************
485 * FreeConsole (KERNEL32.267)
487 BOOL32 WINAPI
FreeConsole(VOID
)
490 PDB32
*pdb
= PROCESS_Current();
495 console
= (CONSOLE
*)pdb
->console
;
497 if (console
== NULL
) {
498 SetLastError(ERROR_INVALID_PARAMETER
);
502 CLIENT_SendRequest( REQ_FREE_CONSOLE
, -1, 0 );
503 if (CLIENT_WaitReply( NULL
, NULL
, 0 ) != ERROR_SUCCESS
)
505 K32OBJ_DecCount(&console
->header
);
510 HANDLE_CloseAll( pdb
, &console
->header
);
511 K32OBJ_DecCount( &console
->header
);
518 /*************************************************************************
521 * Open a handle to the current process console.
523 HANDLE32
CONSOLE_OpenHandle( BOOL32 output
, DWORD access
, LPSECURITY_ATTRIBUTES sa
)
525 struct open_console_request req
;
526 struct open_console_reply reply
;
532 req
.inherit
= (sa
&& (sa
->nLength
>=sizeof(*sa
)) && sa
->bInheritHandle
);
533 CLIENT_SendRequest( REQ_OPEN_CONSOLE
, -1, 1, &req
, sizeof(req
) );
534 CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
);
535 if (reply
.handle
== -1) return INVALID_HANDLE_VALUE32
;
538 if (!(console
= (CONSOLE
*)HeapAlloc( SystemHeap
, 0, sizeof(*console
))))
543 console
->header
.type
= K32OBJ_CONSOLE
;
544 console
->header
.refcount
= 1;
545 console
->nrofirs
= 0;
546 console
->irs
= HeapAlloc(GetProcessHeap(),0,1);;
547 handle
= HANDLE_Alloc( PROCESS_Current(), &console
->header
, req
.access
,
548 req
.inherit
, reply
.handle
);
550 K32OBJ_DecCount(&console
->header
);
555 /*************************************************************************
556 * CONSOLE_make_complex [internal]
558 * Turns a CONSOLE kernel object into a complex one.
559 * (switches from output/input using the terminal where WINE was started to
562 * This makes simple commandline tools pipeable, while complex commandline
563 * tools work without getting messed up by debugoutput.
565 * All other functions should work indedependend from this call.
567 * To test for complex console: pid == 0 -> simple, otherwise complex.
569 static BOOL32
CONSOLE_make_complex(HANDLE32 handle
)
571 struct set_console_fd_request req
;
572 struct get_console_info_reply info
;
577 int i
,xpid
,master
,slave
;
580 if (!CONSOLE_GetInfo( handle
, &info
)) return FALSE
;
581 if (info
.pid
) return TRUE
; /* already complex */
583 MSG("Console: Making console complex (creating an xterm)...\n");
585 if (tcgetattr(0, &term
) < 0) return FALSE
;
586 term
.c_lflag
= ~(ECHO
|ICANON
);
588 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), handle
,
589 K32OBJ_CONSOLE
, 0 )) == -1)
592 if (wine_openpty(&master
, &slave
, NULL
, &term
, NULL
) < 0)
595 if ((xpid
=fork()) == 0) {
596 tcsetattr(slave
, TCSADRAIN
, &term
);
597 sprintf(buf
, "-Sxx%d", master
);
598 /* "-fn vga" for VGA font. Harmless if vga is not present:
599 * xterm: unable to open font "vga", trying "fixed"....
601 execlp("xterm", "xterm", buf
, "-fn","vga",NULL
);
602 ERR(console
, "error creating AllocConsole xterm\n");
607 CLIENT_SendRequest( REQ_SET_CONSOLE_FD
, dup(slave
), 1, &req
, sizeof(req
) );
608 CLIENT_WaitReply( NULL
, NULL
, 0 );
610 /* most xterms like to print their window ID when used with -S;
611 * read it and continue before the user has a chance...
613 for (i
=0; c
!='\n'; (status
=read(slave
, &c
, 1)), i
++) {
614 if (status
== -1 && c
== '\0') {
615 /* wait for xterm to be created */
619 ERR(console
, "can't read xterm WID\n");
624 /* enable mouseclicks */
625 sprintf(buf
,"%c[?1001s%c[?1000h",27,27);
626 WriteFile(handle
,buf
,strlen(buf
),&xlen
,NULL
);
628 if (GetConsoleTitle32A( buf
, sizeof(buf
) ))
630 WriteFile(handle
,"\033]2;",4,&xlen
,NULL
);
631 WriteFile(handle
,buf
,strlen(buf
),&xlen
,NULL
);
632 WriteFile(handle
,"\a",1,&xlen
,NULL
);
639 /***********************************************************************
640 * AllocConsole (KERNEL32.103)
642 * creates an xterm with a pty to our program
644 BOOL32 WINAPI
AllocConsole(VOID
)
646 struct open_console_request req
;
647 struct open_console_reply reply
;
648 PDB32
*pdb
= PROCESS_Current();
650 HANDLE32 hIn
, hOut
, hErr
;
652 SYSTEM_LOCK(); /* FIXME: really only need to lock the process */
654 console
= (CONSOLE
*)pdb
->console
;
656 /* don't create a console if we already have one */
657 if (console
!= NULL
) {
658 SetLastError(ERROR_ACCESS_DENIED
);
663 if (!(console
= (CONSOLE
*)HeapAlloc( SystemHeap
, 0, sizeof(*console
))))
669 console
->header
.type
= K32OBJ_CONSOLE
;
670 console
->header
.refcount
= 1;
671 console
->nrofirs
= 0;
672 console
->irs
= HeapAlloc(GetProcessHeap(),0,1);;
674 CLIENT_SendRequest( REQ_ALLOC_CONSOLE
, -1, 0 );
675 if (CLIENT_WaitReply( NULL
, NULL
, 0 ) != ERROR_SUCCESS
)
677 K32OBJ_DecCount(&console
->header
);
683 req
.access
= GENERIC_READ
| GENERIC_WRITE
| SYNCHRONIZE
;
685 CLIENT_SendRequest( REQ_OPEN_CONSOLE
, -1, 1, &req
, sizeof(req
) );
686 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
) != ERROR_SUCCESS
)
688 K32OBJ_DecCount(&console
->header
);
692 if ((hIn
= HANDLE_Alloc(pdb
,&console
->header
, req
.access
,
693 FALSE
, reply
.handle
)) == INVALID_HANDLE_VALUE32
)
695 K32OBJ_DecCount(&console
->header
);
701 CLIENT_SendRequest( REQ_OPEN_CONSOLE
, -1, 1, &req
, sizeof(req
) );
702 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
) != ERROR_SUCCESS
)
705 K32OBJ_DecCount(&console
->header
);
709 if ((hOut
= HANDLE_Alloc(pdb
,&console
->header
, req
.access
,
710 FALSE
, reply
.handle
)) == INVALID_HANDLE_VALUE32
)
713 K32OBJ_DecCount(&console
->header
);
718 if (!DuplicateHandle( GetCurrentProcess(), hOut
,
719 GetCurrentProcess(), &hErr
,
720 0, TRUE
, DUPLICATE_SAME_ACCESS
))
724 K32OBJ_DecCount(&console
->header
);
729 if (pdb
->console
) K32OBJ_DecCount( pdb
->console
);
730 pdb
->console
= (K32OBJ
*)console
;
731 K32OBJ_IncCount( pdb
->console
);
733 /* NT resets the STD_*_HANDLEs on console alloc */
734 SetStdHandle(STD_INPUT_HANDLE
, hIn
);
735 SetStdHandle(STD_OUTPUT_HANDLE
, hOut
);
736 SetStdHandle(STD_ERROR_HANDLE
, hErr
);
738 SetLastError(ERROR_SUCCESS
);
740 SetConsoleTitle32A("Wine Console");
745 /******************************************************************************
746 * GetConsoleCP [KERNEL32.295] Returns the OEM code page for the console
751 UINT32 WINAPI
GetConsoleCP(VOID
)
757 /***********************************************************************
758 * GetConsoleOutputCP (KERNEL32.189)
760 UINT32 WINAPI
GetConsoleOutputCP(VOID
)
762 return GetConsoleCP();
765 /***********************************************************************
766 * GetConsoleMode (KERNEL32.188)
768 BOOL32 WINAPI
GetConsoleMode(HANDLE32 hcon
,LPDWORD mode
)
770 struct get_console_mode_request req
;
771 struct get_console_mode_reply reply
;
773 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), hcon
,
774 K32OBJ_CONSOLE
, GENERIC_READ
)) == -1)
776 CLIENT_SendRequest( REQ_GET_CONSOLE_MODE
, -1, 1, &req
, sizeof(req
));
777 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) return FALSE
;
783 /******************************************************************************
784 * SetConsoleMode [KERNEL32.628] Sets input mode of console's input buffer
787 * hcon [I] Handle to console input or screen buffer
788 * mode [I] Input or output mode to set
794 BOOL32 WINAPI
SetConsoleMode( HANDLE32 hcon
, DWORD mode
)
796 struct set_console_mode_request req
;
798 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), hcon
,
799 K32OBJ_CONSOLE
, GENERIC_READ
)) == -1)
802 CLIENT_SendRequest( REQ_SET_CONSOLE_MODE
, -1, 1, &req
, sizeof(req
));
803 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
807 /***********************************************************************
808 * GetConsoleTitleA (KERNEL32.191)
810 DWORD WINAPI
GetConsoleTitle32A(LPSTR title
,DWORD size
)
812 struct get_console_info_request req
;
813 struct get_console_info_reply reply
;
818 if ((hcon
= CreateFile32A( "CONOUT$", GENERIC_READ
, 0, NULL
,
819 OPEN_EXISTING
, 0, 0 )) == INVALID_HANDLE_VALUE32
)
821 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), hcon
,
822 K32OBJ_CONSOLE
, GENERIC_READ
)) == -1)
827 CLIENT_SendRequest( REQ_GET_CONSOLE_INFO
, -1, 1, &req
, sizeof(req
) );
828 if (!CLIENT_WaitReply( &len
, NULL
, 2, &reply
, sizeof(reply
), title
, size
))
830 if (len
> sizeof(reply
)+size
) title
[size
-1] = 0;
838 /******************************************************************************
839 * GetConsoleTitle32W [KERNEL32.192] Retrieves title string for console
842 * title [O] Address of buffer for title
843 * size [I] Size of buffer
846 * Success: Length of string copied
849 DWORD WINAPI
GetConsoleTitle32W( LPWSTR title
, DWORD size
)
854 if (!(tmp
= HeapAlloc( GetProcessHeap(), 0, size
))) return 0;
855 ret
= GetConsoleTitle32A( tmp
, size
);
856 lstrcpyAtoW( title
, tmp
);
857 HeapFree( GetProcessHeap(), 0, tmp
);
862 /***********************************************************************
863 * WriteConsoleA (KERNEL32.729)
865 BOOL32 WINAPI
WriteConsole32A( HANDLE32 hConsoleOutput
,
867 DWORD nNumberOfCharsToWrite
,
868 LPDWORD lpNumberOfCharsWritten
,
871 /* FIXME: should I check if this is a console handle? */
872 return WriteFile(hConsoleOutput
, lpBuffer
, nNumberOfCharsToWrite
,
873 lpNumberOfCharsWritten
, NULL
);
878 if (bufused==curbufsize-1) \
879 buffer = HeapReAlloc(GetProcessHeap(),0,buffer,(curbufsize+=100));\
881 #define SADD(s) { char *x=s;while (*x) {CADD(*x);x++;}}
883 /***********************************************************************
884 * WriteConsoleOutputA (KERNEL32.732)
886 BOOL32 WINAPI
WriteConsoleOutput32A( HANDLE32 hConsoleOutput
,
887 LPCHAR_INFO lpBuffer
,
890 LPSMALL_RECT lpWriteRegion
)
892 int i
,j
,off
=0,lastattr
=-1;
893 char sbuf
[20],*buffer
=NULL
;
894 int bufused
=0,curbufsize
= 100;
896 const int colormap
[8] = {
900 CONSOLE_make_complex(hConsoleOutput
);
901 buffer
= HeapAlloc(GetProcessHeap(),0,100);;
904 TRACE(console
,"wr: top = %d, bottom=%d, left=%d,right=%d\n",
906 lpWriteRegion
->Bottom
,
911 for (i
=lpWriteRegion
->Top
;i
<=lpWriteRegion
->Bottom
;i
++) {
912 sprintf(sbuf
,"%c[%d;%dH",27,i
+1,lpWriteRegion
->Left
+1);
914 for (j
=lpWriteRegion
->Left
;j
<=lpWriteRegion
->Right
;j
++) {
915 if (lastattr
!=lpBuffer
[off
].Attributes
) {
916 lastattr
= lpBuffer
[off
].Attributes
;
917 sprintf(sbuf
,"%c[0;%s3%d;4%dm",
919 (lastattr
& FOREGROUND_INTENSITY
)?"1;":"",
920 colormap
[lastattr
&7],
921 colormap
[(lastattr
&0x70)>>4]
923 /* FIXME: BACKGROUND_INTENSITY */
926 CADD(lpBuffer
[off
].Char
.AsciiChar
);
930 sprintf(sbuf
,"%c[0m",27);SADD(sbuf
);
931 WriteFile(hConsoleOutput
,buffer
,bufused
,&res
,NULL
);
932 HeapFree(GetProcessHeap(),0,buffer
);
936 /***********************************************************************
937 * WriteConsoleW (KERNEL32.577)
939 BOOL32 WINAPI
WriteConsole32W( HANDLE32 hConsoleOutput
,
941 DWORD nNumberOfCharsToWrite
,
942 LPDWORD lpNumberOfCharsWritten
,
946 LPSTR xstring
=HeapAlloc( GetProcessHeap(), 0, nNumberOfCharsToWrite
);
948 lstrcpynWtoA( xstring
, lpBuffer
,nNumberOfCharsToWrite
);
950 /* FIXME: should I check if this is a console handle? */
951 ret
= WriteFile(hConsoleOutput
, xstring
, nNumberOfCharsToWrite
,
952 lpNumberOfCharsWritten
, NULL
);
953 HeapFree( GetProcessHeap(), 0, xstring
);
958 /***********************************************************************
959 * ReadConsoleA (KERNEL32.419)
961 BOOL32 WINAPI
ReadConsole32A( HANDLE32 hConsoleInput
,
963 DWORD nNumberOfCharsToRead
,
964 LPDWORD lpNumberOfCharsRead
,
967 CONSOLE
*console
= CONSOLE_GetPtr( hConsoleInput
);
969 LPSTR xbuf
= (LPSTR
)lpBuffer
;
972 SetLastError(ERROR_INVALID_HANDLE
);
973 FIXME(console
,"(%d,...), no console handle!\n",hConsoleInput
);
976 TRACE(console
,"(%d,%p,%ld,%p,%p)\n",
977 hConsoleInput
,lpBuffer
,nNumberOfCharsToRead
,
978 lpNumberOfCharsRead
,lpReserved
980 CONSOLE_get_input(hConsoleInput
);
982 /* FIXME: should we read at least 1 char? The SDK does not say */
983 for (i
=0;(i
<console
->nrofirs
)&&(charsread
<nNumberOfCharsToRead
);i
++) {
984 if (console
->irs
[i
].EventType
!= KEY_EVENT
)
986 if (!console
->irs
[i
].Event
.KeyEvent
.bKeyDown
)
988 *xbuf
++ = console
->irs
[i
].Event
.KeyEvent
.uChar
.AsciiChar
;
991 /* SDK says: Drains all other input events from queue. */
992 CONSOLE_drain_input(console
,i
);
993 if (lpNumberOfCharsRead
)
994 *lpNumberOfCharsRead
= charsread
;
995 K32OBJ_DecCount(&console
->header
);
999 /***********************************************************************
1000 * ReadConsoleW (KERNEL32.427)
1002 BOOL32 WINAPI
ReadConsole32W( HANDLE32 hConsoleInput
,
1004 DWORD nNumberOfCharsToRead
,
1005 LPDWORD lpNumberOfCharsRead
,
1009 LPSTR buf
= (LPSTR
)HeapAlloc(GetProcessHeap(), 0, nNumberOfCharsToRead
);
1011 ret
= ReadConsole32A(
1014 nNumberOfCharsToRead
,
1015 lpNumberOfCharsRead
,
1019 lstrcpynAtoW(lpBuffer
,buf
,nNumberOfCharsToRead
);
1020 HeapFree( GetProcessHeap(), 0, buf
);
1025 /******************************************************************************
1026 * ReadConsoleInput32A [KERNEL32.569] Reads data from a console
1029 * hConsoleInput [I] Handle to console input buffer
1030 * lpBuffer [O] Address of buffer for read data
1031 * nLength [I] Number of records to read
1032 * lpNumberOfEventsRead [O] Address of number of records read
1038 BOOL32 WINAPI
ReadConsoleInput32A(HANDLE32 hConsoleInput
,
1039 LPINPUT_RECORD lpBuffer
,
1040 DWORD nLength
, LPDWORD lpNumberOfEventsRead
)
1042 CONSOLE
*console
= CONSOLE_GetPtr( hConsoleInput
);
1044 TRACE(console
, "(%d,%p,%ld,%p)\n",hConsoleInput
, lpBuffer
, nLength
,
1045 lpNumberOfEventsRead
);
1047 FIXME(console
, "(%d,%p,%ld,%p), No console handle!\n",hConsoleInput
,
1048 lpBuffer
, nLength
, lpNumberOfEventsRead
);
1050 /* Indicate that nothing was read */
1051 *lpNumberOfEventsRead
= 0;
1055 CONSOLE_get_input(hConsoleInput
);
1056 /* SDK: return at least 1 input record */
1057 while (!console
->nrofirs
) {
1060 res
=WaitForSingleObject(hConsoleInput
,0);
1062 case STATUS_TIMEOUT
: continue;
1063 case 0: break; /*ok*/
1064 case WAIT_FAILED
: return 0;/*FIXME: SetLastError?*/
1065 default: break; /*hmm*/
1067 CONSOLE_get_input(hConsoleInput
);
1070 if (nLength
>console
->nrofirs
)
1071 nLength
= console
->nrofirs
;
1072 memcpy(lpBuffer
,console
->irs
,sizeof(INPUT_RECORD
)*nLength
);
1073 if (lpNumberOfEventsRead
)
1074 *lpNumberOfEventsRead
= nLength
;
1075 CONSOLE_drain_input(console
,nLength
);
1076 K32OBJ_DecCount(&console
->header
);
1080 /***********************************************************************
1081 * SetConsoleTitle32A (KERNEL32.476)
1083 * Sets the console title.
1085 * We do not necessarily need to create a complex console for that,
1086 * but should remember the title and set it on creation of the latter.
1087 * (not fixed at this time).
1089 BOOL32 WINAPI
SetConsoleTitle32A(LPCSTR title
)
1092 PDB32
*pdb
= PROCESS_Current();
1095 char titleformat
[]="\033]2;%s\a"; /*this should work for xterms*/
1099 TRACE(console
,"(%s)\n",title
);
1101 console
= (CONSOLE
*)pdb
->console
;
1104 if(console
->title
) /* Free old title, if there is one */
1105 HeapFree( SystemHeap
, 0, console
->title
);
1106 console
->title
= (LPSTR
)HeapAlloc(SystemHeap
, 0,strlen(title
)+1);
1107 if(console
->title
) strcpy(console
->title
,title
);
1108 titlestring
= HeapAlloc(GetProcessHeap(), 0,strlen(title
)+strlen(titleformat
)+1);
1110 K32OBJ_DecCount(&console
->header
);
1114 sprintf(titlestring
,titleformat
,title
);
1116 /* only set title for complex console (own xterm) */
1117 if (console
->pid
!= -1) {
1118 WriteFile(GetStdHandle(STD_OUTPUT_HANDLE
),titlestring
,strlen(titlestring
),&written
,NULL
);
1119 if (written
== strlen(titlestring
))
1124 HeapFree( GetProcessHeap(), 0, titlestring
);
1125 K32OBJ_DecCount(&console
->header
);
1132 struct set_console_info_request req
;
1133 struct get_console_info_reply info
;
1137 if ((hcon
= CreateFile32A( "CONOUT$", GENERIC_READ
|GENERIC_WRITE
, 0, NULL
,
1138 OPEN_EXISTING
, 0, 0 )) == INVALID_HANDLE_VALUE32
)
1140 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), hcon
,
1141 K32OBJ_CONSOLE
, GENERIC_WRITE
)) == -1)
1143 req
.mask
= SET_CONSOLE_INFO_TITLE
;
1144 CLIENT_SendRequest( REQ_SET_CONSOLE_INFO
, -1, 2, &req
, sizeof(req
),
1145 title
, strlen(title
)+1 );
1146 if (CLIENT_WaitReply( NULL
, NULL
, 0 )) goto error
;
1147 if (CONSOLE_GetInfo( hcon
, &info
) && info
.pid
)
1149 /* only set title for complex console (own xterm) */
1150 WriteFile( hcon
, "\033]2;", 4, &written
, NULL
);
1151 WriteFile( hcon
, title
, strlen(title
), &written
, NULL
);
1152 WriteFile( hcon
, "\a", 1, &written
, NULL
);
1156 CloseHandle( hcon
);
1161 /******************************************************************************
1162 * SetConsoleTitle32W [KERNEL32.477] Sets title bar string for console
1165 * title [I] Address of new title
1168 * This should not be calling the A version
1174 BOOL32 WINAPI
SetConsoleTitle32W( LPCWSTR title
)
1178 LPSTR titleA
= HEAP_strdupWtoA( GetProcessHeap(), 0, title
);
1179 ret
= SetConsoleTitle32A(titleA
);
1180 HeapFree( GetProcessHeap(), 0, titleA
);
1184 /***********************************************************************
1185 * ReadConsoleInput32W (KERNEL32.570)
1187 BOOL32 WINAPI
ReadConsoleInput32W(HANDLE32 hConsoleInput
,
1188 LPINPUT_RECORD lpBuffer
,
1189 DWORD nLength
, LPDWORD lpNumberOfEventsRead
)
1191 FIXME(console
, "(%d,%p,%ld,%p): stub\n",hConsoleInput
, lpBuffer
, nLength
,
1192 lpNumberOfEventsRead
);
1196 /***********************************************************************
1197 * FlushConsoleInputBuffer (KERNEL32.132)
1199 BOOL32 WINAPI
FlushConsoleInputBuffer(HANDLE32 hConsoleInput
)
1201 CONSOLE
*console
= CONSOLE_GetPtr( hConsoleInput
);
1205 CONSOLE_drain_input(console
,console
->nrofirs
);
1206 K32OBJ_DecCount(&console
->header
);
1211 /******************************************************************************
1212 * SetConsoleCursorPosition [KERNEL32.627]
1213 * Sets the cursor position in console
1216 * hConsoleOutput [I] Handle of console screen buffer
1217 * dwCursorPosition [I] New cursor position coordinates
1221 BOOL32 WINAPI
SetConsoleCursorPosition( HANDLE32 hcon
, COORD pos
)
1226 CONSOLE_make_complex(hcon
);
1227 TRACE(console
, "%d (%dx%d)\n", hcon
, pos
.x
, pos
.y
);
1228 /* x are columns, y rows */
1229 sprintf(xbuf
,"%c[%d;%dH", 0x1B, pos
.y
+1, pos
.x
+1);
1230 /* FIXME: store internal if we start using own console buffers */
1231 WriteFile(hcon
,xbuf
,strlen(xbuf
),&xlen
,NULL
);
1235 /***********************************************************************
1236 * GetNumberOfConsoleInputEvents (KERNEL32.246)
1238 BOOL32 WINAPI
GetNumberOfConsoleInputEvents(HANDLE32 hcon
,LPDWORD nrofevents
)
1240 CONSOLE
*console
= CONSOLE_GetPtr( hcon
);
1243 FIXME(console
,"(%d,%p), no console handle!\n",hcon
,nrofevents
);
1246 CONSOLE_get_input(hcon
);
1247 *nrofevents
= console
->nrofirs
;
1248 K32OBJ_DecCount(&console
->header
);
1252 /***********************************************************************
1253 * GetNumberOfConsoleMouseButtons (KERNEL32.358)
1255 BOOL32 WINAPI
GetNumberOfConsoleMouseButtons(LPDWORD nrofbuttons
)
1257 FIXME(console
,"(%p): stub\n", nrofbuttons
);
1262 /***********************************************************************
1263 * PeekConsoleInputA (KERNEL32.550)
1265 * Gets 'cInRecords' first events (or less) from input queue.
1267 * Does not need a complex console.
1269 BOOL32 WINAPI
PeekConsoleInput32A(HANDLE32 hConsoleInput
,
1270 LPINPUT_RECORD pirBuffer
,
1274 CONSOLE
*console
= CONSOLE_GetPtr( hConsoleInput
);
1277 FIXME(console
,"(%d,%p,%ld,%p), No console handle passed!\n",hConsoleInput
, pirBuffer
, cInRecords
, lpcRead
);
1279 /* Indicate that nothing was read */
1284 TRACE(console
,"(%d,%p,%ld,%p)\n",hConsoleInput
, pirBuffer
, cInRecords
, lpcRead
);
1285 CONSOLE_get_input(hConsoleInput
);
1286 if (cInRecords
>console
->nrofirs
)
1287 cInRecords
= console
->nrofirs
;
1289 memcpy(pirBuffer
,console
->irs
,cInRecords
*sizeof(INPUT_RECORD
));
1291 *lpcRead
= cInRecords
;
1292 K32OBJ_DecCount(&console
->header
);
1296 /***********************************************************************
1297 * PeekConsoleInputW (KERNEL32.551)
1299 BOOL32 WINAPI
PeekConsoleInput32W(HANDLE32 hConsoleInput
,
1300 LPINPUT_RECORD pirBuffer
,
1304 /* FIXME: Hmm. Fix this if we get UNICODE input. */
1305 return PeekConsoleInput32A(hConsoleInput
,pirBuffer
,cInRecords
,lpcRead
);
1309 /******************************************************************************
1310 * GetConsoleCursorInfo32 [KERNEL32.296] Gets size and visibility of console
1313 * hcon [I] Handle to console screen buffer
1314 * cinfo [O] Address of cursor information
1320 BOOL32 WINAPI
GetConsoleCursorInfo32( HANDLE32 hcon
,
1321 LPCONSOLE_CURSOR_INFO cinfo
)
1323 struct get_console_info_reply reply
;
1325 if (!CONSOLE_GetInfo( hcon
, &reply
)) return FALSE
;
1328 cinfo
->dwSize
= reply
.cursor_size
;
1329 cinfo
->bVisible
= reply
.cursor_visible
;
1335 /******************************************************************************
1336 * SetConsoleCursorInfo32 [KERNEL32.626] Sets size and visibility of cursor
1342 BOOL32 WINAPI
SetConsoleCursorInfo32(
1343 HANDLE32 hcon
, /* [in] Handle to console screen buffer */
1344 LPCONSOLE_CURSOR_INFO cinfo
) /* [in] Address of cursor information */
1346 struct set_console_info_request req
;
1350 if ((req
.handle
= HANDLE_GetServerHandle( PROCESS_Current(), hcon
,
1351 K32OBJ_CONSOLE
, GENERIC_WRITE
)) == -1)
1353 CONSOLE_make_complex(hcon
);
1354 sprintf(buf
,"\033[?25%c",cinfo
->bVisible
?'h':'l');
1355 WriteFile(hcon
,buf
,strlen(buf
),&xlen
,NULL
);
1357 req
.cursor_size
= cinfo
->dwSize
;
1358 req
.cursor_visible
= cinfo
->bVisible
;
1359 req
.mask
= SET_CONSOLE_INFO_CURSOR
;
1360 CLIENT_SendRequest( REQ_SET_CONSOLE_INFO
, -1, 1, &req
, sizeof(req
) );
1361 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
1365 /******************************************************************************
1366 * SetConsoleWindowInfo [KERNEL32.634] Sets size and position of console
1372 BOOL32 WINAPI
SetConsoleWindowInfo(
1373 HANDLE32 hcon
, /* [in] Handle to console screen buffer */
1374 BOOL32 bAbsolute
, /* [in] Coordinate type flag */
1375 LPSMALL_RECT window
) /* [in] Address of new window rectangle */
1377 FIXME(console
, "(%x,%d,%p): stub\n", hcon
, bAbsolute
, window
);
1382 /******************************************************************************
1383 * SetConsoleTextAttribute32 [KERNEL32.631] Sets colors for text
1385 * Sets the foreground and background color attributes of characters
1386 * written to the screen buffer.
1392 BOOL32 WINAPI
SetConsoleTextAttribute32(HANDLE32 hConsoleOutput
,WORD wAttr
)
1394 const int colormap
[8] = {
1401 TRACE(console
,"(%d,%d)\n",hConsoleOutput
,wAttr
);
1402 sprintf(buffer
,"%c[0;%s3%d;4%dm",
1404 (wAttr
& FOREGROUND_INTENSITY
)?"1;":"",
1406 colormap
[(wAttr
&0x70)>>4]
1408 WriteFile(hConsoleOutput
,buffer
,strlen(buffer
),&xlen
,NULL
);
1413 /******************************************************************************
1414 * SetConsoleScreenBufferSize [KERNEL32.630] Changes size of console
1417 * hConsoleOutput [I] Handle to console screen buffer
1418 * dwSize [I] New size in character rows and cols
1424 BOOL32 WINAPI
SetConsoleScreenBufferSize( HANDLE32 hConsoleOutput
,
1427 FIXME(console
, "(%d,%dx%d): stub\n",hConsoleOutput
,dwSize
.x
,dwSize
.y
);
1432 /******************************************************************************
1433 * FillConsoleOutputCharacterA [KERNEL32.242]
1436 * hConsoleOutput [I] Handle to screen buffer
1437 * cCharacter [I] Character to write
1438 * nLength [I] Number of cells to write to
1439 * dwCoord [I] Coords of first cell
1440 * lpNumCharsWritten [O] Pointer to number of cells written
1446 BOOL32 WINAPI
FillConsoleOutputCharacterA(
1447 HANDLE32 hConsoleOutput
,
1451 LPDWORD lpNumCharsWritten
)
1456 SetConsoleCursorPosition(hConsoleOutput
,dwCoord
);
1457 for(count
=0;count
<nLength
;count
++)
1458 WriteFile(hConsoleOutput
,&cCharacter
,1,&xlen
,NULL
);
1459 *lpNumCharsWritten
= nLength
;
1464 /******************************************************************************
1465 * FillConsoleOutputCharacterW [KERNEL32.243] Writes characters to console
1468 * hConsoleOutput [I] Handle to screen buffer
1469 * cCharacter [I] Character to write
1470 * nLength [I] Number of cells to write to
1471 * dwCoord [I] Coords of first cell
1472 * lpNumCharsWritten [O] Pointer to number of cells written
1478 BOOL32 WINAPI
FillConsoleOutputCharacterW(HANDLE32 hConsoleOutput
,
1482 LPDWORD lpNumCharsWritten
)
1487 SetConsoleCursorPosition(hConsoleOutput
,dwCoord
);
1488 /* FIXME: not quite correct ... but the lower part of UNICODE char comes
1491 for(count
=0;count
<nLength
;count
++)
1492 WriteFile(hConsoleOutput
,&cCharacter
,1,&xlen
,NULL
);
1493 *lpNumCharsWritten
= nLength
;
1498 /******************************************************************************
1499 * FillConsoleOutputAttribute [KERNEL32.241] Sets attributes for console
1502 * hConsoleOutput [I] Handle to screen buffer
1503 * wAttribute [I] Color attribute to write
1504 * nLength [I] Number of cells to write to
1505 * dwCoord [I] Coords of first cell
1506 * lpNumAttrsWritten [O] Pointer to number of cells written
1512 BOOL32 WINAPI
FillConsoleOutputAttribute( HANDLE32 hConsoleOutput
,
1513 WORD wAttribute
, DWORD nLength
, COORD dwCoord
,
1514 LPDWORD lpNumAttrsWritten
)
1516 FIXME(console
, "(%d,%d,%ld,%dx%d,%p): stub\n", hConsoleOutput
,
1517 wAttribute
,nLength
,dwCoord
.x
,dwCoord
.y
,lpNumAttrsWritten
);
1518 *lpNumAttrsWritten
= nLength
;
1522 /******************************************************************************
1523 * ReadConsoleOutputCharacter32A [KERNEL32.573]
1528 BOOL32 WINAPI
ReadConsoleOutputCharacter32A(HANDLE32 hConsoleOutput
,
1529 LPSTR lpstr
, DWORD dword
, COORD coord
, LPDWORD lpdword
)
1531 FIXME(console
, "(%d,%p,%ld,%dx%d,%p): stub\n", hConsoleOutput
,lpstr
,
1532 dword
,coord
.x
,coord
.y
,lpdword
);
1533 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
1538 /******************************************************************************
1539 * ScrollConsoleScreenBuffer [KERNEL32.612]
1544 BOOL32 WINAPI
ScrollConsoleScreenBuffer( HANDLE32 hConsoleOutput
,
1545 LPSMALL_RECT lpScrollRect
, LPSMALL_RECT lpClipRect
,
1546 COORD dwDestOrigin
, LPCHAR_INFO lpFill
)
1548 FIXME(console
, "(%d,%p,%p,%dx%d,%p): stub\n", hConsoleOutput
,lpScrollRect
,
1549 lpClipRect
,dwDestOrigin
.x
,dwDestOrigin
.y
,lpFill
);
1550 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);