[ros-diffs] [hbirr] 15687: - Don't duplicate the process handle.

hbirr at svn.reactos.com hbirr at svn.reactos.com
Mon May 30 22:11:48 CEST 2005


- Don't duplicate the process handle.  
- Do close the process and thread handle if the caller doesn't request
it.
Modified: trunk/reactos/subsys/smss/smapiexec.c
  _____  

Modified: trunk/reactos/subsys/smss/smapiexec.c
--- trunk/reactos/subsys/smss/smapiexec.c	2005-05-30 19:45:04 UTC
(rev 15686)
+++ trunk/reactos/subsys/smss/smapiexec.c	2005-05-30 20:11:44 UTC
(rev 15687)
@@ -113,24 +113,6 @@

 				__FUNCTION__, Status);
 		}
 	}
-	else
-	{
-		HANDLE DupProcessHandle = (HANDLE) 0;
-		
-		Status = NtDuplicateObject (NtCurrentProcess(),
-					    pProcessInfo->ProcessHandle,
-					    NtCurrentProcess(),
-					    & DupProcessHandle,
-					    PROCESS_ALL_ACCESS,
-					    0, 0);
-		if(!NT_SUCCESS(Status))
-		{
-			DPRINT1("SM: %s: NtDuplicateObject failed
(Status=0x%08lx)\n",
-				__FUNCTION__, Status);
-		}
-		pProcessInfo->ProcessHandle = DupProcessHandle;
-		
-	}
 
 	/* Wait for process termination */
 	if (WaitForIt)
@@ -145,6 +127,11 @@
 		}
 		
 	}
+        if (NULL == UserProcessInfo)
+        {
+           NtClose(pProcessInfo->ProcessHandle);
+           NtClose(pProcessInfo->ThreadHandle);
+        }
 	return Status;
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050530/3fa88442/attachment.html


More information about the Ros-diffs mailing list