AnonymousPipeServerStream.Windows.cs 808 B

12345678910111213141516171819202122
  1. using Microsoft.Win32.SafeHandles;
  2. using System.Diagnostics;
  3. using System.Runtime.InteropServices;
  4. namespace System.IO.Pipes
  5. {
  6. public sealed partial class AnonymousPipeServerStream
  7. {
  8. public AnonymousPipeServerStream (PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity pipeSecurity)
  9. : base (direction, bufferSize)
  10. {
  11. if (direction == PipeDirection.InOut) {
  12. throw new NotSupportedException(SR.NotSupported_AnonymousPipeUnidirectional);
  13. }
  14. if (inheritability < HandleInheritability.None || inheritability > HandleInheritability.Inheritable) {
  15. throw new ArgumentOutOfRangeException(nameof(inheritability), SR.ArgumentOutOfRange_HandleInheritabilityNoneOrInheritable);
  16. }
  17. Create(direction, inheritability, bufferSize, pipeSecurity);
  18. }
  19. }
  20. }