Commit graph

119 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto edf419952d [CONSRV]
Try to do some archaeology of names: attempt to attribute some files to programmers who spent lot of time on them, based on SVN history (I might have forget some other ones).

svn path=/branches/ros-csrss/; revision=58730
2013-04-10 20:22:30 +00:00
Hermès Bélusca-Maïto d070d323fb [KERNEL32-CONSRV]
- Implement GetLargestConsoleWindowSize (and add a DPRINT to see what happens when Far 1.65 is launched).
- Implement SetConsoleWindowInfo in kernel32 and pre-implement its CONSRV counterpart.

svn path=/branches/ros-csrss/; revision=58726
2013-04-09 15:21:14 +00:00
Hermès Bélusca-Maïto 2358a3210f [CONSRV]
"Hack-fix" some headers to remove the forward declaration of typedef struct _CONSOLE *PCONSOLE;, which makes GCC 4.4.3 angry, but makes GCC 4.7.2 stay imperturbable.

svn path=/branches/ros-csrss/; revision=58725
2013-04-08 21:03:24 +00:00
Hermès Bélusca-Maïto 3a7f8d36e8 [BASESRV-CONSRV-WINSRV]
Code reorganization only: put public server apis definitions in a dedicated include to be included in the respective init.c files.

svn path=/branches/ros-csrss/; revision=58718
2013-04-07 23:39:39 +00:00
Hermès Bélusca-Maïto 882d71759c [CONSRV]
Code reorganization. Common functions declarations, shared between the console server and the frontends, are put inside a include/ subdirectory. Functions needed only for the console server are in the usual root directory. Functions used only for the frontends are in their corresponding directories in under frontends/.

svn path=/branches/ros-csrss/; revision=58717
2013-04-07 23:18:59 +00:00
Hermès Bélusca-Maïto 463b98e376 Sync with trunk r58687.
svn path=/branches/ros-csrss/; revision=58690
2013-04-06 15:28:22 +00:00
Hermès Bélusca-Maïto cae17bc374 [CONSRV]
Shut-up almost all the dprints.

svn path=/branches/ros-csrss/; revision=58689
2013-04-06 13:40:34 +00:00
Hermès Bélusca-Maïto 431cf24bb1 [CSRSRV]
Mispelling fix only.

[CONSRV]
Improve selection, implement "Marking", i.e. selection with keyboard, and implement transition "Marking" --> "Selection" (selection with mouse).

svn path=/branches/ros-csrss/; revision=58688
2013-04-06 13:18:19 +00:00
Hermès Bélusca-Maïto 6bb80fcd01 [CONSRV]
Allow passing into quick-edit and insert mode via the console properties dialog. Also make the context menu working.

svn path=/branches/ros-csrss/; revision=58634
2013-04-01 17:26:53 +00:00
Hermès Bélusca-Maïto 8a45602a5b [KERNEL32-CONSRV]
Implement (Get/Set)ConsoleDisplayMode.

[PSDK]
Reorganize wincon.h a little bit and add few new flags from MSDN / Wine's wincon.h (which was up-to-date compared to ours) and from https://sites.google.com/site/marckupper/utilities/setconsolemode (the ENABLE_AUTO_POSITION flag which happens to be set by default for consoles on Windows Vista+).

[CONSRV]
- Fix the implementation of Srv(Get/Set)ConsoleMode.
- Try to fix some mouse handling problems.
- Add a TEMPORARY HACK!!!! to circumvent one of the many bugs we have in user32/win32k concerning handling right-mouse clicks on windows titlebars.
The comment:
/*
 * HACK: !! Because, when we deal with WM_RBUTTON* and we do not
 * call after that DefWindowProc, on ReactOS, right-clicks on the
 * (non-client) application title-bar does not display the system
 * menu and does not trigger a WM_NCRBUTTONUP message too.
 * See: http://git.reactos.org/?p=reactos.git;a=blob;f=reactos/win32ss/user/user32/windows/defwnd.c;hb=HEAD#l1103
 * and line 1135 too.
 */

Tested with Far Manager 3 (TM)

Happy Easter !!

