Commit graph

20 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto bc73176945 [CONSRV]
HeapAlloc --> RtlAllocateHeap
HeapFree --> RtlFreeHeap
GetProcessHeap --> RtlGetProcessHeap

svn path=/branches/ros-csrss/; revision=58168
2013-01-13 19:18:54 +00:00
Hermès Bélusca-Maïto df7477717c [KERNEL32]
- 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
2013-01-13 17:07:25 +00:00
Hermès Bélusca-Maïto fc78a963d0 [CONSRV]
Renaming CSRSS_... structures into CONSOLE_...

svn path=/branches/ros-csrss/; revision=58120
2013-01-05 23:37:04 +00:00
Hermès Bélusca-Maïto 86fa2ba4e0 [KERNEL32-CONSRV]
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
2013-01-05 23:10:12 +00:00
Hermès Bélusca-Maïto 7851c1a1c2 [WIN32K]
- Start to implement NtUserConsoleControl to allow the console server define Console Window Class atom.
- In UserInitialize, initialize the current thread by a call to UserCreateThreadInfo.
- In UserCreateThreadInfo, set the TIF_CSRSSTHREAD flag for threads created by CSRSS.
- In NtUserQueryWindow, when querying the process/thread ID associated to a given window, check whether the window was created by CSRSS and if so, if this is a Console window, get the process/thread ID of the associated console process (console leader process), instead of the CID of CSRSS.

[CONSRV]
- Introduce the concept of console leader process (to be used as the process owning the console window).
- Introduce extra console window information to store the PID and TID of the console leader process via new internal flags to be used by GetWindowLong.
- Effectively set the console window console leader CID at its creation.
- Improve CsrInitConsole to set a console leader process to the console being created.

This fixes http://jira.reactos.org/browse/CORE-122 in this branch.

[CONSRV-WIN32K]
Fix various code misspellings.

svn path=/branches/ros-csrss/; revision=58107
2013-01-04 00:41:10 +00:00
Hermès Bélusca-Maïto 31776e274a [CONSRV]
Revert unwanted changes brought accidentally in r58104.

svn path=/branches/ros-csrss/; revision=58105
2013-01-03 17:47:34 +00:00
Hermès Bélusca-Maïto e4d97e422f [KERNEL32]
Silent more debug prints and remove an unused DPRINT1 I've introduced in r57666.

svn path=/branches/ros-csrss/; revision=58104
2013-01-03 17:42:27 +00:00
Hermès Bélusca-Maïto dd5a9c5231 [CONSRV]
- Fix console apps initialization.
- Add some debug output (NOTE TO MYSELF: remove them when all things work).
- Rewrite ConsoleNewProcess.
- Reorganize SrvAllocConsole and create ConsoleConnect based on SrvAllocConsole.
- Create ConsoleDisconnect which undoes what ConsoleConnect and ConsoleNewProcess did.
- Rework a little bit CsrInitConsole.

Now the console app. initialization algorithm is the following:

1- A process is created, its type (GUI or CUI) is determined (kernel32 and basesrv).
2- ConsoleNewProcess is called (consrv) and makes this new process inherit the console handles table from its parent
   (NOTE: this is done for all CUI processes, because at this point, we still don't know whether we must inherit
   the handles from the parent or not).
3- (back in kernel32) In BasepInitConsole, we determine whether or not we must create a new console window or use
   the parent's one or not using one at all. We (as a client) connect to the console server (consrv) (via CsrClientConnectToServer)
   which in turn (via CSRSS mechanism) calls ConsoleConnect. For GUI processes we do nothing. For CUI processes, we initialize
   a new console based on properties set in BasepInitConsole.
4- When a process dies, ConsoleDisconnect is called and whether it is a GUI or CUI process, we revert the actions done previously.

Part 2/2

TODO: - Debug the CSR waits.
      - Work on the console properties property-sheet.
      - See what can be done on http://jira.reactos.org/browse/CORE-122

svn path=/branches/ros-csrss/; revision=58098
2013-01-02 00:32:20 +00:00
Hermès Bélusca-Maïto ca2cc847d2 [CONSRV]
- Delete all the remnants of Win32CsrValidateBuffer calls, which were replaced by standard CsrValidateMessageBuffer calls, and therefore delete the unused server.c file.
- Adapt WriteConsole API to use CSR waits. This replaces the old event-based waiting.

TODO: Dereference all the waits in Console->WriteWaitQueue.

svn path=/branches/ros-csrss/; revision=57819
2012-12-08 16:13:16 +00:00
Hermès Bélusca-Maïto 0d59b8df65 [KERNEL32]
- 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
2012-12-08 00:39:24 +00:00
Hermès Bélusca-Maïto ec2194eefa [CONSRV]
Correct a debug message.

