System.IO.Pipes.PipeStream.ValidateHandleIsPipe C# (CSharp) Méthode

ValidateHandleIsPipe() private méthode

Throws an exception if the supplied handle does not represent a valid pipe.
private ValidateHandleIsPipe ( SafePipeHandle safePipeHandle ) : void
safePipeHandle Microsoft.Win32.SafeHandles.SafePipeHandle The handle to validate.
Résultat void
        internal void ValidateHandleIsPipe(SafePipeHandle safePipeHandle)
        {
            // Check that this handle is infact a handle to a pipe.
            if (Interop.Kernel32.GetFileType(safePipeHandle) != Interop.Kernel32.FileTypes.FILE_TYPE_PIPE)
            {
                throw new IOException(SR.IO_InvalidPipeHandle);
            }
        }