PKTHREAD
KiRendezvousWithThread(
  IN  PRECHANNEL WaitChannel,
  IN  ULONG WaitMode
  );

Routine Description:

    This function performs a rendezvous with a thread waiting on the
    channel receive event.

    N.B. This routine is called with the dispatcher database locked.

    N.B. The wait IRQL is assumed to be set for the current thread.

    N.B. Control is returned from this function with the dispatcher
        database unlocked.

Arguments:

    WaitChannel - Supplies a pointer to a channel whose receive event
        is the target of the rendezvous operation.

    WaitMode - Supplies the processor wait mode.

Return Value:

    If a thread rendezvous is successfully performed, then the address
    of the thread object is returned as the completion status. Otherwise,
    if the wait completes because of a timeout or because the thread is
    being terminated, then the appropriate status is returned.