Xamarin Public Jenkins (auto-signing) 0abdbe5a7d Imported Upstream version 5.18.0.142
Former-commit-id: 7467d4b717762eeaf652d77f1486dd11ffb1ff1f
2018-10-09 08:20:59 +00:00

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);
}
}
}