mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:56:00 +00:00
- Don't duplicate the process handle.
- Do close the process and thread handle if the caller doesn't request it. svn path=/trunk/; revision=15687
This commit is contained in:
parent
277b2da899
commit
e3d66fd5c6
1 changed files with 5 additions and 18 deletions
|
@ -113,24 +113,6 @@ SmCreateUserProcess (LPWSTR ImagePath,
|
||||||
__FUNCTION__, Status);
|
__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 */
|
/* Wait for process termination */
|
||||||
if (WaitForIt)
|
if (WaitForIt)
|
||||||
|
@ -145,6 +127,11 @@ SmCreateUserProcess (LPWSTR ImagePath,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (NULL == UserProcessInfo)
|
||||||
|
{
|
||||||
|
NtClose(pProcessInfo->ProcessHandle);
|
||||||
|
NtClose(pProcessInfo->ThreadHandle);
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue