2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Console Server DLL
4 * FILE: win32ss/user/winsrv/consrv/shutdown.c
5 * PURPOSE: Processes Shutdown
6 * PROGRAMMERS: Alex Ionescu
9 /* INCLUDES *******************************************************************/
16 /* FUNCTIONS ******************************************************************/
18 // NOTE: See http://blogs.msdn.com/b/ntdebugging/archive/2007/06/09/how-windows-shuts-down.aspx
21 ConsoleClientShutdown(IN PCSR_PROCESS CsrProcess
,
23 IN BOOLEAN FirstPhase
)
25 PCONSOLE_PROCESS_DATA ProcessData
= ConsoleGetPerProcessData(CsrProcess
);
29 if ( ProcessData
->ConsoleHandle
!= NULL
||
30 ProcessData
->HandleTable
!= NULL
)
32 DPRINT1("ConsoleClientShutdown(0x%p, 0x%x, %s) - Console process [0x%x, 0x%x]\n",
33 CsrProcess
, Flags
, FirstPhase
? "FirstPhase" : "LastPhase",
34 CsrProcess
->ClientId
.UniqueProcess
, CsrProcess
->ClientId
.UniqueThread
);
36 /* We are done with the process itself */
37 CsrDereferenceProcess(CsrProcess
);
38 return CsrShutdownCsrProcess
;
42 DPRINT1("ConsoleClientShutdown(0x%p, 0x%x, %s) - Non-console process [0x%x, 0x%x]\n",
43 CsrProcess
, Flags
, FirstPhase
? "FirstPhase" : "LastPhase",
44 CsrProcess
->ClientId
.UniqueProcess
, CsrProcess
->ClientId
.UniqueThread
);
46 /* On first pass, ignore the process since the GUI server should take it... */
47 if (FirstPhase
) return CsrShutdownNonCsrProcess
;
49 /* ... otherwise, call the generic handler */
50 // FIXME: Should call a generic shutdown handler!!
51 CsrDereferenceProcess(CsrProcess
);
52 return CsrShutdownCsrProcess
;
55 return CsrShutdownNonCsrProcess
;