Author: ion
Date: Sun Feb 19 06:44:09 2012
New Revision: 55699
URL:
http://svn.reactos.org/svn/reactos?rev=55699&view=rev
Log:
[CSRSRV]: I confused ShutdownCallback with DisconnectCallback. What win32csr needs is
actually the later. Fixed that. Also removed CallProcessDeleted since we already call the
Disconnectcallback from CsrRemoveProcess, which we do call in CSRSRV. Enabled the code
that was disabled.
Modified:
trunk/reactos/subsystems/csr/csrsrv/process.c
trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c
trunk/reactos/subsystems/win32/csrss/csrsrv/init.c
trunk/reactos/subsystems/win32/csrss/csrsrv/procsup.c
trunk/reactos/subsystems/win32/csrss/win32csr/console.c
trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c
trunk/reactos/subsystems/win32/csrss/win32csr/handle.c
trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h
Modified: trunk/reactos/subsystems/csr/csrsrv/process.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/csr/csrsrv/proc…
==============================================================================
--- trunk/reactos/subsystems/csr/csrsrv/process.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/csr/csrsrv/process.c [iso-8859-1] Sun Feb 19 06:44:09 2012
@@ -345,10 +345,10 @@
ServerDll = CsrLoadedServerDll[i];
/* Check if it's valid and if it has a Disconnect Callback */
- if (ServerDll && ServerDll->DisconnectCallback)
+ if ((ServerDll) && (ServerDll->DisconnectCallback))
{
/* Call it */
- (ServerDll->DisconnectCallback)(CsrProcess);
+ ServerDll->DisconnectCallback(CsrProcess);
}
}
}
Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c [iso-8859-1] Sun Feb 19
06:44:09 2012
@@ -14,7 +14,6 @@
#include <debug.h>
extern NTSTATUS CallProcessCreated(PCSR_PROCESS, PCSR_PROCESS);
-extern NTSTATUS CallProcessDeleted(PCSR_PROCESS);
/* GLOBALS *******************************************************************/
@@ -97,7 +96,6 @@
LOCK;
Process = pProcessData->ProcessHandle;
- CallProcessDeleted(pProcessData);
/* Dereference all process threads */
NextEntry = pProcessData->ThreadList.Flink;
Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/csrsrv/init.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/csrsrv/init.c [iso-8859-1] Sun Feb 19 06:44:09
2012
@@ -82,31 +82,6 @@
}
return Status;
-}
-
-NTSTATUS
-CallProcessDeleted(IN PCSR_PROCESS ProcessData)
-{
- ULONG Result = 0;
- unsigned i;
- PCSR_SERVER_DLL ServerDll;
-
- DPRINT("CSR: %s called\n", __FUNCTION__);
-
- /* Notify the Server DLLs */
- for (i = 0; i < CSR_SERVER_DLL_MAX; i++)
- {
- /* Get the current Server DLL */
- ServerDll = CsrLoadedServerDll[i];
-
- /* Make sure it's valid and that it has callback */
- if ((ServerDll) && (ServerDll->ShutdownProcessCallback))
- {
- Result = ServerDll->ShutdownProcessCallback(ProcessData, 0, FALSE);
- }
- }
-
- return Result;
}
CSRSS_API_DEFINITION NativeDefinitions[] =
Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/procsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/csrsrv/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/csrsrv/procsup.c [iso-8859-1] Sun Feb 19 06:44:09
2012
@@ -701,66 +701,63 @@
NTAPI
CsrRemoveProcess(IN PCSR_PROCESS CsrProcess)
{
+ PCSR_SERVER_DLL ServerDll;
+ ULONG i;
+ ASSERT(ProcessStructureListLocked());
+
+ /* Remove us from the Process List */
+ RemoveEntryList(&CsrProcess->ListLink);
+
+ /* Release the lock */
+ CsrReleaseProcessLock();
+
+ /* Loop every Server DLL */
+ for (i = 0; i < CSR_SERVER_DLL_MAX; i++)
+ {
+ /* Get the Server DLL */
+ ServerDll = CsrLoadedServerDll[i];
+
+ /* Check if it's valid and if it has a Disconnect Callback */
+ if ((ServerDll) && (ServerDll->DisconnectCallback))
+ {
+ /* Call it */
+ ServerDll->DisconnectCallback(CsrProcess);
+ }
+ }
+}
+
+/*++
+ * @name CsrInsertProcess
+ *
+ * The CsrInsertProcess routine inserts a CSR Process into the Process List
+ * and notifies Server DLLs of the creation of a new CSR Process.
+ *
+ * @param Parent
+ * Optional pointer to the CSR Process creating this CSR Process.
+ *
+ * @param CurrentProcess
+ * Optional pointer to the current CSR Process.
+ *
+ * @param CsrProcess
+ * Pointer to the CSR Process which is to be inserted.
+ *
+ * @return None.
+ *
+ * @remarks None.
+ *
+ *--*/
+VOID
+NTAPI
+CsrInsertProcess(IN PCSR_PROCESS Parent OPTIONAL,
+ IN PCSR_PROCESS CurrentProcess OPTIONAL,
+ IN PCSR_PROCESS CsrProcess)
+{
#if 0
PCSR_SERVER_DLL ServerDll;
ULONG i;
#endif
ASSERT(ProcessStructureListLocked());
- /* Remove us from the Process List */
- RemoveEntryList(&CsrProcess->ListLink);
-
- /* Release the lock */
- CsrReleaseProcessLock();
-#if 0
- /* Loop every Server DLL */
- for (i = 0; i < CSR_SERVER_DLL_MAX; i++)
- {
- /* Get the Server DLL */
- ServerDll = CsrLoadedServerDll[i];
-
- /* Check if it's valid and if it has a Disconnect Callback */
- if (ServerDll && ServerDll->DisconnectCallback)
- {
- /* Call it */
- (ServerDll->DisconnectCallback)(CsrProcess);
- }
- }
-#endif
-}
-
-/*++
- * @name CsrInsertProcess
- *
- * The CsrInsertProcess routine inserts a CSR Process into the Process List
- * and notifies Server DLLs of the creation of a new CSR Process.
- *
- * @param Parent
- * Optional pointer to the CSR Process creating this CSR Process.
- *
- * @param CurrentProcess
- * Optional pointer to the current CSR Process.
- *
- * @param CsrProcess
- * Pointer to the CSR Process which is to be inserted.
- *
- * @return None.
- *
- * @remarks None.
- *
- *--*/
-VOID
-NTAPI
-CsrInsertProcess(IN PCSR_PROCESS Parent OPTIONAL,
- IN PCSR_PROCESS CurrentProcess OPTIONAL,
- IN PCSR_PROCESS CsrProcess)
-{
-#if 0
- PCSR_SERVER_DLL ServerDll;
- ULONG i;
-#endif
- ASSERT(ProcessStructureListLocked());
-
/* Set the parent */
CsrProcess->Parent = Parent;
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/console.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/console.c [iso-8859-1] Sun Feb 19
06:44:09 2012
@@ -313,7 +313,8 @@
CSR_API(CsrFreeConsole)
{
- return Win32CsrReleaseConsole(ProcessData, 0, 0);
+ Win32CsrReleaseConsole(ProcessData);
+ return STATUS_SUCCESS;
}
VOID WINAPI
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c [iso-8859-1] Sun Feb 19
06:44:09 2012
@@ -353,7 +353,7 @@
ServerDll->HardErrorCallback = Win32CsrHardError;
ServerDll->NewProcessCallback = Win32CsrDuplicateHandleTable;
- ServerDll->ShutdownProcessCallback = Win32CsrReleaseConsole;
+ ServerDll->DisconnectCallback = Win32CsrReleaseConsole;
#else
*ApiDefinitions = Win32CsrApiDefinitions;
ServerProcs->HardErrorProc = Win32CsrHardError;
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/handle.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/handle.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/handle.c [iso-8859-1] Sun Feb 19
06:44:09 2012
@@ -132,10 +132,10 @@
ConioDeleteConsole(&Console->Header);
}
-ULONG
+VOID
WINAPI
Win32CsrReleaseConsole(
- PCSR_PROCESS ProcessData, ULONG Flags, BOOLEAN First)
+ PCSR_PROCESS ProcessData)
{
PCSRSS_CONSOLE Console;
ULONG i;
@@ -161,10 +161,8 @@
//CloseHandle(ProcessData->ConsoleEvent);
//ProcessData->ConsoleEvent = NULL;
RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
- return 0;
- }
- RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
- return -1;
+ }
+ RtlLeaveCriticalSection(&ProcessData->HandleTableLock);
}
NTSTATUS
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/win32csr.h [iso-8859-1] Sun Feb 19
06:44:09 2012
@@ -54,7 +54,7 @@
VOID FASTCALL Win32CsrUnlockObject(Object_t *Object);
NTSTATUS FASTCALL Win32CsrReleaseObject(PCSR_PROCESS ProcessData,
HANDLE Object);
-ULONG WINAPI Win32CsrReleaseConsole(PCSR_PROCESS ProcessData, ULONG Flags, BOOLEAN
First);
+VOID WINAPI Win32CsrReleaseConsole(PCSR_PROCESS ProcessData);
NTSTATUS WINAPI Win32CsrDuplicateHandleTable(PCSR_PROCESS SourceProcessData,
PCSR_PROCESS TargetProcessData);
CSR_API(CsrGetHandle);