mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
Rework of #5448, contributes to #7143. The anonymous pipes were tested on macOS, build was tested only on few configurations (hoping to solve some issue through Jenkins builds). Named pipe tests get stuck on macOS, but it may be unrelated Xunit issue and needs some proper debugging. @Therzok, do you know of anything else that is missing for parallel MSBuild? Do you have some test environment for it by chance?
31 lines
803 B
C#
31 lines
803 B
C#
using System.Security.AccessControl;
|
|
|
|
namespace System.IO.Pipes
|
|
{
|
|
public partial class PipeStream
|
|
{
|
|
public PipeSecurity GetAccessControl ()
|
|
{
|
|
if (State == PipeState.Closed) {
|
|
throw Error.GetPipeNotOpen ();
|
|
}
|
|
|
|
// PipeState must be Disconnected, Connected, or Broken
|
|
return new PipeSecurity (SafePipeHandle, AccessControlSections.Access | AccessControlSections.Owner | AccessControlSections.Group);
|
|
}
|
|
|
|
public void SetAccessControl (PipeSecurity pipeSecurity)
|
|
{
|
|
if (pipeSecurity == null) {
|
|
throw new ArgumentNullException (nameof(pipeSecurity));
|
|
}
|
|
|
|
// Checks that State != WaitingToConnect and State != Closed
|
|
CheckPipePropertyOperations ();
|
|
|
|
// PipeState must be either Disconected or Connected
|
|
pipeSecurity.Persist (SafePipeHandle);
|
|
}
|
|
}
|
|
}
|