[ros-diffs] [sir_richard] 46048: [CSRSS]: Differentiate between first-try and second-try shutdown. In the first try, the console server should defer to the user/win32k server to attempt shutdown for a non-console app. However, if we end up with a second try because this did not happen, then the console server takes matters in its own hands and calls the CTRL-C handler (with some exceptions, such as system/service apps, or apps not belonging to the LUID).
sir_richard at svn.reactos.org
sir_richard at svn.reactos.org
Wed Mar 10 04:35:18 CET 2010
- Previous message: [ros-diffs] [sir_richard] 46047: [KERNEL32]: As indicated by the comment, kernel32 should always connect to the console server, even for non-console apps (the latter will just basically ignore the request). This is needed to (at minimum) setup the Ctrl-C handler, as otherwise, only "true console" apps will have a handler, even though internally, all apps have such a handler. This is what CSRSS needs to call internally for shutting down non-GUI apps, for example. (The default CTRL-C handler will just call ExitProcess).
- Next message: [ros-diffs] [sir_richard] 46049: [NTOS]: No good deed goes unpunished. Continuing the novel/saga from a couple of days ago, it seems that now that impersonation works, various code paths are being tickled into existence. For example, it would seem parts of the system now attempt setting primary tokens. This would cause an assertion, since PspAssignPrimaryToken incorrectly dereferenced the token (leading to a double-dereference) due to an off-by-! mistake.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: sir_richard
Date: Wed Mar 10 04:35:18 2010
New Revision: 46048
URL: http://svn.reactos.org/svn/reactos?rev=46048&view=rev
Log:
[CSRSS]: Differentiate between first-try and second-try shutdown. In the first try, the console server should defer to the user/win32k server to attempt shutdown for a non-console app. However, if we end up with a second try because this did not happen, then the console server takes matters in its own hands and calls the CTRL-C handler (with some exceptions, such as system/service apps, or apps not belonging to the LUID).
Modified:
trunk/reactos/subsystems/win32/csrss/api/process.c
Modified: trunk/reactos/subsystems/win32/csrss/api/process.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/api/process.c?rev=46048&r1=46047&r2=46048&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/api/process.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/api/process.c [iso-8859-1] Wed Mar 10 04:35:18 2010
@@ -696,7 +696,7 @@
PLUID CallerLuid = RealContext[0];
PCSRSS_PROCESS_DATA CsrProcess = NULL;
NTSTATUS Status = STATUS_UNSUCCESSFUL;
- BOOLEAN FirstTry = TRUE;
+ BOOLEAN FirstTry;
ULONG Result = 0;
ULONG Hash;
@@ -729,6 +729,7 @@
while (TRUE)
{
/* Find the next process to shutdown */
+ FirstTry = TRUE;
if (!(CsrProcess = FindProcessForShutdown(CallerLuid)))
{
/* Done, quit */
@@ -741,7 +742,7 @@
/* Release the lock, make the callback, and acquire it back */
DPRINT1("Found process: %lx\n", CsrProcess->ProcessId);
CsrReleaseProcessLock();
- Result = (ULONG)EnumProc(CsrProcess, Context);
+ Result = (ULONG)EnumProc(CsrProcess, (PVOID)((ULONG_PTR)Context | FirstTry));
CsrAcquireProcessLock();
/* Check the result */
@@ -754,7 +755,7 @@
else if (Result == CsrShutdownNonCsrProcess)
{
/* A non-CSR process, the callback didn't touch it */
- continue;
+ //continue;
}
else if (Result == CsrShutdownCancelled)
{
- Previous message: [ros-diffs] [sir_richard] 46047: [KERNEL32]: As indicated by the comment, kernel32 should always connect to the console server, even for non-console apps (the latter will just basically ignore the request). This is needed to (at minimum) setup the Ctrl-C handler, as otherwise, only "true console" apps will have a handler, even though internally, all apps have such a handler. This is what CSRSS needs to call internally for shutting down non-GUI apps, for example. (The default CTRL-C handler will just call ExitProcess).
- Next message: [ros-diffs] [sir_richard] 46049: [NTOS]: No good deed goes unpunished. Continuing the novel/saga from a couple of days ago, it seems that now that impersonation works, various code paths are being tickled into existence. For example, it would seem parts of the system now attempt setting primary tokens. This would cause an assertion, since PspAssignPrimaryToken incorrectly dereferenced the token (leading to a double-dereference) due to an off-by-! mistake.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Ros-diffs
mailing list