branch update for HEAD-2003091401
[reactos.git] / subsys / csrss / api / process.c
index cd53f24..ce3af30 100644 (file)
@@ -18,8 +18,6 @@
 #define NDEBUG
 #include <debug.h>
 
-BOOL STDCALL W32kCleanupForProcess( INT Process );
-
 #define LOCK   RtlEnterCriticalSection(&ProcessDataLock)
 #define UNLOCK RtlLeaveCriticalSection(&ProcessDataLock)
 
@@ -120,7 +118,12 @@ NTSTATUS STDCALL CsrFreeProcessData(ULONG Pid)
    if (pProcessData)
    {
       //DbgPrint("CsrFreeProcessData pid: %d\n", Pid);
-      W32kCleanupForProcess(Pid);  //should check if win32k process
+      if (pProcessData->Console)
+      {
+         RtlEnterCriticalSection(&ActiveConsoleLock);
+         RemoveEntryList(&pProcessData->ProcessEntry);
+         RtlLeaveCriticalSection(&ActiveConsoleLock);
+      }
       if (pProcessData->HandleTable)
       {
         for( c = 0; c < pProcessData->HandleTableSize; c++ )
@@ -246,6 +249,10 @@ CSR_API(CsrCreateProcess)
           return Status;
         }
        NtClose( Process );
+       NewProcessData->CtrlDispatcher = Request->Data.CreateProcessRequest.CtrlDispatcher;
+       RtlEnterCriticalSection( &ActiveConsoleLock );
+       InsertHeadList(&NewProcessData->Console->ProcessList, &NewProcessData->ProcessEntry);
+       RtlLeaveCriticalSection( &ActiveConsoleLock );
      }
    else Reply->Data.CreateProcessReply.OutputHandle = Reply->Data.CreateProcessReply.InputHandle = INVALID_HANDLE_VALUE;