Project: I/O Utility Classes
Unit: PJPipe
Class: TPJPipe
Applies to: ~>1.0
constructor Create(const Size: LongWord; const Inheritable: Boolean = True);
overload;
constructor Create(const Inheritable: Boolean = True);
overload;
constructor Create(const Size: LongWord; const Security: TSecurityAttributes);
overload;
constructor Create(const Security: TSecurityAttributes);
overload;
There are four overloaded constructors, each of which creates a pipe with certain characteristics depending on the parameters.
When a Size parameter is present the pipe is created with the specified size in bytes. If Size is 0 or is not provided then the Windows default pipe size is used.
If the Inheritable parameter is present it specifies whether ReadHandle and WriteHandle are to be inheritable. Calling Create with a single Size parameter, or with no parameters, is the same as specifying Inherited as True.
Security parameters, where provided, specify the required security for the pipe. If ReadHandle and WriteHandle are to be inheritable the TSecurityAttributes.bInheritHandle field must be set to True.
All versions of the constructor raise EInOutError exceptions if the pipe can’t be created. The exception message includes the reason for failure that was returned from the operating system.