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
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
- 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
- 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
Implement the usage of the STARTF_TITLEISLINKNAME flag (in a STARTUPINFO structure, it signals that the program was started from a shell link, and therefore its lpTitle member holds the path of the link).
What I do is that, in CShellLink::InvokeCommand (called when a shortcut is being executed), I initialize the SHELLEXECUTEINFO structure such that we know that we are starting from a shortcut (use the
SEE_MASK_HASLINKNAME flag), and to hold the path to the flag I use its lpClass member (which is not used for other things in this code path). Then the whole thing is passed to ShellExecuteExW which, in turn,
calls the SHELL_ExecuteW function. This function reads the SHELLEXECUTEINFO structure and, if it has the flag SEE_MASK_HASLINKNAME (or SEE_MASK_HASTITLE too, if somebody also uses lpClass to pass a particular
title for the startup), we use the forementioned lpClass member, holding the link path, as the title (lpTitle member) of a new STARTUPINFO object used when calling CreateProcess (and thus, launching the
new application). So that this application will be aware that she was launched via a link (therefore we become compliant with the STARTF_TITLEISLINKNAME documentation).
svn path=/branches/ros-csrss/; revision=58480
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
Remove the old implementation of GetConsoleInputWaitHandle which was commented-out for some time.
[BASESRV]
Correct few names.
svn path=/branches/ros-csrss/; revision=58454
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
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
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
- Add an icon.
- Fix some labels in the property box and the disposition of controls in english and french resources (not in all because positions change between languages and I've no time synchronizing by hand all the resource files, removing the differences).
svn path=/branches/ros-csrss/; revision=58343
Code reorganization only : move the console-related initialization functions into a dedicated file, and create a specific header to hold console function definitions.
svn path=/branches/ros-csrss/; revision=58306
- 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
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
Introduce new helper functions Win32CsrInitHandlesTable and Win32CsrAllocateConsole and use them in many places (in ConsoleConnect, SrvAllocConsole and SrvAttachConsole).
svn path=/branches/ros-csrss/; revision=58184
Fix support for CONIN$ and CONOUT$, and add support for CON special file
(now, writing to C:\CON or C:\somepath\CONIN$ or C:\anotherpath\CONOUT$ works).
svn path=/branches/ros-csrss/; revision=58182
- Correct a error return code (in AllocConsole).
- Implement AttachConsole (inspired by AllocConsole).
[CONSRV]
- Correct a error return code (in AllocConsole).
- Introduce helper functions to simplify console-initialization code.
- Implement server-side of AttachConsole (I used pieces of code from ConsoleNewProcess, ConsoleConnect and SrvAllocConsole).
Some debug prints were introduced (for debug-purposes :P), will be removed when all things work.
TODO: have a look on the handles code.
svn path=/branches/ros-csrss/; revision=58166
Rename some structures (CSRSS_... ---> CONSOLE_...) and clarify what the ConsoleHandle members are for (--> OutputHandle or InputHandle).
No code changes otherwise.
svn path=/branches/ros-csrss/; revision=58119
- Fix console apps initialization.
- Introduce a helper function InitConsoleCtrlHandling for initializing console control handling.
- We now initialize the new created console when connecting the client (kernel32) to the server (consrv) by calling CsrClientConnectToServer with real parameters (not dummy ones).
- Add/activate some debug prints (will be removed when all things work).
Part 1/2
svn path=/branches/ros-csrss/; revision=58096
- Code reorganization.
- In particular, move IsConsoleHandle macro to a place which it can be used by both kernel32 and consrv.
svn path=/branches/ros-csrss/; revision=58063
* HANDLE_TYPE --> CONSOLE_HANDLE_TYPE because it hits "previous" definition of this enumeration (a totally different one from win32ss/include/ntuser.h)
* Temporarily add a dummy member to the CONSOLE_CONNECTION_INFO structure, to make MSVC happy.
svn path=/branches/ros-csrss/; revision=58055
- Simplify IntGetConsoleInput and IntReadConsole.
[CONSRV]
- Implement event waiting for reading console input buffer with CSR wait blocks. This replaces the event-based waiting which, after being moved from client-side (kernel32) to server-side (see r57721), made all consoles hang when one of them was waiting for new input.
TODO: Dereference all the waits in Console->ReadWaitQueue.
svn path=/branches/ros-csrss/; revision=57817
Re-fix part of the capture-buffer offset setting, based on what I understood from all my previous investigations. It reverts a little part of r57673 but fixing some existing bugs there.
svn path=/branches/ros-csrss/; revision=57809
Deactivate the code of GetConsoleInputWaitHandle, because it calls a function that doesn't seem to appear in the console server apis listed in http://j00ru.vexillium.org/csrss_list/api_list.html (and that I haven't included in the console server apis list), until I find a better solution. It fixes compilation.
[CONSRV]
- Code reorganization
- Introduce the CONSOLE_CONNECTION_INFO structure needed for initializing consoles when launching a program (see http://svn.reactos.org/svn/reactos/trunk/reactos/lib/kernel32/misc/dllmain.c?r1=16826&r2=16825&pathrev=16826), instead of calling AllocConsole. Not used at this time.
Now the branch compiles.
svn path=/branches/ros-csrss/; revision=57749
When calling CsrClientConnectToServer with a valid connection info user buffer, after capturing the buffer and calling CsrClientCallServer, do not forget to copy back to the user buffer the updated connection info and to free the capture buffer !
svn path=/branches/ros-csrss/; revision=57743
- Merge IntWriteConsoleOutputCharacter and WriteConsoleOutputAttribute functions into IntWriteConsoleOutputCode helper functions, which is used inside WriteConsoleOutputAttribute and WriteConsoleOutputCharacterW/A.
- In server-side, merge CsrWriteConsoleOutputChar and CsrWriteConsoleOutputAttrib into the server API SrvWriteConsoleOutputString.
- The structures CSRSS_WRITE_CONSOLE_OUTPUT_CHAR and CSRSS_WRITE_CONSOLE_OUTPUT_ATTRIB are merged into CSRSS_WRITE_CONSOLE_OUTPUT_CODE.
[CONSRV]
- Add a CsrValidateMessageBuffer usage.
svn path=/branches/ros-csrss/; revision=57740
- Modify the helper function IntWriteConsole to make it use of capture buffers for passing things to write.
- Now, the loop disappears.
- I moved the pause-event wait (introduced in revision r47359) inside consrv, and (concerning the server-api-part SrvWriteConsole), especially in the ConioWriteConsole function, to be sure that all functions calling ConioWriteConsole become sensible to pause event. This REALLY NEEDS testing (and of course the code needs cleaning of the introduced comments, when I'm sure it works).
svn path=/branches/ros-csrss/; revision=57738