svn path=/branches/ros-csrss/; revision=58632
2013-04-01 00:23:34 +00:00
Hermès Bélusca-Maïto 146e44fdf7 [CONSRV]
Trigger WINDOW_BUFFER_SIZE_EVENT event when resizing the screen-buffer.

svn path=/branches/ros-csrss/; revision=58624
2013-03-31 00:47:44 +00:00
Hermès Bélusca-Maïto b0125170ac [PSDK]
Introduce GET_KEYSTATE_WPARAM, GET_NCHITTEST_WPARAM, GET_XBUTTON_WPARAM macros.

[CONSRV]
Fix double-click, mouse scrolling and add support for control keys.

svn path=/branches/ros-csrss/; revision=58623
2013-03-31 00:34:13 +00:00
Hermès Bélusca-Maïto e1f0919480 [CONSRV]
- Compile with Vista+ defines.
- Add basic mouse events support. Tested with Far Manager.

svn path=/branches/ros-csrss/; revision=58620
2013-03-30 22:54:47 +00:00
Hermès Bélusca-Maïto 22ecec636a [CONSRV]
Code reorganization only.

svn path=/branches/ros-csrss/; revision=58618
2013-03-30 21:25:27 +00:00
Hermès Bélusca-Maïto ac02b55ded [CONSRV]
Move frontend (i.e. gui or tui) code to a dedicated directory.

svn path=/branches/ros-csrss/; revision=58616
2013-03-30 20:40:08 +00:00
Hermès Bélusca-Maïto 01729482ae [CONSOLE.DLL]
- Fix passing and retrieving gui terminal front-end information.
- Fix default (global) console parameters saving.

[CONSRV]
- PSEH2-protect calls to CreateRemoteThread when 1. calling console app. control handlers and 2. retrieving console settings from console.dll.
- Introduce a new way of locking consoles when being used, and store them in a list.

svn path=/branches/ros-csrss/; revision=58615
2013-03-30 18:44:56 +00:00
Hermès Bélusca-Maïto 1e1a59fb22 Synchronize with trunk r58606.
svn path=/branches/ros-csrss/; revision=58607
2013-03-24 19:05:43 +00:00
Hermès Bélusca-Maïto 53eba1ba5f [CONSOLE.DLL-CONSRV]
- Further separate properties of the GUI terminal front-end and those independent of the UI.
- Fix some console initialization steps.

svn path=/branches/ros-csrss/; revision=58605
2013-03-24 17:08:10 +00:00
Hermès Bélusca-Maïto fe98b9ea97 [CONSRV]
Fix what I broke in revision r58447, namely at which process the terminal window belongs to.

svn path=/branches/ros-csrss/; revision=58557
2013-03-20 00:41:47 +00:00
Hermès Bélusca-Maïto 4bae574ebe [CONSRV]
Use a new helper function ConSrvConsoleProcessCtrlEvent to send control events to processes belonging to a given console.

svn path=/branches/ros-csrss/; revision=58556
2013-03-19 23:40:20 +00:00
Hermès Bélusca-Maïto f10a8c4fa9 [CONSRV]
Code beautification, no changes.

svn path=/branches/ros-csrss/; revision=58555
2013-03-19 22:05:38 +00:00
Hermès Bélusca-Maïto c70f992aa1 Synchronize with trunk r58528.
svn path=/branches/ros-csrss/; revision=58529
2013-03-16 22:10:42 +00:00
Hermès Bélusca-Maïto e2d2cb40e2 [CSRSRV]
Clarify few parts of code; remove unneeded comments and DPRINTs; start documentation of the CsrCreateProcess routine.

[BASESRV-CONSRV-WINSRV]
Correct the sizes of the API tables.

[SM]
Correct the API names.

svn path=/branches/ros-csrss/; revision=58464
2013-03-10 19:37:33 +00:00
Hermès Bélusca-Maïto 0a679dbf86 [CONSRV]
Attempt to fix terminal window positioning at initialization. Some work also needs to be done in console.dll.

svn path=/branches/ros-csrss/; revision=58463
2013-03-10 15:56:35 +00:00
Hermès Bélusca-Maïto 17c9d97fe7 [CONSRV]
- Fix console initialization / uninitialization and resources release when initialization fails.
- Remove unneeded DPRINTs.

