To simplify, this is a situation where a NamedPipe SERVER is waiting for a NamedPipe CLIENT to write to the pipe (using WriteFile())
The Windows API that is blocking
Take a look on CancelSynchronousIo
Marks pending synchronous I/O operations that are issued by the specified thread as canceled.
And CancelIo/CancelIoEx:
To cancel all pending asynchronous I/O operations, use either:
CancelIo — this function only cancels operations issued by the calling thread for the specified file handle.
CancelIoEx — this function cancels all operations issued by the threads for the specified file handle.