I replaced by error the mask 0x10000003 by 0x3, which had as an effect to match handles of value 0xffffffff (invalid_handle_value). Fichtre !
svn path=/branches/ros-csrss/; revision=58064
- 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
- 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
- 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
- Add a useful CHECK_API_MSG_SIZE macro to check whether a server message structure can hold in a CSR_API_MESSAGE structure. These checks are required because LPC will use the generic CSR_API_MESSAGE structure for communicating all the different servers' messages, and thus we avoid possible buffer overflows with this method.
- Effectively use this macro for all the server message structures.
- Remove a hack regarding the maximum data size we can pass through the CSR LPC port.
- Remove the now unused CSRSS_HEADER_SIZE symbol.
svn path=/branches/ros-csrss/; revision=57810
- Comment on the size of some members of the CSR_WAIT_BLOCK structure.
- Initialize the WaitBlock member of CSR_THREAD to a valid value when creating a wait block, and NULLify it when we release a wait block.
- ALWAYS USE offsets in CSR_CAPTURE_BUFFER structure, instead of real pointers !! It is needed when their base address change (eg. during a CSR wait, their base address, corresponding to the address of an CSR API message, change) (found when testing CSR waits with the console).
svn path=/branches/ros-csrss/; revision=57806
- Correct a misspelling 'CsrThreadAltertable' -> 'CsrThreadAlertable'.
- Introduce CSR_REPLY_CODEs instead of using hardcoded values, and use them with CSR_API_ROUTINE-type functions. They correspond to which decision CSRSRV should take after a server function is called: answer to the client or not, and perform according tasks.
[BASESRV]
Use CSR_REPLY_CODEs.
svn path=/branches/ros-csrss/; revision=57801
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
- 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
- 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
- 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
- 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
- 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
- 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
Reorganize the data members according to their purposes (increases the lisibility only). No code changes.
svn path=/branches/ros-csrss/; revision=57722
- 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
- Use a standard win32 thread function for the ConsoleControlDispatcher thread, instead of a custom PCONTROLDISPATCHER one.
- Deactivate debug outputs in console.c, which were activated by error in r57706.
svn path=/branches/ros-csrss/; revision=57714
- 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
- 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
- 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
Add a new header containing per-process console-specific structure CSRSS_CON_PROCESS_DATA (it is stored inside one of the element of the ServerData array inside the CSR_PROCESS structure). It was deleted from csrsrv.h in revision r57673 and reappears here. Also add a macro in order to facilitate its access inside consrv.
svn path=/branches/ros-csrss/; revision=57685
- Add parameter annotations.
- Improve CSR buffer allocation with 4-byte align.
- Simplify the capture-buffer pointers settings.
[CSRSRV]
- Remove last console structure from csrsrv.h (in next commits it will be placed in a proper header).
- Enable global CSR debugging (for debugging purposes... ;-) ).
- api.c: Enable debugging.
- api.c/.h: Remove old code and deprecated unused definitions.
- Use the Win2k3-compliant version of CsrCreateThread (code from subsystems/csr/csrsrv) (TODO: correct its usage in basesrv:BaseSrvCreateThread).
- init.c: Implement a helper routine, CsrInitCsrRootProcess, in order to initialize the per-process server data (see CSR_PROCESS structure) in the Root CSR process. New process inherit it from this Root process.
- server.c - Add a DPRINT. Remove a hack. Correct a parameter passing.
- session.c - Remove a hack (it will go to the new process initialization in consrv)
- Disable the code of CsrConnectToUser while user32:ClientThreadSetup doesn't work.
- Correct the implementation of CsrValidateMessageBuffer.
- Basic implementation of CsrValidateMessageString using CsrValidateMessageBuffer.
TODO:
- Compare CsrpHandleConnectionRequest with the other one function in api.c.
- Compare CsrValidateMessageBuffer with Win32CsrValidateBuffer ?
svn path=/branches/ros-csrss/; revision=57673
- 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
- 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
- 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
- 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
- Fix a variable and a header names.
[CSR]
- Move all the interesting code from the "old" csrsrv (see r57579) to the new one. TODO: finish to reorganize the code.
- Rename the headers to a standard naming I will use for the other server dlls.
- Remove now unneeded files.
(one can sometimes find commented names next to declaration of variables: it is when a variable name doesn't satisfy me because it isn't enough self-explaining for my taste).
[CONSOLE]
- Add a new header for console working (win32csr --> consrv.dll == the console part of winsrv.dll I separate from it, because I plan a profound reworking on the console after all that).
svn path=/branches/ros-csrss/; revision=57591
- Use new naming scheme.
[CSRSRV]
- Continuing headers reorganization.
- Activate new code.
[CSRSRV/WIN32CSR]
- Move some code into basesrv.
[BASESRV]
- Add basesrv.dll
The names of the APIs tables come from http://j00ru.vexillium.org/csrss_list/api_list.html as usual,
however I used the NT 4 ones for testing purposes only. After that I will update them to 2k3 version
and add function stubs. Also some variable names are deduced from the subsystems/win32/csrss/csrsrv/server.c ones.
svn path=/branches/ros-csrss/; revision=57587
- Use the new messaging structures and the new macros, plus the new CSR_API function's signature (--> and rename some variables).
- Code cleaning & formatting.
[CSRSS/NDK]
- Reorganize all the header files in logical units (server.h for server-side of CSR, client.h for client-side, and msg.h for messaging), removing duplicated definitions.
- Code cleaning & formatting.
The next step would be to activate the code of server-dll loading inside csrsrv, then moving all the console-related APIs from win32csr to winsrv, the latter built with the same structure as csrsrv's.
svn path=/branches/ros-csrss/; revision=57570