Author: hbelusca
Date: Thu Oct 25 20:40:41 2012
New Revision: 57618
URL:
http://svn.reactos.org/svn/reactos?rev=57618&view=rev
Log:
[CSR/BASESRV/CONSRV/WINSRV]
- Fix code headers. No code changes.
- Rename csrcl.h to csr.h for readability purposes.
- exitros.c --> shutdown.c
Added:
branches/ros-csrss/include/reactos/subsys/csr/csr.h
- copied, changed from r57617,
branches/ros-csrss/include/reactos/subsys/csr/csrcl.h
branches/ros-csrss/win32ss/user/winsrv/shutdown.c
- copied, changed from r57617, branches/ros-csrss/win32ss/user/winsrv/exitros.c
Removed:
branches/ros-csrss/include/reactos/subsys/csr/csrcl.h
branches/ros-csrss/win32ss/user/winsrv/exitros.c
Modified:
branches/ros-csrss/dll/ntdll/include/ntdll.h
branches/ros-csrss/dll/win32/kernel32/k32.h
branches/ros-csrss/include/reactos/subsys/csr/csrmsg.h
branches/ros-csrss/include/reactos/subsys/csr/csrsrv.h
branches/ros-csrss/include/reactos/subsys/win/base.h
branches/ros-csrss/include/reactos/subsys/win/basemsg.h
branches/ros-csrss/include/reactos/subsys/win/conmsg.h
branches/ros-csrss/include/reactos/subsys/win/winmsg.h
branches/ros-csrss/subsystems/win/basesrv/basesrv.h
branches/ros-csrss/subsystems/win/basesrv/init.c
branches/ros-csrss/subsystems/win/basesrv/server.c
branches/ros-csrss/subsystems/win32/csrsrv/api.c
branches/ros-csrss/subsystems/win32/csrsrv/include/csrplugin.h
branches/ros-csrss/subsystems/win32/csrsrv/init.c
branches/ros-csrss/subsystems/win32/csrsrv/procsup.c
branches/ros-csrss/subsystems/win32/csrsrv/server.c
branches/ros-csrss/subsystems/win32/csrsrv/session.c
branches/ros-csrss/subsystems/win32/csrsrv/srv.h
branches/ros-csrss/subsystems/win32/csrsrv/thredsup.c
branches/ros-csrss/subsystems/win32/csrsrv/wait.c
branches/ros-csrss/subsystems/win32/csrss/csrss.c
branches/ros-csrss/win32ss/user/consrv/alias.c
branches/ros-csrss/win32ss/user/consrv/coninput.c
branches/ros-csrss/win32ss/user/consrv/conio.h
branches/ros-csrss/win32ss/user/consrv/conoutput.c
branches/ros-csrss/win32ss/user/consrv/console.c
branches/ros-csrss/win32ss/user/consrv/consrv.h
branches/ros-csrss/win32ss/user/consrv/guiconsole.c
branches/ros-csrss/win32ss/user/consrv/guiconsole.h
branches/ros-csrss/win32ss/user/consrv/handle.c
branches/ros-csrss/win32ss/user/consrv/lineinput.c
branches/ros-csrss/win32ss/user/consrv/resource.h
branches/ros-csrss/win32ss/user/consrv/server.c
branches/ros-csrss/win32ss/user/consrv/tuiconsole.c
branches/ros-csrss/win32ss/user/consrv/tuiconsole.h
branches/ros-csrss/win32ss/user/winsrv/CMakeLists.txt
branches/ros-csrss/win32ss/user/winsrv/harderror.c
branches/ros-csrss/win32ss/user/winsrv/init.c
branches/ros-csrss/win32ss/user/winsrv/resource.h
branches/ros-csrss/win32ss/user/winsrv/server.c
branches/ros-csrss/win32ss/user/winsrv/winsrv.h
Modified: branches/ros-csrss/dll/ntdll/include/ntdll.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/ntdll/include/ntd…
==============================================================================
--- branches/ros-csrss/dll/ntdll/include/ntdll.h [iso-8859-1] (original)
+++ branches/ros-csrss/dll/ntdll/include/ntdll.h [iso-8859-1] Thu Oct 25 20:40:41 2012
@@ -42,7 +42,7 @@
#include "ntdllp.h"
/* CSRSS Header */
-#include <csr/csrcl.h>
+#include <csr/csr.h>
/* PSEH */
#include <pseh/pseh2.h>
Modified: branches/ros-csrss/dll/win32/kernel32/k32.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/kernel32/k3…
==============================================================================
--- branches/ros-csrss/dll/win32/kernel32/k32.h [iso-8859-1] (original)
+++ branches/ros-csrss/dll/win32/kernel32/k32.h [iso-8859-1] Thu Oct 25 20:40:41 2012
@@ -36,8 +36,8 @@
#include <ndk/umfuncs.h>
/* CSRSS Header */
-#include <csrss/client.h>
-#include <csrss/csrss.h> // FIXME: data header.
+#include <csr/csr.h>
+//#include <csr/csrss.h> // FIXME: data header.
/* C Headers */
#include <ctype.h>
Copied: branches/ros-csrss/include/reactos/subsys/csr/csr.h (from r57617,
branches/ros-csrss/include/reactos/subsys/csr/csrcl.h)
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/csr/csrcl.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/csr/csr.h [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,13 +1,14 @@
/*
- * PROJECT: ReactOS Native Headers
- * FILE: include/subsys/csrss/client.h
- * PURPOSE: Public Definitions for CSR Clients
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: include/reactos/subsys/csr/csr.h
+ * PURPOSE: Public definitions for CSR Clients
* PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
* Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
*/
-#ifndef _CSRCL_H
-#define _CSRCL_H
+#ifndef _CSR_H
+#define _CSR_H
#include "csrmsg.h"
@@ -88,6 +89,6 @@
CsrSetPriorityClass(IN HANDLE Process,
IN OUT PULONG PriorityClass);
-#endif // _CSRCLIENT_H
+#endif // _CSR_H
/* EOF */
Removed: branches/ros-csrss/include/reactos/subsys/csr/csrcl.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/csr/csrcl.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/csr/csrcl.h (removed)
@@ -1,93 +1,0 @@
-/*
- * PROJECT: ReactOS Native Headers
- * FILE: include/subsys/csrss/client.h
- * PURPOSE: Public Definitions for CSR Clients
- * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
- * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
- */
-
-#ifndef _CSRCL_H
-#define _CSRCL_H
-
-#include "csrmsg.h"
-
-/*
-BOOLEAN
-NTAPI
-CsrCaptureArguments(IN PCSR_THREAD CsrThread,
- IN PCSR_API_MESSAGE ApiMessage);
-
-VOID
-NTAPI
-CsrReleaseCapturedArguments(IN PCSR_API_MESSAGE ApiMessage);
-*/
-
-NTSTATUS
-NTAPI
-CsrClientConnectToServer(IN PWSTR ObjectDirectory,
- IN ULONG ServerId,
- IN PVOID ConnectionInfo,
- IN OUT PULONG ConnectionInfoSize,
- OUT PBOOLEAN ServerToServerCall);
-
-NTSTATUS
-NTAPI
-CsrClientCallServer(IN OUT PCSR_API_MESSAGE Request,
- IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL,
- IN ULONG ApiNumber,
- IN ULONG RequestLength);
-
-PVOID
-NTAPI
-CsrAllocateCaptureBuffer(IN ULONG ArgumentCount,
- IN ULONG BufferSize);
-
-VOID
-NTAPI
-CsrFreeCaptureBuffer(IN PCSR_CAPTURE_BUFFER CaptureBuffer);
-
-ULONG
-NTAPI
-CsrAllocateMessagePointer(IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer,
- IN ULONG MessageLength,
- OUT PVOID* CaptureData);
-
-VOID
-NTAPI
-CsrCaptureMessageBuffer(IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer,
- IN PVOID MessageString,
- IN ULONG StringLength,
- OUT PVOID* CapturedData);
-
-VOID
-NTAPI
-CsrProbeForRead(IN PVOID Address,
- IN ULONG Length,
- IN ULONG Alignment);
-
-VOID
-NTAPI
-CsrProbeForWrite(IN PVOID Address,
- IN ULONG Length,
- IN ULONG Alignment);
-
-NTSTATUS
-NTAPI
-CsrIdentifyAlertableThread(VOID);
-
-HANDLE
-NTAPI
-CsrGetProcessId(VOID);
-
-NTSTATUS
-NTAPI
-CsrNewThread(VOID);
-
-NTSTATUS
-NTAPI
-CsrSetPriorityClass(IN HANDLE Process,
- IN OUT PULONG PriorityClass);
-
-#endif // _CSRCLIENT_H
-
-/* EOF */
Modified: branches/ros-csrss/include/reactos/subsys/csr/csrmsg.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/csr/csrmsg.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/csr/csrmsg.h [iso-8859-1] Thu Oct 25
20:40:41 2012
@@ -1,8 +1,9 @@
/*
- * PROJECT: ReactOS Native Headers
- * FILE: include/subsys/csrss/msg.h
- * PURPOSE: Public Definitions for communication
- * between CSR Clients and Servers.
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: include/reactos/subsys/csr/csrmsg.h
+ * PURPOSE: Public definitions for communication
+ * between CSR Clients and Servers
* PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
* Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
*/
Modified: branches/ros-csrss/include/reactos/subsys/csr/csrsrv.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/csr/csrsrv.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/csr/csrsrv.h [iso-8859-1] Thu Oct 25
20:40:41 2012
@@ -1,7 +1,8 @@
/*
- * PROJECT: ReactOS Native Headers
- * FILE: include/subsys/csrss/csrsrv.h
- * PURPOSE: Public Definitions for CSR Servers
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: include/reactos/subsys/csr/csrsrv.h
+ * PURPOSE: Public definitions for CSR Servers
* PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
* Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
*/
@@ -440,6 +441,6 @@
#endif
*/
-#endif // _CSRSERVER_H
+#endif // _CSRSRV_H
/* EOF */
Modified: branches/ros-csrss/include/reactos/subsys/win/base.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/win/base.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/win/base.h [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,6 +1,13 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: include/reactos/subsys/win/base.h
+ * PURPOSE: Public definitions for Base API Clients
+ * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ */
-#ifndef __BASE_H__
-#define __BASE_H__
+#ifndef _BASE_H
+#define _BASE_H
#pragma once
@@ -8,8 +15,6 @@
NTSTATUS WINAPI BaseSetProcessCreateNotify (BASE_PROCESS_CREATE_NOTIFY_ROUTINE);
CSR_SERVER_DLL_INIT(ServerDllInitialization);
-
-
typedef struct _NLS_USER_INFO
{
@@ -79,6 +84,6 @@
ULONG TermsrvClientTimeZoneChangeNum;
} BASE_STATIC_SERVER_DATA, *PBASE_STATIC_SERVER_DATA;
-#endif // __BASE_H__
+#endif // _BASE_H
/* EOF */
Modified: branches/ros-csrss/include/reactos/subsys/win/basemsg.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/win/basemsg.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/win/basemsg.h [iso-8859-1] Thu Oct 25
20:40:41 2012
@@ -1,6 +1,14 @@
-
-#ifndef __BASEMSG_H__
-#define __BASEMSG_H__
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: include/reactos/subsys/win/basemsg.h
+ * PURPOSE: Public definitions for communication
+ * between Base API Clients and Servers
+ * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ */
+
+#ifndef _BASEMSG_H
+#define _BASEMSG_H
#pragma once
@@ -177,7 +185,7 @@
PCSR_CAPTURE_BUFFER CsrCaptureData;
CSR_API_NUMBER ApiNumber;
- ULONG Status;
+ ULONG Status; // ReturnValue; // NTSTATUS Status
ULONG Reserved;
union
{
@@ -195,6 +203,6 @@
} Data;
} BASE_API_MESSAGE, *PBASE_API_MESSAGE;
-#endif // __BASEMSG_H__
+#endif // _BASEMSG_H
/* EOF */
Modified: branches/ros-csrss/include/reactos/subsys/win/conmsg.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] Thu Oct 25
20:40:41 2012
@@ -1,6 +1,14 @@
-
-#ifndef __CONMSG_H__
-#define __CONMSG_H__
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: include/reactos/subsys/win/conmsg.h
+ * PURPOSE: Public definitions for communication
+ * between Console API Clients and Servers
+ * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ */
+
+#ifndef _CONMSG_H
+#define _CONMSG_H
#pragma once
@@ -559,6 +567,6 @@
} Data;
} CONSOLE_API_MESSAGE, *PCONSOLE_API_MESSAGE;
-#endif // __CONMSG_H__
+#endif // _CONMSG_H
/* EOF */
Modified: branches/ros-csrss/include/reactos/subsys/win/winmsg.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/win/winmsg.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/win/winmsg.h [iso-8859-1] Thu Oct 25
20:40:41 2012
@@ -1,6 +1,14 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: include/reactos/subsys/win/winmsg.h
+ * PURPOSE: Public definitions for communication
+ * between User-Mode API Clients and Servers
+ * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ */
-#ifndef __WINMSG_H__
-#define __WINMSG_H__
+#ifndef _WINMSG_H
+#define _WINMSG_H
#pragma once
@@ -9,6 +17,6 @@
// CSR_SERVER_DLL_INIT(UserServerDllInitialization);
-#endif // __WINMSG_H__
+#endif // _WINMSG_H
/* EOF */
Modified: branches/ros-csrss/subsystems/win/basesrv/basesrv.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win/basesr…
==============================================================================
--- branches/ros-csrss/subsystems/win/basesrv/basesrv.h [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win/basesrv/basesrv.h [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,3 +1,10 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS/Win32 Base enviroment Subsystem Server
+ * FILE: subsystems/win/basesrv/basesrv.h
+ * PURPOSE: Main header - Definitions
+ * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ */
#ifndef __BASESRV_H__
#define __BASESRV_H__
Modified: branches/ros-csrss/subsystems/win/basesrv/init.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win/basesr…
==============================================================================
--- branches/ros-csrss/subsystems/win/basesrv/init.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win/basesrv/init.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,6 +1,6 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS/Win32 base enviroment subsystem server
+ * PROJECT: ReactOS/Win32 Base enviroment Subsystem Server
* FILE: subsystems/win/basesrv/init.c
* PURPOSE: Initialization
* PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
Modified: branches/ros-csrss/subsystems/win/basesrv/server.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win/basesr…
==============================================================================
--- branches/ros-csrss/subsystems/win/basesrv/server.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win/basesrv/server.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,8 +1,8 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS/Win32 base enviroment subsystem server
+ * PROJECT: ReactOS/Win32 Base enviroment Subsystem Server
* FILE: subsystems/win/basesrv/server.c
- * PURPOSE: Initialization
+ * PURPOSE: Server APIs
* PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
*/
Modified: branches/ros-csrss/subsystems/win32/csrsrv/api.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/api.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/api.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,6 +1,6 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS CSR Sub System
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
* FILE: subsystems/win32/csrsrv/api.c
* PURPOSE: CSR Server DLL API LPC Implementation
* "\windows\ApiPort" port process management functions
Modified: branches/ros-csrss/subsystems/win32/csrsrv/include/csrplugin.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/include/csrplugin.h [iso-8859-1]
(original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/include/csrplugin.h [iso-8859-1] Thu Oct 25
20:40:41 2012
@@ -19,7 +19,7 @@
#include <windows.h>
-#include <csr/csrcl.h>
+#include <csr/csr.h>
//#include "api.h"
/*
Modified: branches/ros-csrss/subsystems/win32/csrsrv/init.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/init.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/init.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,7 +1,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS CSR SubSystem
- * FILE: subsystems/win32/csrss/csrsrv/init.c
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: subsystems/win32/csrsrv/init.c
* PURPOSE: CSR Server DLL Initialization
* PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
* ReactOS Portable Systems Group
Modified: branches/ros-csrss/subsystems/win32/csrsrv/procsup.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/procsup.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/procsup.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,12 +1,12 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS CSR SubSystem
- * FILE: subsystems/win32/csrss/csrsrv/procsup.c
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: subsystems/win32/csrsrv/procsup.c
* PURPOSE: CSR Server DLL Process Management
* PROGRAMMERS: ReactOS Portable Systems Group
* Alex Ionescu (alex(a)relsoft.net)
*/
-
+
/* INCLUDES *******************************************************************/
#include <srv.h>
Modified: branches/ros-csrss/subsystems/win32/csrsrv/server.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/server.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/server.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,7 +1,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS CSR SubSystem
- * FILE: subsystems/win32/csrss/csrsrv/server.c
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: subsystems/win32/csrsrv/server.c
* PURPOSE: CSR Server DLL Server Functions
* PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
*/
Modified: branches/ros-csrss/subsystems/win32/csrsrv/session.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/session.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/session.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,7 +1,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS CSR SubSystem
- * FILE: subsystems/win32/csrss/csrsrv/session.c
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: subsystems/win32/csrsrv/session.c
* PURPOSE: CSR Server DLL Session Implementation
* PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
*/
Modified: branches/ros-csrss/subsystems/win32/csrsrv/srv.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/srv.h [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/srv.h [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,3 +1,12 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: subsystems/win32/csrsrv/srv.h
+ * PURPOSE: Main header - Definitions
+ * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
+ * ReactOS Portable Systems Group
+ */
+
#ifndef _SRV_H
#define _SRV_H
@@ -36,4 +45,6 @@
#define ROUND_UP(n, align) ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
#define ROUND_DOWN(n, align) (((ULONG)n) & ~((align) - 1l))
-#endif
+#endif // _SRV_H
+
+/* EOF */
Modified: branches/ros-csrss/subsystems/win32/csrsrv/thredsup.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/thredsup.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/thredsup.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,7 +1,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS CSR SubSystem
- * FILE: subsystems/win32/csrss/csrsrv/thredsup.c
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: subsystems/win32/csrsrv/thredsup.c
* PURPOSE: CSR Server DLL Thread Management
* PROGRAMMERS: ReactOS Portable Systems Group
* Alex Ionescu (alex(a)relsoft.net)
Modified: branches/ros-csrss/subsystems/win32/csrsrv/wait.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrsrv/wait.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrsrv/wait.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,7 +1,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS CSR Sub System
- * FILE: subsystems/win32/csrss/csrsrv/wait.c
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
+ * FILE: subsystems/win32/csrsrv/wait.c
* PURPOSE: CSR Server DLL Wait Implementation
* PROGRAMMERS: Emanuele Aliberti
* Alex Ionescu (alex(a)relsoft.net)
Modified: branches/ros-csrss/subsystems/win32/csrss/csrss.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win32/csrs…
==============================================================================
--- branches/ros-csrss/subsystems/win32/csrss/csrss.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win32/csrss/csrss.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,8 +1,8 @@
/*
- * PROJECT: ReactOS Client Server Runtime SubSystem (CSRSS)
* LICENSE: BSD - See COPYING.ARM in root directory
+ * PROJECT: ReactOS Client/Server Runtime SubSystem
* FILE: subsystems/win32/csrss/csrss.c
- * PURPOSE: CSRSS Main Executable Code
+ * PURPOSE: CSRSS Process Main Executable Code
* PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
* ReactOS Portable Systems Group
*/
Modified: branches/ros-csrss/win32ss/user/consrv/alias.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/a…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/alias.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/alias.c [iso-8859-1] Thu Oct 25 20:40:41 2012
@@ -1,10 +1,10 @@
/*
- * PROJECT: ReactOS CSRSS
- * LICENSE: GPL - See COPYING in the top level directory
- * FILE: subsystems/win32/csrss/api/alias.c
- * PURPOSE: CSRSS alias support functions
- * COPYRIGHT: Christoph Wittich
- * Johannes Anderwald
+ * LICENSE: GPL - See COPYING in the top level directory
+ * PROJECT: ReactOS Console Server DLL
+ * FILE: win32ss/user/consrv/alias.c
+ * PURPOSE: Alias support functions
+ * PROGRAMMERS: Christoph Wittich
+ * Johannes Anderwald
*/
/* INCLUDES ******************************************************************/
Modified: branches/ros-csrss/win32ss/user/consrv/coninput.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/coninput.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/coninput.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,9 +1,9 @@
/*
- * reactos/win32ss/user/consrv/conio.c
- *
- * Console I/O functions
- *
- * ReactOS Operating System
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Console Server DLL
+ * FILE: win32ss/user/consrv/coninput.c
+ * PURPOSE: Console I/O functions
+ * PROGRAMMERS:
*/
/* INCLUDES ******************************************************************/
Modified: branches/ros-csrss/win32ss/user/consrv/conio.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/conio.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/conio.h [iso-8859-1] Thu Oct 25 20:40:41 2012
@@ -1,13 +1,12 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS system libraries
- * FILE: subsys/csrss/include/conio.h
- * PURPOSE: CSRSS internal console I/O interface
+ * PROJECT: ReactOS Console Server DLL
+ * FILE: win32ss/user/consrv/conio.h
+ * PURPOSE: Internal console I/O interface
+ * PROGRAMMERS:
*/
#pragma once
-
-// #include "api.h"
#define CSR_DEFAULT_CURSOR_SIZE 25
Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,9 +1,9 @@
/*
- * reactos/win32ss/user/consrv/conio.c
- *
- * Console I/O functions
- *
- * ReactOS Operating System
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Console Server DLL
+ * FILE: win32ss/user/consrv/conoutput.c
+ * PURPOSE: Console I/O functions
+ * PROGRAMMERS:
*/
/* INCLUDES ******************************************************************/
Modified: branches/ros-csrss/win32ss/user/consrv/console.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/console.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/console.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,9 +1,9 @@
/*
- * reactos/win32ss/user/consrv/conio.c
- *
- * Console I/O functions
- *
- * ReactOS Operating System
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Console Server DLL
+ * FILE: win32ss/user/consrv/console.c
+ * PURPOSE: Console I/O functions
+ * PROGRAMMERS:
*/
/* INCLUDES ******************************************************************/
Modified: branches/ros-csrss/win32ss/user/consrv/consrv.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/consrv.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/consrv.h [iso-8859-1] Thu Oct 25 20:40:41 2012
@@ -1,3 +1,10 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Console Server DLL
+ * FILE: win32ss/user/consrv/consrv.h
+ * PURPOSE: Main header - Definitions
+ * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ */
#ifndef __CONSRV_H__
#define __CONSRV_H__
Modified: branches/ros-csrss/win32ss/user/consrv/guiconsole.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/g…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,8 +1,9 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS system libraries
+ * PROJECT: ReactOS Console Server DLL
* FILE: win32ss/user/consrv/guiconsole.c
* PURPOSE: Implementation of gui-mode consoles
+ * PROGRAMMERS:
*/
/* INCLUDES ******************************************************************/
Modified: branches/ros-csrss/win32ss/user/consrv/guiconsole.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/g…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/guiconsole.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/guiconsole.h [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,11 +1,11 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS system libraries
+ * PROJECT: ReactOS Console Server DLL
* FILE: win32ss/user/consrv/guiconsole.h
- * PURPOSE: Interface to GUI consoles
+ * PURPOSE: Interface to gui-mode consoles
+ * PROGRAMMERS:
*/
-// #include "api.h"
#include "conio.h"
#define CONGUI_MIN_WIDTH 10
Modified: branches/ros-csrss/win32ss/user/consrv/handle.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/h…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/handle.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/handle.c [iso-8859-1] Thu Oct 25 20:40:41 2012
@@ -1,9 +1,9 @@
/*
- * reactos/subsys/csrss/api/handle.c
- *
- * CSRSS handle functions
- *
- * ReactOS Operating System
+ * LICENSE: GPL - See COPYING in the top level directory
+ * PROJECT: ReactOS Console Server DLL
+ * FILE: win32ss/user/consrv/handle.c
+ * PURPOSE: Handle functions
+ * PROGRAMMERS:
*/
/* INCLUDES ******************************************************************/
Modified: branches/ros-csrss/win32ss/user/consrv/lineinput.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/l…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/lineinput.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/lineinput.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,7 +1,7 @@
/*
- * PROJECT: ReactOS CSRSS
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: win32ss/user/consrv/lineinput.c
+ * PROJECT: ReactOS Console Server DLL
+ * FILE: win32ss/user/consrv/tuiconsole.c
* PURPOSE: Console line input functions
* PROGRAMMERS: Jeffrey Morlan
*/
Modified: branches/ros-csrss/win32ss/user/consrv/resource.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/r…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/resource.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/resource.h [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,8 +1,7 @@
-/* $Id: resource.h 51293 2011-04-09 12:01:36Z mkupfer $
- *
+/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS Win32 subsystem
- * FILE: subsys/csrss/win32csr/resource.h
+ * PROJECT: ReactOS Console Server DLL
+ * FILE: win32ss/user/consrv/resource.h
* PURPOSE: Resource #defines
*/
Modified: branches/ros-csrss/win32ss/user/consrv/server.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/s…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/server.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/server.c [iso-8859-1] Thu Oct 25 20:40:41 2012
@@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Console Server DLL
* FILE: win32ss/user/consrv/init.c
- * PURPOSE: Initialization
+ * PURPOSE: Server APIs
* PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
*/
Modified: branches/ros-csrss/win32ss/user/consrv/tuiconsole.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/t…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/tuiconsole.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/tuiconsole.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,8 +1,9 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS system libraries
+ * PROJECT: ReactOS Console Server DLL
* FILE: win32ss/user/consrv/tuiconsole.c
- * PURPOSE: Implementation of text-mode consoles
+ * PURPOSE: Interface to text-mode consoles
+ * PROGRAMMERS:
*/
#include "consrv.h"
Modified: branches/ros-csrss/win32ss/user/consrv/tuiconsole.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/t…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/tuiconsole.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/tuiconsole.h [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,11 +1,11 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS system libraries
+ * PROJECT: ReactOS Console Server DLL
* FILE: win32ss/user/consrv/tuiconsole.h
* PURPOSE: Interface to text-mode consoles
+ * PROGRAMMERS:
*/
-// #include "api.h"
#include "conio.h"
extern NTSTATUS FASTCALL TuiInitConsole(PCSRSS_CONSOLE Console);
Modified: branches/ros-csrss/win32ss/user/winsrv/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/C…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/CMakeLists.txt [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/CMakeLists.txt [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -6,8 +6,10 @@
spec2def(winsrv.dll winsrv.spec)
list(APPEND SOURCE
+ harderror.c
init.c
server.c
+ shutdown.c
winsrv.rc
${CMAKE_CURRENT_BINARY_DIR}/winsrv.def)
Removed: branches/ros-csrss/win32ss/user/winsrv/exitros.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/e…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/exitros.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/exitros.c (removed)
@@ -1,943 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS CSRSS subsystem
- * FILE: win32ss/user/winsrv/exitros.c
- * PURPOSE: Logout/shutdown
- */
-
-/* INCLUDES ******************************************************************/
-
-#include "w32csr.h"
-#include <sddl.h>
-
-#define NDEBUG
-#include <debug.h>
-
-
-
-static HWND LogonNotifyWindow = NULL;
-static HANDLE LogonProcess = NULL;
-
-
-/* FUNCTIONS *****************************************************************/
-
-NTSTATUS FASTCALL
-Win32CsrEnumProcesses(CSRSS_ENUM_PROCESS_PROC EnumProc,
- PVOID Context)
-{
- return CsrEnumProcesses(EnumProc, Context);
-}
-
-CSR_API(CsrRegisterLogonProcess)
-{
- if (ApiMessage->Data.RegisterLogonProcessRequest.Register)
- {
- if (0 != LogonProcess)
- {
- return STATUS_LOGON_SESSION_EXISTS;
- }
- LogonProcess = ApiMessage->Data.RegisterLogonProcessRequest.ProcessId;
- }
- else
- {
- if (ApiMessage->Header.ClientId.UniqueProcess != LogonProcess)
- {
- DPRINT1("Current logon process 0x%x, can't deregister from process
0x%x\n",
- LogonProcess, ApiMessage->Header.ClientId.UniqueProcess);
- return STATUS_NOT_LOGON_PROCESS;
- }
- LogonProcess = 0;
- }
-
- return STATUS_SUCCESS;
-}
-
-CSR_API(CsrSetLogonNotifyWindow)
-{
- DWORD WindowCreator;
-
- if (0 ==
GetWindowThreadProcessId(ApiMessage->Data.SetLogonNotifyWindowRequest.LogonNotifyWindow,
- &WindowCreator))
- {
- DPRINT1("Can't get window creator\n");
- return STATUS_INVALID_HANDLE;
- }
- if (WindowCreator != (DWORD_PTR)LogonProcess)
- {
- DPRINT1("Trying to register window not created by winlogon as notify
window\n");
- return STATUS_ACCESS_DENIED;
- }
-
- LogonNotifyWindow =
ApiMessage->Data.SetLogonNotifyWindowRequest.LogonNotifyWindow;
-
- return STATUS_SUCCESS;
-}
-
-typedef struct tagSHUTDOWN_SETTINGS
-{
- BOOL AutoEndTasks;
- DWORD HungAppTimeout;
- DWORD WaitToKillAppTimeout;
-} SHUTDOWN_SETTINGS, *PSHUTDOWN_SETTINGS;
-
-#define DEFAULT_AUTO_END_TASKS FALSE
-#define DEFAULT_HUNG_APP_TIMEOUT 5000
-#define DEFAULT_WAIT_TO_KILL_APP_TIMEOUT 20000
-
-typedef struct tagNOTIFY_CONTEXT
-{
- DWORD ProcessId;
- UINT Msg;
- WPARAM wParam;
- LPARAM lParam;
- HDESK Desktop;
- DWORD StartTime;
- DWORD QueryResult;
- HWND Dlg;
- DWORD EndNowResult;
- BOOL ShowUI;
- HANDLE UIThread;
- HWND WndClient;
- PSHUTDOWN_SETTINGS ShutdownSettings;
- LPTHREAD_START_ROUTINE SendMessageProc;
-} NOTIFY_CONTEXT, *PNOTIFY_CONTEXT;
-
-#define QUERY_RESULT_ABORT 0
-#define QUERY_RESULT_CONTINUE 1
-#define QUERY_RESULT_TIMEOUT 2
-#define QUERY_RESULT_ERROR 3
-#define QUERY_RESULT_FORCE 4
-
-static void FASTCALL
-UpdateProgressBar(HWND ProgressBar, PNOTIFY_CONTEXT NotifyContext)
-{
- DWORD Passed;
-
- Passed = GetTickCount() - NotifyContext->StartTime;
- Passed -= NotifyContext->ShutdownSettings->HungAppTimeout;
- if (NotifyContext->ShutdownSettings->WaitToKillAppTimeout < Passed)
- {
- Passed = NotifyContext->ShutdownSettings->WaitToKillAppTimeout;
- }
- SendMessageW(ProgressBar, PBM_SETPOS, Passed / 2, 0);
-}
-
-static INT_PTR CALLBACK
-EndNowDlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
- INT_PTR Result;
- PNOTIFY_CONTEXT NotifyContext;
- HWND ProgressBar;
- DWORD TitleLength;
- int Len;
- LPWSTR Title;
-
- switch(Msg)
- {
- case WM_INITDIALOG:
- NotifyContext = (PNOTIFY_CONTEXT) lParam;
- NotifyContext->EndNowResult = QUERY_RESULT_ABORT;
- SetWindowLongPtrW(Dlg, DWLP_USER, (LONG_PTR) lParam);
- TitleLength = SendMessageW(NotifyContext->WndClient, WM_GETTEXTLENGTH,
- 0, 0) +
- GetWindowTextLengthW(Dlg);
- Title = HeapAlloc(Win32CsrApiHeap, 0, (TitleLength + 1) * sizeof(WCHAR));
- if (NULL != Title)
- {
- Len = GetWindowTextW(Dlg, Title, TitleLength + 1);
- SendMessageW(NotifyContext->WndClient, WM_GETTEXT,
- TitleLength + 1 - Len, (LPARAM) (Title + Len));
- SetWindowTextW(Dlg, Title);
- HeapFree(Win32CsrApiHeap, 0, Title);
- }
- ProgressBar = GetDlgItem(Dlg, IDC_PROGRESS);
- SendMessageW(ProgressBar, PBM_SETRANGE32, 0,
- NotifyContext->ShutdownSettings->WaitToKillAppTimeout / 2);
- UpdateProgressBar(ProgressBar, NotifyContext);
- SetTimer(Dlg, 0, 200, NULL);
- Result = FALSE;
- break;
-
- case WM_TIMER:
- NotifyContext = (PNOTIFY_CONTEXT) GetWindowLongPtrW(Dlg, DWLP_USER);
- ProgressBar = GetDlgItem(Dlg, IDC_PROGRESS);
- UpdateProgressBar(ProgressBar, NotifyContext);
- Result = TRUE;
- break;
-
- case WM_COMMAND:
- if (BN_CLICKED == HIWORD(wParam) && IDC_END_NOW == LOWORD(wParam))
- {
- NotifyContext = (PNOTIFY_CONTEXT) GetWindowLongPtrW(Dlg, DWLP_USER);
- NotifyContext->EndNowResult = QUERY_RESULT_FORCE;
- SendMessageW(Dlg, WM_CLOSE, 0, 0);
- Result = TRUE;
- }
- else
- {
- Result = FALSE;
- }
- break;
-
- case WM_CLOSE:
- DestroyWindow(Dlg);
- Result = TRUE;
- break;
-
- case WM_DESTROY:
- NotifyContext = (PNOTIFY_CONTEXT) GetWindowLongPtrW(Dlg, DWLP_USER);
- NotifyContext->Dlg = NULL;
- KillTimer(Dlg, 0);
- PostQuitMessage(NotifyContext->EndNowResult);
- Result = TRUE;
- break;
-
- default:
- Result = FALSE;
- break;
- }
-
- return Result;
-}
-
-typedef void (WINAPI *INITCOMMONCONTROLS_PROC)(void);
-
-static void
-CallInitCommonControls()
-{
- static BOOL Initialized = FALSE;
- HMODULE Lib;
- INITCOMMONCONTROLS_PROC InitProc;
-
- if (Initialized)
- {
- return;
- }
-
- Lib = LoadLibraryW(L"COMCTL32.DLL");
- if (NULL == Lib)
- {
- return;
- }
- InitProc = (INITCOMMONCONTROLS_PROC) GetProcAddress(Lib,
"InitCommonControls");
- if (NULL == InitProc)
- {
- return;
- }
-
- (*InitProc)();
-
- Initialized = TRUE;
-}
-
-static DWORD WINAPI
-EndNowThreadProc(LPVOID Parameter)
-{
- PNOTIFY_CONTEXT NotifyContext = (PNOTIFY_CONTEXT) Parameter;
- MSG Msg;
-
- SetThreadDesktop(NotifyContext->Desktop);
- SwitchDesktop(NotifyContext->Desktop);
- CallInitCommonControls();
- NotifyContext->Dlg = CreateDialogParam(GetModuleHandleW(L"win32csr"),
- MAKEINTRESOURCE(IDD_END_NOW), NULL,
- EndNowDlgProc, (LPARAM) NotifyContext);
- if (NULL == NotifyContext->Dlg)
- {
- return 0;
- }
- ShowWindow(NotifyContext->Dlg, SW_SHOWNORMAL);
-
- while (GetMessageW(&Msg, NULL, 0, 0))
- {
- if (! IsDialogMessage(NotifyContext->Dlg, &Msg))
- {
- TranslateMessage(&Msg);
- DispatchMessageW(&Msg);
- }
- }
-
- return Msg.wParam;
-}
-
-typedef struct tagMESSAGE_CONTEXT
-{
- HWND Wnd;
- UINT Msg;
- WPARAM wParam;
- LPARAM lParam;
- DWORD Timeout;
-} MESSAGE_CONTEXT, *PMESSAGE_CONTEXT;
-
-static DWORD WINAPI
-SendQueryEndSession(LPVOID Parameter)
-{
- PMESSAGE_CONTEXT Context = (PMESSAGE_CONTEXT) Parameter;
- DWORD_PTR Result;
-
- if (SendMessageTimeoutW(Context->Wnd, WM_QUERYENDSESSION, Context->wParam,
- Context->lParam, SMTO_NORMAL, Context->Timeout,
- &Result))
- {
- return Result ? QUERY_RESULT_CONTINUE : QUERY_RESULT_ABORT;
- }
-
- return 0 == GetLastError() ? QUERY_RESULT_TIMEOUT : QUERY_RESULT_ERROR;
-}
-
-static DWORD WINAPI
-SendEndSession(LPVOID Parameter)
-{
- PMESSAGE_CONTEXT Context = (PMESSAGE_CONTEXT) Parameter;
- DWORD_PTR Result;
-
- if (Context->wParam)
- {
- if (SendMessageTimeoutW(Context->Wnd, WM_ENDSESSION, Context->wParam,
- Context->lParam, SMTO_NORMAL, Context->Timeout,
- &Result))
- {
- return QUERY_RESULT_CONTINUE;
- }
- return 0 == GetLastError() ? QUERY_RESULT_TIMEOUT : QUERY_RESULT_ERROR;
- }
- else
- {
- SendMessage(Context->Wnd, WM_ENDSESSION, Context->wParam,
- Context->lParam);
- return QUERY_RESULT_CONTINUE;
- }
-}
-
-static BOOL CALLBACK
-NotifyTopLevelEnum(HWND Wnd, LPARAM lParam)
-{
- PNOTIFY_CONTEXT NotifyContext = (PNOTIFY_CONTEXT) lParam;
- MESSAGE_CONTEXT MessageContext;
- DWORD Now, Passed;
- DWORD Timeout, WaitStatus;
- DWORD ProcessId;
- HANDLE MessageThread;
- HANDLE Threads[2];
-
- if (0 == GetWindowThreadProcessId(Wnd, &ProcessId))
- {
- NotifyContext->QueryResult = QUERY_RESULT_ERROR;
- return FALSE;
- }
-
- if (ProcessId == NotifyContext->ProcessId)
- {
- Now = GetTickCount();
- if (0 == NotifyContext->StartTime)
- {
- NotifyContext->StartTime = Now;
- }
- /* Note: Passed is computed correctly even when GetTickCount() wraps due
- to unsigned arithmetic */
- Passed = Now - NotifyContext->StartTime;
- MessageContext.Wnd = Wnd;
- MessageContext.Msg = NotifyContext->Msg;
- MessageContext.wParam = NotifyContext->wParam;
- MessageContext.lParam = NotifyContext->lParam;
- MessageContext.Timeout = NotifyContext->ShutdownSettings->HungAppTimeout;
- if (! NotifyContext->ShutdownSettings->AutoEndTasks)
- {
- MessageContext.Timeout +=
NotifyContext->ShutdownSettings->WaitToKillAppTimeout;
- }
- if (Passed < MessageContext.Timeout)
- {
- MessageContext.Timeout -= Passed;
- MessageThread = CreateThread(NULL, 0, NotifyContext->SendMessageProc,
- (LPVOID) &MessageContext, 0, NULL);
- if (NULL == MessageThread)
- {
- NotifyContext->QueryResult = QUERY_RESULT_ERROR;
- return FALSE;
- }
- Timeout = NotifyContext->ShutdownSettings->HungAppTimeout;
- if (Passed < Timeout)
- {
- Timeout -= Passed;
- WaitStatus = WaitForSingleObjectEx(MessageThread, Timeout, FALSE);
- }
- else
- {
- WaitStatus = WAIT_TIMEOUT;
- }
- if (WAIT_TIMEOUT == WaitStatus)
- {
- NotifyContext->WndClient = Wnd;
- if (NULL == NotifyContext->UIThread &&
NotifyContext->ShowUI)
- {
- NotifyContext->UIThread = CreateThread(NULL, 0,
- EndNowThreadProc,
- (LPVOID) NotifyContext,
- 0, NULL);
- }
- Threads[0] = MessageThread;
- Threads[1] = NotifyContext->UIThread;
- WaitStatus = WaitForMultipleObjectsEx(NULL == NotifyContext->UIThread
?
- 1 : 2,
- Threads, FALSE, INFINITE,
- FALSE);
- if (WAIT_OBJECT_0 == WaitStatus)
- {
- if (! GetExitCodeThread(MessageThread,
&NotifyContext->QueryResult))
- {
- NotifyContext->QueryResult = QUERY_RESULT_ERROR;
- }
- }
- else if (WAIT_OBJECT_0 + 1 == WaitStatus)
- {
- if (! GetExitCodeThread(NotifyContext->UIThread,
- &NotifyContext->QueryResult))
- {
- NotifyContext->QueryResult = QUERY_RESULT_ERROR;
- }
- }
- else
- {
- NotifyContext->QueryResult = QUERY_RESULT_ERROR;
- }
- if (WAIT_OBJECT_0 != WaitStatus)
- {
- TerminateThread(MessageThread, QUERY_RESULT_TIMEOUT);
- }
- }
- else if (WAIT_OBJECT_0 == WaitStatus)
- {
- if (! GetExitCodeThread(MessageThread,
- &NotifyContext->QueryResult))
- {
- NotifyContext->QueryResult = QUERY_RESULT_ERROR;
- }
- }
- else
- {
- NotifyContext->QueryResult = QUERY_RESULT_ERROR;
- }
- CloseHandle(MessageThread);
- }
- else
- {
- NotifyContext->QueryResult = QUERY_RESULT_TIMEOUT;
- }
- }
-
- return QUERY_RESULT_CONTINUE == NotifyContext->QueryResult;
-}
-
-static BOOL CALLBACK
-NotifyDesktopEnum(LPWSTR DesktopName, LPARAM lParam)
-{
- PNOTIFY_CONTEXT Context = (PNOTIFY_CONTEXT) lParam;
-
- Context->Desktop = OpenDesktopW(DesktopName, 0, FALSE,
- DESKTOP_ENUMERATE | DESKTOP_SWITCHDESKTOP);
- if (NULL == Context->Desktop)
- {
- DPRINT1("OpenDesktop failed with error %d\n", GetLastError());
- Context->QueryResult = QUERY_RESULT_ERROR;
- return FALSE;
- }
-
- EnumDesktopWindows(Context->Desktop, NotifyTopLevelEnum, lParam);
-
- CloseDesktop(Context->Desktop);
-
- return QUERY_RESULT_CONTINUE == Context->QueryResult;
-}
-
-static BOOL FASTCALL
-NotifyTopLevelWindows(PNOTIFY_CONTEXT Context)
-{
- HWINSTA WindowStation;
-
- WindowStation = GetProcessWindowStation();
- if (NULL == WindowStation)
- {
- DPRINT1("GetProcessWindowStation failed with error %d\n",
GetLastError());
- return TRUE;
- }
-
- EnumDesktopsW(WindowStation, NotifyDesktopEnum, (LPARAM) Context);
-
- return TRUE;
-}
-
-static BOOL FASTCALL
-NotifyAndTerminateProcess(PCSR_PROCESS ProcessData,
- PSHUTDOWN_SETTINGS ShutdownSettings,
- UINT Flags)
-{
- NOTIFY_CONTEXT Context;
- HANDLE Process;
- DWORD QueryResult = QUERY_RESULT_CONTINUE;
-
- Context.QueryResult = QUERY_RESULT_CONTINUE;
-
- if (0 == (Flags & EWX_FORCE))
- {
- if (NULL != ProcessData->Console)
- {
- ConioConsoleCtrlEventTimeout(CTRL_LOGOFF_EVENT, ProcessData,
- ShutdownSettings->WaitToKillAppTimeout);
- }
- else
- {
- Context.ProcessId = (DWORD_PTR) ProcessData->ClientId.UniqueProcess;
- Context.wParam = 0;
- Context.lParam = (0 != (Flags & EWX_INTERNAL_FLAG_LOGOFF) ?
- ENDSESSION_LOGOFF : 0);
- Context.StartTime = 0;
- Context.UIThread = NULL;
- Context.ShowUI = DtbgIsDesktopVisible();
- Context.Dlg = NULL;
- Context.ShutdownSettings = ShutdownSettings;
- Context.SendMessageProc = SendQueryEndSession;
-
- NotifyTopLevelWindows(&Context);
-
- Context.wParam = (QUERY_RESULT_ABORT != Context.QueryResult);
- Context.lParam = (0 != (Flags & EWX_INTERNAL_FLAG_LOGOFF) ?
- ENDSESSION_LOGOFF : 0);
- Context.SendMessageProc = SendEndSession;
- Context.ShowUI = DtbgIsDesktopVisible() &&
- (QUERY_RESULT_ABORT != Context.QueryResult);
- QueryResult = Context.QueryResult;
- Context.QueryResult = QUERY_RESULT_CONTINUE;
-
- NotifyTopLevelWindows(&Context);
-
- if (NULL != Context.UIThread)
- {
- if (NULL != Context.Dlg)
- {
- SendMessageW(Context.Dlg, WM_CLOSE, 0, 0);
- }
- else
- {
- TerminateThread(Context.UIThread, QUERY_RESULT_ERROR);
- }
- CloseHandle(Context.UIThread);
- }
- }
-
- if (QUERY_RESULT_ABORT == QueryResult)
- {
- return FALSE;
- }
- }
-
- /* Terminate this process */
- Process = OpenProcess(PROCESS_TERMINATE, FALSE,
- (DWORD_PTR) ProcessData->ClientId.UniqueProcess);
- if (NULL == Process)
- {
- DPRINT1("Unable to open process %d, error %d\n",
ProcessData->ClientId.UniqueProcess,
- GetLastError());
- return TRUE;
- }
- TerminateProcess(Process, 0);
- CloseHandle(Process);
-
- return TRUE;
-}
-
-typedef struct tagPROCESS_ENUM_CONTEXT
-{
- UINT ProcessCount;
- PCSR_PROCESS *ProcessData;
- TOKEN_ORIGIN TokenOrigin;
- DWORD ShellProcess;
- DWORD CsrssProcess;
-} PROCESS_ENUM_CONTEXT, *PPROCESS_ENUM_CONTEXT;
-
-static NTSTATUS WINAPI
-ExitReactosProcessEnum(PCSR_PROCESS ProcessData, PVOID Data)
-{
- HANDLE Process;
- HANDLE Token;
- TOKEN_ORIGIN Origin;
- DWORD ReturnLength;
- PPROCESS_ENUM_CONTEXT Context = (PPROCESS_ENUM_CONTEXT) Data;
- PCSR_PROCESS *NewData;
-
- /* Do not kill winlogon or csrss */
- if ((DWORD_PTR) ProcessData->ClientId.UniqueProcess == Context->CsrssProcess
||
- ProcessData->ClientId.UniqueProcess == LogonProcess)
- {
- return STATUS_SUCCESS;
- }
-
- /* Get the login session of this process */
- Process = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE,
- (DWORD_PTR) ProcessData->ClientId.UniqueProcess);
- if (NULL == Process)
- {
- DPRINT1("Unable to open process %d, error %d\n",
ProcessData->ClientId.UniqueProcess,
- GetLastError());
- return STATUS_UNSUCCESSFUL;
- }
-
- if (! OpenProcessToken(Process, TOKEN_QUERY, &Token))
- {
- DPRINT1("Unable to open token for process %d, error %d\n",
- ProcessData->ClientId.UniqueProcess, GetLastError());
- CloseHandle(Process);
- return STATUS_UNSUCCESSFUL;
- }
- CloseHandle(Process);
-
- if (! GetTokenInformation(Token, TokenOrigin, &Origin,
- sizeof(TOKEN_ORIGIN), &ReturnLength))
- {
- DPRINT1("GetTokenInformation failed for process %d with error %d\n",
- ProcessData->ClientId.UniqueProcess, GetLastError());
- CloseHandle(Token);
- return STATUS_UNSUCCESSFUL;
- }
- CloseHandle(Token);
-
- /* This process will be killed if it's in the correct logon session */
- if (RtlEqualLuid(&(Context->TokenOrigin.OriginatingLogonSession),
- &(Origin.OriginatingLogonSession)))
- {
- /* Kill the shell process last */
- if ((DWORD_PTR) ProcessData->ClientId.UniqueProcess ==
Context->ShellProcess)
- {
- ProcessData->ShutdownLevel = 0;
- }
- NewData = HeapAlloc(Win32CsrApiHeap, 0, (Context->ProcessCount + 1)
- * sizeof(PCSR_PROCESS));
- if (NULL == NewData)
- {
- return STATUS_NO_MEMORY;
- }
- if (0 != Context->ProcessCount)
- {
- memcpy(NewData, Context->ProcessData,
- Context->ProcessCount * sizeof(PCSR_PROCESS));
- HeapFree(Win32CsrApiHeap, 0, Context->ProcessData);
- }
- Context->ProcessData = NewData;
- Context->ProcessData[Context->ProcessCount] = ProcessData;
- Context->ProcessCount++;
- }
-
- return STATUS_SUCCESS;
-}
-
-static int
-ProcessDataCompare(const void *Elem1, const void *Elem2)
-{
- const PCSR_PROCESS *ProcessData1 = (PCSR_PROCESS *) Elem1;
- const PCSR_PROCESS *ProcessData2 = (PCSR_PROCESS *) Elem2;
-
- if ((*ProcessData1)->ShutdownLevel < (*ProcessData2)->ShutdownLevel)
- {
- return +1;
- }
- else if ((*ProcessData2)->ShutdownLevel < (*ProcessData1)->ShutdownLevel)
- {
- return -1;
- }
- else if ((*ProcessData1)->ClientId.UniqueProcess <
(*ProcessData2)->ClientId.UniqueProcess)
- {
- return +1;
- }
- else if ((*ProcessData2)->ClientId.UniqueProcess <
(*ProcessData1)->ClientId.UniqueProcess)
- {
- return -1;
- }
-
- return 0;
-}
-
-static DWORD FASTCALL
-GetShutdownSetting(HKEY DesktopKey, LPCWSTR ValueName, DWORD DefaultValue)
-{
- BYTE ValueBuffer[16];
- LONG ErrCode;
- DWORD Type;
- DWORD ValueSize;
- UNICODE_STRING StringValue;
- ULONG Value;
-
- ValueSize = sizeof(ValueBuffer);
- ErrCode = RegQueryValueExW(DesktopKey, ValueName, NULL, &Type, ValueBuffer,
- &ValueSize);
- if (ERROR_SUCCESS != ErrCode)
- {
- DPRINT("GetShutdownSetting for %S failed with error code %ld\n",
- ValueName, ErrCode);
- return DefaultValue;
- }
-
- if (REG_SZ == Type)
- {
- RtlInitUnicodeString(&StringValue, (LPCWSTR) ValueBuffer);
- if (! NT_SUCCESS(RtlUnicodeStringToInteger(&StringValue, 10, &Value)))
- {
- DPRINT1("Unable to convert value %S for setting %S\n",
- StringValue.Buffer, ValueName);
- return DefaultValue;
- }
- return (DWORD) Value;
- }
- else if (REG_DWORD == Type)
- {
- return *((DWORD *) ValueBuffer);
- }
-
- DPRINT1("Unexpected registry type %d for setting %S\n", Type, ValueName);
- return DefaultValue;
-}
-
-static void FASTCALL
-LoadShutdownSettings(PSID Sid, PSHUTDOWN_SETTINGS ShutdownSettings)
-{
- static WCHAR Subkey[] = L"\\Control Panel\\Desktop";
- LPWSTR StringSid;
- WCHAR InitialKeyName[128];
- LPWSTR KeyName;
- HKEY DesktopKey;
- LONG ErrCode;
-
- ShutdownSettings->AutoEndTasks = DEFAULT_AUTO_END_TASKS;
- ShutdownSettings->HungAppTimeout = DEFAULT_HUNG_APP_TIMEOUT;
- ShutdownSettings->WaitToKillAppTimeout = DEFAULT_WAIT_TO_KILL_APP_TIMEOUT;
-
- if (! ConvertSidToStringSidW(Sid, &StringSid))
- {
- DPRINT1("ConvertSidToStringSid failed with error %d, using default shutdown
settings\n",
- GetLastError());
- return;
- }
- if (wcslen(StringSid) + wcslen(Subkey) + 1 <=
- sizeof(InitialKeyName) / sizeof(WCHAR))
- {
- KeyName = InitialKeyName;
- }
- else
- {
- KeyName = HeapAlloc(Win32CsrApiHeap, 0,
- (wcslen(StringSid) + wcslen(Subkey) + 1) *
- sizeof(WCHAR));
- if (NULL == KeyName)
- {
- DPRINT1("Failed to allocate memory, using default shutdown
settings\n");
- LocalFree(StringSid);
- return;
- }
- }
- wcscat(wcscpy(KeyName, StringSid), Subkey);
- LocalFree(StringSid);
-
- ErrCode = RegOpenKeyExW(HKEY_USERS, KeyName, 0, KEY_QUERY_VALUE, &DesktopKey);
- if (KeyName != InitialKeyName)
- {
- HeapFree(Win32CsrApiHeap, 0, KeyName);
- }
- if (ERROR_SUCCESS != ErrCode)
- {
- DPRINT1("RegOpenKeyEx failed with error %ld, using default shutdown
settings\n", ErrCode);
- return;
- }
-
- ShutdownSettings->AutoEndTasks = (BOOL) GetShutdownSetting(DesktopKey,
L"AutoEndTasks",
- (DWORD) DEFAULT_AUTO_END_TASKS);
- ShutdownSettings->HungAppTimeout = GetShutdownSetting(DesktopKey,
- L"HungAppTimeout",
- DEFAULT_HUNG_APP_TIMEOUT);
- ShutdownSettings->WaitToKillAppTimeout = GetShutdownSetting(DesktopKey,
- L"WaitToKillAppTimeout",
- DEFAULT_WAIT_TO_KILL_APP_TIMEOUT);
-
- RegCloseKey(DesktopKey);
-}
-
-static NTSTATUS FASTCALL
-InternalExitReactos(DWORD ProcessId, DWORD ThreadId, UINT Flags)
-{
- HANDLE CallerThread;
- HANDLE CallerToken;
- NTSTATUS Status;
- PROCESS_ENUM_CONTEXT Context;
- DWORD ReturnLength;
- HWND ShellWnd;
- UINT ProcessIndex;
- char FixedUserInfo[64];
- TOKEN_USER *UserInfo;
- SHUTDOWN_SETTINGS ShutdownSettings;
-
- if (ProcessId != (DWORD_PTR) LogonProcess)
- {
- DPRINT1("Internal ExitWindowsEx call not from winlogon\n");
- return STATUS_ACCESS_DENIED;
- }
-
- DPRINT1("FIXME: Need to close all user processes!\n");
- return STATUS_SUCCESS;
-
- CallerThread = OpenThread(THREAD_QUERY_INFORMATION, FALSE, ThreadId);
- if (NULL == CallerThread)
- {
- DPRINT1("OpenThread failed with error %d\n", GetLastError());
- return STATUS_UNSUCCESSFUL;
- }
- if (! OpenThreadToken(CallerThread, TOKEN_QUERY, FALSE, &CallerToken))
- {
- DPRINT1("OpenThreadToken failed with error %d\n", GetLastError());
- CloseHandle(CallerThread);
- return STATUS_UNSUCCESSFUL;
- }
- CloseHandle(CallerThread);
-
- Context.ProcessCount = 0;
- Context.ProcessData = NULL;
- if (! GetTokenInformation(CallerToken, TokenOrigin, &Context.TokenOrigin,
- sizeof(TOKEN_ORIGIN), &ReturnLength))
- {
- DPRINT1("GetTokenInformation failed with error %d\n", GetLastError());
- CloseHandle(CallerToken);
- return STATUS_UNSUCCESSFUL;
- }
- if (! GetTokenInformation(CallerToken, TokenUser, FixedUserInfo,
- sizeof(FixedUserInfo), &ReturnLength))
- {
- if (sizeof(FixedUserInfo) < ReturnLength)
- {
- UserInfo = HeapAlloc(Win32CsrApiHeap, 0, ReturnLength);
- if (NULL == UserInfo)
- {
- DPRINT1("Unable to allocate %u bytes for user info\n",
- (unsigned) ReturnLength);
- CloseHandle(CallerToken);
- return STATUS_NO_MEMORY;
- }
- if (! GetTokenInformation(CallerToken, TokenUser, UserInfo,
- ReturnLength, &ReturnLength))
- {
- DPRINT1("GetTokenInformation failed with error %d\n",
- GetLastError());
- HeapFree(Win32CsrApiHeap, 0, UserInfo);
- CloseHandle(CallerToken);
- return STATUS_UNSUCCESSFUL;
- }
- }
- else
- {
- DPRINT1("GetTokenInformation failed with error %d\n",
GetLastError());
- CloseHandle(CallerToken);
- return STATUS_UNSUCCESSFUL;
- }
- }
- else
- {
- UserInfo = (TOKEN_USER *) FixedUserInfo;
- }
- CloseHandle(CallerToken);
- LoadShutdownSettings(UserInfo->User.Sid, &ShutdownSettings);
- if (UserInfo != (TOKEN_USER *) FixedUserInfo)
- {
- HeapFree(Win32CsrApiHeap, 0, UserInfo);
- }
- Context.CsrssProcess = GetCurrentProcessId();
- ShellWnd = GetShellWindow();
- if (NULL == ShellWnd)
- {
- DPRINT("No shell present\n");
- Context.ShellProcess = 0;
- }
- else if (0 == GetWindowThreadProcessId(ShellWnd, &Context.ShellProcess))
- {
- DPRINT1("Can't get process id of shell window\n");
- Context.ShellProcess = 0;
- }
-
- Status = Win32CsrEnumProcesses(ExitReactosProcessEnum, &Context);
- if (! NT_SUCCESS(Status))
- {
- DPRINT1("Failed to enumerate registered processes, status 0x%x\n",
- Status);
- if (NULL != Context.ProcessData)
- {
- HeapFree(Win32CsrApiHeap, 0, Context.ProcessData);
- }
- return Status;
- }
-
- qsort(Context.ProcessData, Context.ProcessCount, sizeof(PCSR_PROCESS),
- ProcessDataCompare);
-
- /* Terminate processes, stop if we find one kicking and screaming it doesn't
- want to die */
- Status = STATUS_SUCCESS;
- for (ProcessIndex = 0;
- ProcessIndex < Context.ProcessCount && NT_SUCCESS(Status);
- ProcessIndex++)
- {
- if (! NotifyAndTerminateProcess(Context.ProcessData[ProcessIndex],
- &ShutdownSettings, Flags))
- {
- Status = STATUS_REQUEST_ABORTED;
- }
- }
-
- /* Cleanup */
- if (NULL != Context.ProcessData)
- {
- HeapFree(Win32CsrApiHeap, 0, Context.ProcessData);
- }
-
- return Status;
-}
-
-static NTSTATUS FASTCALL
-UserExitReactos(DWORD UserProcessId, UINT Flags)
-{
- NTSTATUS Status;
-
- if (NULL == LogonNotifyWindow)
- {
- DPRINT1("No LogonNotifyWindow registered\n");
- return STATUS_NOT_FOUND;
- }
-
- /* FIXME Inside 2000 says we should impersonate the caller here */
- Status = SendMessageW(LogonNotifyWindow, PM_WINLOGON_EXITWINDOWS,
- (WPARAM) UserProcessId,
- (LPARAM) Flags);
- /* If the message isn't handled, the return value is 0, so 0 doesn't
indicate
- success. Success is indicated by a 1 return value, if anything besides 0
- or 1 it's a NTSTATUS value */
- if (1 == Status)
- {
- Status = STATUS_SUCCESS;
- }
- else if (0 == Status)
- {
- Status = STATUS_NOT_IMPLEMENTED;
- }
-
- return Status;
-}
-
-CSR_API(CsrExitReactos)
-{
- if (0 == (ApiMessage->Data.ExitReactosRequest.Flags & EWX_INTERNAL_FLAG))
- {
- return UserExitReactos((DWORD_PTR) ApiMessage->Header.ClientId.UniqueProcess,
- ApiMessage->Data.ExitReactosRequest.Flags);
- }
- else
- {
- return InternalExitReactos((DWORD_PTR)
ApiMessage->Header.ClientId.UniqueProcess,
- (DWORD_PTR)
ApiMessage->Header.ClientId.UniqueThread,
- ApiMessage->Data.ExitReactosRequest.Flags);
- }
-}
-
-/* EOF */
Modified: branches/ros-csrss/win32ss/user/winsrv/harderror.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/h…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/harderror.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/harderror.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,8 +1,8 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS system libraries
- * FILE: win32ss/user/winsrv/dllmain.c
- * PURPOSE: Initialization
+ * PROJECT: ReactOS User API Server DLL
+ * FILE: win32ss/user/winsrv/harderror.c
+ * PURPOSE: Hard errors
* PROGRAMMERS: Dmitry Philippov (shedon(a)mail.ru)
* Timo Kreuzer (timo.kreuzer(a)reactos.org)
*/
Modified: branches/ros-csrss/win32ss/user/winsrv/init.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/i…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/init.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/init.c [iso-8859-1] Thu Oct 25 20:40:41 2012
@@ -1,25 +1,10 @@
/*
- * init.c - ReactOS/Win32 Console+User Enviroment Subsystem Server - Initialization
- *
- * ReactOS Operating System
- *
- * --------------------------------------------------------------------
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * --------------------------------------------------------------------
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS User API Server DLL
+ * FILE: win32ss/user/winsrv/init.c
+ * PURPOSE: Initialization
+ * PROGRAMMERS: Dmitry Philippov (shedon(a)mail.ru)
+ * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
*/
#include "winsrv.h"
Modified: branches/ros-csrss/win32ss/user/winsrv/resource.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/r…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/resource.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/resource.h [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,8 +1,7 @@
-/* $Id: resource.h 51293 2011-04-09 12:01:36Z mkupfer $
- *
+/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS Win32 subsystem
- * FILE: subsys/csrss/win32csr/resource.h
+ * PROJECT: ReactOS User API Server DLL
+ * FILE: win32ss/user/winsrv/resource.h
* PURPOSE: Resource #defines
*/
Modified: branches/ros-csrss/win32ss/user/winsrv/server.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/s…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/server.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/server.c [iso-8859-1] Thu Oct 25 20:40:41 2012
@@ -1,27 +1,10 @@
/*
- * server.c - ReactOS/Win32 Console+User Enviroment Subsystem Server - Initialization
- *
- * ReactOS Operating System
- *
- * --------------------------------------------------------------------
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * --------------------------------------------------------------------
- *
- * PROGRAMMER: Eric Kohl
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS User API Server DLL
+ * FILE: win32ss/user/winsrv/server.c
+ * PURPOSE: Server APIs
+ * PROGRAMMERS: Eric Kohl
+ * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
*/
/* INCLUDES ******************************************************************/
Copied: branches/ros-csrss/win32ss/user/winsrv/shutdown.c (from r57617,
branches/ros-csrss/win32ss/user/winsrv/exitros.c)
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/s…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/exitros.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/shutdown.c [iso-8859-1] Thu Oct 25 20:40:41
2012
@@ -1,8 +1,9 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS CSRSS subsystem
- * FILE: win32ss/user/winsrv/exitros.c
+ * PROJECT: ReactOS User API Server DLL
+ * FILE: win32ss/user/winsrv/shutdown.c
* PURPOSE: Logout/shutdown
+ * PROGRAMMERS:
*/
/* INCLUDES ******************************************************************/
@@ -28,7 +29,7 @@
return CsrEnumProcesses(EnumProc, Context);
}
-CSR_API(CsrRegisterLogonProcess)
+CSR_API(SrvRegisterLogonProcess)
{
if (ApiMessage->Data.RegisterLogonProcessRequest.Register)
{
@@ -925,7 +926,7 @@
return Status;
}
-CSR_API(CsrExitReactos)
+CSR_API(SrvExitWindowsEx)
{
if (0 == (ApiMessage->Data.ExitReactosRequest.Flags & EWX_INTERNAL_FLAG))
{
Modified: branches/ros-csrss/win32ss/user/winsrv/winsrv.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/w…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/winsrv.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/winsrv.h [iso-8859-1] Thu Oct 25 20:40:41 2012
@@ -1,3 +1,11 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS User API Server DLL
+ * FILE: win32ss/user/winsrv/winsrv.h
+ * PURPOSE: Main header - Definitions
+ * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ */
+
#pragma once
/* PSDK/NDK Headers */