0abdbe5a7d
Former-commit-id: 7467d4b717762eeaf652d77f1486dd11ffb1ff1f
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);
|
|
}
|
|
}
|
|
}
|