svn path=/branches/ros-csrss/; revision=58462
2013-03-10 15:37:22 +00:00
Hermès Bélusca-Maïto 4ec191c413 [CONSOLE.DLL-CONSRV]
Fix cursor size.

svn path=/branches/ros-csrss/; revision=58459
2013-03-10 02:23:46 +00:00
Hermès Bélusca-Maïto 840ea98cba Synchronize with trunk r58457.
svn path=/branches/ros-csrss/; revision=58458
2013-03-10 01:01:36 +00:00
Hermès Bélusca-Maïto b4413b4ef8 [KERNEL32-USER32]
No need to check ApiMessage.Status if you also check the returned value of CsrClientCallServer because, according to dll/ntdll/csr/connect.c:CsrClientCallServer, the (only) return value of CsrClientCallServer _is_ equal to ApiMessage.Status (vide line 169).

svn path=/branches/ros-csrss/; revision=58456
2013-03-09 22:16:26 +00:00
Hermès Bélusca-Maïto 5819952ab9 [CONSRV-USER32-WINSRV]
Pre-synchrosize with trunk, by applying some changes from revision r58411.

svn path=/branches/ros-csrss/; revision=58455
2013-03-09 21:52:12 +00:00
Hermès Bélusca-Maïto 62f4efcc97 [KERNEL32-CONSRV]
Remove the old implementation of GetConsoleInputWaitHandle which was commented-out for some time.

[BASESRV]
Correct few names.

svn path=/branches/ros-csrss/; revision=58454
2013-03-09 21:21:37 +00:00
Hermès Bélusca-Maïto c708f46621 [NTDLL]
Fix CsrCaptureTimeout (verified against Windows Server 2003).

[KERNEL32-CSRSRV-BASESRV-CONSRV-WINSRV]
Clean the code: remove unuseful comments and dprints, reorganize a little bit few source files.

svn path=/branches/ros-csrss/; revision=58453
2013-03-09 21:08:23 +00:00
Hermès Bélusca-Maïto 7268b8776a [CONSRV]
Fix the initialization of screen buffers (concerning the cursor size).

[KERNEL32]
Fix almost all of the console winetests. Only 26 tests remain to be fixed, concerning principally WriteConsoleInputA/W and GetNumberOfConsoleInputEvents.

svn path=/branches/ros-csrss/; revision=58448
2013-03-09 01:39:49 +00:00
Hermès Bélusca-Maïto 818ee21a07 [CONSRV]
- Start to sort out things that depends only of the internals of a console, and things which are only related to "terminal emulators". Do it especially for (what I will call starting from now) the "GUI terminal emulator".
- Temporarily deactivate starting "TUI terminals".
- Temporarily break report that the terminal window is held by the current running console application in it (see r58107). This will be fixed later on.

svn path=/branches/ros-csrss/; revision=58447
2013-03-08 23:37:11 +00:00
Hermès Bélusca-Maïto beff3acbf2 [CONSOLE.DLL]
Use a new unique sample text for fonts and colors overview.

[CONSRV]
Remove few DPRINTs.

