Commit graph

10 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto cef1016047 [CONSRV-WINSRV]
Now that the console server works fine, move it into its real place (as in Windows), that is, inside winsrv.dll, instead of hosting it in consrv.dll.

svn path=/trunk/; revision=59461
2013-07-13 04:54:49 +00:00
Hermès Bélusca-Maïto b16b88d434 [CONSRV]
- Use a handle table for storing consoles. Now checking validity of console handles is done in O(1) instead of O(n) as before.
  I will see later on whether it would be good to have both a handle table and a linked list (which is removed here) for storing them
  (when condrv will be a real console driver, handles to consoles will be obtained as you would obtain usual handles to devices, etc...
  so that consoles will be internally stored in a linked list again).
- Add a "dummy" frontend to have the possibility to adopt default actions when no frontend is attached to a console, and to always have
  a valid virtual table for them.

svn path=/trunk/; revision=59435
2013-07-06 19:47:53 +00:00
Hermès Bélusca-Maïto f40518b097 [CONSRV]
Hey Arch, how do you define functions types?! Fix MSVC builds.

svn path=/trunk/; revision=59306
2013-06-23 10:55:18 +00:00
Hermès Bélusca-Maïto c34686cca0 [CONSRV]
Start to separate better the CSR console server layer from the pure set of console functions (which will constitute a future console driver called... condrv :) ), and rework the terminal frontends interface.
Now load the frontends by order :
- the tui if we're in console mode
- the gui, otherwise.
(It's a temporary solution)
More modifications to come !

svn path=/trunk/; revision=59297
2013-06-23 00:18:47 +00:00
Hermès Bélusca-Maïto 1e2b31b8bc [KERNEL32-CONSRV]
- Implement SetConsoleCursor and ShowConsoleCursor (set the shape of the cursor, and show/hide it). It appears that SetConsoleCursor acts only on graphics screen buffers (tested on Windows).
  I personnaly think it's a limitation we can suppress, but at the moment I keep it.
- Implement SetConsoleMaximumWindowSize which does nothing else than returning TRUE but doesn't give any constraint on the maximum size of the console window (tested on Windows Server 2003).

See http://undoc.airesoft.co.uk/kernel32.dll/SetConsoleCursor.php , http://undoc.airesoft.co.uk/kernel32.dll/ShowConsoleCursor.php and http://undoc.airesoft.co.uk/kernel32.dll/SetConsoleMaximumWindowSize.php for more details.

Useful for the NTVDM interface !

[CONSRV:Gui frontend]
- Fix "Select all" action.
- Enable or disable "Copy" and "Paste" commands in the edition menu.

svn path=/trunk/; revision=59135
2013-06-01 22:49:50 +00:00
Hermès Bélusca-Maïto 8765fbb397 [KERNEL32-CONSRV]
- Implement ConsoleMenuControl; see http://undoc.airesoft.co.uk/kernel32.dll/ConsoleMenuControl.php for more information.
- Implement SetConsoleMenuClose; see http://www.mail-archive.com/harbour@harbour-project.org/msg27509.html (or http://harbour-devel.1590103.n2.nabble.com/Question-about-hb-gt-win-CtrlHandler-usage-td4670862i20.html ) for more information.

[CONSRV]
Remove two unneeded DPRINTs.

svn path=/trunk/; revision=59112
2013-05-30 00:50:03 +00:00
Hermès Bélusca-Maïto 7c2b066810 [CONSOLE.CPL-KERNEL32]
Fix some compilation warnings with MSVC.

[KERNEL32-CONSRV]
- Implement console graphics screen buffers, as described in http://blog.airesoft.co.uk/2012/10/things-ms-can-do-that-they-dont-tell-you-about-console-graphics/ .
  The idea is that the console server creates a memory shared section to be shared with the client console application (it increases performance). A mutex is used to "say" to the console server that he can repaint the screen. The function InvalidateConsoleDIBits is implemented too. The definition of the structure CONSOLE_GRAPHICS_BUFFER_INFO comes directly from the site.
- CreateConsoleScreenBuffer was modified to be able to create such buffers.
This is needed for a working NTVDM-like application.

[CONSRV]
- Rework the console buffer structures so that text-mode buffers and graphics-mode buffers can "inherit" from an "abstract" structure, CONSOLE_SCREEN_BUFFER. Add few helper functions for manipulating them.
- Reorganize the output code in "graphics.c" and "text.c" files to separate text-mode only code from graphics-mode only code, both in the console server and in the GUI front-end.

Other fixes:
- Fix mouse handling (left and right clicks when one goes away from the "Selection" mode); do not handle mouse signal when we reactivate the GUI front-end window by a click.
- Fix GetLargestConsoleWindowSize API in console server side. Now pressing Alt+F9 in Far Manager to "change" the "video" mode works correctly.

Finally:
- Start to implement a (fake, i.e. not using directly a VGA driver) console fullscreen mode. Currently Alt-Enter key presses call a stub which just alternates DPRINTing between "switch to fullscreen mode" and "switch to windowed mode".

Images here:
- Example of an application (a 16-bit emulator by Mysoft) which uses the console graphics screen-buffer functionality: http://img577.imageshack.us/img577/1693/mysoftemulatorargon.png
- A potpourri of console applications which use graphics screen-buffers: http://img571.imageshack.us/img571/6526/consoledelirium.png

Enjoy :)

