Issuing DosProtectClose with the handle to a file closes a handle to a file, pipe, or device.
Closing a device handle causes the device to be notified of the close, if appropriate.
Named-Pipe Considerations
DosProtectClose closes a named pipe by handle. When all handles that refer to one end of a pipe are closed, the pipe is considered broken.
If the client end closes, no other process can reopen the pipe until the serving end issues DosDisConnectNPipe, followed by DosConnectNPipe.
If the server end closes when the pipe is already broken, the pipe is immediately deallocated; otherwise, it is not deallocated until the last client handle is closed.