{
/* Call the generic cleanup code */
DPRINT1("Should kill process: %p\n", CsrProcess);
- CsrProcessRefcountZero(CsrProcess);
CsrAcquireProcessLock();
+ CsrProcessRefcountZero(CsrProcess);
}
}
if (CsrProcessSequenceCount < 5) CsrProcessSequenceCount = 5;
/* Increase the reference count */
- CsrProcess->ReferenceCount++;
+ CsrLockedReferenceProcess(CsrProcess);
/* Initialize the Thread List */
InitializeListHead(&CsrProcess->ThreadList);
* 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 ParentProcess
+ * Optional pointer to the Parent Process creating this CSR Process.
*
* @param CsrProcess
* Pointer to the CSR Process which is to be inserted.
*--*/
VOID
NTAPI
-CsrInsertProcess(IN PCSR_PROCESS Parent OPTIONAL, // ParentProcess
- IN PCSR_PROCESS CurrentProcess OPTIONAL, // CallingProcess
- IN PCSR_PROCESS CsrProcess) // Process
+CsrInsertProcess(IN PCSR_PROCESS ParentProcess OPTIONAL,
+ IN PCSR_PROCESS CsrProcess)
{
PCSR_SERVER_DLL ServerDll;
ULONG i;
ASSERT(ProcessStructureListLocked());
- /* Set the parent */
- CsrProcess->Parent = Parent;
-
/* Insert it into the Root List */
InsertTailList(&CsrRootProcess->ListLink, &CsrProcess->ListLink);
/* Make sure it's valid and that it has callback */
if (ServerDll && ServerDll->NewProcessCallback)
{
- ServerDll->NewProcessCallback(CurrentProcess, CsrProcess);
+ ServerDll->NewProcessCallback(ParentProcess, CsrProcess);
}
}
}
CsrSetBackgroundPriority(CsrProcess);
/* Insert the Process */
- CsrInsertProcess(NULL, CurrentProcess, CsrProcess);
+ CsrInsertProcess(CurrentProcess, CsrProcess);
/* Release lock and return */
CsrReleaseProcessLock();
* @param CsrThread
* Pointer to the CSR Thread to impersonate.
*
- * @return TRUE if impersionation suceeded, false otherwise.
+ * @return TRUE if impersonation succeeded, false otherwise.
*
* @remarks Impersonation can be recursive.
*
{
PLIST_ENTRY NextEntry;
PCSR_PROCESS CurrentProcess = NULL;
- NTSTATUS Status;
+ NTSTATUS Status = STATUS_UNSUCCESSFUL;
/* Acquire the lock */
CsrAcquireProcessLock();
if (!CsrProcess) break;
/* Increase reference to process */
- CsrProcess->ReferenceCount++;
+ CsrLockedReferenceProcess(CsrProcess);
FirstTry = TRUE;
while (TRUE)