svn path=/branches/ros-csrss/; revision=58419
2013-03-03 17:39:44 +00:00
Hermès Bélusca-Maïto 28842d99ad [CONSOLE.DLL-KERNEL32-CONSRV]
Fix the console properties dialog, when launching and transmitting console properties. Before, the properties dialog was directly launched by the console server (consrv), running with CSRSS (System) privileges, what constituted a security hole. Now, I create a remote thread in the running process owning the console for launching the properties dialog (thus it has only user privileges, and not System ones anymore). For that purpose, I basically took the technique described in the following paper (Cesar Cerrudo, "Story of a dumb patch", http://www.argeniss.com/research/MSBugPaper.pdf or http://www.scn.rain.com/~neighorn/PDF/MSBugPaper.pdf), where basically the console server shares the console properties via a shared memory section with the console properties dialog dll. The address of the thread which launches the dialog in the context of the console app is given to the console server the same way as we do for the control handler (called e.g. when you press Ctrl-C, etc...)
Of course this is quite hackish, because you have the GUI interface split between the console server and the console properties dialog dll. Something far more elegant would be to put all the GUI thingie into a dedicated dll or exe, running with the same privileges as the console program itself (a kind of console -- or terminal -- emulator).

[CONSOLE.DLL]
Fix retriving / setting colors.c and other things.

[CONSRV.DLL]
- Fix retrieving / setting console properties from the registry (via the HKCU\Console\* keys), via the shell shortcuts (not totally done at the moment, because somebody has to implement properly that thing : http://msdn.microsoft.com/en-us/library/windows/desktop/bb773359(v=vs.85).aspx (NT_CONSOLE_PROPS structure stored as a shortcut data block) (at application launching time), and via the console properties dialog.
- Few DPRINTs removed.

svn path=/branches/ros-csrss/; revision=58415
2013-03-03 15:35:12 +00:00
Hermès Bélusca-Maïto f4d53fbd91 [KERNEL32-CONSRV]
- Introduce a CONSOLE_PROPS structure to hold console properties such as its title or startup attributes it should have. Initialized at console application launch time. I have to see how could it be possible to merge this structure with some parts of the GUI_CONSOLE_DATA structure and of the ConsoleInfo structure from console.dll (in /dll/cpl).
- Use a helper function to initialize the CONSOLE_PROPS structure in kernel32, at console app start or when calling AllocConsole.
- In BasepInitConsole, do initialization of CONSOLE_PROPS and related only if we are about to launch a console app.

[CONSRV]
- Adapt CONSOLE_CONNECTION_INFO and CONSOLE_ALLOCCONSOLE structures to take into account CONSOLE_PROPS.
- Fix the way we are setting console titles.
- Add experimental support for loading console properties and title and icon from shell links, thanks to the helper LoadShellLinkInfo. However I'm using there Shell COM facility to extract link properties (I could do it "the RAW way", however I would then know the format of link files, that I don't know and that I don't want to mix up with the console code). Therefore I must add dependencies to uuid and ole32 libraries. Note that icons are used in GUI consoles only (use the PrivateExtractIconExW function to retrieve both handles to the big and small icons at the same time).

Part 1/2

[CONSRV]
- Remove an unuseful xxxInitScreenBuffer function in the virtual functions console table.
- In GUI_CONSOLE_DATA structure and related functions, temporarily explicitely mark which members may be used for both GUI and TUI consoles (for a future simplification).
- Add temporary debug prints when we are setting console icon, to see the flow of calls (will be removed just before merging back to trunk).
- Add temporary debug prints in ConSrvInitConsoleScreenBuffer and ConioDeleteScreenBuffer, to figure out how SBs are initialized.

svn path=/branches/ros-csrss/; revision=58305
2013-02-10 12:36:57 +00:00
Hermès Bélusca-Maïto 8cf2fce7be Fix Japanese translation
svn path=/branches/ros-csrss/; revision=58277
2013-02-02 22:42:05 +00:00
Hermès Bélusca-Maïto 927f80ab76 [CONSRV]
Convert language resource files into UTF-8

svn path=/branches/ros-csrss/; revision=58273
2013-02-02 22:08:18 +00:00
Hermès Bélusca-Maïto 54293ba008 [CONSRV]
- Further compactify console allocation / attach code by putting common code into helper functions.
- Now, the default title of a console window is... "ReactOS Console" (and not command prompt since a console window isn't only reserved to command prompts).

svn path=/branches/ros-csrss/; revision=58260
2013-02-01 23:36:23 +00:00
Hermès Bélusca-Maïto 03d1c009f0 [CONSRV]
- Add a macro which specifies how much space chars a TAB is.
- Implement BELL ANSI character handling (basic) and add temporary DPRINTs to see who is called (by the way, Beep() functions seems not to work correctly).

svn path=/branches/ros-csrss/; revision=58253
2013-01-30 22:59:47 +00:00
Hermès Bélusca-Maïto bb519801e2 - Sync with trunk r58248 to bring the latest changes from Amine (headers) and others (hebrew translation, etc...)
- Include only the necessary headers in csrss/csrsrv/basesrv/consrv/winsrv.

svn path=/branches/ros-csrss/; revision=58249
2013-01-28 22:45:53 +00:00
Hermès Bélusca-Maïto 49ea03a6b9 [CONSRV]
Modify driver acquiring/releasing privilege according to r58233. The corresponding modification in services.c will be done at the next synchronization.

svn path=/branches/ros-csrss/; revision=58234
2013-01-26 23:16:34 +00:00
Hermès Bélusca-Maïto 7846f054ff [KERNEL32]
Clean-up IntReadConsoleOutputCode a little bit.

[CONSRV]
Fix a buffer overflow in SrvReadConsoleOutputString, which was translated sometimes into heap corruption and assert, triggered when freeing a remote captured buffer in csrsrv, when executing kernel32_winetest console, just during a call to ReadConsoleOutputCharacterA.
Nevertheless I still keep the culprit code (commented-out now) because it might be useful in the future.

svn path=/branches/ros-csrss/; revision=58229
2013-01-26 19:07:59 +00:00
Hermès Bélusca-Maïto 6d28ec8640 [CONSRV]
Fix input/output (read/write) waiter threads notifications. Now console is usable.
Go and test it! :D

svn path=/branches/ros-csrss/; revision=58225
2013-01-26 16:12:05 +00:00
Hermès Bélusca-Maïto 50a9e6a485 [CONSRV]
Rename functions to their new scheme: ConSrv* instead of Win32Csr* or Conio* (with some exceptions for the latter case).
No code changes.

svn path=/branches/ros-csrss/; revision=58213
2013-01-24 22:41:33 +00:00
Hermès Bélusca-Maïto fe7b0f74d3 [CONSRV]
- Start to implement waiting threads notifications. They can be notified by:
  * the required action (screen displaying lock/unlock, presence of new characters in the input buffer),
  * the fact that the application terminates,
  * we close a (input) handle.
  TODO: When we notify them by calling CsrNotifyWait, they are not dereferenced automatically, but they can be
  by calling a dedicated CSR function. We need to know where it is the best to dereference them.
- Correct a bug introduced in revision r58191, which broke console input mode changes (in SrvSetConsoleMode and SrvGetConsoleMode).

svn path=/branches/ros-csrss/; revision=58211
2013-01-24 20:48:42 +00:00
Hermès Bélusca-Maïto 670f805765 Revert unwanted changes.
svn path=/branches/ros-csrss/; revision=58210
2013-01-23 23:21:39 +00:00
Hermès Bélusca-Maïto 85da7a06cd [CONSRV]
- Start to uniformize some helpers' names :
  ConioLockConsole --> ConioGetConsole and ConioUnlockConsole --> ConioReleaseConsole
  ConioLockInputBuffer --> ConioGetInputBuffer and ConioUnlockInputBuffer --> ConioReleaseInputBuffer
  ConioLockScreenBuffer --> ConioGetScreenBuffer and ConioUnlockScreenBuffer --> ConioReleaseScreenBuffer
  but the overall naming must be revamped.
- Add them a boolean parameter to determine whether or not we should lock the console. It is useful to not lock an already locked console when input / output waiting threads are called,
  because these are called from functions which lock the console.
- In the GUI console window message loop, after retrieving a pointer to the corresponding console, lock it before calling funtions in the message dispatcher (and unlock the console at the end).
- Use PostMessage instead of SendMessage for "sending" GUI messages to console windows, to avoid possible deadlocks (because of console locking).

- Add temporary /// LOCK /// comments to easily localize where I deactivated extra console (un)locking code (this remains to be analyzed further).

svn path=/branches/ros-csrss/; revision=58205
2013-01-22 23:28:51 +00:00
Hermès Bélusca-Maïto d064e48b32 Code formatting only.
svn path=/branches/ros-csrss/; revision=58199
2013-01-20 22:26:06 +00:00
Hermès Bélusca-Maïto 40ee602754 [CONSRV]
Add extra parentheses in macros arguments usage.

svn path=/branches/ros-csrss/; revision=58198
2013-01-20 22:15:21 +00:00