[Process] Start process as non-elevated user
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
### Background and motivation
Today I've been studying some MSFT source code and I got to the conclusion that we most likely need to add the ability to start process as non-elevated user when running as elevated user.
One way of doing that on Windows would be to use following sys-calls:
- https://learn.microsoft.com/en-us/windows/win32/api/winsafer/nf-winsafer-safercreatelevel
- https://learn.microsoft.com/en-us/windows/win32/api/winsafer/nf-winsafer-safercomputetokenfromlevel
- https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessasusera
### API Proposal
The proposal is to extend `ProcessStartInfo` with a new `StartNonElevated ` property that indicates the process should be started as non-elevated user.
```csharp
namespace System.Diagnostics;
{
public sealed class ProcessStartInfo
{
public bool StartNonElevated { get; set; }
}
}
```
Any feedback is welcome!
Contributor guide
Assessment
This issue has not been assessed yet.