155 {
157 bool flag;
159 try
160 {
161 global::Interop.Kernel32.SECURITY_ATTRIBUTES lpPipeAttributes =
PipeStream.GetSecAttrs(inheritability, pipeSecurity, ref pinningHandle);
162 flag = ((direction != PipeDirection.In) ? global::Interop.Kernel32.CreatePipe(out
_clientHandle, out hWritePipe, ref lpPipeAttributes, bufferSize) : global::Interop.Kernel32.CreatePipe(out hWritePipe, out
_clientHandle, ref lpPipeAttributes, bufferSize));
163 }
164 finally
165 {
166 if (pinningHandle.IsAllocated)
167 {
168 pinningHandle.Free();
169 }
170 }
171 if (!flag)
172 {
174 }
175 if (!global::Interop.Kernel32.DuplicateHandle(global::Interop.Kernel32.GetCurrentProcess(), hWritePipe, global::Interop.Kernel32.GetCurrentProcess(), out var lpTargetHandle, 0u, bInheritHandle: false, 2u))
176 {
178 }
179 hWritePipe.Dispose();
181 base.State = PipeState.Connected;
182 }
SafePipeHandle _clientHandle
PipeStream(PipeDirection direction, int bufferSize)
void InitializeHandle(SafePipeHandle? handle, bool isExposed, bool isAsync)
static Exception GetExceptionForLastWin32Error(string path="")