svn path=/trunk/; revision=59099
2013-05-29 00:29:07 +00:00
Hermès Bélusca-Maïto c3c6b6199f [CONSRV]
- Use new helpers ConsoleAllocHeap and ConsoleFreeHeap instead of RtlAllocateHeap and RtlFreeHeap, to be able to use also debug heaps etc...
- Initialize completely CONSOLE and CONSOLE_SCREEN_BUFFER structures to avoid using unitializing fields, that can be prone to bugs.
- Do not unnecessarily lock the per-process IO handles table.
- Validate the console pointers when calling SrvCloseHandle / SrvVerifyConsoleIoHandle / SrvDuplicateHandle (so that we are sure to do valid operations for console applications, and fail properly for GUI ones).

- Fix a bug caught by [TheFlash] which unveiled only on livecds (why??) as random CSR heap corruptions. It was caused by corrupting the heap by freeing invalid IO handles when freeing the handles table inherited by default when starting a console application. I reworked the initialization code a bit and the freeing code to fix this problem.
  This bug was diagnosed with the help of Thomas Faber's debug heap (see http://www.reactos.org/wiki/User:ThFabba/Debug_Heap ), that I've augmented a bit (with dumping functions when a heap block was found invalid).

- Now reenable the CSR heap usage.

CORE-7157 #resolve #comment Resolved in revision 59001. Thanks for your help :D

svn path=/trunk/; revision=59001
2013-05-12 00:20:15 +00:00
Hermès Bélusca-Maïto 9c6d52c545 [CONSRV]
Be sure to use our local heap instead of the current application heap, to store the console title.
To simplify the code, I introduced helper functions based on well-known Rtl functions.

svn path=/trunk/; revision=58925
2013-05-04 15:31:19 +00:00
Hermès Bélusca-Maïto 599a7affa3 [REACTOS]
Merge of the ros-csrss branch created with a three-fold purpose:

- Use the new Windows-compatible Client-Server Runtime Subsystem (csrss + csrsrv)
written by Alex Ionescu to replace the old hacked one. Also the CSR client part,
residing in ntdll, is updated. Some work also done on the dlls side, which
communicate with CSR, namely kernel32.

- Replace our very old win32csr.dll CSR server by the collection basesrv.dll /
winsrv.dll as it is done under Windows.

- Since the console subsystem is (for historical purposes on Windows) the
only subsystem which exploits all the possibilities of the CSR, I decided to
put it in a new CSR dll called 'consrv.dll', even if on Windows it is included
together with other APIs inside the winsrv dll (since Windows NT 3.1 release)
(I took the name 'consrv' from the dll where it was included in Windows NT 3.1
beta from October 1991). Some work was also done on its internal architecture
(the external interface is of course unchanged for compatibility reasons) and a
two-layer approach was developed, using the existing idea of console functions +
GUI or TUI we already had in win32csr:
	* the "console server" which dialogs with the console applications,
and which maintains a list of all the created consoles.
	* different "front-ends" corresponding to where you want to output
the information (~= console hardware) (Work-In-Progress).
Another idea would be to make those front-ends dynamically-loadable (instead
of being compiled inside consrv).
- I also fixed some parts of the console properties dialog box.

More information can be found in http://www.reactos.org/archives/public/ros-dev/2013-April/016121.html

CORE-122 CORE-2510 CORE-7002 #resolve #comment Committed in revision r58xxx.

svn path=/trunk/; revision=58770
2013-04-15 19:32:00 +00:00