svn path=/branches/ros-csrss/; revision=57758
2012-11-24 13:04:28 +00:00
Hermès Bélusca-Maïto 2d18c1a929 Synchronize up to trunk's revision r57756.
svn path=/branches/ros-csrss/; revision=57757
2012-11-24 13:02:15 +00:00
Hermès Bélusca-Maïto feb045c64b [CONSRV]
Fix a DPRINT.

svn path=/branches/ros-csrss/; revision=57728
2012-11-18 13:16:58 +00:00
Hermès Bélusca-Maïto de31fffea8 [KERNEL32/CONSRV]
- Use new structures and api indices namings (as usual).

[CONSRV]
- Merge CSRSS_SET_TITLE and CSRSS_GET_TITLE into CSRSS_CONSOLE_TITLE.
- Merge CSRSS_GET_CONSOLE_(OUTPUT_)CP and CSRSS_SET_CONSOLE_(OUTPUT_)CP into CSRSS_CONSOLE_CP.
- NtDuplicateObject(GetCurrentProcess(), ... ---> NtDuplicateObject(NtCurrentProcess(), ...
- Use CsrValidateMessageBuffer instead of Win32CsrValidateBuffer.
- Use CONSOLE_PROCESS_DATA structure.

TODO: Remove a DPRINT1 checkpoint in SrvAllocConsole after future tests are OK.

svn path=/branches/ros-csrss/; revision=57727
2012-11-18 13:10:03 +00:00
Hermès Bélusca-Maïto 56190eec33 [KERNEL32]
- Make some functions compliant with the new structures and server apis indices names.

[KERNEL32/CONSRV]
- Merge CSRSS_SET_CONSOLE_MODE and CSRSS_GET_CONSOLE_MODE into CSRSS_CONSOLE_MODE.
- Rename CSRSS_SETGET_CONSOLE_HW_STATE into CSRSS_CONSOLE_HW_STATE.

svn path=/branches/ros-csrss/; revision=57724
2012-11-17 23:07:59 +00:00
Hermès Bélusca-Maïto dab294603f [KERNEL32/CONSRV]
- Make OpenConsole call only one server api, namely SrvOpenConsole, which was known before under the name CsrGetHandle (this latter function was removed in r57689 by error).
- Merge CSRSS_GET_INPUT_HANDLE and CSRSS_GET_OUTPUT_HANDLE structures into CSRSS_OPEN_CONSOLE (used by the functions named above).

[CONSRV]
- Add SrvOpenConsole (copied from CsrGetHandle), and add DPRINT1s to it.
- Load the localized string "Command Prompt" using the Server DLL's instance handle instead of calling GetModuleHandleW.
- Make use of CONSOLE_PROCESS_DATA structures.

svn path=/branches/ros-csrss/; revision=57723
2012-11-17 22:42:04 +00:00
Hermès Bélusca-Maïto d81d8d6116 [CSR/CONSRV/WINSRV]
- Move some structures to better place, fix code.

svn path=/branches/ros-csrss/; revision=57619
2012-10-25 21:37:52 +00:00
Hermès Bélusca-Maïto b507bd0612 [CSR/BASESRV/CONSRV/WINSRV]
- Fix code headers. No code changes.
- Rename csrcl.h to csr.h for readability purposes.
- exitros.c --> shutdown.c

svn path=/branches/ros-csrss/; revision=57618
2012-10-25 20:40:41 +00:00
Hermès Bélusca-Maïto 1827b99497 [CONSRV]
- Add consrv to compilation. It compiles now \o/
- Convert the used console-csrss structures to the new ones.

[CSR]
- Continue to move some structures, and temporary activate a symbol.

[WIN32CSR]
- Clean a header.

svn path=/branches/ros-csrss/; revision=57602
2012-10-23 22:31:36 +00:00
Hermès Bélusca-Maïto 608c1e0428 [CONSRV/WIN32CSR]
- Move all the console subsystem from win32csr to a new server dll called consrv.dll (instead of putting it directly to winsrv.dll). It's because I want to rework on this later on.
Many things must be done in order to achieve the moving (renaming functions, etc...). Tables & symbol names come from http://j00ru.vexillium.org/csrss_list/api_list.html as usual,
but here I took the Win 2k3 ones and I added few Win 7 functions which already existed in our codebase. The other table names are guessed based on what originally existed in csrsrv
and so on. Many stubs are also missing.
Cultural remark: consrv.dll originally existed in Beta releases of Windows NT 3.1 (e.g. the October 1991 one), but was soon merged with winsrv.dll and thus, in subsequent versions of
Windows, the console subsystem is also found in winsrv.dll. See http://www.logotypes.se/NT310CSRSS.txt and http://j00ru.vexillium.org/?p=349#comment-1883. One has to wait until
Windows 7 to see it moving again to conhost.exe.

[CSRSRV]
- Add an explanation comment on what the ValidTable member in the CSR_SERVER_DLL structure is for.

svn path=/branches/ros-csrss/; revision=57597
2012-10-22 23:55:51 +00:00
Renamed from win32ss/user/win32csr/console.c (Browse further)