Commit graph

58 commits

Author SHA1 Message Date
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 c0399e88a6 [KERNEL32/CONSRV]
- 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
2012-12-30 21:02:12 +00:00
Hermès Bélusca-Maïto dba80b614b Sync with trunk revision r58045 to bring the corrections on configure.cmd and on widl/wpp.
svn path=/branches/ros-csrss/; revision=58046
2012-12-29 20:57:10 +00:00
Hermès Bélusca-Maïto f44e914e80 Sync with trunk r58033.
svn path=/branches/ros-csrss/; revision=58034
2012-12-28 23:37:33 +00:00
Hermès Bélusca-Maïto 3d2c0a805b - Synchronize up to trunk's revision r57864.
- [CONSRV/WINSRV] Add langage definition support.

svn path=/branches/ros-csrss/; revision=57865
2012-12-10 23:01: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 24087a3b01 Synchronize up to trunk's revision r57784.
svn path=/branches/ros-csrss/; revision=57785
2012-11-30 21:32:42 +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 90229a39a0 [KERNEL32/CONSRV]
- 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
2012-11-19 23:26:36 +00:00
Hermès Bélusca-Maïto ef1e1fc82b [KERNEL32/CONSRV]
- 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
2012-11-19 21:48:22 +00:00
Hermès Bélusca-Maïto e71f1dd200 [KERNEL32/CONSRV]
- Merge IntFillConsoleOutputCharacter and FillConsoleOutputAttribute functions into IntFillConsoleOutputCode helper and make it used by FillConsoleOutputAttribute/CharacterW/A.
- In server-side, CsrFillOutputChar and CsrFillOutputAttrib are merged into SrvFillConsoleOutput.
- Merge CSRSS_FILL_OUTPUT and CSRSS_FILL_OUTPUT_ATTRIB structures into CSRSS_FILL_OUTPUT.

svn path=/branches/ros-csrss/; revision=57734
2012-11-18 17:06:48 +00:00
Hermès Bélusca-Maïto e505499a2c [CONSRV]
CsrSetTextAttrib --> SrvSetConsoleTextAttribute and activate it in the list of APIs indices.

svn path=/branches/ros-csrss/; revision=57732
2012-11-18 14:30:25 +00:00
Hermès Bélusca-Maïto f079b2b2b6 [CONSRV]
- Use the ConsoleGetPerProcessData macro (--> CONSOLE_PROCESS_DATA structure).
- Do not forget to leave a critical section if we fail.

svn path=/branches/ros-csrss/; revision=57731
2012-11-18 14:21:21 +00:00
Hermès Bélusca-Maïto a4ef6acb0a [CONSRV]
Use the ConsoleGetPerProcessData macro (--> CONSOLE_PROCESS_DATA structure).

svn path=/branches/ros-csrss/; revision=57730
2012-11-18 14:17:47 +00:00
Hermès Bélusca-Maïto 4b04f7d488 [KERNEL32]
Use new structures and api indices namings.

[CONSRV]
Use CsrValidateMessageBuffer instead of Win32CsrValidateBuffer.

svn path=/branches/ros-csrss/; revision=57729
2012-11-18 13:54:32 +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 1568822b7c [KERNEL32]
- Use new structures and api indices namings.

[CONSRV]
- CSRSS_SET_CURSOR ==> CSRSS_SET_CURSOR_POSITION for SrvSetConsoleCursorPosition.
- Merge CSRSS_GET_CURSOR_INFO and CSRSS_SET_CURSOR_INFO into CSRSS_CURSOR_INFO.

svn path=/branches/ros-csrss/; revision=57725
2012-11-17 23:29:53 +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 2006c3bf86 [KERNEL32/CONSRV]
- Move the waiting loop of IntReadConsole into SrvReadConsole instead.
- Merge IntPeekConsoleInput and IntReadConsoleInput helpers into a single IntGetConsoleInput helper function
  and make PeekConsoleInputW/A and ReadConsoleInputW/A use it.
  Indeed, the "only" difference between these two functions, is that the first one keeps the data read inside
  the console input buffer, but on the contrary the second removes the data and does not return until at least
  one input record has been read.
  In server-side, CsrReadInputEvent and CsrPeekConsoleInput are merged into SrvGetConsoleInput. Merge the corresponding
  structures.
- Use shorter variable names in IntReadConsoleOutput and use CONSOLE_PROCESS_DATA structure in SrvReadConsoleOutput.
- Merge IntReadConsoleOutputCharacter and ReadConsoleOutputAttribute functions into a single IntReadConsoleOutputCode
  helper function, and make ReadConsoleOutputAttribute and ReadConsoleOutputCharacterW/A use it.
  In server-side, CsrReadConsoleOutputChar and CsrReadConsoleOutputAttrib are merged into SrvReadConsoleOutputString.
  (Remark: the SrvReadConsoleOutputString name comes from http://j00ru.vexillium.org/csrss_list/api_list.html and I
  checked that it was indeed the server function that was called by both ReadConsoleOutputAttribute and ReadConsoleOutputCharacter).
  The idea behind merging these two functions is, that an attribute or a character are instances of the same entity, namely
  a "code" (what would be called an (ANSI) escape sequence). Therefore I encode them inside the same CSRSS_READ_CONSOLE_OUTPUT_CODE
  structure and I use it with the previous functions.

