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
);
27 if ( ProcessData
->ConsoleHandle
!= NULL
||
28 ProcessData
->HandleTable
!= NULL
)
30 DPRINT1("ConsoleClientShutdown(0x%p, 0x%x, %s) - Console process [0x%x, 0x%x]\n",
31 CsrProcess
, Flags
, FirstPhase
? "FirstPhase" : "LastPhase",
32 CsrProcess
->ClientId
.UniqueProcess
, CsrProcess
->ClientId
.UniqueThread
);
34 /* We are done with the process itself */
35 CsrDereferenceProcess(CsrProcess
);
36 return CsrShutdownCsrProcess
;
40 DPRINT1("ConsoleClientShutdown(0x%p, 0x%x, %s) - Non-console process [0x%x, 0x%x]\n",
41 CsrProcess
, Flags
, FirstPhase
? "FirstPhase" : "LastPhase",
42 CsrProcess
->ClientId
.UniqueProcess
, CsrProcess
->ClientId
.UniqueThread
);
44 /* On first pass, ignore the process since the GUI server should take it... */
45 if (FirstPhase
) return CsrShutdownNonCsrProcess
;
47 /* ... otherwise, call the generic handler */
48 // FIXME: Should call a generic shutdown handler!!
49 CsrDereferenceProcess(CsrProcess
);
50 return CsrShutdownCsrProcess
;
53 return CsrShutdownNonCsrProcess
;