Commit graph

38 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto 0345e745fd [BASESRV]
Remove a temporary DPRINT1.

[CSRSRV]
- Shut down debug output.
- Fix some misspellings.
- Fix a bug in CsrMoveSatisfiedWaits ("satisfied" waits are waits where WaitFunction was put to NULL during a previous call to CsrNotifyWait, but still not dereferenced, and which can be dereferenced by a call to CsrDereferenceWait).

svn path=/branches/ros-csrss/; revision=58103
2013-01-03 17:18:19 +00:00
Hermès Bélusca-Maïto d820098fa6 [KERNEL32/BASESRV/CONSRV]
- 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
2013-01-01 23:36:19 +00:00
Hermès Bélusca-Maïto 0444a3a392 [CONSRV]
- Be sure that we reply to the dying client when he dies.
- "Improve" a debug output (display the client process).
- Use existing helper functions for incrementing reference counts for threads and processes.

svn path=/branches/ros-csrss/; revision=58075
2013-01-01 02:59:31 +00:00
Hermès Bélusca-Maïto fc76ef76f0 [CSRSRV]
Be sure to REALLY compare the Client ID (both Process and Thread handles).

svn path=/branches/ros-csrss/; revision=58074
2013-01-01 02:21:05 +00:00
Hermès Bélusca-Maïto c61063134c [CSRSRV]
Do NOT confuse a handle and a pointer to a handle !! In this case we need a handle.

Caught in the following situation :

1- Launch a process A which initializes a console A (say, cmd.exe).
2- Launch a process B which also initializes a console B (for instance, in the first cmd.exe, do: start cmd.exe)
3- Click on the "Close" button (the "Cross" button in the right upper side) of the windows of the console A.
4- Notice that the console B closes but the process B remains alive, whereas the console A remains open but the process A is killed...
   (contrary to what you expected, closing the console A and the process A)

(when clicking on the "Close" button, the Console Server launches a remote thread in the context of the target process, and it appeared in the described situation
that it was the wrong process, because of bad parameter passing to the sub-function CsrLockProcessByClientId called when creating the remote thread).

svn path=/branches/ros-csrss/; revision=58073
2013-01-01 02:12:19 +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 5a7730db99 [CONSRV]
However here, we must keep the incrementation at the end of the loop, because of a possible corner case (a loop-break which takes place when we reach the last element of the list, but NextEntry already points to its head because of the cyclicity of the list) with the following 'if'-test made just after the loop.

svn path=/branches/ros-csrss/; revision=57867
2012-12-11 01:45:49 +00:00
Hermès Bélusca-Maïto e63aae82fe [CONSRV]
Put the "Move to the next entry" code just after retrieving list record, because it is less bug-prone.
Indeed correct a bug in CsrDestroyProcess where we were doing an infinite loop when trying to notify existing CSR waits, because NextEntry was set to the CsrProcess->ThreadList.Flink element (head) of the list.

svn path=/branches/ros-csrss/; revision=57866
2012-12-11 01:25:57 +00:00
Hermès Bélusca-Maïto 0da8c7abf0 [CONSRV]
"Reply Already Sent" and not already done !

svn path=/branches/ros-csrss/; revision=57818
2012-12-08 00:45:41 +00:00
Hermès Bélusca-Maïto 80d0bde839 [CSRSRV/BASESRV/CONSRV/WINSRV]
- 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
2012-12-06 23:43:31 +00:00
Hermès Bélusca-Maïto 5127a493a3 [NTDLL/CSRSRV]
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
2012-12-06 22:24:27 +00:00
Hermès Bélusca-Maïto ae20fbcb81 [CSRSRV]
- 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
2012-12-05 23:21:41 +00:00
Hermès Bélusca-Maïto 4ccda5290d [CSRSRV]
Add the CSRSRV status file from trunk/reactos/subsystems/csr/csrsrv/ and update it.

svn path=/branches/ros-csrss/; revision=57804
2012-12-04 23:10:07 +00:00
Hermès Bélusca-Maïto 2599e85e27 [CSRSRV]
- 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
2012-12-04 23:01:54 +00:00
Hermès Bélusca-Maïto b942b837af [CSRSRV]
Remove the unneeded CsrpHandleConnectionRequest function since CsrApiHandleConnectionRequest does already the job.

svn path=/branches/ros-csrss/; revision=57744
2012-11-21 18:52:42 +00:00
Hermès Bélusca-Maïto ae88c763da [CSRSRV]
- Remove unused functions CallHardError and CsrHandleHardError (in fact calling the hard error callback is already done in the listening thread).
- Add an annotation and correct a typographical error; remove old comments.
- Remove the now unneeded csrplugin.h header (a relic of the old callback system of the old csrss/csrsrv).