[CONSRV]
- Make use of the CONSOLE_PROCESS_DATA structure (introduced in r57685).
- Use CsrValidateMessageBuffer instead of Win32CsrValidateBuffer.
- Reorganize conmsg.h a little bit.

svn path=/branches/ros-csrss/; revision=57721
2012-11-17 21:39:41 +00:00
Hermès Bélusca-Maïto 7e801b0929 [CONSRV]
Use CsrValidateMessageBuffer instead of Win32CsrValidateBuffer.

svn path=/branches/ros-csrss/; revision=57720
2012-11-17 20:05:52 +00:00
Hermès Bélusca-Maïto ecb660bb7d [CONSRV]
Code reorganization only, no code changes.

svn path=/branches/ros-csrss/; revision=57717
2012-11-17 15:41:31 +00:00
Hermès Bélusca-Maïto 0bdd9a32b0 [KERNEL32/CONSRV]
Fix compilation.

svn path=/branches/ros-csrss/; revision=57715
2012-11-15 23:13:23 +00:00
Hermès Bélusca-Maïto 0473031b87 [KERNEL32]
- Move console-related Vista+ functions from client/vista.c to a dedicated client/console/vista.c file, and add it to compilation.
- Move some helper functions from console.c to history.c.
- Use the new api index names in history.c.

[CONSRV]
- Merge CSRSS_GET_HISTORY_INFO and PCSRSS_SET_HISTORY_INFO structures declarations into CSRSS_HISTORY_INFO, and therefore use only one member of it inside CONSOLE_API_MESSAGE structure.
- WORD --> UINT for few structure members related to history information.

svn path=/branches/ros-csrss/; revision=57713
2012-11-15 22:34:44 +00:00
Hermès Bélusca-Maïto 1ccafa6cae [KERNEL32/CONSRV]
- Use capture buffers to pass (variable-length) strings to the console server.
- Merge the CSRSS_ADD_CONSOLE_ALIAS and CSRSS_GET_CONSOLE_ALIAS structures into a unique structure CSRSS_CONSOLE_ALIAS.

TODO: Check what happens to the "/ sizeof(WCHAR);" in GetConsoleAliasesW.

svn path=/branches/ros-csrss/; revision=57712
2012-11-15 21:02:01 +00:00
Hermès Bélusca-Maïto e03c8d5702 [CONSRV]
- Initialize the per-process structure size : fixes console initialization.

svn path=/branches/ros-csrss/; revision=57702
2012-11-13 21:11:30 +00:00
Hermès Bélusca-Maïto cbc3e80b5a [BASESRV]
- Remove the unneeded CallProcessCreated function since the same functionality is programmed and executed in CSRSRV when CsrInsertProcess is called via a call of CsrCreateProcess.
- Remove some hacks in process creation.
- In BaseSrvExitProcess, use the 'Reply = 2' value instead of the old hack 'ApiMessage->ApiNumber = 0xBABE'.

[USER32/WINSRV]
- Make SetLogonNotifyWindow call our 'RosSetLogonNotifyWindow' hack and explicitely mark it as a hack.
- CsrSetLogonNotifyWindow --> RosSetLogonNotifyWindow to emphasize that it is a ReactOS-specific hack.

svn path=/branches/ros-csrss/; revision=57694
2012-11-09 23:39:45 +00:00
Hermès Bélusca-Maïto f77f05cd9d Synchronize up to trunk's revision r57689.
svn path=/branches/ros-csrss/; revision=57690
2012-11-07 23:07:18 +00:00
Hermès Bélusca-Maïto 2970f8652b [CONSRV]
- Use the DLL instance for getting its win23 resources.
- Use the CONSOLE_PROCESS_DATA structure (see r57686) for accessing console-specific fields of the processes (instead of using them implemented in the CSR_PROCESS structure).
- Win32CsrDuplicateHandleTable --> ConsoleNewProcess since it's the callback function called when a new process is created, and start to move some hacks currently present in BaseSrvCreateProcess.

TODO: suppress the starting-application-related hacks in BaseSrvCreateProcess (in basesrv).

svn path=/branches/ros-csrss/; revision=57689
2012-11-07 22:23:36 +00:00
Hermès Bélusca-Maïto df87a091d1 [CONSRV]
Code formatting only.

