public static bool CreatePipe(ref IntPtr hReadPipe, ref IntPtr hWritePipe) { var lpPipeAttributes = new Natives.SECURITY_ATTRIBUTES { nLength = Marshal.SizeOf(typeof(Natives.SECURITY_ATTRIBUTES)), bInheritHandle = true, lpSecurityDescriptor = IntPtr.Zero }; if (!Natives.CreatePipe(out hReadPipe, out hWritePipe, ref lpPipeAttributes, 4089)) { return(false); } return(true); }