svn path=/branches/ros-csrss/; revision=57741
2012-11-20 19:34:03 +00:00
Hermès Bélusca-Maïto 6716529b84 [CSRSRV]
- Comments formatting.
- Correct a nasty initialization bug which unveiled itself as, eg., critical sections being already initialized in consoles, whereas we were creating new ones. It was because we didn't copy correctly per-process server data from parent process to child process. Now consoles initialize finely.

Now, only modifications to the console subsystem remain to make it totally conform to the new messaging structures of csrss (I mean, using the capture buffers).

svn path=/branches/ros-csrss/; revision=57703
2012-11-13 23:45:02 +00:00
Hermès Bélusca-Maïto bc0af6b272 [CSRSRV]
- Use a variable ServerDll instead of using each time CsrLoadedServerDll[i], as it is done in some other places.
- Clean the code (remove extra-parentheses).
- Zero-out the memory buffer allocated for CsrSrvSharedStaticServerData.

svn path=/branches/ros-csrss/; revision=57701
2012-11-13 21:08:19 +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 b5dc23b4a0 [BASESRV]
- Comment some code and correct the DllMain prototype. No functional changes though.

svn path=/branches/ros-csrss/; revision=57688
2012-11-07 22:08:38 +00:00
Hermès Bélusca-Maïto d736f0b914 [NTDLL]
- 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
2012-11-05 00:23:58 +00:00
Hermès Bélusca-Maïto ec451b5d49 [CSRSRV]
Code formatting only.

svn path=/branches/ros-csrss/; revision=57622
2012-10-27 14:30:32 +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 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 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
Hermès Bélusca-Maïto 574d00dc19 [CSRSRV/BASESRV/CONSRV/WIN32CSR/WINSRV]
- Fix resource files strings, headers, delete unuseful files... Nothing interesting.
- Add winsrv to build.

svn path=/branches/ros-csrss/; revision=57605
2012-10-24 21:37:22 +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 ad62b115de [BASESRV]
- Remove an unneeded cmake comment.

[CSRSRV]
- Compile the resource file.

svn path=/branches/ros-csrss/; revision=57596
2012-10-22 23:37:07 +00:00
Hermès Bélusca-Maïto a195c2bcb5 [NTDLL]
- 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
2012-10-22 00:09:51 +00:00
Hermès Bélusca-Maïto 6144173cdf [BASESRV]
- Compile basesrv and add headers.
Some other things are missing yet.

svn path=/branches/ros-csrss/; revision=57589
2012-10-21 17:18:33 +00:00
Hermès Bélusca-Maïto 518cb1c247 [BASESRV]
Forget two files.

svn path=/branches/ros-csrss/; revision=57588
2012-10-20 21:04:51 +00:00
Hermès Bélusca-Maïto 13fc08ccc7 [NTDLL/KERNEL32]
- 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
2012-10-20 21:03:32 +00:00
Hermès Bélusca-Maïto 16c4e80679 [CSRSRV]
- Start renaming some APIs which should not be present there, but in basesrv instead.
Names come from http://j00ru.vexillium.org/csrss_list/api_list.html#Windows_2k3

svn path=/branches/ros-csrss/; revision=57583
2012-10-20 14:07:04 +00:00
Hermès Bélusca-Maïto 71a7fe86e4 [CSRSS/CSRSRV]
- Reorganize the source code tree.

(Branch build still broken)

svn path=/branches/ros-csrss/; revision=57582
2012-10-20 13:28:09 +00:00
Hermès Bélusca-Maïto f40ade26d9 [CSRSS/CSRSRV]
- Rename ProcessDataLock to CsrProcessLock (as it was in the "old" csrsrv, see r57579).
- Merge the APIs from the "old" csrsrv (subsystems/csr , see r57579) with the other ones (subsystems/win32/csrss/csrsrv).
- Reorganize the functions into Private & Public functions.
- Add temporary comments.
- Start removing things which should be present in basesrv instead of in csrsrv.

This breaks build of this branch at the moment...

svn path=/branches/ros-csrss/; revision=57580
2012-10-20 13:00:41 +00:00
Hermès Bélusca-Maïto 13811a0034 [CSR]
Remove old csrss.

svn path=/branches/ros-csrss/; revision=57579
2012-10-19 20:14:47 +00:00
Hermès Bélusca-Maïto 61d07a5b47 [NTDLL/KERNEL32/CSRSRV/WIN32K/USER32/WIN32CSR]
- 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
2012-10-17 23:10:40 +00:00
Hermès Bélusca-Maïto 65ce146169 Create a branch for working on csrss and co.
svn path=/branches/ros-csrss/; revision=57561
2012-10-14 13:04:31 +00:00