svn path=/branches/ros-csrss/; revision=57687
2012-11-07 21:16:09 +00:00
Hermès Bélusca-Maïto 34086f2971 [CONSRV]
- Use the new PCONSOLE_PROCESS_DATA type instead of PCSR_PROCESS, for accessing console-specific fields inside a console structure (the code modifications inside these functions will follow in the next commits).
- Remove unneeded included header files in consrv.h.
- Use a DLL instance in order to facilitate the access to win32 resources.
- Activate the declaration of server apis (or rename existing ones to the Windows scheme from the http://j00ru.vexillium.org/csrss_list/api_list.html#Windows_2k3 list).
- Comment the Win32CsrValidateBuffer helper (because it should be replaced by the usage of CsrValidateMessageBuffer).
- Add the list of the old APIs (just for me, to remember at the end to check that I didn't forget ome of them during the process of moving / renaming).

svn path=/branches/ros-csrss/; revision=57686
2012-11-07 21:10:48 +00:00
Hermès Bélusca-Maïto bd4d83d88f [WIN32K]
- Remove the now unneeded CSR messaging support.
- CsrInit() goes away also and the usage of the CsrProcess is replaced by that of gpepCSRSS.

[WINSRV]
- Use a DLL instance for loading resources, instead of calling GetModuleHandle.

[KERNEL32/NTDLL]
- Remove unneeded variables.

svn path=/branches/ros-csrss/; revision=57665
2012-11-02 13:50:31 +00:00
Hermès Bélusca-Maïto dbcead9345 [WIN32K/USER32/WINSRV]
- Correct an enumeration identificator initialization.
- Move the call of CSR for registering the logon application, from kernel-mode win32k to user-mode user32
  and therefore remove the unneeded co_CsrNotify function (plus some other unneeded defines).
- Comment some non-working code (#if 0) in user32/misc/misc.c and winsrv/shutdown.c.

svn path=/branches/ros-csrss/; revision=57664
2012-11-02 11:23:26 +00:00
Hermès Bélusca-Maïto b3c0c36f28 Synchronize with trunk's revision r57659.
svn path=/branches/ros-csrss/; revision=57660
2012-10-31 19:39:53 +00:00
Hermès Bélusca-Maïto eb1f9f74b7 Forgot two files.
svn path=/branches/ros-csrss/; revision=57654
2012-10-31 00:41:02 +00:00
Hermès Bélusca-Maïto 509461cd33 Synchronize with trunk's revision r57652.
svn path=/branches/ros-csrss/; revision=57653
2012-10-31 00:26:38 +00:00
Hermès Bélusca-Maïto c269edc831 Fix part of build.
svn path=/branches/ros-csrss/; revision=57638
2012-10-28 12:57:03 +00:00
Hermès Bélusca-Maïto 9dcdf10c6c - Synchronize with trunk's revision r57633.
[WIN32CSR/BOOTDATA]
- Finally get rid of win32csr, being replaced by winsrv and consrv.
- Remove it from the subsystem command-line.

[WINSRV]
- Move a hack from win32csr to winsrv.

svn path=/branches/ros-csrss/; revision=57635
2012-10-28 12:13:03 +00:00
Hermès Bélusca-Maïto 43c7fc0c8d Synchronize with trunk's revision r57629.
svn path=/branches/ros-csrss/; revision=57630
2012-10-28 10:05:08 +00:00
Hermès Bélusca-Maïto 3cb1779934 [WIN32SS/USER32]
- Use the new subsystems header winmsg.h
- Use the new USER_API_MESSAGE structure, and adapt co_CsrNotify in consequence.
- Code formatting.

[KERNEL32]
- Use the new subsystems headers basemsg.h, conmsg.h, winmsg.h, etc...

[NTDLL]
- Code formatting only.

svn path=/branches/ros-csrss/; revision=57628
2012-10-27 23:52:28 +00:00
Hermès Bélusca-Maïto cbcea7d2f7 [CONSRV/WINSRV]
- Fix structures usage and headers inclusions.
- Make winsrv compile.
- Deactivate some code related to processes enumeration (for testing purposes).

svn path=/branches/ros-csrss/; revision=57620
2012-10-25 22:14:46 +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 6a5637234a [WINSRV/WIN32CSR]
- Move the last APIs which should be in winsrv and remove unneeded files and resources from win32csr. Keep only the desktop things.
- I'm waiting for the patch of Giannis which would act on win32csr, then I will transfer the needed changes into winsrv and I will remove definitively win32csr.
At the moment, winsrv doesn't compile, but win32csr does.

svn path=/branches/ros-csrss/; revision=57611
2012-10-24 23:19:54 +00:00
Hermès Bélusca-Maïto 2d61015804 [CSRSRV/WINSRV]
- Move the last User CSR api which was in csrsrv instead of in winsrv.
- Remove unneeded file.

svn path=/branches/ros-csrss/; revision=57610
2012-10-24 22:07:46 +00:00