public AnonymousPipeServerStream(PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity pipeSecurity) : base(direction, bufferSize)
{
object obj2;
if (direction == PipeDirection.InOut)
{
throw new NotSupportedException(System.SR.GetString("NotSupported_AnonymousPipeUnidirectional"));
}
if ((inheritability < HandleInheritability.None) || (inheritability > HandleInheritability.Inheritable))
{
throw new ArgumentOutOfRangeException("inheritability", System.SR.GetString("ArgumentOutOfRange_HandleInheritabilityNoneOrInheritable"));
}
Microsoft.Win32.UnsafeNativeMethods.SECURITY_ATTRIBUTES secAttrs = PipeStream.GetSecAttrs(inheritability, pipeSecurity, out obj2);
try
{
this.Create(direction, secAttrs, bufferSize);
}
finally
{
if (obj2 != null)
{
((GCHandle)obj2).Free();
}
}
}