This call returns information about local named pipes attached to a specific system semaphore.
DosQNmPipeSemState
SemHandle (HSEM) - input
pipestatus (UCHAR)
Value
Bit
Value
87
A record is placed in InfoBuf for each local named pipe that has a semaphore attached whose handle matches the handle specified and whose state is closed or allows blocking mode I/O to be done.
There is no guarantee that records in the buffer refer to named pipes opened by the process making this call. If the same system semaphore is attached to different named pipes by multiple processes, information about named pipes that are not accessible to the caller can be returned. Thus, cooperating processes should agree on a convention for key values to help identify the named pipes of interest. A key value is associated with the pipe at the time the semaphore is set with DosSetNmPipeSem.
If a process wants data in the buffer to refer only to its own named pipes, it must use an exclusive system semaphore.
A process associates a single semaphore with multiple pipes by way of DosSetNmPipeSem. After waking up from a wait on the semaphore, a thread issues DosQNmPipeSemState, which returns the I/O state information for all pipes associated with the semaphore. The thread can scan this information to determine which pipes can be read or written. This is more efficient than polling the pipes with a non-blocking I/O on each pipe.